Docs
After submitDestinations: email, Slack, webhooks, your database
View as Markdown(opens in a new tab)

Destinations: email, Slack, webhooks, your database

A destination is where a form's completed submissions go. Destinations belong to one form; "Add to all forms" in the dashboard and --all-forms in the CLI create one per form. Add them in the dashboard or with the CLI, so an agent can wire them without a browser:

npx @trymirio/mirio destinations add slack --form demo-request     # prints an "Add to Slack" link for a person
npx @trymirio/mirio destinations add slack https://hooks.slack.com/services/T000/B000/XXXX --form demo-request
npx @trymirio/mirio destinations add postgres "postgres://postgres.abcd:[email protected]:6543/postgres" --form demo-request
npx @trymirio/mirio destinations add email [email protected] --all-forms     # a workspace member
npx @trymirio/mirio destinations add webhook https://example.com/hooks/mirio --form demo-request
npx @trymirio/mirio destinations add slack https://hooks.slack.com/services/T000/B000/XXXX --form demo-request --unfinished 30
npx @trymirio/mirio destinations update dst_… --nudge 2h --digest 09:00@Europe/Berlin    # Slack: reminders
npx @trymirio/mirio destinations list
npx @trymirio/mirio destinations test dst_…

Spam and test submissions are never delivered, and partial ones only as unfinished alerts where you turn those on. Sandbox projects never deliver.

Public addresses only. Webhook URLs must be https://, and webhooks and databases must be on the public internet: Mirio refuses localhost, private and link-local ranges (cloud metadata), internal names like *.internal, and names that resolve to any of those, when you add the destination and again at every delivery. To try a webhook running on your machine, expose it with a tunnel (ngrok, cloudflared), add the tunnel's URL, and send it a sample with mirio destinations test dst_…. Test submissions (mirio test, or a live site's form on localhost) are never delivered.

Email goes to workspace members only, once they've joined. The person who claims a site (or creates it in the dashboard) gets email notifications on every form automatically, including forms added later. Invite teammates to the workspace to add them: an invite counts once they've signed in and accepted it, and Mirio checks again when each email is sent, so someone removed from the workspace stops getting them. Outside addresses are refused (use Slack for shared inboxes and aliases). Each response arrives as New response: <form name>, with triage's read, the answers, where the person came from and a button to it in Mirio (what's in it).

When the claimer's email isn't added. That default is an ordinary email destination, added at the claim for the forms that exist and, for a form registered later, when its file is first registered, but only if the form has no destination yet. Adding Slack, a webhook or a database to a registered form never removes it. Adding one to a form that isn't registered yet (a draft from the dashboard's New form) means the claimer won't get that form's emails, so add them too:

npx @trymirio/mirio destinations add slack --form demo-request
# ⚠ demo-request isn't registered yet, so [email protected] (who claimed the site) won't get its responses by email … To keep them, also run `mirio destinations add email [email protected] --form demo-request`.
npx @trymirio/mirio destinations add email [email protected] --form demo-request

