Docs
Get API key

Leads

Change many leads

PATCH/leads

Up to 1,000 leads’ changes in one call: names, the short company name, company, job title, email, custom fields and tags, as PATCH /leads/{leadId} makes them. Each row stands alone: one that fails changes nothing, and the others still save. Repeating the call is safe.

Try itSend a real request with your API key

This changes your workspace, as the same change in the app would. Your key stays in this page and goes only to Salesteam.

Headers

  • Idempotency-Keystring

    Any unique value up to 255 characters, like a UUID. The request runs once; repeats within 24 hours get the first answer, with Idempotent-Replayed: true. Up to 255 characters.

Body

  • leadsarray of LeadPatchRowRequired

    Up to 1,000.

    Each item
    • leadIdstring or null

      Up to 180 characters.

    • idstring or null

      The same as leadId. Up to 180 characters.

    • linkedinUrlstring or null

      Up to 1,000 characters.

    • firstNamestring or null

      What {{first_name}} says. It can’t be emptied. Up to 100 characters.

    • lastNamestring or null

      Up to 100 characters.

    • companystring or null

      A new company resets companyShort to the automatic one, unless you send companyShort too. Up to 200 characters.

    • companyShortstring or null

      The short company name {{company_short}} and {{company_name}} use, like “Acme” for “Acme Holdings, Inc.”. Clear it to go back to the automatic one. Up to 100 characters.

    • titlestring or null

      Their job title. Up to 200 characters.

    • emailstring · email or null

      The email Salesteam uses for them from now on. Up to 254 characters.

    • customFieldsobject or null

      Values for the workspace's custom fields, by field key or name (service_word or Service word; see GET /custom-fields). A name the workspace doesn't have yet becomes a new field: a number makes a Number field, a list a Multi-select, anything else Text. Values are checked against the field's type: a URL needs a web address, a Number a number, a Date a date (saved as YYYY-MM-DD), and a choice that isn't an option yet is added. null removes a value; an empty string or an empty list leaves it as it is. Up to 50 per lead.

    • tagsobject or null

      Tags to add (a new name becomes a workspace tag) and tags to take off, by name.

      Inside it
      • addarray of string or null

        Tag names (or IDs); one name can be a string. Up to 20.

      • removearray of string or null

        Tag names (or IDs); one name can be a string. Up to 20.

    • cleararray of string or null

      Fields to empty: lastName, company, companyShort (back to the automatic one), title or email. A cleared company or title shows what LinkedIn says, if anything.

Answer

200 OK One result per row.

  • dataUpdateLeadsResultRequired
    Inside it
    • updatedintegerRequired
    • unchangedintegerRequired
    • failedintegerRequired
    • resultsarray of objectRequired
      Each item
      • indexintegerRequired

        Position of this row in the request.

      • leadIdstring or nullRequired
      • statusstringRequired

        A failed row changed nothing; the other rows still saved. One of updated, unchanged, failed.

      • changedarray of string

        The fields that changed.

      • errorobject
        Inside it
        • codestringRequired

          An error code from the table above, as a whole request would get it.

        • messagestringRequired

Errors

  • 400 Bad requestinvalid_request invalid_json duplicate_in_request
  • 401 Unauthorizedunauthorized
  • 404 Not foundnot_found not_in_campaign
  • 409 Conflictconflict idempotency_in_progress workspace_busy campaign_finished campaign_without_list tag_limit lead_has_history campaign_not_launched campaign_cannot_resume ambiguous_email
  • 413 Too largetoo_large
  • 415 Wrong content typeunsupported_media_type
  • 422 Can’t processidempotency_key_reused
  • 429 Too many requestsrate_limited
  • 500 Server errorserver_error

Every error has the same shape. See Errors.

PATCH /leads
curl -X PATCH "https://app.salesteam.dev/api/v1/leads" \
  -H "Authorization: Bearer $SALESTEAM_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "leads": [
    {
      "leadId": "lead_8f2c",
      "firstName": "James",
      "companyShort": "Proper Sky"
    },
    {
      "linkedinUrl": "https://www.linkedin.com/in/ana-ruiz-example",
      "clear": [
        "companyShort"
      ]
    }
  ]
}'
200 answer
{
  "data": {
    "updated": 1,
    "unchanged": 1,
    "failed": 0,
    "results": [
      {
        "index": 0,
        "leadId": "lead_8f2c",
        "status": "updated",
        "changed": [
          "firstName",
          "companyShort"
        ]
      },
      {
        "index": 1,
        "leadId": "lead_31d0",
        "status": "unchanged",
        "changed": []
      }
    ]
  }
}