Automations

Start an automation for a contact

POST /api/v1/automations/{uid}/execute

For an automation whose trigger is "API call". The contact is given as for adding a contact (EMAIL, any field of the list by its tag, tag, status). A contact the automation's list does not hold yet is added to it first; a contact it holds is used as it is, without changing its fields. An automation runs once per contact.

The automation's page shows the URL of this call, with its uid.

Parameters
uid string required path
The automation's uid.
Request body application/x-www-form-urlencoded
EMAIL string (email) required
tag string
Tags, separated by commas. Only for a contact the list does not hold yet.
status string
Only for a contact the list does not hold yet. One of: subscribed, unsubscribed, unconfirmed.

A field of the list, by its tag. Only for a contact the list does not hold yet.

Responses
200 The automation started for the contact.
401 The token is missing or wrong (Unauthenticated.), or its user may not act on this object (Unauthorized). Without the Accept: application/json header, a missing or wrong token answers with a redirect to the sign-in page instead.
403 The contact is not on the list and the list refused it (a field is wrong, or the plan allows no more contacts).
404 The token's account has no automation with this uid.
409 The contact went through this automation already.
422 Nothing was started: the automation is not started by API calls, is not active, has no step after its trigger or no list, EMAIL is missing, the contact is not subscribed, or it is outside the segment the automation is limited to.
Start an automation for a contact
1 2 3 4 5 6
curl -X POST 'https://your-domain/api/v1/automations/6adaabd9f2abd/execute' \
  -H "Accept: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  --data-urlencode 'EMAIL=anna@example.com' \
  --data-urlencode 'tag=trial' \
  --data-urlencode 'status=subscribed'
Response
{
    "success": true,
    "subscriber_uid": "ec9a5eef0b70f",
    "contact_created": true
}