Docs menu

Create a webhook

POST/v1/webhooks

  • Scope webhooks:manage

Starts sending the chosen events to url. The answer has the signing secret, shown only this once.

Request body

  • urlstringrequired

    A public https:// URL. No credentials, private or local addresses; redirects aren't followed.

  • eventsarray of "message.received" | "message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.fallback" | "message.reaction" | "draft.created" | "draft.approved" | "draft.rejected" | "chat.updated" | "profile.online" | "profile.offline" | "call.ringing" | "call.answered" | "call.transferred" | "call.ended" | "call.voicemail" | "call.transcription" | "calling.cap_warning"required

    The event types to send, such as message.received.

  • profile_idsarray of string or null

    Only events from these lines. Leave it out (or null) for every line. A key limited to some lines must list them.

  • descriptionstring

    A note for people.

Response

201 CreatedThe webhook and its secret.

  • idstringrequired

    whk_…

  • object"webhook"required

  • urlstringrequired

  • eventsarray of "message.received" | "message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.fallback" | "message.reaction" | "draft.created" | "draft.approved" | "draft.rejected" | "chat.updated" | "profile.online" | "profile.offline" | "call.ringing" | "call.answered" | "call.transferred" | "call.ended" | "call.voicemail" | "call.transcription" | "calling.cap_warning"required

  • profile_idsarray of string or nullrequired

    Only events from these lines; null = every line the team has.

  • descriptionstring or nullrequired

  • activebooleanrequired

  • created_attimestamprequired

  • updated_attimestamprequired

  • secretstringrequired

    whsec_…: verify X-Signature with it. Shown only here.

Errors

StatusCodeMeans
400validation_failedA field is missing or invalid.
401unauthorizedThe API key is missing, unknown or revoked.
403insufficient_scopeThe API key lacks the scope this needs.
404not_foundNo such object, or the key can't see it.

Every error is { "error": { "code", "message" } }. All error codes.

Keys come with your first line.

Request an invite and we'll set up a line for your team. API access is part of every plan.

Request an invite