Create Token
POST
/tokens
const url = 'https://example.com/tokens';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"expires_at":"2026-04-15T12:00:00Z","name":"example","scopes":["read","write"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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" ] }'Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “Responses”Successful Response
Media typeapplication/json
TokenCreated
object
created_at
required
Created At
string format: date-time
id
required
Id
string format: uuid
is_current
Is Current
boolean
kind
required
Kind
string
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>
ValidationErrorobject
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" } ]}