Docs
After submitWebhooks and email
View as Markdown(opens in a new tab)

Webhooks and email

Completed submissions are delivered to every enabled destination on their form: email, Slack, webhooks and databases. Spam and test submissions never trigger deliveries; partial ones only as unfinished alerts, on destinations where you turn those on. Sandbox projects never deliver.

Email

Email notifications go to workspace members: the person who claims the site gets them on every form, and you add teammates per form in the dashboard (Setup → Delivery) or with npx @trymirio/mirio destinations add email <member> --form <slug> (--all-forms for every form). There is no verification step and no outside addresses; use Slack for shared inboxes and aliases. One email per completed submission, with the subject New response: <form name>: triage's summary, fit, category and group picks first (when triage is on), then each question and answer, where the person came from (the page and the source), and an Open in Mirio button. Its footer links the form's Delivery settings. npx @trymirio/mirio destinations test on an email destination sends Test notification: <form name> with sample answers. With unfinished alerts on, a response left unfinished gets one email too, Unfinished response: <form name>: where the person stopped, the answers so far, where they came from, and the button. Every email has a plain-text version and follows the reader's dark mode where their mail app supports it.

Webhooks

Add a URL in the form's Setup → Delivery in the dashboard, or npx @trymirio/mirio destinations add webhook <url> --form <slug>. You get a signing secret once; store it as an environment variable.

Request: POST with Content-Type: application/json, User-Agent: Mirio-Webhooks/1, Mirio-Delivery-Id, Mirio-Signature.

{
  "id": "dlv_…",
  "type": "submission.completed",
  "createdAt": "2026-10-13T12:00:00.000Z",
  "data": { "id": "sub_…", "status": "complete", "values": { "email": "[email protected]" }, "form": { "id": "frm_…", "slug": "waitlist", "name": "Waitlist" }, "meta": { … }, "versionNumber": 3, "owner": null, … }
}

data.owner is who on the team owns the response, { userId, email, name, assignedAt }, or null when it's unassigned (Routing to people).

Event types

type When data
submission.completed A response is completed (not spam, not a test) The submission, status: "complete"
submission.unfinished A response with an email answer has gone the webhook's unfinishedAfterMinutes without a save, while still unfinished. Only on webhooks with unfinished alerts on; at most once per response. The same shape, status: "partial", with pagesCompleted and the answers so far
submission.action Someone on the team acted on the response, from Mirio or from Slack: Book, Reply, Not a fit or Spam (Mark as spam in Mirio included; Replies); an agent marked it handled (mirio handled, POST …/submissions/{id}/actions); or Mirio sent the form's instant confirmation to the person (kind: "confirmed", via: "auto", by: null, usually a few seconds after submission.completed). One event per action, on every webhook on the form. Not for test responses. The response as it is now (status: "spam" after Spam), plus a top-level action: { kind: "booked" | "replied" | "declined" | "spam" | "handled" | "confirmed", via: "slack" | "dashboard" | "api" | "auto", by, userId, emailed, subject?, note?, at } (dashboard is Mirio; handled comes via: "api", with by: null and the agent's note)

A response that's finished later still sends submission.completed, so a webhook with unfinished alerts on can get both for one response (same data.id). Check type before you act: a CRM sync might create the lead on submission.completed, only a follow-up task on submission.unfinished, and record what happened on submission.action (action.kind says which: booked, replied, not a fit, spam, handled, or confirmed for the instant confirmation; action.via says where). An agent that marks a response handled gets its own submission.action back: check action.via === "api" if your handler shouldn't act on it again. Database destinations get actions too, as the row's mirio_status and mirio_actions; email and Slack destinations don't.

Verify the signature

Mirio-Signature: t=1760356800,v1=<hex> where v1 = HMAC-SHA256(secret, "<t>.<raw body>").

import { createHmac, timingSafeEqual } from 'node:crypto';

export function verifyMirioSignature(rawBody: string, header: string, secret: string, toleranceSeconds = 300) {
  const parts = Object.fromEntries(header.split(',').map((p) => p.split('=') as [string, string]));
  const t = Number(parts.t);
  if (!t || Math.abs(Date.now() / 1000 - t) > toleranceSeconds) return false;
  const expected = createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex');
  return expected.length === parts.v1?.length && timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1));
}

Respond with any 2xx within 10 seconds. Anything else is retried.

Retries and replay

Backoff: 1 minute, 5 minutes, 15 minutes, 1 hour, 3 hours, 6 hours, then every 6 hours until 24 hours after the first attempt. The delivery log in the dashboard shows every attempt with the response code. Replay any delivery with one click; a replay is a fresh delivery with the same payload (an unfinished alert replays as submission.unfinished, and is sent only while the response is still unfinished; an action event replays with the same action).