Skip to content

Create

POST
/api/tokens
curl --request POST \
--url https://kelpie.example.com/api/tokens \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "role": "viewer", "expires_in_days": 90 }'

Create a token for yourself. Its value is in the response and can’t be shown again.

The token acts as you, with no role higher than role.

Media typeapplication/json
TokenIn
object
name
required
Name
string
>= 1 characters <= 100 characters
role
required
Role
string
Allowed values: viewer operator editor admin
expires_in_days
Expires In Days
Any of:
integer
>= 1 <= 3650

Successful Response

Media typeapplication/json
TokenCreated
object
id
required
Id
string format: uuid
name
required
Name
string
prefix
required
Prefix
string
role
required
Role
string
Allowed values: viewer operator editor admin
username
required
Username
string
created_at
required
Created At
string format: date-time
expires_at
required
Expires At
Any of:
string format: date-time
last_used_at
required
Last Used At
Any of:
string format: date-time
last_used_ip
required
Last Used Ip
Any of:
string
token
required
Token
string

Example

{
"role": "viewer"
}

Validation Error

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

Example generated

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