Bulk update prospects

Operation ID: bulkUpdateProspects

Group: CRM › Prospects

Open in the interactive reference

PATCH /crm/prospects/bulk

Retry-safe: A write that accepts Idempotency-Key: repeating a request with the same key replays the stored answer instead of executing twice.

Updates multiple prospects in one request, up to 100. Each entry takes exactly the input of PATCH crm/prospects/:id, with id naming the prospect, and is checked by the same rules. A prospect may appear only once. All-or-nothing: if any entry is invalid, the call fails with that entry's error, 'index' set to its zero-based position in prospects, and nothing is changed. The response is empty.

Parameters

Name In Type Required Description
Api-Version header string · v1 yes The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version v1.
Idempotency-Key header string no An opaque caller-chosen string (1-255 characters) that makes this request safe to retry. Repeating the same key with an identical request body replays the original response instead of re-executing - but only once that original request succeeded; a failed attempt re-executes on retry. Repeating the key with a different body is answered with 422. A key still in flight is answered with 409 - as is a key whose original request was interrupted before it finished, for a few minutes afterwards, until that attempt is presumed dead. A completed response stays replayable for 24 hours. The key is scoped to the caller, not to the action: reusing it for a different action is answered with 409 or 422 rather than treated independently. On read actions this header is ignored. On write actions that cannot offer the guarantee it is answered with 400 IDEMPOTENCY_NOT_SUPPORTED rather than silently ignored.

Request body

Required, application/json: bulkUpdateProspectsInput.

