Skip to main content
POST
/
webhooks
Create a webhook subscription
curl --request POST \
  --url https://app.sendmux.ai/api/v1/webhooks \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "https://hooks.acme.com/sendmux",
  "event_types": [
    "message.bounced",
    "message.received"
  ]
}
'
{
  "ok": true,
  "meta": {
    "request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
  },
  "data": {
    "id": "whk_clxxxxxxxxxxxxxxxxxxxxxxxxx",
    "name": "Acme inbound forwarder",
    "url": "https://hooks.acme.com/sendmux",
    "event_types": [
      "message.bounced",
      "message.received"
    ],
    "filters": {
      "mailbox_ids": [
        "mbx_clxxxxxxxxxxxxxxxxxxxxxxxxx"
      ]
    },
    "enabled": true,
    "failing": false,
    "created_at": "2026-04-23T09:12:00Z",
    "updated_at": "2026-04-23T09:12:00Z",
    "secret": "whsec_a9f3c2…"
  }
}

Authorizations

Authorization
string
header
required

Sendmux API key. Use a root API key for Management API routes, or a mailbox credential for Mailbox API routes. Obtain keys from the dashboard under API Keys.

Headers

Idempotency-Key
string

Client-chosen unique key to safely retry the request. Cached for 24h per (team, endpoint, key). Different body with same key returns 409 idempotency_conflict.

Maximum string length: 255
Example:

"webhooks-create-20260424-001"

Body

application/json
url
string<uri>
required

HTTPS endpoint that will receive event POSTs. Must be https:// — plain HTTP is rejected.

Example:

"https://hooks.acme.com/sendmux"

event_types
enum<string>[]
required

At least one event type must be provided.

Minimum array length: 1

Event types a webhook may subscribe to. sendmux.test is accepted so you can verify end-to-end delivery via POST /webhooks/{id}/test.

Available options:
message.delivered,
message.bounced,
message.complained,
message.rejected,
message.delivery_delayed,
message.received,
message.received.spam,
sendmux.test
Example:
["message.bounced", "message.received"]
name
string

Optional human-friendly label (max 255 chars). Surfaced in dashboard list/detail views.

Required string length: 1 - 255
Example:

"Acme inbound forwarder"

filters
object

Optional delivery scope. Omit or pass an empty mailbox_ids array to receive matching events for all mailboxes in the team.

enabled
boolean

Defaults to true.

Example:

true

Response

Subscription created, including the signing secret. The response carries a Location header pointing at the canonical GET URL for the new subscription.

ok
enum<boolean>
required
Available options:
true
meta
object
required
data
object
required