POST to it adds one recipient. That makes a CRM, a form, or a no-code tool a trigger without writing code.
Use it with a project or campaign whose trigger source is an API call or webhook. For how triggered sends behave, see Triggered texts and emails.
Get the hook URL
There are two places to get it, and both give you the same three values:- In the dashboard. Open the report page of a triggered project or campaign whose trigger is An API call or webhook, and choose Generate webhook URL. The page shows the webhook URL, and under it the address and secret for tools that can set headers.
- Over the API. Call
POST /v1/projects/{id}/hookfor a text project orPOST /v1/email/campaigns/{id}/hookfor an email campaign.
hook_urlhas the secret in the address. Use it in tools that can only be given a URL.endpoint_urlhas no secret in it. Send thesecretin anX-Hook-Secretheader. Prefer this when your tool can set headers: a URL can end up in proxy logs and browser history, and a header does not.
hook_url and endpoint_url are built on it, for example https://go.yourdomain.org/webhooks/trigger/text/.... The domain is chosen in this order: the tracking domain the project or campaign uses for its own links; your organization’s only tracking domain; your organization’s only dashboard domain, or its parent organization’s. When there are several candidates and none is chosen on the item, or there is no domain at all, both are on api.politicalcomms.com. A URL on either host works the same way.
Send a recipient
POST the hook URL (or the endpoint URL with the X-Hook-Secret header) with a JSON or form body. No X-API-Key header and no signature are needed.
Fields are merge tags in your message (
{first_name}), are kept on the recipient, and appear in reports, exports and the contact.custom_fields of your outbound webhooks.
Answers
The hook adds the recipient before it answers, so a2xx means the person was actually entered. A tool that shows you only the status code can trust it.
A
202 or 200 answer has this shape:
Zapier and Make
You do not need a published app: the generic webhook step in each tool works with the URL.- Zapier
- Make
- Choose your trigger, for example a new row in Google Sheets or a new contact in your CRM.
- Add the action Webhooks by Zapier, event POST.
- Set URL to the hook URL and Payload Type to
json. - Under Data, add
phone_number(oremail) and map it from your trigger. Add one line per field you want in the message, such asfirst_name. Addoccurrence_idmapped to a unique id from the trigger, such as the row id. - Test the step. A
202withqueuedmeans the person was added.
occurrence_id so that a replayed run does not send twice.