Skip to content

Platform

Webhooks

Signed HTTP requests to your endpoint for conversations, messages, contacts and more. Events, payloads, signature checks in Node and Python, retries.

On this page

Webhooks send events from Channlize to your own HTTPS endpoint, as they happen. Use them to sync conversations into a CRM, page someone on a new urgent message, or mirror contacts into your database. Manage endpoints under Integration → Webhooks in the dashboard, or from the API.

To receive webhooks from other services (Stripe, GitHub, email providers…) into Slack, see Connections instead.

Endpoints

An endpoint is a URL, an optional name and description, the events it subscribes to, and an enabled switch. An organization can register several endpoints: 1 on Free, 2 on Personal, 10 on Pro and 50 on Business (see Plans & limits). An endpoint can be tied to a project, in which case it only gets that project's conversation, message and tracked events.

Each endpoint has its own signing secret (whsec_…). Channlize generates it when you add the endpoint and shows it once: store it in your server's environment, for example as CHANNLIZE_WEBHOOK_SECRET. It's encrypted at rest and never shown again. If it leaks, or you lose it, rotate it (see Rotate the secret).

The URL must be public https. URLs with credentials, localhost, and hosts that resolve to private, loopback or link-local addresses are refused, both when you save the endpoint and on every delivery.

Events

EventSent when
conversation.createdA conversation is started: widget, contact form, email, a Connection or the API.
conversation.assignedA conversation is assigned to a teammate or unassigned: in the dashboard, through the API, from Slack (/assign, the Assign button), or by a routing rule.
conversation.status_changedA conversation's status changes between open, pending, resolved and closed, by hand (dashboard, API, Slack) or automatically: an agent's reply moves an open conversation to pending, a customer writing again reopens a resolved or closed one, and a visitor closing the chat widget closes it. A change that leaves the status as it was sends nothing.
conversation.closedA conversation becomes resolved or closed. It's sent together with conversation.status_changed.
conversation.ratedA customer rates a conversation (CSAT, 1 to 5) from the chat widget or the rating email, or changes their rating within the 7 days it stays editable.
message.createdA message is added to a conversation: from the customer (direction: "inbound"), or from your team, an AI agent or the autopilot ("outbound"). Internal notes and system messages aren't sent.
contact.createdA new contact is created.
agent.message.createdA message is posted on a Channlize for Agents channel.
ai.overage.spend_limitAI overage reaches 50, 80 or 100 % of the monthly spend limit, once per threshold and billing period.
event.trackedA server log line is recorded with trackServerEvent or POST /v1/events.

Send test in the dashboard (or POST /v1/webhooks/{id}/test) sends a webhook.test event right away, whatever the endpoint subscribes to.

Payload

Every delivery is a JSON POST with the same envelope:

JSON
{
  "id": "6f1c2a9e-8d1b-4e7a-9c35-0b2f1d4a6e88",
  "type": "message.created",
  "version": 1,
  "created_at": "2026-11-07T10:30:00.000Z",
  "organization_id": "8a1d…",
  "data": {
    "message": {
      "id": "c27e…",
      "conversation_id": "41b0…",
      "direction": "inbound",
      "author_type": "customer",
      "author_name": "Ada",
      "content": "Hi, my invoice is wrong",
      "content_truncated": false,
      "created_at": "2026-11-07T10:30:00.000Z"
    },
    "conversation": {
      "id": "41b0…",
      "url": "https://api.channlize.com/api/v1/conversations/41b0…"
    }
  }
}
  • id is the event id. It's the same for every endpoint, every retry and every resend of the event.
  • version is 1. A breaking change to a payload would come as a new version; fields can be added within a version, so ignore the ones you don't know.
  • Payloads are small: ids, the key fields, and a url to fetch the full resource from the REST API with a server key. Message text is cut at 1,000 characters (content_truncated: true).

The data of each event:

Eventdata
conversation.createdconversation: { id, project_id, contact_id, subject, status, priority, source, assignee_id, created_at, url }
conversation.assignedconversation, assignee and previous_assignee ({ type: "user", id, name } or null), changed_by
conversation.status_changed, conversation.closedconversation, status, previous_status, changed_by
conversation.ratedconversation, and rating: { score, comment, channel, rated_at, first_rated_at, previous_score, scale, question }. channel is widget or email; previous_score is null for a first rating; scale is 5.
message.createdmessage: { id, conversation_id, direction, author_type, author_name, content, content_truncated, created_at }, and conversation: { id, url }
contact.createdcontact: { id, email, name, created_at, url }
agent.message.createdmessage: { id, channel_id, thread_id, type, sender: { type, id }, text, text_truncated, mentions, created_at, url }
ai.overage.spend_limit{ threshold, spent_cents, spend_limit_cents, currency, paused, period_start, period_end }. paused is true at 100 %.
event.tracked{ event_id, event_type, properties, organization_id, project_id }
webhook.test{ message, endpoint: { id, url } }

