curl --request POST \
--url https://{subdomain}.conveyour.com/api/analytics/identify \
--header 'Content-Type: application/json' \
--header 'x-conveyour-token: <api-key>' \
--data '
{
"id": "jane@example.com",
"traits": {
"first_name": "Jane",
"last_name": "Doe",
"email": "jane@example.com"
}
}
'{
"status": "ok",
"message": "queued",
"data": {}
}{
"status": "failed",
"message": "Lacking necessary permission add_contacts",
"data": {
"permission": "add_contacts"
}
}Identify a contact
Creates or updates a contact from a set of traits. Use this from the browser or your app, for example after a form submission or login. The call is queued: the response is always ok with message queued (or queued N for an array of payloads), even if the contact save later fails, so a successful response does not confirm the traits were saved.
Trait keys. A key can be the field’s name (e.g. role) or its label. Label matching is exact and case-sensitive after underscores become spaces (Assoc_Company matches the label Assoc Company; assoc company does not). Only the name, first name/first_name and last name/last_name variants are case-insensitive. A key that matches no existing field creates a new field on the default bucket, so check spelling and case.
Related custom object fields. Set them with the field’s plain key. Each value can be the record’s _id, its external_id, or its display-field text (exact match, case-insensitive). IDs are checked first, so existing integrations that send _id behave the same. A single field takes one value. A multiple field (max 50 links) takes a list, which replaces the current links, or {"add": [...], "remove": [...]} to change them incrementally. A multiple field also accepts a single string: it is split on | if one is present, otherwise on commas, and replaces the links. add and remove accept such strings too. A display name that contains a comma is split into separate values, so use | as the separator, or send the _id or external_id, for those records. On a multiple field an empty string leaves the field unchanged; on a single field an empty string or null clears it. If any value for a field matches no record, or more than one, that field is skipped and left unchanged; the other traits still save. Lookup runs for new and existing contacts.
Do not send role_id or role_ids for a field named role: those keys don’t match the field, so identify creates a new field (for example role id) holding the value you sent, and role is not updated.
Related contacts fields. Related contacts fields take contact IDs only. A single name string fails the whole update, so none of that call’s traits save. A list of names is reduced to valid IDs, and a list with none clears the field. contact_role takes an ObjectId only.
curl --request POST \
--url https://{subdomain}.conveyour.com/api/analytics/identify \
--header 'Content-Type: application/json' \
--header 'x-conveyour-token: <api-key>' \
--data '
{
"id": "jane@example.com",
"traits": {
"first_name": "Jane",
"last_name": "Doe",
"email": "jane@example.com"
}
}
'{
"status": "ok",
"message": "queued",
"data": {}
}{
"status": "failed",
"message": "Lacking necessary permission add_contacts",
"data": {
"permission": "add_contacts"
}
}Authorizations
Your API key token. Contacts endpoints require a Server-only — Full API key — see Authentication.
Query Parameters
Team scope for the request, as one or more team ObjectIds. The brackets are required: PHP keeps only the last value for a repeated plain key, so teams=A&teams=B silently resolves to B alone. On requests with a JSON body you may send teams (no brackets) in the body instead.
Values that are not valid ObjectIds are silently ignored — a mistyped team ID behaves as if no team was sent. See the teams section of the API conventions guide.
Body
Contact fields to create or update, keyed by field name or label (labels match exactly and case-sensitively after underscores become spaces). Unknown keys create a new field. Related custom object fields accept a record _id, external_id, or display text; multiple fields accept a list (replace), a |- or comma-separated string (replace), or {add, remove}.
Response
Success.
The common response envelope shared by all ConveYour endpoints.