Skip to content

Create an agent token

POST
/api/v4/projects/{id}/cluster_agents/{agent_id}/tokens

Creates a token for an agent. You must have the Maintainer or Owner role to use this endpoint. An agent can have only two active tokens at one time.

id
required
One of:
string

The ID or URL-encoded path of the project

agent_id
required
integer

The ID of an agent

Media type application/json
object
name
required

The name for the token

string
nullable
description

The description for the token

string
nullable
Example generated
{
"name": "example",
"description": "example"
}

Created

Media type application/json
object
id
integer format: int64
name
string
description
string
agent_id
integer format: int64
status
string
created_at
string format: date-time
created_by_user_id
integer format: int64
last_used_at
string format: date-time
token
string
Example
{
"id": 1,
"agent_id": 1,
"created_by_user_id": 1
}

Bad Request

Not Found