Start automation
POST
https://app.sendapp.ai/api/automations/{id}/start
Starts right away, for one contact, a switched-on automation with the Call from another system trigger. It does the same as the automation's secret address, but the automation's ID is enough. If the contact does not exist yet, it is created.
The steps really run: a «Send template» step sends the WhatsApp message to the contact. To try it, use an automation with harmless steps, for example «Add tag».
The contact:
contact_id of a contact of your account, or phone and/or email (with name, or first_name and last_name, for a new contact). If you pass none of the three, the contact is read from data the way the automation's address does: the fields chosen in the editor or the usual names (phone, email, name…).The fields of
data are used in the steps as hook:name; nested keys become hook:order.id. At most 50 fields, 500 characters each.Responses:
200 with ran, run_id, run_status (done, waiting, failed…), reason, contact_id and contact_created; with ran: false the automation did not start because its conditions («If…») are not met for this contact — 200 with status: duplicate if the same idempotency_key was already used in the last 24 hours — 404 if the automation or the contact is not in your account — 409 if the automation is switched off — 413 if the body is larger than 64 KB — 422 if a value is not valid.Common errors:
401 if the API key is missing or wrong — 403 if the plan has expired or does not include API access, or if the connected app (Zapier, Make) only has read permission — 429 if you make too many requests in a short time, or if the automation already received 120 starts in the last minute (its address's calls count too): try again after the seconds given in the Retry-After header.Parameters
9 · 2 required
apikey
required
Your API Key (the
X-API-Key header also works).
id
required
Automation ID (integer, in the path). Use
GET /api/automations to find it.
contact_id
optional
ID of a contact of your account.
phone
optional
Phone in international format, for example
+393331234567. Used when contact_id is missing.
email
optional
The contact's email. Used when
contact_id is missing.
name
optional
Name for a new contact (or
first_name and last_name).
data
optional
Object with the fields the steps read as
hook:name, for example {"order_id": "1234"}.
token
optional
Only for an automation that applies to all accounts: the token of the contact's account. For an automation of one account, omit it or pass that account's.
idempotency_key
optional
A key of your own, up to 200 characters: with the same key within 24 hours the automation does not start again and the answer is
status: duplicate. The key is shared with the secret address of the same automation: a key already received there (Idempotency-Key header) answers duplicate here too, and the other way round. You can also use the Idempotency-Key header.
Need help with the integration? info@sendapp.live