Skip to content

Create or update contacts in bulk

POST
/v2/contacts/batch
curl --request POST \
--url https://api.connect.ms/v2/contacts/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "contacts": [ { "firstName": "example", "lastName": "example", "company": "example", "email": "hello@example.com", "clientReference": "example", "number": "example", "tags": [ "example" ] } ] }'

Writes up to 1000 contacts in one call, matching each on its number. Rows with an invalid number are reported by position and the rest are still saved; a row with no number rejects the whole request.

Connect-Version
string

The API version to use, for example 2026-10-01. Defaults to the version set on your API key.

Idempotency-Key
string

A unique value of up to 255 characters, so a retried request is not acted on twice. Required for keys in Strict API Mode.

The contacts to create or update.

Media typeapplication/json

The contacts to create or update.

object
contacts
required

The contacts to write, between 1 and 1000. Each is matched on its number: an existing contact is updated (fields left out are kept), otherwise one is created; tags are ignored here.

Array
>= 1 characters
object
firstName

The contact’s first name, up to 80 characters.

string
nullable 0 <= 80 characters
lastName

The contact’s last name, up to 80 characters.

string
nullable 0 <= 80 characters
company

The contact’s company, up to 120 characters.

string
nullable 0 <= 120 characters
email

The contact’s email address, up to 256 characters.

string format: email
nullable 0 <= 256 characters /^[^@]+@[^@]+$/
clientReference

Your own reference for the contact, up to 128 characters.

string
nullable 0 <= 128 characters
number
required

The contact’s phone number, in any common format; a number without a country code is treated as UK. Stored in E.164 format.

string
>= 1 characters
tags

Tags to apply to the contact, up to 64 characters each; blank or longer tags are dropped. Ignored by the batch endpoint.

Array<string>
nullable

Example generated

{
"contacts": [
{
"firstName": "example",
"lastName": "example",
"company": "example",
"email": "hello@example.com",
"clientReference": "example",
"number": "example",
"tags": [
"example"
]
}
]
}

The counts of contacts created and updated, with any row errors.

Media typeapplication/json

The outcome of a batch of contact writes.

object
created
required

How many contacts were created.

integer format: int32
updated
required

How many existing contacts were updated.

integer format: int32
errors
required

Rows that were not accepted, by position.

Array<object>

A row of the request that was not accepted.

object
index
required

The zero-based position of the row in the submitted contacts.

integer format: int32
error
required

What was wrong with the row.

string
truncations
required

Fields that were shortened to fit rather than rejecting the row.

Array<object>

A contact field whose values were shortened to fit during a batch write.

object
field
required

The contact field that was shortened.

string
maxLength
required

The maximum length the values were shortened to.

integer format: int32
count
required

How many submitted rows had this field shortened.

integer format: int32
exampleRows
required

The first affected positions in the submitted list (up to five, counting from 0), so the source can be fixed.

Array<integer>

Example generated

{
"created": 1,
"updated": 1,
"errors": [
{
"index": 1,
"error": "example"
}
],
"truncations": [
{
"field": "example",
"maxLength": 1,
"count": 1,
"exampleRows": [
1
]
}
]
}

The request is not valid. The detail field says why, and errors lists any problems by field name.

Media typeapplication/problem+json

Why a request failed, in the RFC 9457 problem details format.

object
type
required

A URI identifying the kind of problem, ending in a code such as validation_failed, not_found, sending_blocked or rate_limited.

string
title
required

A short, fixed summary of the kind of problem.

string
status
required

The HTTP status code of the response.

integer format: int32
detail

What went wrong with this particular request, when there is more to say than the title.

string
nullable
errors

For validation failures, the problems found, keyed by field name (nested fields as template.name, list items as messages[3]).

object
key
additional properties
Array<string>
requestId
required

The id recorded for this error, matching the Request-Id header when one is sent. Quote it when contacting support.

string

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"errors": {
"additionalProperty": [
"example"
]
},
"requestId": "example"
}

The API key or bearer token is missing or not valid, or the request signature could not be verified.

Media typeapplication/problem+json

Why a request failed, in the RFC 9457 problem details format.

object
type
required

A URI identifying the kind of problem, ending in a code such as validation_failed, not_found, sending_blocked or rate_limited.

string
title
required

A short, fixed summary of the kind of problem.

string
status
required

The HTTP status code of the response.

integer format: int32
detail

What went wrong with this particular request, when there is more to say than the title.