A conversation.rated delivery:

JSON
{
  "id": "0d7e4c1a-5b2f-4a8e-9f61-3c2b7a9d1e44",
  "type": "conversation.rated",
  "version": 1,
  "created_at": "2026-11-07T15:02:11.000Z",
  "organization_id": "8a1d…",
  "data": {
    "conversation": {
      "id": "41b0…",
      "project_id": "9c3e…",
      "contact_id": "b72f…",
      "subject": "Invoice is wrong",
      "status": "resolved",
      "priority": "normal",
      "source": "live_chat",
      "assignee_id": "e15a…",
      "created_at": "2026-11-07T10:30:00.000Z",
      "url": "https://api.channlize.com/api/v1/conversations/41b0…"
    },
    "rating": {
      "score": 4,
      "comment": "Quick and clear, thanks!",
      "channel": "widget",
      "rated_at": "2026-11-07T15:02:10.000Z",
      "first_rated_at": "2026-11-07T15:01:02.000Z",
      "previous_score": 3,
      "scale": 5,
      "question": "How would you rate the help you received?"
    }
  }
}

changed_by says who made the change: { type: "user", id } (dashboard), { type: "api_key", id, name }, { type: "routing_rule" }, { type: "slack", id, name } (the Slack user id and name), { type: "widget" } (the visitor closed the chat), or { type: "system", reason } for an automatic move, with reason agent_reply (open → pending) or customer_message (reopened).

Headers

HeaderValue
Content-Typeapplication/json
User-AgentChannlize-Webhooks/1
Channlize-Signaturet=<unix seconds>,v1=<hex HMAC-SHA256> (see below)
Channlize-Event-IdThe event id (id in the body). Deduplicate on it.
Channlize-Delivery-IdOne delivery of the event to this endpoint. It's the same on retries, and new on a resend.
Channlize-Event-TypeThe event, e.g. message.created
Channlize-TimestampThe t of the signature

Verify the signature

Channlize-Signature is t= followed by a Unix timestamp, then v1= followed by the hex HMAC-SHA256 of the string <t>.<raw body>, keyed with the endpoint's signing secret (the whole whsec_… string). To verify a delivery:

  1. Read the raw request body as received, before parsing it. Re-serialized JSON doesn't match.
  2. Split the header on ,: take the t value and every v1 value.
  3. Refuse the request if t is more than 5 minutes away from your clock. That stops replays.
  4. Compute the HMAC-SHA256 of <t>.<raw body> with your secret, and compare it in constant time with each v1. Accept the request if one matches.

Node.js, with no dependency:

verify-webhook.ts
import { createHmac, timingSafeEqual } from 'node:crypto';

export function verifyChannlizeWebhook(
  rawBody: string,
  header: string | null,
  secret: string,
  toleranceSeconds = 300,
): boolean {
  const items = (header ?? '').split(',').map((part) => part.trim().split('='));
  const t = Number(items.find(([key]) => key === 't')?.[1]);
  const signatures = items.filter(([key]) => key === 'v1').map(([, value]) => value ?? '');
  if (!t || signatures.length === 0) return false;
  if (Math.abs(Date.now() / 1000 - t) > toleranceSeconds) return false;
  const expected = createHmac('sha256', secret).update(`${t}.${rawBody}`).digest();
  return signatures.some((sig) => {
    const received = Buffer.from(sig, 'hex');
    return received.length === expected.length && timingSafeEqual(received, expected);
  });
}

Python:

python
import hashlib, hmac, time

def verify_channlize_webhook(raw_body: bytes, header: str, secret: str, tolerance: int = 300) -> bool:
    items = [part.strip().split("=", 1) for part in (header or "").split(",") if "=" in part]
    t = next((value for key, value in items if key == "t"), None)
    signatures = [value for key, value in items if key == "v1"]
    if not t or not signatures or abs(time.time() - int(t)) > tolerance:
        return False
    expected = hmac.new(secret.encode(), f"{t}.".encode() + raw_body, hashlib.sha256).hexdigest()
    return any(hmac.compare_digest(expected, sig) for sig in signatures)

