Skip to content

Create Token

POST
/tokens
curl --request POST \
--url https://example.com/tokens \
--header 'Content-Type: application/json' \
--data '{ "expires_at": "2026-04-15T12:00:00Z", "name": "example", "scopes": [ "read", "write" ] }'
Media typeapplication/json
TokenCreate
object
expires_at
Any of:
string format: date-time
name
required
Name
string
scopes
Scopes
Array<string>
default: read,write

Successful Response

Media typeapplication/json
TokenCreated
object
created_at
required
Created At
string format: date-time
expires_at
required
Any of:
string format: date-time
id
required
Id
string format: uuid
is_current
Is Current
boolean
kind
required
Kind
string
last_used_at
required
Any of:
string format: date-time
name
required
Name
string
scopes
required
Scopes
Array<string>
token
required
Token
string

Example

{
"is_current": false
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string

Example generated

{
"detail": [
{
"ctx": {},
"input": "example",
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}