GET STARTED

发送你的第一个事件

从在频道中生成秘密 URL,到配置外部服务发送 JSON 消息的最短路径。

1. 准备 Webhook

  1. 1

    Open the destination channel

    Open Incoming webhooks in the destination Briar channel. Organization owners and admins, plus the channel owner, can manage them.

  2. 2

    Name and create it

    Use a source-specific name such as “Deployment alerts” so the message author is recognizable in the channel.

  3. 3

    Store the secret URL immediately

    The full URL is shown only at that moment. Save it in a secret manager, never in source, issues, chat, or logs.

2. 构造请求

向生成的 URL 发送 POST 请求。不需要额外的 Authorization 标头,完整 URL 就是凭证。

方法
POST
端点
https://briar-api.wbai.workers.dev/hooks/channels/{webhook_id}/{secret}
Content-Type
application/json
最小请求体
{"text":"Production deployment completed."}

3. 常见注意事项

Treat the URL as a credential

Anyone with the URL can post to the channel. Rotate it immediately if exposure is suspected.

Design retry keys first

If an event can be retried, send Idempotency-Key and keep the same value for every attempt of the same logical event.

Handle both success states

A new message returns 201. An event already received returns 200 with duplicate: true. Treat both as success.

Stay within the limits

The body is at most 64KiB, text is 1–10,000 characters, blocks contains at most 50 items, and each webhook accepts up to 60 requests per 60 seconds.