Skip to content

Create a deployment token

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

The token value is returned once and cannot be retrieved later.

Media typeapplication/json
CreateTokenRequest
object
name
Name
string
default: Deployment token
site_name
required
Site Name
string

Successful Response

Media typeapplication/json
CreatedDeploymentTokenResponse
object
id
required
Id
string
name
required
Name
string
site_name
required
Site Name
string
token
required
Token
string
Examplegenerated
{
"id": "example",
"name": "example",
"site_name": "example",
"token": "example"
}

Authentication is required.

Media typeapplication/json
ErrorResponse
object
detail
required
Detail
string
Examplegenerated
{
"detail": "example"
}

A session token and site ownership are required.

Media typeapplication/json
ErrorResponse
object
detail
required
Detail
string
Examplegenerated
{
"detail": "example"
}

The site does not exist.

Media typeapplication/json
ErrorResponse
object
detail
required
Detail
string
Examplegenerated
{
"detail": "example"
}

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
Examplegenerated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}