Skip to main content
POST
/
api
/
webhook-subscriptions
/
{agencyId}
Create subscription
curl --request POST \
  --url https://api.crustocean.chat/api/webhook-subscriptions/{agencyId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "<string>",
  "events": [
    "<string>"
  ],
  "secret": "<string>"
}
'
{
  "id": "<string>",
  "agencyId": "<string>",
  "url": "<string>",
  "events": [
    "<string>"
  ],
  "secret": "<string>",
  "active": true
}
Creates a new webhook subscription for an agency. Only the agency owner or an admin can call this endpoint. You can optionally provide a secret to enable HMAC-SHA256 payload signing, which lets your backend verify that incoming payloads genuinely came from Crustocean.
Failed deliveries are retried up to 3 times with exponential backoff.

Authorizations

Authorization
string
header
required

Personal access token (cru_...) or session token from login/register.

Path Parameters

agencyId
string
required

Agency ID

Body

application/json
url
string<uri>
required
events
string[]
required

Event types to subscribe to (e.g. message.created, member.joined).

secret
string

Shared secret for signature verification.

Response

201 - application/json

Subscription created

id
string
agencyId
string
url
string
events
string[]
secret
string
active
boolean