string
nullable
errors

For validation failures, the problems found, keyed by field name (nested fields as template.name, list items as messages[3]).

object
key
additional properties
Array<string>
requestId
required

The id recorded for this error, matching the Request-Id header when one is sent. Quote it when contacting support.

string

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"errors": {
"additionalProperty": [
"example"
]
},
"requestId": "example"
}

The caller is not allowed to do this.

Media typeapplication/problem+json

Why a request failed, in the RFC 9457 problem details format.

object
type
required

A URI identifying the kind of problem, ending in a code such as validation_failed, not_found, sending_blocked or rate_limited.

string
title
required

A short, fixed summary of the kind of problem.

string
status
required

The HTTP status code of the response.

integer format: int32
detail

What went wrong with this particular request, when there is more to say than the title.

string
nullable
errors

For validation failures, the problems found, keyed by field name (nested fields as template.name, list items as messages[3]).

object
key
additional properties
Array<string>
requestId
required

The id recorded for this error, matching the Request-Id header when one is sent. Quote it when contacting support.

string

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"errors": {
"additionalProperty": [
"example"
]
},
"requestId": "example"
}

Another request created some of these contacts at the same time. Retry.

Media typeapplication/problem+json

Why a request failed, in the RFC 9457 problem details format.

object
type
required

A URI identifying the kind of problem, ending in a code such as validation_failed, not_found, sending_blocked or rate_limited.

string
title
required

A short, fixed summary of the kind of problem.

string
status
required

The HTTP status code of the response.

integer format: int32
detail

What went wrong with this particular request, when there is more to say than the title.

string
nullable
errors

For validation failures, the problems found, keyed by field name (nested fields as template.name, list items as messages[3]).

object
key
additional properties
Array<string>
requestId
required

The id recorded for this error, matching the Request-Id header when one is sent. Quote it when contacting support.

string

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"errors": {
"additionalProperty": [
"example"
]
},
"requestId": "example"
}

This Idempotency-Key was already used for a different request. Use a new key.

Media typeapplication/problem+json

Why a request failed, in the RFC 9457 problem details format.

object
type
required

A URI identifying the kind of problem, ending in a code such as validation_failed, not_found, sending_blocked or rate_limited.

string
title
required

A short, fixed summary of the kind of problem.

string
status
required

The HTTP status code of the response.

integer format: int32
detail

What went wrong with this particular request, when there is more to say than the title.

string
nullable
errors

For validation failures, the problems found, keyed by field name (nested fields as template.name, list items as messages[3]).

object
key
additional properties
Array<string>
requestId
required

The id recorded for this error, matching the Request-Id header when one is sent. Quote it when contacting support.

string

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"errors": {
"additionalProperty": [
"example"
]
},
"requestId": "example"
}

This API key requires an Idempotency-Key header on every POST and PATCH.

Media typeapplication/problem+json

Why a request failed, in the RFC 9457 problem details format.

object
type
required

A URI identifying the kind of problem, ending in a code such as validation_failed, not_found, sending_blocked or rate_limited.

string
title
required

A short, fixed summary of the kind of problem.

string
status
required

The HTTP status code of the response.

integer format: int32
detail

What went wrong with this particular request, when there is more to say than the title.

string
nullable
errors

For validation failures, the problems found, keyed by field name (nested fields as template.name, list items as messages[3]).

object
key
additional properties
Array<string>
requestId
required

The id recorded for this error, matching the Request-Id header when one is sent. Quote it when contacting support.

string

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"errors": {
"additionalProperty": [
"example"
]
},
"requestId": "example"
}

The service is temporarily unavailable. Retry after the Retry-After header.

Media typeapplication/problem+json

Why a request failed, in the RFC 9457 problem details format.

object
type
required

A URI identifying the kind of problem, ending in a code such as validation_failed, not_found, sending_blocked or rate_limited.

string
title
required

A short, fixed summary of the kind of problem.

string
status
required

The HTTP status code of the response.

integer format: int32
detail

What went wrong with this particular request, when there is more to say than the title.

string
nullable
errors

For validation failures, the problems found, keyed by field name (nested fields as template.name, list items as messages[3]).

object
key
additional properties
Array<string>
requestId
required

The id recorded for this error, matching the Request-Id header when one is sent. Quote it when contacting support.

string

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"errors": {
"additionalProperty": [
"example"
]
},
"requestId": "example"
}