Updated on 2023-09-14 GMT+08:00

Creating a User Group

Function

This API is provided for the administrator to create a user group.

The API can be called using both the global endpoint and region-specific endpoints.

URI

POST /v3/groups

Request Parameters

Table 1 Parameters in the request header

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Fill application/json;charset=utf8 in this field.

X-Auth-Token

Yes

String

Access token issued to a user to bear its identity and permissions.

For details about the permissions required by the token, see Actions.

Table 2 Parameters in the request body

Parameter

Mandatory

Type

Description

group

Yes

Object

User group information.

Table 3 group

Parameter

Mandatory

Type

Description

description

No

String

User group description, which must contain less than or equal to 255 characters.

domain_id

No

String

Account ID. For details about how to obtain the account ID, see Obtaining Account, IAM User, Group, Project, Region, and Agency Information.

name

Yes

String

User group name, which must contain less than or equal to 64 characters.

Response Parameters

Table 4 Parameters in the response body

Parameter

Type

Description

group

Object

User group information.

Table 5 group

Parameter

Type

Description

description

String

User group description.

id

String

User group ID.

domain_id

String

ID of the account to which the user group belongs.

name

String

User group name.

links

Object

User group resource link.

create_time

Long

Time when the user group was created.

Example Request

Request for an administrator to create a user group named IAMGroup

POST https://iam.myhuaweicloud.eu/v3/groups
{
    "group": {
        "description": "IAMDescription",
        "domain_id": "d78cbac186b744899480f25bd0...",
        "name": "IAMGroup"
    }
}

Example Response

Status code: 201

The user group is created successfully.

{
    "group": {
        "description": "IAMDescription",
        "links": {
            "self": "https://iam.myhuaweicloud.eu/v3/groups/077a4c7bcd8010d53fb7c003e9d966c2"
        },
        "id": "077a4c7bcd8010d53fb7c003e9d966c2",
        "create_time": 1578969208707,
        "domain_id": "d78cbac186b744899480f25bd0...",
        "name": "IAMGroup"
    }
}

Status Codes

Status Code

Description

201

The user group is created successfully.

400

Invalid parameters.

401

Authentication failed.

403

Access denied.

409

A resource conflict occurs.

Error Codes

None