In a Next.js route handler, use await req.text() for the raw body. In Express, use express.raw({ type: 'application/json' }) on the webhook route. In Flask, use request.get_data(). Answer 400 when the signature doesn't verify.

With @channlize/core 0.9.0 or later, verifyWebhookSignature({ body, header, secret }) does this for you, and constructWebhookEvent(body, header, secret) verifies and returns the typed event. Both use Web Crypto, so they run on Node.js, Deno, Bun and edge runtimes.

Rotate the secret

Rotate secret (or POST /v1/webhooks/{id}/rotate-secret) generates a new secret and shows it once. You choose how long the old secret keeps working (overlap_hours, default 24, up to 168). During the overlap, each delivery carries two v1 signatures, one per secret, so your endpoint keeps verifying with the old one until you deploy the new one. With overlap_hours: 0 the old secret stops at once.

Retries

  • Answer with a 2xx status within 10 seconds. Anything else is a failure: another status, a timeout, a network error, or a redirect (redirects aren't followed).
  • A failed delivery is retried 5 times with exponential backoff: after 1, 4, 16 and 64 minutes, then 4 hours, so about 5.5 hours in all. After the last attempt it's marked failed.
  • If every delivery to an endpoint fails for 3 days, the endpoint is disabled and your organization's owners get an email. Fix it, send a test event, then turn it back on. Events that happened while it was disabled aren't queued: resend the ones you need from the delivery log.
  • A URL that's refused (a private address, for example) fails at once, without retries.

Delivery log

Each endpoint keeps a log of its latest attempts, the newest 100. For each attempt it shows the status, the response code, how long it took and the first 2 KB of your response body. Open it with Deliveries in the dashboard, or GET /v1/webhooks/{id}/deliveries. Resend sends a delivery's event again: the same event id and payload, with a new delivery id.

Best practices

  • Verify every request and refuse old timestamps. Keep the secret on the server, never in browser code or a repository.
  • Answer fast, then work. Store the event or put it on a queue, answer 2xx, and process it afterwards. Slow handlers time out and get retried.
  • Deduplicate on Channlize-Event-Id. Retries and resends repeat it, and in rare cases one attempt can arrive twice.
  • Don't rely on order. Deliveries can arrive out of order. Use created_at, or fetch the resource from url for its current state.
  • Subscribe to what you use. Each endpoint only gets its events, and fewer events means less to handle.

Manage endpoints from the API

With a server key that has the webhooks:read or webhooks:write scope:

EndpointScope
GET /v1/webhookswebhooks:readList endpoints. Secrets are never listed.
POST /v1/webhookswebhooks:write{ url, events, name?, description?, enabled?, project_id? }. Returns 201 with webhook and its secret, shown once. 403 PLAN_LIMIT_REACHED past your plan's endpoints.
GET /v1/webhooks/eventswebhooks:readThe event catalog.
GET /v1/webhooks/{id}webhooks:readOne endpoint.
PATCH /v1/webhooks/{id}webhooks:writeChange any of the create fields. enabled: true turns a disabled endpoint back on.
DELETE /v1/webhooks/{id}webhooks:writeDelete the endpoint and its delivery log.
POST /v1/webhooks/{id}/rotate-secretwebhooks:write{ overlap_hours? }. Returns the new secret, once.
POST /v1/webhooks/{id}/testwebhooks:writeSend a webhook.test event now. Returns { status, response_code, duration_ms, error }.
GET /v1/webhooks/{id}/deliverieswebhooks:readLatest deliveries with their attempts, ?limit= up to 100.
POST /v1/webhooks/{id}/deliveries/{deliveryId}/resendwebhooks:writeResend a delivery. Returns 202.

The next @channlize/core release wraps these as client.webhooks (list, create, update, delete, rotateSecret, test, deliveries, resend), and the MCP server has matching tools (list_webhook_endpoints, create_webhook_endpoint, …).

Shell
curl https://api.channlize.com/v1/webhooks \
  -H "Authorization: Bearer $CHANNLIZE_SERVER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/webhooks/channlize","events":["conversation.created","message.created"]}'

Endpoints created before signed events

Endpoints created before Channlize generated signing secrets keep working. Until you rotate their secret, each delivery also carries the old X-Webhook-Signature: sha256=<hex HMAC-SHA256 of the raw body> header, signed with the secret you set. event.tracked keeps its data fields inside the new envelope. Switch your receiver to Channlize-Signature, then rotate the secret: after the rotation, only Channlize-Signature is sent.