Skip to main content

Webhooks

Webhooks send what happens in AutoDM to your own app, or to Zapier, Make or n8n. When an event you picked happens, AutoDM sends a POST request with a JSON body to your URL.

Webhooks are available on every paid plan, from Creator Pro. Add them in Developer → Webhooks.

Events​

EventWhen it is sent
contact.createdA flow or the Telegram Subscribers screen saves a person for the first time
contact.updatedA contact's saved answers (fields) or tags change
lead.capturedA contact's email address or phone number is saved or changes
tag.addedA tag is added to a contact (one event per tag)
comment.receivedSomeone comments on a post, or writes in a group or under a post you follow (Instagram, Facebook, Threads replies, Telegram groups)
message.receivedSomeone sends a DM. Button taps and quick replies are not included
automation.sentAn automation sent its reply to someone
link.clickedSomeone opened a link in an automation DM. Needs Count link clicks on the automation

Comments and DMs are sent whether or not an automation answers them.

The request​

POST /your/path HTTP/1.1
Content-Type: application/json
User-Agent: AutoDM-Webhooks/1.0
AutoDM-Event: lead.captured
AutoDM-Delivery: evt_4f6c0e0b8b5d4d7f9c1a2b3c4d5e6f70
AutoDM-Signature: t=1795800000,v1=5d41402abc4b2a76b9719d911017c592...
{
"id": "evt_4f6c0e0b8b5d4d7f9c1a2b3c4d5e6f70",
"type": "lead.captured",
"createdAt": "2026-11-28T09:31:12.000Z",
"data": {
"contact": {
"id": "7c0e7a52-4a4f-4f5e-9a51-2f6f7d1c9b10",
"platform": "instagram",
"accountId": "0f9c8d4e-3b2a-4c1d-9e8f-7a6b5c4d3e2f",
"recipientId": "17841400000000000",
"username": "jane.doe",
"tags": ["lead", "ebook"],
"fields": { "email": "jane@example.com", "name": "Jane" },
"lastAutomationId": "5b1d2c3e-4f5a-4b6c-8d7e-9f0a1b2c3d4e",
"createdAt": "2026-11-28T09:30:00.000Z",
"updatedAt": "2026-11-28T09:31:12.000Z"
},
"email": "jane@example.com",
"phone": null
}
}

The id stays the same on every retry of the same event, so you can ignore an id you have already handled. Requests sent with Send test have "test": true.

Check the signature​

Each webhook has its own signing secret (it starts with whsec_). It is shown once when you add the webhook and when you make a new one. AutoDM-Signature holds the time the request was signed (t, Unix seconds) and v1, the hex HMAC-SHA256 of <t>.<raw body> made with the secret.

import crypto from 'node:crypto';

function isFromAutoDM(rawBody, header, secret) {
const parts = Object.fromEntries(header.split(',').map((part) => part.split('=')));
const expected = crypto.createHmac('sha256', secret).update(`${parts.t}.${rawBody}`).digest('hex');
const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) < 300;
return fresh && crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1 || ''));
}

Use the raw request body, not a parsed and re-encoded copy.

Answers and retries​

  • Answer with any 2xx status within 10 seconds. The answer's body is shown in the delivery log (first 1,000 characters).
  • Any other status, a timeout or a network error is tried again up to 7 more times, starting 1 minute later and doubling each time (the last try is about 2 hours after the event).
  • Answer 410 Gone to stop: the webhook is turned off right away.
  • After 15 events in a row fail every try, the webhook is turned off and the reason is shown on it. Turn it back on in Developer → Webhooks.
  • AutoDM does not follow redirects. URLs must use https:// and cannot point to a private or local network address.

Delivery log​

Open a webhook to see what was sent in the last 7 days (older entries are cleared every day): the event, the status, the answer and the full payload. Send again queues the same event (same id) once more.

Zapier, Make and n8n​

  • Zapier: connect AutoDM with your AutoDM login (OAuth). Triggers: New Lead, New Contact, Updated Contact, Tag Added to Contact, New Comment, New DM, Automation Sent, Link Clicked. Actions: Send DM, Update Contact. Search: Find Contact.
  • Make and n8n: connect with an API key from Developer → API keys (Read and write). The same triggers and actions are available.

Turning a Zap, scenario or workflow on adds a webhook for it in Developer → Webhooks (for example "Zapier subscription"); turning it off removes it. You can switch them off or delete them in AutoDM too. A tool can only delete the subscriptions it added, never webhooks you added yourself.

Integration API​

The same endpoints are on /public/v1 with an API key, and on /integrations/v1 with an OAuth token (scope integrations, used by Zapier).

Method and pathWhat it does
GET /meThe connected account (id, email)
POST /hooksSubscribe a URL: { "targetUrl": "https://...", "event": "lead.captured", "source": "zapier" | "make" | "n8n" }
DELETE /hooks/{id}Remove a subscription made with POST /hooks
GET /events/{type}/samplesThe last 3 events of this type, or an example when there are none yet
GET /contacts?email=&username=&recipientId=&platform=Find contacts (up to 10). At least one of email, username or recipientId
GET /contacts/{id}One contact
PATCH /contacts/{id}{ "addTags": [], "removeTags": [], "fields": { "name": "value" } }. An empty value removes a field. Field names use a-z, 0-9 and _
POST /messages{ "contactId": "...", "text": "...", "idempotencyKey": "..." } sends a DM through the Inbox

Sending a DM needs Inbox turned on and an Inbox conversation with the person (they messaged you first). Every Inbox rule applies: Instagram and Facebook allow a reply only within 24 hours of the person's last message. The same idempotencyKey sends once. Changing a contact's tags or fields sends contact.updated, tag.added and lead.captured like any other change.