API referenceWebhooks
POST
/webhooks

JavaScript SDK: swarmhit.webhooks.create(params)

Registers an endpoint that receives the subscribed events. The response includes a secret — store it to verify delivery signatures.

Authorization

bearerAuth
AuthorizationBearer <token>

An API key created on the Access tokens page.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/webhooks" \  -H "Content-Type: application/json" \  -d '{    "url": "https://example.com/hooks/swarmhit",    "events": [      "message.received",      "connection.accepted"    ]  }'
{  "data": {    "id": "string",    "url": "string",    "events": [      "string"    ],    "enabled": true,    "classifyReplies": true,    "secret": "string",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "lastDeliveryAt": "2019-08-24T14:15:22Z",    "failureCount": 0,    "disabledReason": "string"  }}