API v1currentBase URLhttps://api.sendlib.com/v1Bearer API key

API

Authentication

Bearer tokens, scoped API keys, and best practices for securing your Sendlib integration.

Bearer tokens

Every API request must include a bearer token in the Authorization header. Tokens are created in the Sendlib dashboard and are tenant-scoped — each token belongs to exactly one account.

Shell
curl -X POST https://api.sendlib.com/v1/transmissions \
  -H "Authorization: Bearer $SENDLIB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"recipients":[{"email":"user@example.com"}],"content":{"subject":"Test","text":"Hello"}}'

If the token is missing or invalid, the API returns 401 Unauthorized. If the token is valid but lacks the required scope for the endpoint, you'll receive 403 Forbidden.

Scoped keys

Sendlib supports fine-grained permission scopes on API keys. In production, always prefer scoped keys so each service only gets the privileges it needs.

ScopeGrants access to
send:transmissionsCreate and send transmissions
read:eventsQuery message and transmission events
manage:webhooksCreate, update, delete, and test webhooks
manage:sending-domainsDomain verification and DNS management
manage:templatesCreate and update stored templates
manage:suppressionsAdd/remove suppression rules
manage:api-keysCreate additional API keys
manage:smtp-credentialsCreate SMTP credentials
manage:ip-poolsManage IP pool assignments
manage:pacingConfigure pacing and warmup policies

Creating a scoped key

Shell
curl -X POST https://api.sendlib.com/v1/api-keys \
  -H "Authorization: Bearer $SENDLIB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"prod-sender","scopes":["send:transmissions","read:events"]}'

Key rotation

Rotate keys regularly — at minimum quarterly, or immediately if a key may have been exposed.

  1. Create a new key with the same scopes.
  2. Deploy the new key to your services.
  3. Verify traffic is flowing on the new key (check X-Request-ID headers in logs).
  4. Delete the old key from the dashboard.

SMTP authentication

If you use SMTP instead of REST, authenticate with the SMTP credentials endpoint. SMTP credentials use standard AUTH LOGIN with the username and password returned at creation time.

Shell
curl -X POST https://api.sendlib.com/v1/smtp-credentials \
  -H "Authorization: Bearer $SENDLIB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"prod-smtp"}'

Next