API reference

REST API, version 4.

JSON in, JSON out. Base URL https://api.stackpost.example. Authenticate with a bearer key.

POST/v1/messages
Send one message. Returns 202 with an id.
{ "to": "ana@example.com", "template": "welcome" }
GET/v1/messages/{id}
Fetch a message and its delivery events.
{ "id": "msg_8f2k1", "status": "delivered" }
POST/v1/batches
Send up to 5,000 messages in one request.
{ "messages": [ ... ] }
GET/v1/templates
List templates and their live versions.
{ "data": [ { "id": "welcome", "version": 7 } ] }
PUT/v1/templates/{id}
Publish a new template version.
{ "version": 8, "status": "live" }
DELETE/v1/webhooks/{id}
Delete a webhook endpoint.
{ "deleted": true }

Errors

CodeMeaningWhat to do
400Bad requestCheck the field named in the error body.
401Bad or missing keyUse a key from the same mode.
409Duplicate idempotency keyThe first request already succeeded.
429Rate limitedBack off and honour Retry-After.
500Our faultRetry; check the status page.