Skip to content
Chatwise
Skip to Content
Developer docs

Create a webhook endpoint

POST /v1/webhook-endpoints. Creates an endpoint that receives events.

View as Markdown

POSThttps://api.chatwise.so/v1/webhook-endpoints

Creates an endpoint that receives events. The response is the only time signingSecret is returned, so store it right away.

The endpoint receives events that happen after it was created. A workspace can have 10 endpoints.

The API key needs the webhooks:write scope. It also needs messages:read when you subscribe to message.* events. See authentication and scopes.

Example

curl -X POST 'https://api.chatwise.so/v1/webhook-endpoints' \
  -H "Authorization: Bearer $CHATWISE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "Order support",
  "url": "https://example.com/webhooks/chatwise",
  "events": [
    "message.received"
  ]
}'

Body

JSON. Unknown fields are refused with a 400.

FieldTypeDescription
namestringRequired. A name for the endpoint, 1 to 80 characters. Spaces around it are ignored. Can't be blank, or contain control characters or unpaired surrogates.
urlstringRequired. Where to send events: a public https:// URL on port 443, without a username, password or #fragment. Spaces around it are ignored. At most 2048 characters.
eventsarray of stringsRequired. The events to receive. message.* events also need the messages:read scope. Each one of message.received, message.sent, message.delivered, message.read, message.failed, comment.received.
accountIdsarray of stringsOnly send events for these accounts. Leave out, or send an empty list, for every account. At most 50.

Response

201. The endpoint, with its signing secret.

{
  "data": {
    "id": "we_01JE2Z3K8Q9V7W5X4Y3Z2A1B0C",
    "name": "Order support",
    "url": "https://example.com/webhooks/chatwise",
    "events": [
      "message.received"
    ],
    "accountIds": [],
    "status": "ACTIVE",
    "apiVersion": "2026-12-01",
    "health": {
      "lastSuccessAt": null,
      "lastFailureAt": null,
      "consecutiveFailures": 0,
      "disabledAt": null,
      "disabledReason": null
    },
    "createdAt": "2026-11-02T10:00:00.000Z",
    "updatedAt": "2026-11-02T10:00:00.000Z",
    "signingSecret": "whsec_ZXhhbXBsZS1zZWNyZXQtZG8tbm90LXVzZS0wMDAwMDA="
  }
}
FieldTypeDescription
data.idstringThe endpoint's id.
data.namestringThe endpoint's name.
data.urlstringWhere events are sent.
data.eventsarray of stringsThe events it receives. Each one of message.received, message.sent, message.delivered, message.read, message.failed, comment.received.
data.accountIdsarray of stringsThe accounts it receives events for. Empty means every account.
data.statusstringACTIVE, PAUSED by the workspace, or DISABLED by Chatwise (see health.disabledReason).
data.apiVersionstringThe payload format it receives, as a date.
data.healthobjectHow its deliveries are going.
data.health.lastSuccessAtstring or nullWhen an attempt last succeeded. ISO 8601, in UTC.
data.health.lastFailureAtstring or nullWhen an attempt last failed. ISO 8601, in UTC.
data.health.consecutiveFailuresintegerFailed attempts since the last success.
data.health.disabledAtstring or nullWhen Chatwise disabled it. ISO 8601, in UTC.
data.health.disabledReasonstring or nullWhy Chatwise disabled it.
data.createdAtstringWhen it was created. ISO 8601, in UTC.
data.updatedAtstringWhen it, or its health, last changed. ISO 8601, in UTC.
data.signingSecretstringThe secret that signs its deliveries: whsec_ and 32 random bytes in base64. Shown only here; store it safely.

Errors

StatusMessageWhat it means
400Expected property name or '}' in JSON at position 1 (line 1 column 2)The request body isn't valid JSON. The message says where.
400Validation failedA parameter or body field is missing, unknown or malformed. errors lists each one.
400Use a public https:// URL on port 443, without a username, password or #fragment.The URL can't receive webhooks.
400Every account id must be one of this workspace's connected accounts.An id in accountIds isn't one of the workspace's accounts.
400A workspace can have at most 10 webhook endpoints.Delete an endpoint you no longer use.
400Message events need an API key with the messages:read scope too.The key lacks messages:read, which message.* events need.
401A valid Bearer API key is requiredThe Authorization header is missing or isn't Bearer <API key>.
401Invalid or revoked API keyThe key doesn't exist, was revoked, or has expired.
401Invalid API keyChatwise couldn't check the key. Try again.
403API key does not have the required scope: webhooks:writeThe key lacks the route's scope. Create a key that has it.
413request entity too largeThe request body is larger than 100 KB.
429API key rate limit exceededWait the number of seconds in the Retry-After header.
500Internal server errorSomething failed in Chatwise. Retry reads with backoff.

The body of an error is described in errors.

On this page