Automation webhook trigger
Another app can start an Antero automation for a person by posting their email or phone to the automation's own URL; the other fields it sends become merge tags.
Who can use this: Managers and above set up automations (
automations:manage). The app that calls the URL needs no account.
Set it up
- Open Marketing → Automations and click New automation.
- Give it a Name, choose Starts when: Another app calls a webhook, and click Create.
- Under What starts it, copy the Webhook URL. It looks like
https://your-antero-address/hooks/automations/{token}, where the token is 40 letters and digits. - Add the steps, choose Can a contact go through it again?, and save.
- Click Switch on. Until then every call is refused with HTTP 409.
- Paste the URL into the other app (Zapier, Make, n8n, your website's server, a booking system) as a webhook that sends a
POST.
The automation runs in its brand: contacts are found and made there, and its steps use that brand's connections. See Automations for steps, re-entry and runs.
The request
- Method:
POSTonly. - Body: JSON (
Content-Type: application/json) or form data (application/x-www-form-urlencodedormultipart/form-data). Query-string parameters on the URL are read too. Send JSON with itsContent-Type, or it is not read. - No API key, cookie or CSRF token: the token in the URL is the only key.
- Send
Accept: application/jsonto get JSON for every error, including the rate limit.
Fields
At least a valid email or phone is required. Antero recognises these field names, in any letter case:
| Detail | Field names |
|---|---|
email, email_address, emel |
|
| Phone | phone, phone_number, mobile, whatsapp, telefon |
| Name | name, full_name, fullname, nama |
| Company | company, company_name, syarikat |
- The email must be a valid address. A phone number without a country code is read as Malaysian, so
012-345 6789becomes+60123456789. - Every field you send, including the ones above, becomes a
{{trigger.*}}merge tag:- nested objects are joined with
_:{"order": {"id": "A1001"}}givesorder_id; - list items get their position:
{"items": ["Rendang", "Satay"]}givesitems_0anditems_1; - characters other than letters, digits and
_become_(first-namegivesfirst_name), and names are cut at 60 characters; - values become text, trimmed and cut at 500 characters;
truebecomes1,falsebecomes empty, andnullis left out; - only the first 50 fields are kept.
- nested objects are joined with
How the contact is found or made
- Antero looks in the automation's brand for a contact with that email, then with that phone.
- A contact it finds is used as it is: the call does not change its name, email, phone or company. Use an Update a field step with
{{trigger.*}}tags to change them. - Otherwise it makes a contact with the name (or the email, or the phone, when no name is sent), email, phone and company, and the automation's name as its Source. The new contact counts toward the plan's contact limit and starts any A contact is created automations.
- The run starts unless the automation's re-entry rule keeps the contact out (by default "Again, once their last run has finished").
Responses
| Status | Body | Meaning |
|---|---|---|
| 202 | {"contact_id": 2051, "run_id": 902, "started": true} |
The run started. |
| 202 | {"contact_id": 2051, "run_id": null, "started": false} |
The contact was found or made, but the re-entry rule kept them out. |
| 404 | {"message": "Not found."} |
No automation has this token, or it no longer starts with a webhook. |
| 409 | {"message": "This automation is switched off."} |
The automation is a draft or paused. |
| 409 | {"message": "The workspace has reached its plan's contact limit."} |
A new contact was needed but the plan has no room. |
| 422 | {"message": "Send an email or a phone number so Antero can find or create the contact."} |
No valid email or phone was sent. |
| 429 | – | More than 1,200 calls in a minute to this URL. Wait and try again. |
A 202 means the run was queued: its steps then run on their own, and their results show on the automation's Runs.
Example
curl -X POST "https://antero.example.com/hooks/automations/q8Vt2LmN4xR7cJ1aZ5bK9pW3sD6fH0gY2uE4iO8n" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"name": "Siti Aminah",
"email": "siti@example.com",
"phone": "012-345 6789",
"plan": "Gold",
"order": {"id": "A1001", "total": "250.00"}
}'
{ "contact_id": 2051, "run_id": 902, "started": true }
This run has {{trigger.name}}, {{trigger.email}}, {{trigger.phone}}, {{trigger.plan}}, {{trigger.order_id}} and {{trigger.order_total}}.
The same call as form data:
curl -X POST "https://antero.example.com/hooks/automations/q8Vt2LmN4xR7cJ1aZ5bK9pW3sD6fH0gY2uE4iO8n" \
-H "Accept: application/json" \
--data-urlencode "email=siti@example.com" \
--data-urlencode "plan=Gold"
Use the fields in steps
Type {{trigger.field}} in a step's text, next to the usual {{contact.*}} and {{brand.name}} tags. Add a fallback after a bar for calls that leave the field out: {{trigger.plan|Standard}}. A field that was not sent becomes the fallback, or nothing.
| Step | Example |
|---|---|
Update a field (a custom field plan) |
{{trigger.plan}} |
| Open a deal (title) | Order {{trigger.order_id}} |
| Schedule a follow-up (subject) | Call {{contact.first_name}} about the {{trigger.plan}} plan |
| Send an SMS, Reply on WhatsApp | Hi {{contact.first_name}}, we got your order {{trigger.order_id}}. |
| Send a WhatsApp template (a variable) | {{trigger.order_total}} |
| Send an email (subject or body) | Your {{trigger.plan}} plan is ready |
| Alert the team on Telegram | New order {{trigger.order_id}} from {{contact.name}}: RM{{trigger.order_total}} |
- Field names are matched exactly, letter case included: a field sent as
Planis{{trigger.Plan}}. - Post to your webhook forwards every field, under
trigger.payloadin theautomation.stepevent.
Rate limit
Each automation's URL takes up to 1,200 calls a minute; more get HTTP 429. Calls to different automations count separately.
Keep the URL secret
Anyone with the URL can add contacts to the brand and start the automation. Call it from a server or an automation tool, never from JavaScript in a public web page.
The token cannot be changed. If the URL leaks, Pause the automation (calls then get 409), make a new automation with the same steps (it gets a new URL), and delete the old one.
Troubleshooting
- 422 although an email was sent. The field name is not one in the table above, the address is not valid, or JSON was sent without
Content-Type: application/json. - 409 "This automation is switched off." Click Switch on on the automation.
- 202 with
"started": false. The contact already went through, or is still going through, and the re-entry rule keeps them out. Change Can a contact go through it again?. - A merge tag comes out empty. Check the flattened field name (nested fields are joined with
_) and its letter case.