Contacts

Store a project's contacts, declare typed properties, set language and timezone, and distinguish deletion from erasure.

A contact belongs to one project. Its email address is case-insensitive: Bob@Example.com and bob@example.com are the same contact. The address you supply is kept for display and sending. Another project can hold its own contact for that address, with separate consent and preferences.

Use a full-access API key. In the dashboard, contacts need the audience permission: owner, admin, developer or support (team roles).

Create and read a contact

Declare any custom properties before using them, then create the contact:

curl https://api.exx.sh/contacts \
  -H "Authorization: Bearer $EXX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email":"sam@example.com","first_name":"Sam","language":"de","timezone":"Europe/Berlin"}'

POST /contacts returns the contact's id. An address already in the project returns 409 exx_contact_exists; use PATCH /contacts/{id_or_email} to change it. GET /contacts/{id_or_email} accepts the id or an address in any case. GET /contacts lists contacts with limit, after and before; segment_id filters the list.

You can set first_name, last_name, unsubscribed, properties, segments and topics on create. Names, properties, language, timezone and subscription state can be updated. language is a BCP 47 tag, such as de or pt-BR, used by hosted pages. timezone is an IANA name, such as Europe/Berlin, used by local-time broadcasts.

Declare properties

POST /contact-properties takes a key, type and optional fallback_value:

{"key":"plan","type":"string","fallback_value":"free"}

Types are string and number, plus the exx.sh extensions boolean and date. A date uses ISO 8601; a date without a time means midnight UTC. Keys contain letters, digits and underscores. Undeclared keys and values of another type return validation_error.

Set values with PATCH /contacts/{id_or_email}:

{"properties":{"plan":"pro"}}

A property's null value removes that contact's value. A declared fallback can supply a missing value in a segment rule or a broadcast placeholder. A property's type cannot change while a contact has a value or a rule uses it. Deleting a property is refused while a rule uses it; otherwise it hides the key immediately and removes values in the background.

Static segments group contacts you add explicitly. Topics record the kinds of mail each contact wants. The legacy audiences API still works: an audience is a static segment. Adding the same address to two audiences adds memberships to one contact; removing a membership does not delete the contact.

An unsubscribe is not reset by an import or an ordinary update. Read consent and double opt-in before adding a list or changing consent.

Delete or erase

DELETE /contacts/{id_or_email} tidies a list. It removes the contact and its memberships, topic choices, consent log and activity. If it was unsubscribed, a keyed hash remembers that choice so adding the address again does not silently subscribe it.

POST /contacts/{id_or_email}/erase is the erasure action. It hides the contact immediately and removes it, its consent log and activity within 24 hours. Broadcast recipient rows lose the address and contact id but keep delivery counts. A project-specific keyed hash remains as an erasure marker, so bulk imports skip the address.

Erasure does not remove everything at once. Existing sent-mail logs, content, transcripts and webhook payloads expire with the plan's retention. API request logs and import or export files keep their own retention. Suppressions remain until you remove them, so a bounced or complaining address is still blocked. See the privacy policy for these periods.

After erasure finishes, a single POST /contacts can add someone who signed up again; it clears the marker. A bulk import never does.

On this page