POST
/
v1
/
webhooks
Create webhook subscription
curl --request POST \
  --url https://api.distranmail.com/v1/webhooks \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "url": "https://api.your-domain.com/webhooks",
  "events": [
    "message.created"
  ],
  "description": "New message notifications",
  "metadata": {
    "environment": "production"
  }
}'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "url": "<string>",
  "events": [
    "message.created"
  ],
  "description": "<string>",
  "status": "active",
  "secret": "<string>",
  "metadata": {},
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Response

201
application/json

Webhook subscription created successfully

The response is of type object.