Create an Agent API token

Create an Agent API token for remote workers.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

organizationIdstringRequired
The ID of the organization that owns the deployment where you want to create the Agent API token.
deploymentIdstringRequired
The ID of the deployment where you want to create the Agent API token.

Request

The request body for creating an Agent API Token.
namestringRequired
The name of the API token.
descriptionstringOptional
The description for the API token.
tokenExpiryPeriodInDaysintegerOptional1-3650
The expiry period of the API token in days. If not specified, the token will never expire.

Response

OK
createdAtstringformat: "date-time"

The time when the API token was created in UTC, formatted as YYYY-MM-DDTHH:MM:SSZ.

descriptionstring
The description of the API token.
idstring
The API token's ID.
kindenum
The kind of the API token.
Allowed values:
namestring
The name of the API token.
scopeenum
The scope of the API token.
Allowed values:
shortTokenstring
The short value of the API token.
startAtstringformat: "date-time"

The time when the API token will become valid in UTC, formatted as YYYY-MM-DDTHH:MM:SSZ.

updatedAtstringformat: "date-time"

The time when the API token was last updated in UTC, formatted as YYYY-MM-DDTHH:MM:SSZ.

createdByobject
endAtstringformat: "date-time"

The time when the API token expires in UTC, formatted as YYYY-MM-DDTHH:MM:SSZ.

expiryPeriodInDaysinteger
The expiry period of the API token in days.
lastUsedAtstringformat: "date-time"

The time when the API token was last used in UTC, formatted as YYYY-MM-DDTHH:MM:SSZ.

roleslist of objects
The roles of the API token.
tokenstring
The value of the API token.
updatedByobject

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
500
Internal Server Error