Install the SDK
Pick your language. Every SDK reads the key from an environment variable and retries safe requests on its own.
npm install stackpost pip install stackpost gem install stackpost
Use a test key (sk_test_) while developing. Test keys return real responses but never send.
Send a message
A message needs a recipient, and either a template or a body. The response returns right away with status queued.
curl https://api.stackpost.example/v1/messages \ -H "Authorization: Bearer sk_test_..." \ -d to="ana@example.com" -d template="welcome"
Receive events
Events are posted to your endpoint with an X-Stackpost-Signature header. Verify it before you trust the body.
const ok = sp.webhooks.verify(rawBody, sigHeader, secret); if (!ok) return res.status(400).end();
Templates
Templates are versioned. Publishing makes a new version live; older versions stay available so a rollback is one click.
Limits and retries
| Plan | Requests / sec | Batch size | Webhook retries |
|---|---|---|---|
| Free | 5 | 50 | 3 over 1 hour |
| Growth | 50 | 500 | 12 over 24 hours |
| Scale | 500 | 5,000 | 24 over 72 hours |