Getting Started

Authentication

PostMTA uses bearer token authentication. All API requests must include a valid API key in the Authorization header.

API Keys

Key Types

PrefixEnvironmentDescription
pmta_test_SandboxEmails validated but not delivered. No billing.
pmta_live_ProductionReal email delivery. All sends are billable.

Key Scopes

ScopeDescription
messages:sendSend transactional emails
messages:readRead message status and details
domains:manageAdd, verify, and delete sending domains
webhooks:manageCreate and delete webhook endpoints
ip-pools:manageConfigure IP pools and warm-up
analytics:readRead delivery and engagement analytics
account:readRead account and billing information

Using API Keys

Authorization: Bearer pmta_live_xxxxxxxxxxxxxxxxxxxx
Never expose API keys in client-side code, public repositories, or logs. Rotate keys immediately if compromised.

IP Allowlisting

curl -X PUT https://api.postmta.com/v1/settings/security -H "Authorization: Bearer pmta_live_xxxx" -H "Content-Type: application/json" -d '{"allowed_ips":["203.0.113.0/24","198.51.100.14"]}'

Webhook Signature Verification

Every webhook request is signed using HMAC-SHA256. The signature is sent in the PostMTA-Signature header.