mirio destinations add and the "Add to Slack" link print that warning (warnings in --json and in the API's response), and the draft's Delivery page in the dashboard says the same under Email. A form that already has the claimer's address gets no warning.

Filters

Email and Slack destinations can be limited to some triage categories, fit levels and picks in the form's groups, so #sales only hears about high-fit leads while support questions go to the support inbox, and to some answers, like enterprise requests from the pricing page:

curl -X POST "$API/v1/project/destinations" -H "Authorization: Bearer $MIRIO_SECRET_KEY" -H 'Content-Type: application/json' \
  -d '{ "type": "slack", "formSlug": "demo-request", "url": "https://hooks.slack.com/services/…", "filter": { "categories": ["Sales lead"], "fit": ["high", "medium"] } }'
  • categories: the form's review categories (strings, up to 40 characters). fit: any of high, medium, low. groups: options per group key, e.g. { "urgency": ["This week"] }. All optional; a response must match every list that is set. A group the response has no pick in (an older review) doesn't filter.
  • CLI: --categories "Sales lead" --fit high --group "Urgency: This week, This quarter" (repeat --group; the key comes from the group's name).
  • No filter, or empty lists, means every response.
  • The triage parts fail open: when a response has no review (the form has review off, the review failed or timed out, or the monthly review limit was reached), they let it through. Conditions on answers still apply.
  • Webhooks and databases cannot be filtered; they receive every completed response so your own systems stay complete. Filter on review.category, review.fit, review.groups and the values there.
  • The triage parts don't apply to unfinished alerts: those responses aren't triaged. Answers do.
  • In the dashboard, each email and Slack destination has a "Send: All responses ▾" menu for the same setting.

Filter on answers

A destination can also be limited by what a response says, on any field: a hidden field (intent from the pricing page), a choice or a text question. No webhook to write, and it doesn't need triage:

npx @trymirio/mirio destinations add slack --form demo-request --where intent=enterprise,sales
npx @trymirio/mirio destinations add email [email protected] --form demo-request --where intent=enterprise --where plan=team   # both must match
npx @trymirio/mirio destinations update dst_… --where source=pricing      # replaces the conditions
npx @trymirio/mirio destinations update dst_… --clear-where                # removes them (categories, fit and groups stay)
curl -X POST "$API/v1/project/destinations" -H "Authorization: Bearer $MIRIO_SECRET_KEY" -H 'Content-Type: application/json' \
  -d '{ "type": "slack", "formSlug": "demo-request", "url": "https://hooks.slack.com/services/…", "filter": { "where": [{ "field": "intent", "in": ["enterprise", "sales"] }] } }'
curl -X PATCH "$API/v1/project/destinations/dst_…" -H "Authorization: Bearer $MIRIO_SECRET_KEY" -H 'Content-Type: application/json' \
  -d '{ "filter": { "where": [{ "field": "plan", "in": ["team"] }] } }'
  • where is a list of conditions, { field, in }, with the field's key from the schema file. A response must match every condition (AND); within one, any of the values will do (OR). Up to 5 conditions and 20 values each.
  • Values are compared after trimming, in any case: Enterprise matches enterprise. A multiple-choice answer matches when any of its picks does; a number matches as written (40); yes/no and consent fields take true or false (or yes, no).
  • For choice fields, use option values; an option's label works too and is stored as its value. A value that isn't an option, or a key the form doesn't have, is refused with the list to pick from. The form must be registered (a draft from the dashboard has no fields yet).
  • No answer, no match. Unlike the triage parts, conditions on answers don't fail open: a response without that field, or with it empty, isn't sent to that destination. They apply whether or not triage ran, also to unfinished alerts (a partial is checked against the answers it has so far).
  • With allForms, every form must have the field; otherwise nothing is created and the error names the form.
  • Mirio stores conditions by the field's id, so renaming a field (with renamedFrom) keeps the filter; the API and mirio destinations list show the field's current key.
  • PATCH changes a filter in place: each part you send (categories, fit, groups, where) replaces that part, null clears it, and parts you leave out stay. "filter": null clears all of it.
  • In the dashboard: Send ▾ → Only some → Only when, a question picker (questions and hidden fields) with the options to tick for choice fields, or values to type (comma-separated) for hidden and text fields. The row reads "Only responses where Intent is enterprise".
  • Hidden fields usually take their value from the link the person followed, so a visitor can set them too (?intent=enterprise). Filtering on one sorts responses into the right channel; it doesn't prove anything about who sent them.

Unfinished responses

A demo request abandoned on its last step is often the most interesting one. Turn on unfinished alerts for an email, Slack or webhook destination and it also hears about a response where the person gave an email address and then stopped, once they haven't saved anything for that long:

npx @trymirio/mirio destinations add slack --form demo-request --unfinished 30      # with a new destination
npx @trymirio/mirio destinations update dst_… --unfinished 60                      # an existing one
npx @trymirio/mirio destinations update dst_… --unfinished off
  • Which responses: partial responses with an answer to an email field, on a claimed (live) site, that haven't been saved for the chosen time. Spam, test responses and sandbox projects never alert. A response that's finished in time gets only the normal notification.
  • Once: at most one unfinished alert per response and destination, even if the person comes back, saves another page and stops again. If they finish later, the normal notification for a completed response still goes out.
  • At most 30 an hour per destination: a partial save has no bot check (Turnstile runs on the final submit), so this caps what a bot posting partials could send. The rest wait for the next hour, or go unsent once they're older than 24 hours.
  • The time is whole minutes from 10 to 1440 (24 hours), counted from the person's last save (each page they finish is a save). The dashboard offers 15 minutes, 30 minutes, 1 hour and 2 hours. Mirio checks once a minute.
  • When you turn it on, responses that stopped within the last day and have been quiet long enough are included; older ones aren't.
  • No triage: unfinished responses aren't triaged, so a destination's category, fit and group filters don't apply to them (they fail open, like a response without a review). Conditions on answers do apply: an alert goes out only when the answers so far match.
  • Databases don't take the option: they hold finished responses only.
  • In the dashboard: a destination's ⋯ menu on the form's Delivery page → Unfinished responses (Off, after 15 minutes, 30 minutes, 1 hour or 2 hours). The response's activity lists each alert as an unfinished alert.
  • API: unfinishedAfterMinutes on POST /v1/project/destinations, and PATCH /v1/project/destinations/{id} with { "unfinishedAfterMinutes": 60 } (or null to turn it off). See the API.
  • Try it: npx @trymirio/mirio destinations test dst_… --unfinished (0.2.4) sends a sample unfinished alert, as the destination would get it (POST /v1/project/destinations/{id}/test with { "event": "submission.unfinished" }). Nothing is stored.
  • Forms that open with an email (a signup step, a link from a campaign) can save as soon as they open with saveOnOpen, so someone who leaves without answering is alerted too.

What each destination gets:

  • Slack: "Unfinished · Demo request", then where they stopped and when ("Stopped on page 2 of 3 · last active 32 minutes ago"), the answers so far (formatted like a completed response's), the page and where the person came from, and the Open in Mirio button. On a channel added with Add to Slack, if the person finishes later, the alert changes to "Finished · Demo request" and the full response is posted in its thread, also shown in the channel.
  • Email: the subject Unfinished response: Demo request, with the same content.
  • Webhooks: a signed event with type: "submission.unfinished" and the same data as submission.completed, with status: "partial" and pagesCompleted. Retries and replay work the same way. See Webhooks.

An alert that's still retrying when the person finishes the form isn't sent (its delivery shows why); the completed notification goes out instead.

Nudges and the daily digest

Two options for a Slack channel, so a good lead doesn't sit unanswered:

  • Nudges: when nobody has acted on a good-fit response a while after it came in, Mirio reminds the channel, once.
  • The daily digest: once a day at the hour you pick, what came in since the day before and the high-fit responses still waiting.
npx @trymirio/mirio destinations update dst_… --nudge 2h                    # high fit, 2 hours after it came in
npx @trymirio/mirio destinations update dst_… --nudge 1h:high,medium        # medium fit too
npx @trymirio/mirio destinations update dst_… --digest 09:00@Europe/Berlin  # every day at 9:00 in Berlin
npx @trymirio/mirio destinations update dst_… --nudge off --digest off

In the dashboard: the Slack channel's ⋯ menu on the form's Delivery page → Nudges (Off, or after 1 hour, 2 hours or 4 hours, for high fit or for high and medium fit) and Daily digest (Off, or a time, in your browser's time zone). The row says what's on ("Nudges after 2 hours · Digest at 09:00 (Berlin)"). Email, webhook and database destinations don't take them.

What counts as handled. Any action on the response: Book, Reply, Not a fit or Spam, from Slack or from Mirio (a reply still being sent from Mirio counts too), or an agent saying it's handled with mirio handled <slug> <id> or the API (Replies). Changing triage's fit or category isn't an action, and neither is the form's instant confirmation: Mirio sending it doesn't mean anyone on the team has answered.

Nudges

  • Which responses: finished responses (not spam, not tests) on a claimed site, with a triage fit the option watches (high, or high and medium), that this channel was sent, and that nobody has acted on for the chosen time since they came in. Fit needs triage on and the form's description of a great response (npx @trymirio/mirio review <slug> --ideal "…"); without it, responses have no fit and nothing is nudged. A channel's filter applies, since only responses the channel was sent count.
  • The time: whole minutes from 10 to 1440 (24 hours), counted from when the response was finished. The default when you turn nudges on is 2 hours, high fit. Mirio checks once a minute.
  • Once: at most one nudge per response and channel. There's no second one later; the daily digest lists what's still waiting.
  • When you turn it on, responses that became due in the last day are included; older ones aren't.
  • The message: on a channel added with Add to Slack, a reply in the response's thread: "Still waiting: no one has replied yet · came in 2 hours ago", mentioning the response's owner so they're notified, with the same Book, Reply, Not a fit and Spam buttons as the response's own message. With no owner to mention, the reply is also shown in the channel. On a channel added with a webhook URL, it's a new message instead: "Still waiting · Demo request", who it is (name, company, email) with triage's summary, the fit, how long ago it came in and where from, "No one has replied yet", and Open in Mirio. When someone uses a button on the nudge, it says what was done. A nudge queued just before someone acts isn't sent (its delivery says why).
  • Nudges show in the response's Activity and the channel's Deliveries, marked "Nudge".

The daily digest

  • When: every day at the hour you pick, in the time zone you pick (an IANA name such as Europe/Berlin; the default is America/Los_Angeles, and the dashboard uses your browser's). Daylight saving time is followed. If Mirio misses the hour (it was down), it posts within the next 6 hours, else skips that day.
  • What it covers: the form's finished responses since the day before's digest (so no response is counted twice or missed, also on the days the clocks change), that the channel's filter lets through: how many, by fit ("2 high fit · 1 medium · 3 low"), and how many someone acted on. Then Still waiting: high-fit responses from the last 7 days that nobody has acted on, newest first, up to 10 by name with a link to each, and how many more. Spam and test responses aren't counted.
  • Skipped when nothing came in and nothing is waiting. At most once a day per channel.
  • The message: "Daily digest · Demo request", posted as a new message, with Open in Mirio. If Slack is down it's retried for up to 6 hours.

API: PATCH /v1/project/destinations/{id} with { "nudge": { "afterMinutes": 120, "fit": ["high"] } } (or {} for the defaults) and { "digest": { "hour": 9, "timezone": "Europe/Berlin" } }; null turns either off. GET /v1/project/destinations returns nudge and digest on Slack destinations. See the API.

Slack

Add to Slack (the easy way): in the form's Delivery settings, "Add Slack channel" → Add to Slack. Slack asks which channel (private channels too), and the channel shows up by name. Mirio's Slack app gets permission to post to the channel you pick, to open forms in Slack when someone clicks a button on its messages, and to read people's names and email addresses so it can match whoever clicked with your Mirio members. It can't read messages or see other channels.

From the CLI, leave out the URL. An agent can't click through Slack, so the CLI prints a link for a person in the site's workspace and waits until they've picked the channel:

npx @trymirio/mirio destinations add slack --form demo-request      # or --all-forms; --no-wait to print the link and exit

The link works for 30 minutes and only for members of the site's workspace (it signs them in first). --json prints { connectUrl, expiresAt } without waiting; mirio destinations list shows the channel once it's connected. API: POST /v1/project/destinations/slack-link with { "formSlug": "…" } or { "allForms": true }.

An incoming webhook URL still works (Slack: create an app → Incoming Webhooks → add one for the channel), for workspaces that don't allow installing apps.

Each completed submission posts a message with the form name, Mirio's summary, then the fit, category and each group's pick with why it fits on the line under them (when triage is on), up to 10 fields ("+N more fields" when there are more; long answers are shortened to 200 characters), flags such as agent, the page URL, where the person came from ("From /pricing · via google / cpc · landed on /blog/launch"; see attribution), and a button to the submission in Mirio. With unfinished alerts on, a response left unfinished posts its own message, headed "Unfinished ·

"; with nudges and the daily digest on, the channel also gets "Still waiting · " and "Daily digest · ".

Threads

On channels added with Add to Slack, Mirio posts as its app, so each response gets one message and everything after it goes in that message's thread:

  • A nudge about it, mentioning its owner (above).
  • What research found about the company and the person, with a link to the source of each fact, usually within a minute.
  • The response itself, when the person finished after an unfinished alert: the alert is the thread's first message and changes to "Finished · Demo request", and the response is also shown in the channel so it isn't missed.
  • A replay from the response's Activity.

The daily digest is still its own message. Channels added with a webhook URL keep one message per event, without threads: a webhook can't reply in a thread or change a message.

Channels added with Add to Slack before November 5, 2026 have no threads until they're connected once more, as under Reconnecting below (Mirio's app couldn't post as itself then); they keep one message per event, as before.

The app has to be in the channel. When you add a public channel with Add to Slack, Mirio's app joins it, and it joins again if someone removes it. Slack doesn't let apps join private channels, so for a private channel, open the channel's details and add Mirio under Integrations. Until the app is in the channel, Mirio posts through the channel's webhook as before, without threads, and mirio destinations test dst_… says so. A test message tells you which way it went (via: "app" or "webhook", and a note when it fell back). Channels added before November 24 need reconnecting once so the app can join them: the Delivery page says Reconnect so each response gets a thread.

Buttons. On channels added with Add to Slack, the message also has Book (when the form has a booking link), Reply and Not a fit (when the response has an email address) and Spam. Book, Reply and Not a fit open a form in Slack with an email Mirio drafts for you to edit and send; Spam moves the response to spam. Once someone acts, from Slack, from Mirio or an agent's mirio handled, and however long after, the buttons on the response's messages are replaced by what they did ("Eric replied · 2:14 PM"); if Slack is busy just then, Mirio tries again (the response's Activity shows it as a Slack update). The same buttons are on each response in Mirio. See Replies. Channels added by pasting a webhook URL have no buttons.

Reconnecting. Channels added with Add to Slack before November 5, 2026 post without buttons until you connect them once more: the Delivery page says Reconnect to add Book, Reply and Not a fit buttons next to them. Pick the same channel in Slack; Mirio updates the channel you have (keeping its filter) rather than adding it twice.

Your database (Postgres, Supabase)

Mirio writes each completed submission into a table in your own Postgres database, and writes it again when your team acts on it. Nothing to build: give it a connection string and it keeps the table in sync with your schema.

  • The table is created on first delivery, default name mirio_<slug>, schema public.
  • One column per field, named after the field key, typed by field type (text, double precision, integer, boolean, date, text[]). New fields in a new schema version add columns automatically; removed fields keep their column.
  • System columns: mirio_id (primary key), mirio_form, mirio_status, mirio_flags, mirio_enrichments, mirio_review (the AI review as JSON), mirio_ai_category, mirio_ai_fit, one mirio_ai_<group key> text column per triage group (added when a group is), mirio_meta, mirio_values (the full values as JSON), mirio_submitted_at, mirio_received_at, mirio_actions (what the team did, below). Tables made before a column existed gain it on the next delivery.
  • Writes are upserts on mirio_id, so retries and replays never duplicate rows.
  • What the team did. When someone uses Book, Reply, Not a fit or Spam on a response, from Mirio or from Slack (Replies), Mirio writes the row again: mirio_status as it is now (spam after Spam) and mirio_actions, a JSON array of every action, latest first, in the API's shape: [{ "kind": "replied", "via": "dashboard", "by": "Eric Li", "userId": "usr_…", "emailed": true, "subject": "Your demo with Acme", "at": "…" }] (kind is booked, replied, declined, spam, handled (an agent's mark) or confirmed (the instant confirmation); via is dashboard for Mirio, slack, api, or auto for the confirmation). It's [] until someone acts. Actions on test responses stay in Mirio.
  • The connection string is encrypted at rest and never shown again.
  • The host must be public (see above). If Mirio can't connect, the error says so without detail about the network (a wrong password or a missing database is reported as such).

Supabase: Project settings → Database → Connection string → Transaction pooler (port 6543), URI format. Use a dedicated database role with CREATE on the schema if you prefer not to use postgres. Row Level Security does not apply to this role's inserts, so read the table through your normal policies.

Webhooks

Signed POSTs with retries for 24 hours and replay from the dashboard. See Webhooks and email. Use a webhook when you want to run your own logic (create a CRM lead, start a sequence) rather than store rows.

A recipe: Supabase from a webhook instead

If you would rather own the insert, a Next.js route handler is about twenty lines:

// app/api/mirio/route.ts
import { createClient } from '@supabase/supabase-js';
import { createHmac, timingSafeEqual } from 'node:crypto';

export async function POST(req: Request) {
  const raw = await req.text();
  const header = req.headers.get('mirio-signature') ?? '';
  const { t, v1 } = Object.fromEntries(header.split(',').map((p) => p.split('=') as [string, string]));
  const expected = createHmac('sha256', process.env.MIRIO_WEBHOOK_SECRET!).update(`${t}.${raw}`).digest('hex');
  if (!v1 || expected.length !== v1.length || !timingSafeEqual(Buffer.from(expected), Buffer.from(v1))) return new Response('bad signature', { status: 401 });

  const event = JSON.parse(raw);
  if (event.type !== 'submission.completed') return new Response('ignored'); // e.g. submission.unfinished alerts
  const supabase = createClient(process.env.SUPABASE_URL!, process.env.SUPABASE_SERVICE_ROLE_KEY!);
  const { error } = await supabase.from('demo_requests').upsert({ id: event.data.id, ...event.data.values, category: event.data.review?.category, received_at: event.createdAt });
  return error ? new Response(error.message, { status: 500 }) : new Response('ok');
}

Return a 2xx only after the insert succeeds; Mirio retries anything else.