Create, find, update, disable and delete the people you send email or SMS to, identified by a contact ID, an email address or an SMS number. Contacts belong to your account rather than to a mailing list, so one contact can be on many lists. To add contacts to mailing lists, see List members.
Read the mails sent to a contact and the actions recorded for them. The action history is built on request: start an update, check its status until it is done, and then read the actions. You can also export the history of all contacts.
Answer GDPR requests: permanently erase all data of a contact, or export the data stored about them. For the states a contact can be in and the endpoints that change them, see Contact lifecycle.
Get contact
Returns an active contact by ID, with its properties, list memberships and consents. Use options to leave out the parts you do not need.
Returns an error if the contact does not exist or is deleted. Use getDeletedRecipient for deleted contacts, or getShadowRecipient if you do not know the contact's state.
Get contact › Responses
OK
succeedResponse status.
Get contact by email
Finds a contact by email address and returns it in the same format as getRecipient. The address is not case-sensitive.
Returns an error if no active contact has the address. With include_deleted, a deleted contact is also returned, in the format of getDeletedRecipient.
Get contact by email › Request Body
emailEmail address of the contact.
include_deletedAlso search deleted contacts. Defaults to false.
Get contact by email › Responses
OK
succeedResponse status.
Get contact by SMS
Finds a contact by SMS number and returns it in the same format as getRecipient. A number in local format is also matched, using your account's default SMS country.
Returns an error if no active contact has the number. With include_deleted, a deleted contact is also returned, in the format of getDeletedRecipient.
Get contact by SMS › Request Body
smsContact mobile phone number, e.g. +358401234567.
include_deletedAlso search deleted contacts. Defaults to false.
Get contact by SMS › Responses
OK
succeedResponse status.
Get contacts
Returns active, confirmed contacts in the same format as getRecipient. Unconfirmed and deleted contacts are not included.
Use from and num to page through the contacts. To fetch large batches faster, use options to leave out the data you do not need.
Get contacts › Request Body
fromNumber of results to skip.
numMaximum number of results. 0 or omitted returns all.
orderField to order results by: id, email, sms or a property name. Unordered when omitted.
sortSort direction, asc or desc. Defaults to asc.
filterCase-insensitive search text matched against email, SMS and property values. Use * as a wildcard.
Get contacts › Responses
OK
succeedResponse status.
Get contacts as a table
Returns the given contacts as a table. The first row has the column names (member, email, sms and your property names), and each following row has the values of one contact.
Deleted contacts are included. IDs that are not found are left out.
Get contacts as a table › Responses
OK
succeedResponse status.
resultArrays of contact details. The first array contains headers.
Find contacts by property
Returns active, confirmed contacts whose value for the given property exactly matches query, in the same format as getRecipient. Property IDs (handles) are listed by getCustomerProperties.
Returns at most 25 contacts per call. Use offset to get more.
Find contacts by property › Request Body
property_idProperty handle. See getCustomerProperties.
queryProperty value to search for. Must match exactly.
limitMaximum number of contacts to return, at most 25. Defaults to 1.
offsetNumber of matching contacts to skip, for pagination. Defaults to 0.
Find contacts by property › Responses
OK
succeedResponse status.
Run predefined contact search
Runs one of the predefined contact searches, selected with nm, and returns an array of contact IDs. The last item of the array is the total number of matching contacts, without the from and num limits.
With csv, the first item is CSV text with the contacts' data instead of IDs. list is used only with getMailingListMembers.
Run predefined contact search › Request Body
nmQuery to run.
listMailing list ID.
fromNumber of results to skip.
numMaximum number of results. 0 or omitted returns all.
orderField to order results by: id, email, sms or a property name. Unordered when omitted.
sortSort direction, asc or desc. Defaults to asc.
qCase-insensitive search text matched against email, SMS and property values. Use * as a wildcard.
csvIf true, the first item is semicolon-separated CSV text with all properties instead of contact IDs. Defaults to false.
gzipIf true, the CSV text is zlib-compressed and Base64-encoded. Applies only with csv. Defaults to false.
Run predefined contact search › Responses
OK
succeedResponse status.
resultReturns an array of contact IDs. The last item in the array is always the count of contacts.
Find contact ID
Finds a contact by email address or SMS number and returns its ID, or false if no contact is found. Deleted contacts are also found.
The email address is not case-sensitive, but the SMS number must match the stored number exactly.
Find contact ID › Request Body
email_or_smsEmail address or SMS number of the contact.
Find contact ID › Responses
OK
succeedResponse status.
resultContact ID.
Check if contact is active
Checks whether a contact, found by ID, email address or SMS number, is active (not deleted).
Without strict, 0 is also returned when the contact does not exist. With strict, the result tells instead whether the contact is missing.
Check if contact is active › Request Body
Contact ID, email address or SMS number.
strictIf true, returns 1 when the contact does not exist and 0 when it does, regardless of its state. Defaults to false.
Check if contact is active › Responses
OK
succeedResponse status.
resultWith strict set to false: 1 for enabled, 0 for disabled.
Get contact statuses
Checks several email addresses in one call and returns, for each one, whether it belongs to an active contact, a deleted contact or no contact.
Get contact statuses › Request Body
recipientsEmail addresses of the contacts.
Get contact statuses › Responses
OK
succeedResponse status.
resultContact statuses keyed by email address: 0 for an active contact, 1 for a deleted contact and 2 if no contact has the address.
Get active or deleted contact
Returns a contact by ID whether it is active or deleted, with its properties and list memberships. The enabled field tells which. Consents are not included.
Use this when you do not know the contact's state. Otherwise use getRecipient or getDeletedRecipient.
Get active or deleted contact › Request Body
idContact ID.
Get active or deleted contact › Responses
OK
succeedResponse status.
Contact data.
Create or update contact
Creates a contact, or updates an existing one, and adds it to the given mailing lists. Returns the contact ID.
An existing contact is searched by id, then email, then sms; one of these must be given. An existing contact is updated as with editRecipient, so an omitted email or sms is cleared. If the contact is deleted, nothing is done and false is returned.
Adding the contact to a list it has left subscribes it to the list again.
Every property given is created or reset as a text property: an existing property also loses its data type, required and subscription page settings. To keep the property settings, update the contact with updateRecipient and add it to lists with joinMailingList. Property name restrictions apply here.
Create or update contact › Request Body
idContact ID.
emailEmail address of the contact.
smsContact mobile phone number, e.g. +358401234567.
Contact properties as name-value pairs.
autoconfirmConfirm the contact automatically. Defaults to false.
reasonFree-text reason for creating the contact.
originOrigin of the action, e.g. a subscription page URL or api.
listsIDs of the mailing lists to join.
adminWhether an admin made the join. false treats it as the contact's own subscription, for example in subscription statistics. Defaults to true.
Create or update contact › Responses
OK
succeedResponse status.
The contact ID, or false if the contact is deleted.
Create contact
Creates a new contact and returns its ID. The contact is not added to any mailing list: use joinMailingList afterwards, or createAndJoinRecipient to do both in one call.
Returns an error if a contact with the same email address or SMS number already exists, even if that contact is deleted. Use reactivateRecipient for deleted contacts.
Without autoconfirm, the contact stays unconfirmed. No confirmation email is sent.
Create contact › Request Body
emailEmail address of the contact.
smsContact mobile phone number, e.g. +358401234567.
Contact properties as name-value pairs.
autoconfirmConfirm the contact automatically. Defaults to false.
reasonFree-text reason for creating the contact.
originOrigin of the action, e.g. a subscription page URL or api.
dig_graveyardReactivate an email address that is marked unreachable due to bounces. Defaults to false.
Note: Use this only for addresses confirmed to work. Abuse of this flag leads to suspension of REST API privileges.
Create contact › Responses
OK
succeedResponse status.
resultContact ID.
Update contact by email
Updates a contact found by email. Give only the property values that change; values cannot be unset. sms is used only when a new contact is created.
With create, the contact is created if it does not exist. Properties that do not exist yet are created as text properties. Property name restrictions apply here.
Update contact by email › Request Body
emailEmail address of the contact.
smsContact mobile phone number, e.g. +358401234567.
Contact properties as name-value pairs.
reasonFree-text reason for the action.
originOrigin of the action, e.g. a subscription page URL or api.
createCreate the contact if it does not exist. A created contact is confirmed automatically. Defaults to false.
Update contact by email › Responses
OK
succeedResponse status.
resultContact ID.
Edit contact by ID
Changes a contact's email address, SMS number and properties. Give email and sms even if they do not change, because omitted values are cleared. Only the given properties are updated.
To update a contact found by email address without giving the SMS number, use updateRecipient.
Edit contact by ID › Request Body
idContact ID.
emailEmail address of the contact.
smsContact mobile phone number, e.g. +358401234567.
Contact properties as name-value pairs.
reasonFree-text reason for the action.
originOrigin of the action, e.g. a subscription page URL or api.
Edit contact by ID › Responses
OK
succeedResponse status.
resultReturns null.
Delete contact
Deletes a contact by ID and removes it from all its mailing lists. Returns 1 on success, 0 if deleting the contact failed, and an error if no active contact has the ID.
The contact's properties are kept, so it can be restored with enableRecipient or reactivateRecipient. Its consents are revoked and its confirmation is removed; restoring the contact does not bring the consents back. To erase the personal data permanently, use forgetRecipient. See Contact lifecycle.
Delete contact › Request Body
idContact ID.
reasonFree-text reason for the deletion.
subscriber_reason_typeUnsubscribe reason type given by the contact.
subscriber_reason_textFree-text unsubscribe reason given by the contact.
originOrigin of the action, e.g. a subscription page URL or api.
extra_dataExtra details stored with the deletion event. Supported keys: source_delivery_id (one of your delivery IDs) and tracking-id.
Delete contact › Responses
OK
succeedResponse status.
result1 if the contact was deleted, 0 if deleting it failed.
Get deleted contact
Returns a deleted contact by ID, with its properties, former list memberships, consents and the reason for the deletion.
Returns an error if the contact is active or does not exist. Use getRecipient for active contacts.
Get deleted contact › Request Body
idContact ID.
Get deleted contact › Responses
OK
succeedResponse status.
Get deleted contacts
Returns deleted contacts in the same format as getDeletedRecipient, including forgotten ones. Use from and num to page through the contacts.
Get deleted contacts › Request Body
fromNumber of results to skip.
numMaximum number of results. 0 or omitted returns all.
orderField to order results by: id, email, sms or a property name. Unordered when omitted.
sortSort direction, asc or desc. Defaults to asc.
filterCase-insensitive search text matched against email, SMS and property values. Use * as a wildcard.
Get deleted contacts › Responses
OK
succeedResponse status.
Deleted contact info.
Restore contact by ID
Restores a deleted contact by ID. The email address is also removed from the list of addresses that are unreachable due to bounces, and the contact is marked as confirmed. List memberships are not restored.
Returns 0 if the contact is forgotten, pseudonymized by the daily cleanup, or cannot be restored. Returns an error if no deleted contact has the ID, also when the contact is active. To restore a contact by email address or SMS number, use reactivateRecipient.
Restore contact by ID › Request Body
idContact ID.
reasonFree-text reason for the action.
Restore contact by ID › Responses
OK
succeedResponse status.
resultNumber of contacts enabled.
Restore contact by email/SMS
Restores a deleted contact by email address or SMS number, both given in email, and returns its ID. If the contact is already active, it is only confirmed or given a confirmation code. List memberships are not restored.
Without confirm, a confirmation code is set for the contact (see getRecipientCode). identity and msg are saved as the reason for the reactivation. Returns an error if no contact is found.
The address must match the saved one exactly, and email addresses are saved in lowercase. An address that is blocked because mail to it bounced returns an error; restore such a contact by ID with enableRecipient, which also removes the block. A contact pseudonymized by the daily cleanup is restored with its old ID, but without its old properties and unconfirmed. See Contact lifecycle.
Restore contact by email/SMS › Request Body
emailEmail address of the contact.
identityName or other identifier of the person or system doing the reactivation.
msgFree-text reason for the action.
confirmConfirm the contact automatically. Defaults to false.
riseDeprecated. Set to null.
originOrigin of the action, e.g. a subscription page URL or api.
Contact properties as name-value pairs.
Restore contact by email/SMS › Responses
OK
succeedResponse status.
resultContact ID.
Get contact stats
Returns the number of deliveries to each given contact and, if requested, the number of opens and clicks with their share of the deliveries.
Accepts at most 1000 contact IDs per call.
Get contact stats › Request Body
recipient_idsContact IDs, at most 1000.
valuesStatistics to return.
Get contact stats › Responses
OK
succeedResponse status.
Arrays of the requested delivery statistics keyed by contact ID.
Count unique emails
Counts the unique email addresses among the active members of the given mailing lists and the given ad hoc addresses. An address that is on several lists is counted once.
Count unique emails › Request Body
listsMailing list IDs. Active members of these lists are counted. If empty, only adhocs are counted.
adhocsAdditional email addresses to count.
exclude_listsIDs of mailing lists whose active members are excluded from the count.
Count unique emails › Responses
OK
succeedResponse status.
resultNumber of unique email addresses found.
Count unlisted contacts
Returns the number of active contacts who are not active members of any mailing list.
The number is read from a cache that is updated when these contacts are listed with queryRecipientsBy (getUnassociatedRecipients), at most once in 10 minutes. It can therefore be out of date.
Count unlisted contacts › Responses
OK
succeedResponse status.
resultNumber of unassociated contacts.
Get excluded contacts
Returns contacts of your account who received a completed delivery scheduled after the given time, or who are active members of the given mailing lists. A contact who matches both criteria is returned once.
Get excluded contacts › Request Body
paramsSearch criteria. Contacts matching deliveries or lists are returned; with neither, the result is empty.
Get excluded contacts › Responses
OK
succeedResponse status.
Check email domains
Checks whether the domains of all given email addresses are allowed for contacts in your account. Returns false if any domain is not allowed.
The same check is done when a contact is created.
Check email domains › Request Body
recipientsEmail addresses to check.
Check email domains › Responses
OK
succeedResponse status.
resultReturns true if all given email addresses have allowed domains and false if any of them has a non-allowed domain.
Get contact mail history
Returns the mails sent to a contact, and future deliveries scheduled for it, newest first. For other actions, such as opens and clicks, use memberHistoryActions.
Get contact mail history › Request Body
idContact ID.
limitMaximum number of mails to return. 0 returns no mails. Defaults to 10.
Get contact mail history › Responses
OK
succeedResponse status.
Get contact action history
Returns a contact's actions, such as received mails, list joins, opens and clicks.
The actions are collected in advance. To get new data, first call memberHistoryUpdate and wait until memberHistoryUpdateStatus returns 0.
Get contact action history › Request Body
idContact ID.
Filters for the history actions.
Get contact action history › Responses
OK
succeedResponse status.
Refresh contact action history
Starts collecting a contact's latest actions in the background for memberHistoryActions. Returns 1 if the update was started. Use memberHistoryUpdateStatus to check when it is ready.
Refresh contact action history › Request Body
idContact ID.
Refresh contact action history › Responses
OK
succeedResponse status.
resultReturns 1 on success.
Get history update status
Tells whether an update started with memberHistoryUpdate is still running for the contact. When it returns 0, memberHistoryActions returns up-to-date data.
Get history update status › Request Body
idContact ID.
Get history update status › Responses
OK
succeedResponse status.
resultReturns 0 when ready, otherwise returns 1.
Export all contact history
Starts a background job that collects the action history of all your contacts in the given date range, and returns a handle for the job.
This job is not tracked by memberHistoryUpdateStatus, which only reports the state of a single contact's update started with memberHistoryUpdate.
To get the result, call /v1/jobStatus and then /v1/jobResult with the handle as handle. These endpoints are not documented separately. jobResult returns the result as a Base64-encoded file, and it can be fetched only once.
Export all contact history › Responses
OK
succeedResponse status.
resultProcess handle.
Forget contact
Permanently erases a contact's personal data, as required by the GDPR right to be forgotten. This cannot be undone.
The contact is deleted and removed from all lists. Its properties, SMS number, consents and logged events are removed, and its email address is replaced with a hash. Deleted contacts can also be forgotten.
Returns 0 if the contact is not found, and 1 without changing anything if the contact is already forgotten.
Forget contact › Request Body
recipient_idContact ID.
reasonFree-text reason for the action.
Forget contact › Responses
OK
succeedResponse status.
resultReturns 1 on success.
Forget contact by email
Same as forgetRecipient, but finds the contact by email address, including deleted contacts. Returns an error if the address is not found.
Forget contact by email › Request Body
emailEmail address of the contact.
reasonFree-text reason for the action.
Forget contact by email › Responses
OK
succeedResponse status.
resultReturns 1 on success.
Forget contact by SMS
Same as forgetRecipient, but finds the contact by SMS number, including deleted contacts. Returns an error if the number is not found.
Forget contact by SMS › Request Body
smsContact mobile phone number, e.g. +358401234567.
reasonFree-text reason for the action.
Forget contact by SMS › Responses
OK
succeedResponse status.
resultReturns 1 on success.
Export contact data
Returns a file with the data stored about a contact, for answering GDPR data access requests. The file contains, for example, the email address, SMS number, chosen properties, consents, received mails, opens and clicks.
Deleted contacts are also supported.
Export contact data › Request Body
recipient_idContact ID.
Export contact data › Responses
OK
succeedResponse status.
resultBase64-encoded file.