Revoke Personal Access Token
Revoke a personal access token. The token will be immediately invalidated.
Quick Navigation
Endpoint
DELETE /api/v1/auth/tokens/{token_id}
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <access_token> |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
token_id | integer | Yes | Token ID |
Response
Success (200)
{
"success": true,
"data": {
"message": "Token revoked successfully"
},
"message": "Token revoked successfully"
}
Error (404)
{
"success": false,
"error": {
"code": "token_not_found",
"message": "Token not found"
}
}
Features
- Token will be immediately invalidated
- Cannot be used anymore after revocation
- Only token owner can revoke their tokens
- Cannot be undone
Example
curl -X DELETE "https://api.rivergen.com/api/v1/auth/tokens/1" \
-H "Authorization: Bearer <access_token>"
Related Endpoints
- List Tokens - List all tokens
- Create Token - Create new token