Skip to content

Create



POST /api/v1/workspace/accesskey/add

Overview

Create a Key

Body Request Parameters

Parameter Name Type Required Description
name string Y AK name information
Example: xxx
Allow empty: False
remark string API Key remark
Example: For test environment data query
Allow empty: False
Max length: 512
roleUUIDs array List of roles assigned to the API key (excluding owner)
Allow empty: False

Parameter Supplementary Description

*1. Request Parameter Description

Parameter Name type Required Description
name string Required API Key name
remark string API Key remark
roleUUIDs array Specify the role UUIDs for the API Key (excluding owner, default is ['wsAdmin']), added in the 2025-03-12 iteration

Request Example

curl 'https://openapi.guance.com/api/v1/workspace/accesskey/add' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  -H 'Content-Type: application/json;charset=UTF-8' \
  --data-raw '{"name": "88"}' \
  --compressed \
  --insecure

Response

{
    "code": 200,
    "content": {
        "createAt": 1678024319,
        "creator": "xxxx",
        "deleteAt": -1,
        "id": null,
        "name": "88",
        "sk": "xxx",
        "status": 0,
        "updateAt": 1678024319,
        "updator": "xxx",
        "uuid": "xxx",
        "workspaceUUID": "wksp_xxxx32"
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "TRACE-A294E29E-33DE-48A5-A379-0BAA1519D256"
}

Feedback

Is this page helpful? ×