Skip to main content
Adds one of the account’s own traits, worked out for every contact from an event your website or server sends: how many times it happened, when it last happened, or the total of a number in it, over the last so many days. Values are worked out in the background.
Needs the cdp.contacts:write scope.

Body

Send an Idempotency-Key header to add it once however often the request is retried.

Request

Response

201 Created — the trait. Use key in audience rules, and merge_tag in messages.

Errors

Every refusal is {"error": {"code", "message", "field"}}; field is there when one input is at fault. Any request can also be refused for its key, its account or its rate (key_required, invalid_key, account_suspended, plan_excludes_api, address_not_allowed, rate_limited); see the overview.