Delete¶
GET /api/v1/workspace/accesskey/{ak_uuid}/delete
Overview¶
Soft-deletes the API Key in the current workspace and invalidates the corresponding credentials.
Before Calling and Usage Steps¶
Use an OpenAPI Key in the current workspace that has the workspace.openAPIKeyManage permission. The route declaration is marked with a freeEdition version restriction, but the current OpenAPI authentication chain does not perform this version check, so do not describe the version itself as inevitably causing a 403; verify availability based on the deployment and actual permissions. The resource scope always comes from the workspace to which the request header Key belongs; you cannot switch workspaces using the Body. An owner Key also requires the current identity to include owner; API management permission alone does not replace this check.
This is a GET endpoint with side effects; do not place it in web links, automatic prefetching, or health probes. First confirm that all consumers have been migrated, then call by resource UUID; Keys that are not system Keys and have not been deleted can be deleted, including disabled historical Keys. Delete the Key and its associations with valid roles, then commit, and then write the old ak/sk to the invalidation cache. The current Key can delete itself; the current request can complete, and subsequent calls must use another valid Key.
A miss (nonexistent/cross-workspace/deleted/system Key) still returns content=true, which does not prove that the target was deleted in this request; retrying with the original UUID after deletion will not delete a new Key by name. If the target is bound to an agent account and createdWay=agent, deletion from this endpoint is prohibited; use the account-specific workflow. An owner Key requires an owner identity. Deletion does not delete the workspace or account, nor does it withdraw tasks that have already started executing.
The database commits first and then updates the cache; on a 500 or a timeout, use another management Key to verify the target and role status, then process by the original UUID. Do not rely on the truth value to determine that all nodes have been invalidated immediately.
Route Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| ak_uuid | string | Y | UUID of the Key resource in the current workspace. Do not enter ak/sk plaintext or a UUID from another workspace. Example: wsak_exampleHow to obtain or enter: Obtain it from content[].uuid in the API Key List or from content.uuid in the creation response; verify it with API Key Details if necessary. |
Request Headers¶
| Parameter | 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 this operation permission from API Key Management in the target Workspace. |
Additional Parameter Notes¶
A GET with side effects; the credential becomes invalid after deletion. Before calling, migrate consumers and retain another valid management Key.
Request Example¶
curl --get 'https://openapi.guance.com/api/v1/workspace/accesskey/wsak_example/delete' \
-H 'DF-API-KEY: <DF-API-KEY>'
Response¶
HTTP 200, application/json. The example below shows the main fields that can be read directly.
| Field | Type | Description |
|---|---|---|
| content | boolean | true when processing is complete; also true when there is no match; does not return the deletion count or Key details. |
{
"code": 200,
"content": true,
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
Error Response¶
For authentication, rate limiting, and common request errors, see Common Error Definitions.
| HTTP Status | errorCode | Trigger Condition | Message or Response Description | Handling |
|---|---|---|---|---|
| 400 | ft.AgentWorkspaceAKCanNotDelete | The target is a credential bound to an agent account with a non-empty accountUUID and createdWay=agent | API Keys bound to an agent cannot be deleted. | Manage it using the dedicated lifecycle workflow for the bound account; do not delete account-shared credentials. |
| 403 | ft.Forbidden | Insufficient management permissions, or a non-owner deleting an owner Key | You do not have permission to perform this operation. | Use the appropriate permissions and an owner identity. |
| 500 | ft.InternalServerError | Database or credential cache invalidation failed; rotation/deletion may have been committed before the error was returned | Internal error | First use another valid management Key to read the original UUID and status. If the rotation response is lost and the old Key has been invalidated, use another valid management Key to rotate again and securely receive the new credential; do not repeatedly retry with the invalidated old Key. |