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"}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.
AuthorizationBearer <token>API key: st_live_... or st_test_...
Idempotency-Key?stringRepeated POST with the same key within 24 h returns the first response.
length <= 255application/json- body
url*stringHTTPS only, at most 2048 characters. Private and loopback addresses are rejected.
urilength <= 2048events*array<>1 <= items <= 9Webhook created. signing_secret is shown only in this response.
application/json- response
id*stringurl*stringevents*array<>test_mode*booleanTrue 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?stringPresent only in the first successful create or rotate-secret response; omitted on idempotent replay.
created_at*stringdate-time