Skip to main content
POST
/
api
/
v1
/
keys
Create API key
curl --request POST \
  --url https://api.myrouter.example/api/v1/keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "label": "<string>",
  "limit": 123,
  "expires_at": "2023-11-07T05:31:56Z"
}
'
{
  "data": {
    "hash": "<string>",
    "name": "<string>",
    "account_id": "<string>",
    "disabled": true,
    "usage": 123,
    "created_at": "2023-11-07T05:31:56Z",
    "label": "<string>",
    "limit": 123,
    "limit_remaining": 123,
    "last_used_at": "2023-11-07T05:31:56Z"
  },
  "key": "<string>",
  "request_id": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-request-id
string

Optional caller request id.

Body

application/json
name
string
required

Key display name.

label
string

Customer-visible label; not platform label id.

limit
number

Optional customer charge limit.

expires_at
string<date-time>

Optional expiration timestamp.

Response

Create API key response.

data
object
required

Created key metadata.

key
string
required

One-time API key secret.

request_id
string

Request id.