Skip to main content
POST
/
api-keys
Create an API key
curl --request POST \
  --url https://api.pulsewave.dev/v1/api-keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Production backend",
  "scopes": [
    "messages:write",
    "messages:read"
  ]
}
'
{
  "id": "key_4m8n2q",
  "object": "api_key",
  "name": "<string>",
  "scopes": [
    "<string>"
  ],
  "last_used_at": "2023-11-07T05:31:56Z",
  "created_at": "2023-11-07T05:31:56Z",
  "secret": "pw_live_8f2k9q3m1n7r5t6y4u2i0o8p"
}

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:
["messages:write", "messages:read"]

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"