Skip to content
On this page

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

EventWhen it arrives
lead.createdsomeone wrote the code word in a comment, in Direct or in reply to a story
lead.answeredthe last form question was answered or skipped, or the person answered a Telegram bot question
lead.qualifiedthe person reached the funnel's qualifying step, so it's a lead
order.paidthe cashier confirmed payment for an order in the funnel's bot
order.refundedthe order's money was returned in full
testthe «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

FieldWhat it holds
eventthe event, the same as in X-Viralmaxing-Event
occurredAtwhen it happened, ISO 8601 in UTC
workspace.id, workspace.namethe workspace
instagramAccount.id, .usernamethe account the word was written under
reel.mediaId, reel.urlthe reel; reel is null for Direct and stories, url is null until Viralmaxing knows the reel's address
codeWordthe word the person wrote

The lead and the funnel:

FieldWhat it holds
lead.idthe lead key: one for all of a person's events in this funnel, join by it
lead.username, lead.instagramUrlusername 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.namethe funnel; the name is its code words, comma-separated
orderpayments and refunds only: id, product, amountKopecks, refundedKopecks, currency, test, paidAt, telegramUsername

The payment amount:

FieldWhat it holds
order.amountKopecks, .refundedKopecksalways rubles, currency is RUB; another currency is converted at the Bank of Russia rate of the payment day
order.originalAmount, .originalCurrencypayments not in rubles only: the amount in minor units of the cashier's currency; 50 € is 5000 and EUR
order.approximatetrue when the rubles are approximate: Telegram Stars or the previous day's rate
order.underpaidtrue 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:

json
{
  "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:

json
{
  "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:

json
{
  "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.

Read next