SendApp Docs
Log in

Instant notifications on automations

POST https://app.sendapp.ai/api/automations/hooks
Subscribes one of your addresses to the runs of an automation, of any kind: as soon as it starts, finishes or fails, SendApp sends a POST with the automation, the run, the contact and the event data. This is what Zapier's instant trigger uses. The list of all automations is read with GET /api/automations?all=1; GET /api/automations/hooks shows the subscriptions, GET /api/automations/hooks/sample an example, DELETE /api/automations/hooks/{id} removes one.
Every delivery has the header X-SendApp-Signature: t=<unix>,v1=<hmac>: HMAC-SHA256 of t.body with the secret, which you receive only once, when you create the subscription.
If your address answers 410 the subscription is removed. With 429, 5xx or no answer the delivery is retried up to 4 times.
If your address keeps failing (20 deliveries in a row), the subscription is paused: during that time events are not sent or recovered later. SendApp tries again about once an hour with the event of that moment, and the first successful answer restarts the subscription. It also restarts if you create it again. If it keeps failing for about a week of tries it is removed. With more than 500 deliveries waiting per subscription, or 1000 per account, new ones are skipped. Your address must answer within 4 seconds, otherwise the delivery counts as failed. The subscription's paused field says whether it is paused, and we tell you by email once per pause.
run.reason is a fixed code, never a text: opted_out, app_off, timeout, step_failed, skipped or empty.
The order_status_url and tracking_url links can open the recipient's data without a login: treat them as confidential.
If the connection you created the subscription with expires, deliveries are paused and the events of that time are not recovered: we tell you once, in the panel and by email. Reconnect it to restart them.
Tests of the automation and runs skipped by its checks (anti-repeat, sending hours) send nothing.
You receive the contact's personal data in your tool: you remain responsible for it and must respect the opted_out status. An excluded contact does not stop the delivery: contact.id is the key to use to find the contact through the APIs. The body always carries contact.opted_out and contact.marketing_consent, and run.skipped_for_opt_out is true if a step or the run was skipped because of the exclusion. It contains no conversation text.
A failed email can send both run_completed and run_failed for the same run: the step that queues the email closes the run, and if the email fails afterwards the run becomes failed.
The subscription stops if you revoke the connection or the API key it was created with. Deliveries also stop with a suspended account, an expired plan or no API access.

Parameters

5 · 1 required
url required
Public https address.
events optional
One or more of run_started, run_completed, run_failed. Default: run_started.
automation_id optional
Empty = all the account's automations.
label optional
A name to recognise it.
include_event_data optional
Include the data of the event that started the rule, in data.hook_data, plus data.payment_link and data.deal_name. Off by default: when off, these fields are not there. When on, credentials and known free-text fields (body, message, comment, note, description, ticket, assignee, reason) are removed, nested ones included. It may contain personal data and other data from the connected systems, under your responsibility. With the same parameter, GET /api/automations/hooks/sample shows an example that includes these fields.
Need help with the integration? info@sendapp.live