API reference

Contacts

The workspace's contacts: the people campaigns, calls and bookings are about. List and search them, read one, create, change and delete them, and keep them in step with another system by phone number (upsert) or by the same CSV import the Contacts page offers. A contact is keyed by its phone number in E.164 form. 7 endpoints. Add your API key in the authentication panel to send test requests from this page.

List and search contacts

GET/api/external/v1/contacts

The workspace's contacts, newest first unless sortBy/sortDir say otherwise, a page at a time (page from 0, size up to 100, default 20).

Filters, all optional and combined: search (a part of the name, email, phone, city, address, website, notes, source, import file name or a tag), city and country (exact, any case), dataSource (exact: MANUAL, IMPORT, API, WHATSAPP, BOOKING_PAGE, ...), importFilename (a part of it), createdFrom / createdTo (dates, YYYY-MM-DD, both inclusive). phone looks one number up instead (any common format; matched in E.164) and answers that contact alone, or no item.

Answers {items, page, size, totalItems, totalPages}; each item is a contact with its id, names, phone (phoneNumber as stored, phoneNumberNormalized in E.164), email, company, address fields, tags, customData, metaData, dataSource and createdAt.

Errors: 400 INVALID_REQUEST for a sort field that cannot be sorted on or a malformed date; 403 FEATURE_NOT_ENABLED when the account's Contacts page is closed.

Parameters

  • searchstringquery
  • citystringquery
  • countrystringquery
  • dataSourcestringquery
  • importFilenamestringquery
  • createdFromstringquery

    Created on or after this date (YYYY-MM-DD).

  • createdTostringquery

    Created on or before this date (YYYY-MM-DD).

  • phonestringquery

    Look one phone number up instead of listing; any common format.

  • sortBystringquery

    createdAt (default), name, firstName, lastName, company, email, city or country.

  • sortDirstringquery

    asc or desc (default).

  • pageinteger (int32)query
  • sizeinteger (int32)query

Responses

  • 200OK

Create a contact

POST/api/external/v1/contacts

Adds a contact to the workspace, as the Contacts page does: one more against the plan's contact limit.

Fields: phone (required; E.164 such as +442079460958, or a national number with its country code), name (else made from firstName + lastName, else the phone), firstName, lastName, company, email, city, state, zipCode, country, address, website, notes, photoUrl, tags (a list of words), customData and metaData (objects of your own fields), relationshipStrength, assistantEmail, assistantPhone, and dataSource (where the contact came from; API when not sent).

Answers 201 with the contact.

Errors: 400 INVALID_CONTACT without a valid phone number; 409 PLAN_LIMIT_REACHED when the plan's contacts are used up (limit, allowed).

Request body application/json

  • namestring
  • firstNamestring
  • lastNamestring
  • companystring
  • emailstring
  • phonestring
  • citystring
  • statestring
  • zipCodestring
  • countrystring
  • addressstring
  • websitestring
  • notesstring
  • photoUrlstring
  • dataSourcestring
  • relationshipStrengthstring
  • assistantEmailstring
  • assistantPhonestring
  • tagsarray of string
  • addTagsarray of string
  • removeTagsarray of string
  • customDataobject
  • metaDataobject

Responses

  • 200OK

Read a contact

GET/api/external/v1/contacts/{contactId}

One contact of the workspace by its id, with every field the list shows.

Errors: 404 CONTACT_NOT_FOUND when there is no such contact in this workspace.

Parameters

  • contactIdstring (uuid)pathRequired

Responses

  • 200OK

Change a contact

PATCH/api/external/v1/contacts/{contactId}

Changes only the fields sent; every other field keeps its value. Send "" to clear a text field.

The fields are those of creating a contact. tags replaces the contact's tags; addTags and removeTags add or take away single tags instead. customData and metaData are merged key by key into what the contact has, and a key sent as null is removed. A new phone must be valid E.164.

Answers 200 with the contact.

Errors: 404 CONTACT_NOT_FOUND; 400 INVALID_CONTACT for an invalid phone number.

Parameters

  • contactIdstring (uuid)pathRequired

Request body application/json

  • namestring
  • firstNamestring
  • lastNamestring
  • companystring
  • emailstring
  • phonestring
  • citystring
  • statestring
  • zipCodestring
  • countrystring
  • addressstring
  • websitestring
  • notesstring
  • photoUrlstring
  • dataSourcestring
  • relationshipStrengthstring
  • assistantEmailstring
  • assistantPhonestring
  • tagsarray of string
  • addTagsarray of string
  • removeTagsarray of string
  • customDataobject
  • metaDataobject

Responses

  • 200OK

Delete a contact

DELETE/api/external/v1/contacts/{contactId}

Deletes the contact and the memories kept about it, as deleting it on the Contacts page does.

Answers 204.

Errors: 404 CONTACT_NOT_FOUND.

Parameters

  • contactIdstring (uuid)pathRequired

Responses

  • 200OK

Import contacts from CSV

POST/api/external/v1/contacts/import

The Contacts page's CSV import. csvContent (required) is the file's text with a header row; the columns are recognised by their names as on the page (name, first/last name, phone, email, company, city, state, zip, country, address, website, notes; any other column goes to customData). phoneColumnHeader names the phone column when it is not recognised. importFileName is kept on each contact (importFilename) and filters the list later.

mergeMode decides what happens to a number the workspace has: SKIP_EXISTING (default) leaves it, OVERWRITE_EXISTING replaces its fields with the file's, FILL_EMPTY_ONLY fills only its empty ones.

The plan's contact limit is checked once, before the import starts, as on the page.

Answers 200 {created, updated, skipped, duplicatesInFile, contacts}.

Errors: 400 MISSING_FIELD without csvContent; 400 INVALID_CONTACT for a file the import cannot read (no phone column, no rows); 409 PLAN_LIMIT_REACHED.

Request body application/json

  • csvContentstring
  • importFileNamestring
  • phoneColumnHeaderstring
  • mergeModestring

Responses

  • 200OK

Create or update contacts by phone number

POST/api/external/v1/contacts/upsert

Keeps up to 100 contacts in step with another system in one call, matched by phone number (the contact list's key, compared in E.164). A number the workspace has updates that contact with the fields sent (as PATCH does); a new number creates a contact (as create does, dataSource API unless sent).

Body: {"contacts": [ ... ]}, each item a contact as in create, phone required. All or nothing: when one item is refused nothing is saved, and the error names its index.

The plan's contact limit is checked once for all the new numbers together.

Answers 200 {created, updated, items: [{index, created, contact}]} in the order sent.

Errors: 400 MISSING_FIELD (no contacts), 400 TOO_MANY_CONTACTS (more than 100), 400 INVALID_CONTACT (an item without a valid phone, index), 400 DUPLICATE_PHONE (the same number twice, index); 409 PLAN_LIMIT_REACHED.

Request body application/json

  • contactsarray of ContactBody

Responses

  • 200OK