Skip to main content
POST
Bulk upsert users (synchronous)

Authorizations

Authorization
string
header
required

Project-scoped secret API key (sk_…). Pass in the Authorization: Bearer <key> header. Grants access to the project the key was issued for.

Body

application/json
Required array length: 1 - 100 elements

A single user upsert. At least one of anonymous_id or external_id must be present. When both are present they are linked.

anonymous_id
string
required

Anonymous tracking identifier captured before the user was identified.

Example:

"anon-2c8a3e"

external_id
string | null

Optional system-of-record identifier to attach to this anonymous user.

Example:

"cust-9f4b21"

email
string<email> | null

User’s email address. Validated against RFC 5322 on write.

Example:

"jane@example.com"

phone
string | null

User’s phone number. E.164 preferred; other formats are normalised when possible.

Example:

"+61400123456"

timezone
string | null

IANA timezone (for example Australia/Sydney).

Maximum string length: 50
Example:

"Australia/Sydney"

locale
string | null

BCP-47 locale tag (for example en-AU).

Maximum string length: 255
Example:

"en-AU"

data
object | null

Free-form custom attributes attached to the user. Used in segmentation and template rendering.

Example:

Response

Per-item upsert outcomes. Partial success is allowed.

Synchronous result of a bulk user upsert. Partial success is allowed.

results
object[]
required

Per-item outcomes in the same order as the request body.

succeeded
integer
required

Count of items that upserted successfully.

Example:

2

failed
integer
required

Count of items that failed.

Example:

0