Skip to content

Create an access token

POST
/api/tokens
curl --request POST \
--url https://api-dev.wrktr.com/api/tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "expiresInDays": "Infinity" }'

Only from a signed-in web session (a token can’t create tokens): the CLI’s wrktr token create opens the browser for this. The token is returned once.

Media typeapplication/json
object
name
required
string
>= 1 characters <= 100 characters
expiresInDays
Any of:
Any of:
number

NewToken

Media typeapplication/json
object
token
required
string
info
required
object
id
required
string
name
required
string
prefix
required
string
createdAt
required
Any of:
number
lastUsedAt
required
Any of:
Any of:
number
expiresAt
required
Any of:
Any of:
number
Example
{
"info": {
"createdAt": "Infinity",
"lastUsedAt": "Infinity",
"expiresAt": "Infinity"
}
}

Unauthorized

Media typeapplication/json
object
_tag
required
string
Allowed values: Unauthorized
message
required
string
Example
{
"_tag": "Unauthorized"
}

Forbidden

Media typeapplication/json
object
_tag
required
string
Allowed values: Forbidden
message
required
string
Example
{
"_tag": "Forbidden"
}