Revoke Token (Legacy API)¶
POST /api/v1/offline_token/temporary_token/revoke
Overview¶
The legacy flow revokes the temporary offline Token cache; the current version has compatibility limitations with the new Token format.
Prerequisites and Usage Steps¶
This is a legacy API. Historical documentation is scheduled to be taken offline on 2026-05-31; the current source code is still retained, and whether it is available on a deployment site depends on the actual version. New integrations use a one-time authCode creation/redemption flow. Only Tokens that have been verified as compatible with the legacy custom. prefix and can be parsed using the legacy signature method proceed to cache deletion. The current public route does not pass in the Token type, so successful revocation cannot be guaranteed for new unprefixed RS256 Tokens, and a generic internal error may be returned. Do not replace revocation confirmation with an expectation that retries will succeed or with custom modifications to other formats. After true is successfully returned for a compatible format, the Token's offline authorization cache in the current workspace is deleted; subsequent use requires revalidation and the Token should become invalid. Requests that have already started or completed are not withdrawn as a result. If the cache no longer exists, a compatible Token can still return true. For an unredeemed code, use Revoke One-Time Auth Code, but after a code has been redeemed, revoking the code does not affect the Token. For short-term access, you can control expires at creation time and confirm the deadline based on the final expiresAt.
Request Headers¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| DF-API-KEY | string | Y | OpenAPI authentication credential for the workspace. Example: <DF-API-KEY>How to obtain or enter: Obtain an OpenAPI Key with permission for this operation from API Key Management in the target workspace. |
Body Request Parameters¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| token | string | Y | Complete Token string to revoke; required; not an authCode. New unprefixed Tokens currently have revocation compatibility limitations. Allows null: False Example: custom.<LEGACY-HS256-JWT>How to obtain or enter: Obtain it unchanged from the temporary customToken held by the legacy flow; this example is only a placeholder; replace it with your own target Token. First confirm that the target belongs to the current workspace and uses the legacy format compatible with this API. |
Additional Parameter Notes¶
The current failure path does not consistently return 401 OfflineTokenFailed: some parsing failures, cross-workspace cases, or unrecognized prefix cases return 500 InternalServerError. This page describes the actual flow and does not treat the "compatible with new and old Tokens" statement in source code comments as verified behavior.
Request Example¶
curl --request POST 'https://openapi.guance.com/api/v1/offline_token/temporary_token/revoke' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json' \
--data-raw '{"token":"custom.<LEGACY-HS256-JWT>"}'
Response¶
HTTP 200, application/json. The example below shows the main fields that can be read directly.
| Field | Type | Description |
|---|---|---|
| content | boolean | Returns true only after compatible parsing is completed and the cache deletion flow finishes; does not return the Token or the number deleted. |
{
"code": 200,
"content": true,
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
Error Responses¶
For authentication, rate limiting, and common request errors, see Common Error Definitions.
| HTTP Status | errorCode | Trigger Condition | Message or Response Description | Handling |
|---|---|---|---|---|
| 406 | ft.ParameterValidationFailed | A request field is missing, or a field value violates the declared validation conditions | Parameter parsing failed | Check the parameter location, field name, type, and value. |
| 400 | ft.RequestJsonFormatError | The request JSON syntax is invalid | Request JSON format error | Fix the JSON according to content.reason, line, and column. |
| 400 | ft.JsonFormatError | The JSON top level is not an object | Partial JSON file format error | Submit a single JSON object. |
| 401 | ft.OfflineTokenFailed | The Token is not a three-part JWT, and the legacy prefix and JWT cannot be extracted from it | Login-free token validation failed | Check whether an authCode or incomplete string was passed by mistake; do not add a prefix yourself. |
| 500 | ft.InternalServerError | New unprefixed Token signature verification compatibility fails, or Token parsing, workspace mismatch, or unsupported prefix path triggers the current exception handling defect; it may also be a cache processing failure | Internal error | Do not assume revocation succeeded based on this. Check the target format, owning workspace, and expiration time; retain the traceId for an administrator to confirm. The current version requires a separate fix for the compatibility path. |