Skip to content
Sendtier Docs
API reference

Add a webhook endpoint

Source: OpenAPI (openapi/openapi.yaml).

curl -X POST "https://api.sendtier.example/webhooks" \  -H "Authorization: Bearer st_live_REPLACE_ME" \  -H "Content-Type: application/json" \  -d '{    "url": "http://example.com",    "events": [      "email.queued"    ]  }'
{  "id": "string",  "url": "string",  "events": [    "email.queued"  ],  "test_mode": true,  "signing_secret": "string",  "created_at": "2019-08-24T14:15:22Z"}
POST
/webhooks

The signing secret is returned only on the first successful response. A replay with the same Idempotency-Key and request body returns the same webhook without signing_secret, with the usual response headers and Idempotent-Replayed set to true. The caller's mode sets the endpoint mode: a test key or dashboard test mode creates a test endpoint (test_mode true), which receives only test-mode events. Any other caller creates a live endpoint, which receives only live events.

Authorization

headerAuthorizationBearer <token>

API key: st_live_... or st_test_...

Header Parameters

Idempotency-Key?string

Repeated POST with the same key within 24 h returns the first response.

Lengthlength <= 255

Request Body

application/json
  1. body
url*string

HTTPS only, at most 2048 characters. Private and loopback addresses are rejected.

Formaturi
Lengthlength <= 2048
events*array<>
Items1 <= items <= 9

Response Body

Webhook created. signing_secret is shown only in this response.

application/json
  1. response
id*string
url*string
events*array<>
test_mode*boolean

True for a test endpoint, created with a test key or in dashboard test mode. A test endpoint receives only test-mode events and a live endpoint only live events. Every payload carries the same test_mode value. The mode cannot change after creation.

signing_secret?string

Present only in the first successful create or rotate-secret response; omitted on idempotent replay.

created_at*string
Formatdate-time