Developers/Guides

Contacts

Each organisation keeps a directory of contacts: the people and companies it sends mail to, with one postal address, an optional externalId, its own attributes and a marketingPermission. Every live card that goes out makes a contact or touches one (the card count and the last activity move), so the directory is complete without any call. The endpoints need the plan feature contacts; without it they answer 403 feature_not_entitled.

Reading contacts needs items.read; the name, the address line, the postal code, the e-mail, the phone and the attribute values are masked unless the key also has personal_data.read. Changing contacts needs contacts.manage.

Identity

A contact with an externalId is matched on it. Without one, the normalised address together with the name identifies the contact, so two people at one address are two contacts. The two ways meet: a card's contact without an id takes the externalId of a later upsert at the same address and name, and an upsert without an id finds the contact known by its id at the same address and name.

TypeScript
const result = await client.contacts.upsert({
  body: [
    {
      externalId: 'crm-1042',
      name: 'Carla de Vries',
      company: 'Vries B.V.',
      addressLine1: 'Rokin 10',
      postalCode: '1012 KR',
      city: 'Amsterdam',
      email: 'carla@example.com',
      attributes: { segment: 'gold', store: 'Amsterdam' },
      marketingPermission: 'granted',
    },
  ],
  idempotencyKey: 'crm-sync-2026-10-27',
});
// result.created and result.updated

POST /v1/contacts takes one contact or an array of up to 1,000. Fields given replace, attributes merge key by key, and marketingPermission is set only when given. The address is normalised and checked like a card's; a contact without a delivery point is refused with validation_failed naming the entry.

Customer value

valueCents is the customer value you give a contact, in cents (null removes it), for example the revenue from your own systems. A contact also answers orderValueCents, the sum of its measured orders (live conversions), and customerValueCents, the value that counts: your own when set, else the measured orders. Contacts with a value are the customers a lookalike campaign learns from; contacts that objected are never part of it.

Marketing permission and the suppression list

marketingPermission is unknown, granted or objected. Setting objected puts the address on the suppression list with the reason opt_out; setting granted again takes that entry off. The other way round, an address added to the suppression list marks every contact at that address as objected (with permissionSource: "suppression"), and removing the entry sets them back to unknown.

Listing, reading, changing and removing

GET /v1/contacts follows the listing conventions: sortable on createdAt, lastActivityAt (the default, newest first), name and postalCode; filters marketingPermission, source, country, externalId, createdAt, lastActivityAt and search (the name, company, address line, postal code, city, e-mail or external id). GET /v1/contacts/{id} adds the contact's last 25 cards. PATCH /v1/contacts/{id} changes fields; an attribute set to null is removed; externalId: null removes the contact's external id, after which the contact is matched by its address and name; a change that would make the contact the same as another is refused with validation_failed (taken). DELETE /v1/contacts/{id} removes the contact and its attributes; the cards stay.

TypeScript
const page = await client.contacts.list({
  query: { filter: { marketingPermission: 'granted', search: { contains: 'Amsterdam' } } },
});
await client.contacts.patch(contact.id, { body: { attributes: { store: null, tier: 'A' } } });

CSV import

Bulk lists come in through a CSV upload: create an upload session of kind csv, upload the file, complete the session and call contacts.importCsv with the upload id. Columns are mapped to the contact fields by their header names (Dutch and English synonyms for the address fields, plus externalId, email, phone, company, jobTitle and value, the customer value in euros) or through an explicit mapping with {{Header}} expressions; columns left unmapped become attributes under their header. Rows that cannot be identified are reported by line. Imports are capped at 50,000 rows.