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.
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:
| Field | Description |
|---|---|
| Name | A label for people: "User subscribed". |
| Key | What 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. |
| Description | Optional: when it fires. |
| Slack channel | Where it posts. Empty: your default channel from Channels & Routing. |
| Message template | The Slack message, with {{field}} placeholders (below). Empty: the event name in bold. |
| Emoji | Optional, 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.
: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,
nullor 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
| From | How |
|---|---|
| TypeScript | notify() / createNotifier() from @channlize/core |
| Any language | POST /v1/notify |
| AI assistants | the 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.reasonsays 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:
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):
| Status | Meaning |
|---|---|
queued | Accepted, waiting to be posted. |
sent | Posted to Slack. |
skipped | Not posted; see the reason. |
failed | Slack 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
| Events | Log tracking | |
|---|---|---|
| For | A designed Slack message about something that happened | A record of what happened, searchable in the dashboard |
| Call | notify(event, data) | trackEvent / trackServerEvent |
| Slack | Always (when enabled), with your template | Optional alert by severity and name prefix |
| Keys | Server key only | Widget key or server key |
See Log tracking.