Skip to content

Create a user Group

1. API Description

Use this API to create user groups.

2. API URL

POST http://{anymetrics_host:anymetrics_port}/anymetrics/api/v1/userGroup/create

To obtain anymetrics_host:anymetrics_port, see Calling APIs.

3. Common Request Headers

parameter Type required Description
tenant-id String Yes Tenant ID that identifies the tenant to which the resource belongs.
auth-type String Yes Authentication method. Supports UID, TOKEN, ACCOUNT, and APIKEY.
auth-value String Yes Authentication value corresponding to auth-type.

3.1 How to Obtain Common parameters

In Aloudata CAN, select Metric Applications in the top navigation bar, then select API Integration in the left navigation menu. You can obtain tenant-id on the API Integration page. Set auth-value according to auth-type.

image.png

3.2 Request Body parameters:

parameter Type required Description
groups Array Yes user group list
∟ name String Yes user group name
∟ description String No user group description
∟ parentGroupId String No Parent user group ID or code (code is supported in code mode)
∟ code String No user group code (required in code mode)

4. Request Example:

curl --location 'http://localhost:8083/anymetrics/api/v1/userGroup/create' \
--header 'tenant-id: tn_21571046' \
--header 'auth-value: authority_test' \
--header 'auth-type: ACCOUNT' \
--header 'Content-Type: application/json' \
--data '{
  "groups": [
    {
      "name": "East China Sales Group",
      "description": "East China regional sales staff",
      "parentGroupId": "g_root",
      "code": "EAST_SALES"
    }
  ]
}'

5. Response Example:

{
    "data": [
        "17222d20-4a6f-43bf-a0d3-f7911c1eee19"
    ],
    "success": true,
    "code": "200",
    "errorMsg": null,
    "detailErrorMsg": null,
    "traceId": "27cb89dae3b64e238acc50d5458e93e5.187.17760667176470703"
}