Skip to main content
POST
Create an API key

Authorizations

Authorization
string
header
required

All requests must include Authorization: Bearer <api_key>. Keys are prefixed pw_live_ or pw_test_. See Authentication.

Body

application/json
name
string
required
Example:

"Production backend"

mode
enum<string>

Test keys can only send to verified test addresses and never incur charges

Available options:
live,
test
scopes
string[]

Permissions granted to this key. Defaults to ["messages:write", "messages:read"].

Example:

Response

The created API key, including its one-time secret

id
string
Example:

"key_4m8n2q"

object
enum<string>
Available options:
api_key
name
string
mode
enum<string>

Test keys can only send to verified test addresses and never incur charges

Available options:
live,
test
scopes
string[]
last_used_at
string<date-time> | null
created_at
string<date-time>
secret
string

The full secret key. Only returned once.

Example:

"pw_live_8f2k9q3m1n7r5t6y4u2i0o8p"