Immediately revoke an issued Service Account Token.
POST /api/v1/forward/service_account_tokens/{auth_token_id}/revoke
After revocation, the token becomes invalid immediately and subsequent business requests that use it are rejected. Use this endpoint when a token may have leaked or an end-user session ends early.
Request headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | Bearer <Service Account Key> |
| Content-Type | Yes | application/json |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| auth_token_id | string | Yes | Unique ID of the token to revoke, from auth_token_id in the token creation response. |
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
| target_credential_id | string | No | Issuing Key ID from credential_id in the creation response, used to identify the target precisely. |
| target_expires_at | string | No | Token expiration time from expires_at in the creation response, in RFC 3339 format, used to identify the target precisely. |
| reason | string | No | Revocation reason for auditing. |
Example request
Example response
HTTP 200 OK
Response fields
| Field | Type | Description |
|---|---|---|
| revoked | boolean | Whether revocation succeeded. Always true. |
Errors
| HTTP | Type | Code | Condition |
|---|---|---|---|
| 400 | invalid_request_error | - | The request body is invalid, or target_expires_at is not a valid RFC 3339 time. |
| 401 | authentication_error | - | The Service Account Key is invalid or expired, or another credential type was used. |
| 404 | not_found_error | - | The target token does not exist or does not belong to the current Service Account. |
| 409 | conflict_error | - | The locating conditions match multiple tokens. Add target_credential_id or target_expires_at to identify the token precisely. |
Notes
- Revocation cannot be undone. Create a new token to continue access.
- You can revoke only tokens issued under the same Service Account.
- If a Key may have leaked, revoke the token and rotate the Service Account Key on the Enterprise credentials page in the Qoder console.