Create or replace a contact

Search Documentation

Search across all developer documentation

contacts

Create or replace a contact

PUT /v1/contacts/{email}
Auth required api.contacts.manage

Full create-or-replace: if the contact exists it is fully replaced; if it does not exist it is created. Returns 201 on creation and 200 on update.

All fields are replaced (not merged): omitted attributes are cleared, omitted topic_preferences revert to the list default, unsubscribe_all is set to the supplied value.

lists, when present, replaces the contact's static-List membership exactly (an empty array clears all memberships). When lists is absent, list membership is left unchanged.

Supports the Idempotency-Key header.

Path parameters

email string<email> required

Recipient address. Percent-encode @ as %40. Matched case-insensitively.

Request body

Content type: application/json

{
  "attributes": {},
  "unsubscribe_all": true,
  "topic_preferences": [
    {
      "topic_name": "string",
      "subscription_status": "OPT_IN"
    }
  ],
  "lists": [
    "00000000-0000-0000-0000-000000000000"
  ]
}

Responses

200 Contact replaced application/json
201 Contact created application/json
401 Missing, malformed, or unknown API key application/problem+json
403 Key lacks the required scope or plan limit violated application/problem+json
404 Resource not found application/problem+json
422 Query parameter or path value failed validation application/problem+json
429 Per-org rate limit exceeded application/problem+json
500 Unexpected server-side failure. The code is internal_error. The request_id field can be quoted to SendOps support to investigate. application/problem+json