Skip to content
Inkbox

Inkbox

BlogContactDocs
GuidesAPI Reference

Ctrl K

GuidesAPI Reference

Jump to

Webhook Subscriptions

A webhook subscription names one owner — a mailbox or a phone number — one HTTPS destination URL, and a non-empty list of event types from the webhook catalog. When a matching event fires, Inkbox POSTs the payload to the subscription's URL.

You can attach up to 20 active subscriptions per owner (mailbox or phone number). Each URL receives its own POST per event, independently — one slow receiver doesn't block delivery to the others. A 21st POST /webhooks/subscriptions on the same owner returns 409; delete an existing subscription first.

phone.incoming_call is not subscribable. That event is a synchronous control-plane callback — the response body decides whether Inkbox answers the call — so it can't fan out. Configure it via the incoming_call_webhook_url field on the phone number resource instead.

Auth

CallerVisibility
Admin-scoped API keyEvery subscription in the organization.
Human session via the Inkbox ConsoleEvery subscription in the organization.
Claimed agent-scoped API keyOnly subscriptions whose owning mailbox or phone number belongs to that agent's identity.

Unclaimed agent-scoped API keys are rejected.


Create subscription POST

POST /webhooks/subscriptions

Create a new subscription on a mailbox or a phone number.

Request body

FieldTypeRequiredDescription
mailbox_idUUIDConditionallyOwning mailbox. Exactly one of mailbox_id / phone_number_id must be set.
phone_number_idUUIDConditionallyOwning phone number. Exactly one of mailbox_id / phone_number_id must be set.
urlstringYesHTTPS destination for delivered events.
event_typesarray of stringsYesNon-empty, distinct list of event types. Every entry must belong to the owner's channel (mailbox_idmessage.*; phone_number_idtext.*).

Request example

JSONJSON

Response (201)

Returns the new subscription object. See Subscription object.

Validation errors

StatusReason
422Body specified neither or both of mailbox_id / phone_number_id.
422event_types was empty or contained duplicates.
422An event type doesn't belong to the owner's channel (e.g. text.received on a mailbox_id).
422phone.incoming_call was included — managed via the phone-number resource instead.
403mailbox_id belongs to a different organization than the caller.
404mailbox_id or phone_number_id is not visible to the caller (does not exist, or hidden by access scope).
409An active subscription with the same (owner, url) pair already exists.

Code examples


List subscriptions GET

GET /webhooks/subscriptions

List active subscriptions visible to the caller, newest first. Returns an object with a subscriptions array — not a bare array.

Query parameters

ParameterTypeDescription
mailbox_idUUIDFilter by owning mailbox. Mutually exclusive with phone_number_id.
phone_number_idUUIDFilter by owning phone number. Mutually exclusive with mailbox_id.
urlstringFilter by exact destination URL.
event_typestringFilter by event type. phone.incoming_call is rejected — that event isn't stored as a subscription.

Filters AND-combine. Foreign-organization rows are filtered out, so they never appear in results.

Response (200)

JSONJSON

Error responses

StatusReason
422Both mailbox_id and phone_number_id supplied.
422event_type=phone.incoming_call.

Code examples


Get subscription GET

GET /webhooks/subscriptions/{sub_id}

Path parameters

ParameterTypeDescription
sub_idUUIDUnique subscription identifier.

Response (200)

Returns the subscription object. See Subscription object.

Error responses

StatusReason
404Subscription does not exist or is not visible to the caller. Foreign-organization subscriptions return 404.

Code examples


Update subscription PATCH

PATCH /webhooks/subscriptions/{sub_id}

Update a subscription's destination URL and/or event list in place. The owner FKs are immutable — to move a subscription to a different mailbox or phone number, delete it and create a new one.

Path parameters

ParameterTypeDescription
sub_idUUIDUnique subscription identifier.

Request body

FieldTypeRequiredDescription
urlstringNoNew HTTPS destination. Omit to leave unchanged.
event_typesarray of stringsNoNew non-empty, distinct list of event types. Same channel-coherence rules as create. Omit to leave unchanged.

Supplying both fields is fine. Supplying neither no-ops.

Request example

JSONJSON

Response (200)

Returns the updated subscription object. See Subscription object.

Validation errors

StatusReason
422event_types was empty or contained duplicates.
422An event type doesn't belong to the owner's channel.
422phone.incoming_call was included.
404Subscription does not exist or is not visible to the caller.
409The new (owner, url) collides with another active subscription.

Code examples


Delete subscription DELETE

DELETE /webhooks/subscriptions/{sub_id}

Remove a subscription. Inkbox stops delivering events to the URL immediately. Subsequent reads on the same sub_id return 404.

Path parameters

ParameterTypeDescription
sub_idUUIDUnique subscription identifier.

Response (204)

No body.

Error responses

StatusReason
404Subscription does not exist or is not visible to the caller.

Code examples


Subscription object

FieldTypeDescription
idUUIDUnique subscription identifier.
organization_idstringOwning organization (e.g. "org_2abc123def456"). Server-derived from the owner — never read from the request body.
mailbox_idUUID | nullOwning mailbox. Populated when this is a mail subscription; null otherwise.
phone_number_idUUID | nullOwning phone number. Populated when this is a text subscription; null otherwise.
urlstringHTTPS destination for delivered events.
event_typesarray of stringsEvent types this subscription delivers. Every value belongs to the owner's channel.
statusstringAlways "active" on returned rows. Deleted rows are not returned by any endpoint.
created_atstringISO 8601 timestamp the subscription was created.
updated_atstringISO 8601 timestamp the subscription was last updated.

Event types

event_types is a non-empty list drawn from the same catalog the webhook payload pages document:

ChannelAllowed values
Mail (mailbox_id owner)message.received, message.sent, message.forwarded, message.delivered, message.bounced, message.failed
Phone text (phone_number_id owner)text.received, text.sent, text.delivered, text.delivery_failed, text.delivery_unconfirmed

phone.incoming_call is not in this list. It is managed via incoming_call_webhook_url on the phone number resource.

Inkbox

Copyright © 2026 Inkbox

This site is protected by reCAPTCHA.

Google Privacy Policy and Terms of Service apply.

Website

Inkbox

Copyright © 2026 Inkbox

This site is protected by reCAPTCHA.

Google Privacy Policy and Terms of Service apply.

Website

Webhook Subscriptions