Skip to content

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

ParameterRequirementTypeDescription
idRequiredstringUnique identifier of the API Token to modify

Body Parameters

ParameterRequirementTypeDescription
nameRequiredstringNew token identifier (maximum 50 characters)
descriptionOptionalstringUpdated 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 identifier
  • token: Authentication credential for API requests
  • description: Modified contextual information
  • created_at: Original token generation timestamp
  • id: 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
    }
}