v1 · API reference

Webhooks

Register HTTPS endpoints that receive signed event deliveries (delivered, bounced, opened, clicked, …). The signing secret is returned once on create; verify the signature on every delivery.

Base URL: https://www.unitpost.com/api/v1/api/v1

Webhooks

List webhook endpoints

GET/api/v1/api/v1/webhooks

GET /webhooks
curl -X GET 'https://www.unitpost.com/api/v1/api/v1/webhooks' \
  -H 'Authorization: Bearer YOUR_API_KEY'
Response · 200
{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "object": "webhook",
      "id": "id_123",
      "name": "Example",
      "url": "https://example.com",
      "events": [
        "string"
      ],
      "status": "enabled",
      "created_at": "2026-01-01T00:00:00.000Z",
      "updated_at": "2026-01-01T00:00:00.000Z"
    }
  ]
}

Retrieve a list of your webhook endpoints, cursor-paginated, with each endpoint's URL, subscribed events, and status. Signing secrets are never returned here — they're shown exactly once by Create a webhook endpoint. Check an endpoint's wiring end-to-end with Send a test event. Requires the webhooks:read capability.

Parameters3 fields
FieldTypeDescription
limitinteger · queryMax rows to return (default 20, max 100).
afterstring · queryReturn rows after this id (forward paging).
beforestring · queryReturn rows before this id (backward paging).
Response · 200 fields8 fields
FieldTypeDescription
objectrequiredstring
idrequiredstring
namerequiredstring
urlrequiredstring
eventsrequiredstring[]
statusrequiredenumenabled | disabled | suspended
created_atrequiredstring
updated_atrequiredstring
200401403422

Create a webhook endpoint

POST/api/v1/api/v1/webhooks

POST /webhooks
curl -X POST 'https://www.unitpost.com/api/v1/api/v1/webhooks' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "url": "https://example.com/webhooks/unitpost",
    "events": [
      "email.delivered",
      "email.bounced"
    ]
  }'
Response · 201
{
  "object": "webhook",
  "id": "id_123",
  "name": "Example",
  "url": "https://example.com",
  "events": [
    "string"
  ],
  "status": "enabled",
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z",
  "signing_secret": "string"
}

Register an https URL to receive event notifications (deliveries, bounces, opens, clicks, and more) and choose which events it subscribes to. The response includes the signing_secret exactly once — store it now, as it can never be retrieved again; use it to verify each delivery's signature. Confirm the endpoint works with Send a test event, and adjust its URL or events later with Update a webhook endpoint. Requires the webhooks:manage capability.

Request body3 fields
FieldTypeDescription
urlrequiredstring
eventsrequiredstring[]
namestring
Response · 201 fields9 fields
FieldTypeDescription
objectrequiredstring
idrequiredstring
namerequiredstring
urlrequiredstring
eventsrequiredstring[]
statusrequiredenumenabled | disabled | suspended
created_atrequiredstring
updated_atrequiredstring
signing_secretrequiredstringThe HMAC signing secret. Shown exactly once — store it now; it can never be retrieved again. Use it to verify the signature on every delivery to this endpoint.
201401403409422

Retrieve a webhook endpoint

GET/api/v1/api/v1/webhooks/{id}

GET /webhooks/{id}
curl -X GET 'https://www.unitpost.com/api/v1/api/v1/webhooks/wh_123' \
  -H 'Authorization: Bearer YOUR_API_KEY'
Response · 200
{
  "object": "webhook",
  "id": "id_123",
  "name": "Example",
  "url": "https://example.com",
  "events": [
    "string"
  ],
  "status": "enabled",
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}

Retrieve a single webhook endpoint by id — its URL, subscribed events, and status. The signing secret is never included; it's returned exactly once when the endpoint is created. Requires the webhooks:read capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · path
Response · 200 fields8 fields
FieldTypeDescription
objectrequiredstring
idrequiredstring
namerequiredstring
urlrequiredstring
eventsrequiredstring[]
statusrequiredenumenabled | disabled | suspended
created_atrequiredstring
updated_atrequiredstring
200401403404

Update a webhook endpoint

PATCH/api/v1/api/v1/webhooks/{id}

PATCH /webhooks/{id}
curl -X PATCH 'https://www.unitpost.com/api/v1/api/v1/webhooks/wh_123' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "events": [
      "email.delivered"
    ]
  }'
Response · 200
{
  "object": "webhook",
  "id": "id_123",
  "name": "Example",
  "url": "https://example.com",
  "events": [
    "string"
  ],
  "status": "enabled",
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}

Update a webhook endpoint's url, subscribed events, name, and/or status (use status to pause and re-enable deliveries without deleting the endpoint). The signing secret is never changed by an update. Verify your changes with Send a test event. Requires the webhooks:manage capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · path
Request body4 fields
FieldTypeDescription
urlstring
eventsstring[]
namestring
statusenumenabled | disabled
Response · 200 fields8 fields
FieldTypeDescription
objectrequiredstring
idrequiredstring
namerequiredstring
urlrequiredstring
eventsrequiredstring[]
statusrequiredenumenabled | disabled | suspended
created_atrequiredstring
updated_atrequiredstring
200401403404409422

Delete a webhook endpoint

DELETE/api/v1/api/v1/webhooks/{id}

DELETE /webhooks/{id}
curl -X DELETE 'https://www.unitpost.com/api/v1/api/v1/webhooks/wh_123' \
  -H 'Authorization: Bearer YOUR_API_KEY'

Permanently delete a webhook endpoint and its delivery log. Deliveries stop immediately. The operation is idempotent — deleting an already-deleted endpoint still returns 204. To stop deliveries temporarily instead, set status via Update a webhook endpoint. Requires the webhooks:manage capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · path
204401403

Send a test event

POST/api/v1/api/v1/webhooks/{id}/test

POST /webhooks/{id}/test
curl -X POST 'https://www.unitpost.com/api/v1/api/v1/webhooks/wh_123/test' \
  -H 'Authorization: Bearer YOUR_API_KEY'
Response · 200
{
  "object": "webhook_test",
  "delivered": false,
  "response_status": 0,
  "event_type": "string",
  "error": "string"
}

Fire a sample event at the endpoint synchronously and return the receiver's response so you can debug your handler end-to-end. The probe is signed exactly like a real delivery (verify it the same way) but is not persisted to the delivery log. Configure the endpoint itself with Update a webhook endpoint. Requires the webhooks:manage capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · path
Response · 200 fields5 fields
FieldTypeDescription
objectrequiredenumwebhook_test
deliveredrequiredbooleanWhether the endpoint accepted the probe (2xx).
response_statusrequiredintegerThe HTTP status the endpoint returned, or null on a transport error.
event_typerequiredstringThe sample event type that was sent.
errorrequiredstringA transport/error message when delivery failed, else null.
200401403404