Skip to content

Platform

Events

Post a designed Slack message from your code when something happens. Define events in the dashboard, write templates with {{field}} placeholders, and follow every delivery.

On this page

Events turn a line of code into a Slack message: a new signup, a paid invoice, a finished deploy. Your code sends an event key and some data; the dashboard decides where it goes and what it says.

app/api/signup/route.ts
import { createNotifier } from '@channlize/core';

const notify = createNotifier(); // CHANNLIZE_SERVER_API_KEY + CHANNLIZE_PROJECT_ID

export async function POST(req: Request) {
  const { username, plan } = (await req.json()) as { username: string; plan: string };
  // …create the account…
  await notify('user.subscribed', { username, plan }, { idempotencyKey: `signup-${username}` });
  return Response.json({ ok: true });
}

Events need a server API key with the write scope, so call them from your server, never from the browser. You can also send them with curl or from an AI assistant with the MCP server's notify_event tool.

Define an event

Open Events in the dashboard and create an event:

FieldDescription
NameA label for people: "User subscribed".
KeyWhat your code sends: user.subscribed. Lowercase letters, digits, ., _ or -, starting with a letter or digit, at most 100 characters. Changing it later means code sending the old key creates a new draft.
DescriptionOptional: when it fires.
Slack channelWhere it posts. Empty: your default channel from Channels & Routing.
Message templateThe Slack message, with {{field}} placeholders (below). Empty: the event name in bold.
EmojiOptional, e.g. :tada:, shown before the message.
Enabled"Enabled, posts to Slack" or "Disabled, calls are skipped".

The editor shows a live Slack preview from sample JSON data (only for the preview, not saved). Send test on the event's row in the list posts a test message, marked [Test] and filled with sample data, to the event's channel.

You don't have to define events first: see Seen, not configured.

Templates

Templates use Slack formatting (*bold*, _italic_, `code`, :emoji:, <https://example.com|links>) and placeholders filled from the event's data.

Text
:tada: *{{username}}* subscribed to {{plan}}
Billing email: {{customer.email}} · MRR {{ mrr }}
  • {{field}} reads a top-level field; {{user.email}} walks nested objects with dots. Spaces inside the braces are allowed.
  • Field names may contain letters, digits, _, - and .. Array items can't be addressed ({{items.0}} renders as missing).
  • A missing, null or empty value renders as —.
  • Numbers and booleans are printed as is; objects and arrays as JSON.
  • Values are escaped for Slack (&, <, >), so data can't inject mentions or links. The template text itself is not escaped, so your own Slack formatting and links work.
  • Templates are at most 3,000 characters; the rendered message is cut at 3,000 characters with ….

Below the message, Slack also shows up to 10 top-level data fields as label and value, and a context line with the project name and event key.

Send an event

FromHow
TypeScriptnotify() / createNotifier() from @channlize/core
Any languagePOST /v1/notify
AI assistantsthe MCP notify_event tool

Every call answers right away (HTTP 202) with a delivery id and a status:

  • queued: it will be posted to Slack in a moment.
  • skipped: it won't be posted. reason says why: the event is new (saved as a draft), disabled, or there is no Slack workspace or channel.

Seen, not configured

The first time Channlize receives an event key it doesn't know, it saves it as a disabled draft and answers skipped with:

Text
Event "user.subscribed" was seen for the first time and saved as a disabled draft. Configure and enable it in the dashboard (Events) to post to Slack.

On the Events page the draft is tagged Seen, not configured, with the time it was last sent from code. Open it, pick a channel, write a template and enable it; the next call posts. This means you can ship the code first and design the message later, and a typo in a key never throws.

Warning

Nothing reaches Slack until you enable the draft. If your calls succeed but no message shows up, check the status your call got back: skipped with "saved as a disabled draft" means the event is waiting on the Events page.

A draft starts with no template, so once enabled the message is the event name in bold. The sender can't suggest a template; set one when you enable it. To keep a noisy event out of Slack but still see each call, leave it disabled: every call is still listed under Recent deliveries as skipped.

Deliveries

Every call creates a delivery, listed under Events → Recent deliveries (and via GET /v1/projects/{projectId}/event-deliveries):

StatusMeaning
queuedAccepted, waiting to be posted.
sentPosted to Slack.
skippedNot posted; see the reason.
failedSlack refused it. Temporary errors are retried up to 3 times; permanent ones (bot not in channel, channel not found…) fail at once. The reason explains what to fix.

The most common failure is not_in_channel: "The Channlize bot is not in this channel. Invite it in Slack with /invite @Channlize, then send again."

A delivery that was already sent is never posted twice. To make your own retries safe, pass an idempotency key.

Events vs log tracking

EventsLog tracking
ForA designed Slack message about something that happenedA record of what happened, searchable in the dashboard
Callnotify(event, data)trackEvent / trackServerEvent
SlackAlways (when enabled), with your templateOptional alert by severity and name prefix
KeysServer key onlyWidget key or server key

See Log tracking.