List¶
GET /api/v1/workspace/accesskey/list
Overview¶
Lists valid API Key records in the current workspace that are not bound to an account.
Prerequisites and Usage Steps¶
Calling this API requires the workspace.openAPIKeyManage permission of the current workspace. The examples below show a subset of commonly used fields. The list is not paginated, and non-Owners do not see Owner Keys. By default, Owner records come first, and records in the same group are sorted by record ID in descending order. After obtaining the uuid, you can query the details. For workspace Keys created manually and not bound to an account, the workspace Owner can read the full credentials. Non-Owners can read full values only for the Key used in the current call; other records are masked. Records from other sources such as personal and Agent are also masked. Mask sensitive data in responses that appear in logs and tickets.
Request Headers¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| DF-API-KEY | string | Y | Workspace calling credential. The record UUID and the calling credential are different fields. Example: <DF-API-KEY>How to obtain or fill in: Obtain the full credential from the API Key management of the current workspace. |
Query Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| search | string | Fuzzy match by name; omit or leave empty to skip filtering. Allows null: False Example: 应用How to obtain or fill in: Copy a name from the API Key management page of the workspace, or enter part of a name. |
|
| orderBy | string | Field used to sort the list; omit to use the default sorting. Allows null: False Allowed values: ['createAt', 'callCount', 'lastCallAt'] Example: lastCallAtHow to obtain or fill in: Choose creation time createAt, call count callCount, or last call lastCallAt as needed. |
|
| order | string | Defaults to desc; used together with orderBy. Allows null: False Allowed values: ['asc', 'desc'] Example: descHow to obtain or fill in: Choose ascending asc or descending desc. |
Additional Parameter Notes¶
The resource identifiers in the examples are placeholders; replace them with the actual values of the target workspace.
Request Example¶
curl --get -H "DF-API-KEY: <DF-API-KEY>" \
'https://openapi.guance.com/api/v1/workspace/accesskey/list' \
--data-urlencode "search=应用" \
--data-urlencode "orderBy=lastCallAt" \
--data-urlencode "order=desc"
Response¶
HTTP 200, application/json.
| Field | Type | Description |
|---|---|---|
| content | array<object> |
Matching Key records. |
| content[].uuid | string | UUID of the API Key record, commonly prefixed with wsak_. Used in the paths of API Key management APIs. |
| content[].name | string | Name of the API Key. |
| content[].workspaceUUID | string | Workspace the record belongs to. |
| content[].createdWay | string | Creation source of the API Key. |
| content[].remark | string | Remark of the API Key. |
| content[].isOwnerRole | integer or boolean | Whether the API Key has the workspace owner role. |
| content[].callCount | integer | Number of calls recorded. |
| content[].lastCallAt | integer | Last recorded call time in Unix seconds; can be -1 if there is no record. |
| content[].createAt | integer | Record creation time in Unix seconds. |
| content[].accountUUID | string | UUID of the explicitly bound account; an empty string if not bound. |
| content[].effectiveAccountUUID | string | Identity identifier used for authentication. When not bound, it is the UUID of the API Key record. |
| content[].accountInfo | object or null | Profile of the bound account; null if not bound. |
| content[].roles | array<object> |
Set of effective roles; the order is not fixed. |
| content[].roles[].uuid | string | Role UUID. |
| content[].roles[].name | string | Role name. |
| content[].permissions | array<string> |
Set of effective permission identifiers; the order is not fixed. |
| content[].rolePermissions | object | Permission identifiers owned by each role, keyed by role UUID with an array of permission strings as the value. |
| content[].declaration | object or null | Workspace declaration. |
| content[].ak | string | Access Key identifier. May be masked depending on the current identity. |
| content[].sk | string | Secret Key credential. May be masked depending on the current identity. Responses should be handled as sensitive information. |
| content[].creatorInfo | object | Creator profile; an empty object if not found. |
{
"code": 200,
"content": [
{
"uuid": "wsak_example",
"name": "应用数据读取",
"workspaceUUID": "wksp_example",
"createdWay": "manual",
"remark": "",
"isOwnerRole": 0,
"callCount": 14,
"lastCallAt": 1785427200,
"createAt": 1785423600,
"accountUUID": "",
"effectiveAccountUUID": "wsak_example",
"accountInfo": null,
"roles": [
{
"uuid": "role_example",
"name": "应用数据只读"
}
],
"permissions": [
"routine.defaultAccess"
],
"rolePermissions": {
"role_example": [
"routine.defaultAccess"
]
},
"declaration": null,
"ak": "*************abcd",
"sk": "*************ef01",
"creatorInfo": {}
}
],
"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 |
|---|---|---|---|---|
| 406 | ft.ParameterValidationFailed | An undeclared parameter is passed or a parameter value fails validation | Parameter validation failed; the message indicates the invalid field. | Check the location and allowed values of each field. |