Skip to main content
Every webhook on the other pages of this section is outbound: we send events to you. The inbound hook runs the other way. A triggered text project or email campaign can give you a URL, and any tool that can 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}/hook for a text project or POST /v1/email/campaigns/{id}/hook for an email campaign.
The values are shown once, at the moment they are generated. The response below is an example with made-up values; yours will have your own project or campaign id and a 64-character secret.
There are two ways to call the hook, and both use the same secret:
  • hook_url has the secret in the address. Use it in tools that can only be given a URL.
  • endpoint_url has no secret in it. Send the secret in an X-Hook-Secret header. Prefer this when your tool can set headers: a URL can end up in proxy logs and browser history, and a header does not.
Either one is the whole credential: anyone who has it can add recipients. Store it like a secret. Your own domain. If your organization has its own domain, both 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.
The URL is shown only when it is created. Creating a new one rotates it: the previous URL stops working at once and answers 404. Rotate when a URL leaks or when a person who had it leaves, then paste the new URL into your tools.

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 a 2xx 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.
  1. Choose your trigger, for example a new row in Google Sheets or a new contact in your CRM.
  2. Add the action Webhooks by Zapier, event POST.
  3. Set URL to the hook URL and Payload Type to json.
  4. Under Data, add phone_number (or email) and map it from your trigger. Add one line per field you want in the message, such as first_name. Add occurrence_id mapped to a unique id from the trigger, such as the row id.
  5. Test the step. A 202 with queued means the person was added.
In either tool, send an occurrence_id so that a replayed run does not send twice.