Webhook events and the request body
Every event shares one body: the workspace, the Instagram account, the reel, the code word, the lead and the funnel. Fields are only ever added, so a new field doesn't break a receiver that doesn't know it.
Events
| Event | When it arrives |
|---|---|
lead.created | someone wrote the code word in a comment, in Direct or in reply to a story |
lead.answered | the last form question was answered or skipped, or the person answered a Telegram bot question |
lead.qualified | the person reached the funnel's qualifying step, so it's a lead |
order.paid | the cashier confirmed payment for an order in the funnel's bot |
order.refunded | the order's money was returned in full |
test | the «Test» button on the «Send leads to your CRM» card |
lead.answered, lead.qualified and the payment events arrive only after the lead.created of the same lead was delivered or ran out of attempts, so your receiver learns of the lead first. Test payments and payments of people who reached the bot not from Direct are not sent. If someone writes the word again a day later, that's a new lead with a new lead.id.
Fields
| Field | What it holds |
|---|---|
event | the event, the same as in X-Viralmaxing-Event |
occurredAt | when it happened, ISO 8601 in UTC |
workspace.id, workspace.name | the workspace |
instagramAccount.id, .username | the account the word was written under |
reel.mediaId, reel.url | the reel; reel is null for Direct and stories, url is null until Viralmaxing knows the reel's address |
codeWord | the word the person wrote |
The lead and the funnel:
| Field | What it holds |
|---|---|
lead.id | the lead key: one for all of a person's events in this funnel, join by it |
lead.username, lead.instagramUrl | username and profile; a Direct lead's username may be empty |
lead.answers[] | form answers in question order: the field name field, the type type (text, phone or email), question, answer. Telegram bot answers follow with field: telegram |
automation.id, automation.name | the funnel; the name is its code words, comma-separated |
order | payments and refunds only: id, product, amountKopecks, refundedKopecks, currency, test, paidAt, telegramUsername |
The payment amount:
| Field | What it holds |
|---|---|
order.amountKopecks, .refundedKopecks | always rubles, currency is RUB; another currency is converted at the Bank of Russia rate of the payment day |
order.originalAmount, .originalCurrency | payments not in rubles only: the amount in minor units of the cashier's currency; 50 € is 5000 and EUR |
order.approximate | true when the rubles are approximate: Telegram Stars or the previous day's rate |
order.underpaid | true when the buyer paid less than the offer price: the money is real, the bot sent no access |
The body holds nothing else about the person: no internal Instagram ids, no conversation.
Examples
lead.created: someone wrote «выбор» under a reel. No answers yet:
{
"event": "lead.created",
"occurredAt": "2026-11-11T09:04:05Z",
"workspace": { "id": 5300, "name": "Online school" },
"instagramAccount": { "id": "17841400000000001", "username": "school.account" },
"reel": { "mediaId": "18000000000000001", "url": "https://www.instagram.com/reel/DAbc/" },
"codeWord": "выбор",
"lead": {
"id": "lead_3f9a0c1d2e4b5a6978c0d1e2",
"username": "mama_kati",
"instagramUrl": "https://www.instagram.com/mama_kati/",
"answers": []
},
"automation": { "id": 338, "name": "выбор" }
}
lead.answered: the same lead answered the form:
{
"event": "lead.answered",
"occurredAt": "2026-11-11T09:06:40Z",
"lead": {
"id": "lead_3f9a0c1d2e4b5a6978c0d1e2",
"username": "mama_kati",
"instagramUrl": "https://www.instagram.com/mama_kati/",
"answers": [
{ "field": "phone", "type": "phone", "question": "Leave a phone number to book", "answer": "+79990001122" },
{ "field": "parent_child_age", "type": "text", "question": "How old is your child?", "answer": "9" }
]
}
}
The other fields are as in lead.created; they're left out here for brevity and present in the request.
lead.qualified: the lead reached the qualifying step. Same body, event is lead.qualified, answers holds what they've answered so far.
order.paid: a payment in the funnel's bot:
{
"event": "order.paid",
"occurredAt": "2026-11-11T10:15:00Z",
"lead": { "id": "lead_3f9a0c1d2e4b5a6978c0d1e2", "username": "mama_kati", "answers": [] },
"automation": { "id": 338, "name": "выбор" },
"order": {
"id": "order_9b1c2d3e4f5a6b7c8d9e0f1a",
"product": "Monthly pass",
"amountKopecks": 690000,
"refundedKopecks": 0,
"currency": "RUB",
"test": false,
"paidAt": "2026-11-11T10:15:00Z",
"telegramUsername": "katya_mama"
}
}
order.refunded: the same body with refundedKopecks equal to the order amount.
test: the «Test» button: the real workspace and account, a made-up lead lead_test with username viralmaxing_test. Map your fields on it before the first live lead.