API v1currentBase URLhttps://api.sendlib.com/v1Bearer API key

API

Webhooks

Stream real-time delivery outcomes into your systems.

What you should use webhooks for

Webhooks are the canonical way to ingest outcomes into your product:

  • Delivery/bounce/complaint feedback loops
  • Open/click tracking events (if enabled)
  • Suppression automation

Create webhook

POST/v1/webhooks

Creates a webhook endpoint. The signing secret is returned only once.

Scope
manage:webhooks

Store the secret securely; it is not returned again.

Body

  • target_urlstringRequired

    HTTPS URL receiving webhook POSTs.

  • eventsstring[]Required

    Event types to subscribe to.

  • enabledboolean

    Enable/disable delivery.

curl -X POST "https://api.sendlib.com/v1/webhooks" \
  -H "Authorization: Bearer $SENDLIB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "target_url": "https://example.com/webhooks/email",
    "events": ["delivery", "bounce"],
    "enabled": true
  }'
{
  "error": {
    "message": "The request body is not valid JSON or is missing a required field."
  }
}

List webhooks

GET/v1/webhooks

List webhook endpoints for the tenant.

Scope
manage:webhooks
curl "https://api.sendlib.com/v1/webhooks" \
  -H "Authorization: Bearer $SENDLIB_API_KEY"
{
  "error": {
    "message": "Missing or invalid API key."
  }
}

Update webhook

PATCH/v1/webhooks/{id}

Patch a webhook endpoint by id.

Scope
manage:webhooks

Path parameters

  • idstringRequired

    The webhook id.

curl -X PATCH "https://api.sendlib.com/v1/webhooks/WEBHOOK_ID" \
  -H "Authorization: Bearer $SENDLIB_API_KEY"
{
  "error": {
    "message": "Missing or invalid API key."
  }
}

Delete webhook

DELETE/v1/webhooks/{id}

Delete a webhook endpoint by id.

Scope
manage:webhooks

Path parameters

  • idstringRequired

    The webhook id.

curl -X DELETE "https://api.sendlib.com/v1/webhooks/WEBHOOK_ID" \
  -H "Authorization: Bearer $SENDLIB_API_KEY"
{
  "error": {
    "message": "Missing or invalid API key."
  }
}

Rotate webhook secret

POST/v1/webhooks/{id}/rotate-secret

Rotates the signing secret and returns the new secret once.

Scope
manage:webhooks

The new signing secret is returned only once.

Path parameters

  • idstringRequired

    The webhook id.

curl -X POST "https://api.sendlib.com/v1/webhooks/WEBHOOK_ID/rotate-secret" \
  -H "Authorization: Bearer $SENDLIB_API_KEY"
{
  "error": {
    "message": "Missing or invalid API key."
  }
}

Send test webhook

POST/v1/webhooks/{id}/test

Triggers test webhook deliveries to validate your integration.

Scope
manage:webhooks

Path parameters

  • idstringRequired

    The webhook id.

curl -X POST "https://api.sendlib.com/v1/webhooks/WEBHOOK_ID/test" \
  -H "Authorization: Bearer $SENDLIB_API_KEY"
{
  "error": {
    "message": "Missing or invalid API key."
  }
}

Signing and verification

Every webhook endpoint has a signing secret. Store it securely — it's typically returned only when you create the webhook and when you rotate the secret.

To verify authenticity:

  1. Read the raw request body bytes
  2. Compute an HMAC using the signing secret
  3. Compare against the signature header (timing-safe compare)

Event payload

JSON
{
  "type": "delivery",
  "timestamp": "2026-02-05T12:34:56.789Z",
  "message_id": "msg_01HP3GZK7E3D2C4P2J6Q1E9N2X",
  "transmission_id": "f7e8d9c0-b1a2-4c3d-8e9f-0a1b2c3d4e5f",
  "recipient": "user@example.com",
  "provider": "gmail",
  "outcome": {
    "status": "delivered",
    "reason": null
  },
  "meta": {
    "tags": ["receipt"],
    "tenant": "acme"
  }
}

Retries

Webhook delivery is retried when your endpoint returns a non-2xx response or times out.

Simulate events

Webhook Event Simulator

Generate realistic payloads and a demo signature.

Signature header: SendLib-Signature: demo_7e4ce05b
{
  "type": "delivery",
  "timestamp": "2026-02-05T12:34:56.789Z",
  "message_id": "msg_01HP3GZK7E3D2C4P2J6Q1E9N2X",
  "transmission_id": "f7e8d9c0-b1a2-4c3d-8e9f-0a1b2c3d4e5f",
  "recipient": "user@example.com",
  "provider": "gmail",
  "outcome": {
    "status": "delivered",
    "reason": null
  },
  "meta": {
    "tenant": "acme",
    "tags": [
      "receipt"
    ]
  }
}