Skip to main content
POST
/
api-tokens
Create Token
curl --request POST \
  --url https://api.{your-broker}.slate-labs.com/api-tokens \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "scopes": [
    "<string>"
  ],
  "expiry": "90d",
  "ip_allowlist": [
    "<string>"
  ],
  "rate_limit": 50000
}
'
{
  "id": 123,
  "name": "<string>",
  "token_prefix": "<string>",
  "token_last4": "<string>",
  "scopes": [
    "<string>"
  ],
  "ip_allowlist": [
    "<string>"
  ],
  "rate_limit": 123,
  "expires_at": "2023-11-07T05:31:56Z",
  "created_by": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "last_used_at": "2023-11-07T05:31:56Z",
  "token": "<string>"
}

Body

application/json
name
string
required
Required string length: 1 - 100
scopes
string[]
required
Minimum array length: 1
expiry
enum<string>
default:90d
Available options:
30d,
90d,
1y,
never
ip_allowlist
string<ipvanynetwork>[] | null
rate_limit
integer | null
Required range: 1 <= x <= 100000

Response

Successful Response

Returned only on creation and rotation. Contains the one-shot secret.

id
integer
required
name
string
required
token_prefix
string
required
token_last4
string
required
scopes
string[]
required
ip_allowlist
string[] | null
required
rate_limit
integer | null
required
expires_at
string<date-time> | null
required
status
enum<string>
required
Available options:
active,
disabled,
revoked,
expired
created_by
string
required
created_at
string<date-time>
required
last_used_at
string<date-time> | null
required
token
string
required