Create a new API token
POST /api/v1/api_token
POST
/api/v1/api_token
Authorizations
Section titled “Authorizations ”Request Body
Section titled “Request Body ” ApiToken_DetailsForCreate
object
account_id
One of:
Account_Id
A valid account ID
string
Example
013xrzp12g3nqk8ngskn1wtxgka5b0nf Null
Null
string
environment_id
One of:
Environment_Id
A valid environment ID
string
Example
013xrzp12g3nqk8nzxvq7jm2arsfg5h1 Null
Null
string
expires_at
token_scope
Token scope: ‘account’ or ‘environment’
string
Responses
Section titled “ Responses ”Success
object
details
ApiToken_Details
object
account_id
Account_Id
A valid account ID
string
Example
013xrzp12g3nqk8ngskn1wtxgka5b0nf available_actions
ApiToken_AvailableActions
Available actions for this token based on its status
object
activate
Whether the token can be activated
boolean
delete
Whether the token can be deleted
boolean
revoke
Whether the token can be revoked
boolean
suspend
Whether the token can be suspended
boolean
created_by_admin_user_id
One of:
AdminUser_Id
A valid admin user ID
string
Example
013xrzp12g3nqk8nh0qrc2b1jfanmvb9 Null
Null
string
environment_id
One of:
Environment_Id
A valid environment ID
string
Example
013xrzp12g3nqk8nzxvq7jm2arsfg5h1 Null
Null
string
expires_at
When the token expires
string format: date-time
Example
2024-01-01T00:00:00Z id
ApiToken_Id
A valid API token ID
string
Example
013xrzp12g3nqk8n7f8f9jbg8d18q7tm inserted_at
When the token was created
string format: date-time
Example
2024-01-01T00:00:00Z last_used_at
status
Current status of the token
string
Example
active token_scope
Scope of the token
string
Example
account type
Type of resource (always ‘api_token’)
string
Example
api_token updated_at
When the token was last updated
string format: date-time
Example
2024-01-01T00:00:00Z status
string
Example
success token
The JWT token string (only available on creation)
string
Example
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...default
Section titled “default ”Error
One of:
object
code
string
Example
bad_request message
string
status
string
Example
errorobject
code
string
Example
validation_errors errors
message
string
status
string
Example
error