prawnwire Developers

API keys

Authenticate server-side requests with a scoped organization key.

An organization admin creates keys in Developers > API keys in the console. If you are a developer without console access, ask an admin for a key with the scopes your integration needs.

Live and test keys

pw_live_ keys send real mail. pw_test_ keys validate sends without queueing or counting them. Both are real, organization-specific keys. The literal Postmark token POSTMARK_API_TEST is not accepted.

The full key is shown once when it is created. Store it in your server’s secret environment, never in browser JavaScript, mobile app bundles, public repositories, or logs.

Scopes

ScopePermits
email:sendSend single and batch messages, and create and delete suppressions.
email:readRead outbound messages, message details, and suppressions.
domains:readList the organization’s domains.
members:readList the organization’s members.
contacts:readLook up and list newsletter contacts, lists, tags and fields.
contacts:writeCreate and update newsletter contacts, add and remove tags, and subscribe webhook hooks. Needs Newsletters turned on.

Every active key can call GET /v1/me without another scope. A key applies to the whole organization unless an admin limits its sending domains. Missing scope returns HTTP 403.

Authentication headers

Send one of these headers:

Choose one authentication header
Authorization: Bearer pw_live_replace_with_your_key
X-Postmark-Server-Token: pw_live_replace_with_your_key
X-Prawnwire-Server-Token: pw_live_replace_with_your_key

The server checks X-Postmark-Server-Token first, then X-Prawnwire-Server-Token, then the Bearer header. Avoid sending multiple credentials in the same request.

Sending domains

An admin can limit a key to some of the organization’s verified domains when creating it, or later from Developers > API keys. A limited key can send only with a From address on one of those domains. An empty list, the default, lets the key send from any verified domain of the organization. A live key and a test key are limited the same way.

A message from any other domain is refused with HTTP 422 and ErrorCode 400, and nothing is queued or counted for it. The message names the domains the key can use, for example This API key can only send from example.com, not example.org. In a batch, only the messages from other domains are refused. GET /v1/me lists a key’s allowed_domains.

A domain stays on a key’s list after it is removed from the organization or stops being verified, so the key never starts sending from the organization’s other domains on its own. Change the list to let it.

Allowed IPs

An admin can limit a key to up to 20 IP addresses or ranges when creating it, or later from the key’s settings. Each entry is an IPv4 or IPv6 address with an optional prefix, such as 203.0.113.7, 203.0.113.0/24 or 2001:db8::/32. An empty list, the default, lets the key be used from any address. A live key and a test key are limited the same way.

The address checked is the caller’s address as the Prawnwire edge sees it, taken from the first entry of X-Forwarded-For. A client connecting over IPv6 matches IPv6 entries, and an IPv4 client written in IPv4-mapped form (::ffff:203.0.113.7) matches IPv4 entries. Calls through a proxy or NAT gateway come from the proxy’s address, so list that address, not the one behind it. A server with both an IPv4 and an IPv6 address can call from either, so list both.

A call from any other address is refused before anything else is checked, with HTTP 403 and ErrorCode 10 (ip_not_allowed on account endpoints) and the message This API key cannot be used from this address. The refusal does not count against the key’s request rate limit and does not update its last-used time. GET /v1/me lists a key’s allowed_ips.

Revoke and rotate

An admin can revoke a key from Developers > API keys. Revoked keys immediately fail authentication. To rotate without interrupting service, create a replacement, update and verify the application’s configuration, then revoke the old key.

Test keys are not a read-only sandbox. Their no-send behavior applies to email submission; a test key with email:send can still create and delete suppressions. Grant only the scopes the integration needs.

Search documentation

Type to search the documentation.