Update API Token
Modify the properties of an existing API Token by specifying its unique identifier. Token modifications can include updating the name and description fields. To obtain the token ID, utilize the List API Tokens endpoint.
HTTP Request
PUT
{API_URL}/api-tokens/{id}
Path Parameters
Parameter | Requirement | Type | Description |
---|---|---|---|
id | Required | string | Unique identifier of the API Token to modify |
Body Parameters
Parameter | Requirement | Type | Description |
---|---|---|---|
name | Required | string | New token identifier (maximum 50 characters) |
description | Optional | string | Updated supplementary information about token usage |
Response Structure
status boolean
Operation result indicator. Returns true
for successful execution, false
when encountering an error.
message string
Descriptive response indicating the outcome of the token modification request.
data object
Contains the modified API Token information with the following attributes:
name
: Updated token identifiertoken
: Authentication credential for API requestsdescription
: Modified contextual informationcreated_at
: Original token generation timestampid
: Unique token identifier
Implementation Example
Request
bash
curl -X PUT '{API_URL}/api-tokens/{id}' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'refresh-token: {REFRESH_TOKEN}' \
-H 'Content-Type: application/json' \
-d '{
"name": "rich-test-token-new",
"description": "Updated production environment API token"
}'
Response
json
{
"status": true,
"message": "API Token successfully updated",
"data": {
"name": "rich-test-token-new",
"id": "670881c41221aabc72ed946b",
"description": "Updated production environment API token",
"token": "eyJlbWFpbCI6InRlYW1AZXhhYml0cy5haSIsInVzZXJuYW1l...",
"created_at": 1735475573
}
}