Skip to main content

Webhooks

Webhooks allow external services to send messages to Magne channels without a bot account.

How It Works

  1. Create a webhook on a channel (requires MANAGE_WEBHOOKS permission)
  2. Receive a webhook URL with an embedded token: /v1/webhooks/:id/:token
  3. POST messages to the URL — no authentication header needed

Creating a Webhook

POST /v1/servers/:server_id/webhooks
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json

{
  "channelId": "channel-uuid",
  "name": "GitHub Notifications",
  "avatarUrl": "https://example.com/github-avatar.png"
}
The response includes a one-time token field. Store it securely — it won’t be shown again.

Executing a Webhook

POST /v1/webhooks/:webhook_id/:token
Content-Type: application/json

{
  "content": "New commit pushed to main branch"
}
  • No Authorization header required — the token in the URL is the credential
  • Content must be 1–4,000 characters
  • Messages appear in the channel with the webhook’s name and avatar
  • Rate limited to 30 requests per 60 seconds per webhook

Management

EndpointMethodDescription
/v1/servers/:id/webhooksGETList all webhooks for a server
/v1/servers/:id/webhooksPOSTCreate a new webhook
/v1/webhooks/:idGETGet webhook details
/v1/webhooks/:idDELETEDelete a webhook
/v1/webhooks/:id/:tokenPOSTExecute (send message)