Field Type Required Description
prospects array<object> yes The changes, at most 100, each for a different prospect. Each takes the input of PATCH crm/prospects/:id. If any entry is invalid, nothing is changed. Example: [{"id":"3b7d5e9c-1a24-4f80-9c6d-2e8f70b13a45","billingEmail":"invoices@northwind.example"},{"id":"8c1f4a72-6b09-4d15-a3e7-40d2b6915cf8","customerType":"partner"}].
prospects[].id string yes The unique identifier for the prospect to change.
prospects[].prospectName string no The name of the prospect organization. Must not be empty. Omit to leave unchanged.
prospects[].entityId string no The legal entity that owns the prospect. See id on GET base/entities. Omit to leave unchanged.
prospects[].billingEmail string | null no The email address invoices for this prospect would be sent to. Send null to clear, omit to leave unchanged.
prospects[].crmId string | null no The identifier of this prospect in an external CRM system. Send null to clear, omit to leave unchanged.
prospects[].customerType any no The commercial relationship. Omit to leave unchanged. One of: "default", "partner".
prospects[].defaultCurrency string | null no The currency quotes for this prospect default to, ISO 4217. Send null to clear, omit to leave unchanged.
prospects[].sameAsBillToAddress boolean no Whether the sold-to address repeats the bill-to address. Switching it on copies the bill-to address over the sold-to address. Omit to leave unchanged.
prospects[].billToAddress object no Changes to the bill-to address. Omit to leave it unchanged.
prospects[].billToAddress.line1 string no The first address line. Must not be empty. Omit to leave unchanged.
prospects[].billToAddress.line2 string no The second address line. Send an empty string to clear, omit to leave unchanged.
prospects[].billToAddress.city string no The city or locality. Must not be empty. Omit to leave unchanged.
prospects[].billToAddress.stateProvince string no The state, province or region, as an ISO 3166-2 code of the country, for example 'US-WA'. Required when country is 'US'; otherwise send an empty string to clear. Omit to leave unchanged.
prospects[].billToAddress.country string no The country, as an ISO 3166-1 alpha-2 code. Omit to leave unchanged.
prospects[].billToAddress.zipCode string no The postal or ZIP code. Must not be empty. Omit to leave unchanged.
prospects[].billToAddress.attention string no The person or department that mail to this address is for. Send an empty string to clear, omit to leave unchanged.
prospects[].soldToAddress object no Changes to the sold-to address. Must be omitted while sameAsBillToAddress is true.
prospects[].soldToAddress.line1 string no The first address line. Must not be empty. Omit to leave unchanged.
prospects[].soldToAddress.line2 string no The second address line. Send an empty string to clear, omit to leave unchanged.
prospects[].soldToAddress.city string no The city or locality. Must not be empty. Omit to leave unchanged.
prospects[].soldToAddress.stateProvince string no The state, province or region, as an ISO 3166-2 code of the country, for example 'US-WA'. Required when country is 'US'; otherwise send an empty string to clear. Omit to leave unchanged.
prospects[].soldToAddress.country string no The country, as an ISO 3166-1 alpha-2 code. Omit to leave unchanged.
prospects[].soldToAddress.zipCode string no The postal or ZIP code. Must not be empty. Omit to leave unchanged.
prospects[].soldToAddress.attention string no The person or department that mail to this address is for. Send an empty string to clear, omit to leave unchanged.
prospects[].createContacts array<object> no Contacts to add to the prospect. Each is a new contact, or an existing one linked by id.
prospects[].createContacts[].id string no An existing contact to link. It must not belong to another prospect. When set, send no other contact details.
prospects[].createContacts[].displayName string no The contact's display name. Required for a new contact.
prospects[].createContacts[].salutation string no The contact's form of address, for example 'Ms' or 'Dr'.
prospects[].createContacts[].firstName string no The contact's given name.
prospects[].createContacts[].middleName string no The contact's middle name or initial.
prospects[].createContacts[].lastName string no The contact's family name.
prospects[].createContacts[].suffix string no The contact's name suffix, for example 'Jr' or 'PhD'.
prospects[].createContacts[].emailAddress string no The email address the contact is reached at. Required for a new contact. When an existing contact has this address, that contact is linked instead of a new one, as in the app.
prospects[].createContacts[].workPhone string no The contact's work telephone number.
prospects[].createContacts[].isDefaultBillToContact boolean no Whether this is the default contact for the bill-to address. Defaults to false.
prospects[].createContacts[].isDefaultSoldToContact boolean no Whether this is the default contact for the sold-to address. Defaults to false.
prospects[].updateContacts array<object> no Changes to the role flags of contacts already on the prospect.
prospects[].updateContacts[].id string yes The unique identifier for a contact of the prospect.
prospects[].updateContacts[].isDefaultBillToContact boolean no Whether this is the default contact for the bill-to address. Omit to leave unchanged.
prospects[].updateContacts[].isDefaultSoldToContact boolean no Whether this is the default contact for the sold-to address. Omit to leave unchanged.
prospects[].deleteContacts array<string> no The ids of contacts to remove from the prospect. The contact records are kept.
{
  "prospects": [
    {
      "id": "3b7d5e9c-1a24-4f80-9c6d-2e8f70b13a45",
      "billingEmail": "invoices@northwind.example"
    },
    {
      "id": "8c1f4a72-6b09-4d15-a3e7-40d2b6915cf8",
      "customerType": "partner"
    }
  ]
}

Response

200 Success

{
  "data": {},
  "diagnostics": [
    {
      "code": "<code>",
      "message": "<message>",
      "severity": "error",
      "path": [
        "<path>"
      ],
      "details": "<details>"
    }
  ]
}

Response headers

Errors

Code Status
TOO_MANY_PROSPECTS 400
DUPLICATE_PROSPECT 400
NOT_FOUND 400
PROSPECT_CONVERTED 400
ENTITY_NOT_FOUND 400
INVALID_PROSPECT_NAME 400
INVALID_BILLING_EMAIL 400
CURRENCY_NOT_FOUND 400
INVALID_ADDRESS 400
UNEXPECTED_SOLD_TO_ADDRESS 400
CONTACT_NOT_FOUND 400
INVALID_CONTACT 400
CONTACT_DETAILS_WITH_ID 400
DUPLICATE_CONTACT 400
CONTACT_ALREADY_LINKED 400
DUPLICATE_CONTACT_EMAIL 400
DUPLICATE_DEFAULT_CONTACT 400
IDEMPOTENCY_KEY_CONFLICT 409
IDEMPOTENCY_PAYLOAD_MISMATCH 422

Statuses