API reference
REST API, version 4.
JSON in, JSON out. Base URL https://api.stackpost.example. Authenticate with a bearer key.
POST
/v1/messagesSend 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/batchesSend up to 5,000 messages in one request.
{ "messages": [ ... ] }GET
/v1/templatesList 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
| Code | Meaning | What to do |
|---|---|---|
| 400 | Bad request | Check the field named in the error body. |
| 401 | Bad or missing key | Use a key from the same mode. |
| 409 | Duplicate idempotency key | The first request already succeeded. |
| 429 | Rate limited | Back off and honour Retry-After. |
| 500 | Our fault | Retry; check the status page. |