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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
name
required
The name for the token
string
description
The description for the token
string
Examplegenerated
{ "name": "example", "description": "example"}Responses
Section titled “Responses”Created
Media typeapplication/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