• Identity and Access Management

iam
  1. Help Center
  2. Identity and Access Management
  3. API Reference
  4. User Group Management
  5. Creating a User Group

Creating a User Group

Function Description

This interface is used to create a user group.

URI

URI format

POST /v3/groups

Request

  • Request header parameter description

    Parameter

    Mandatory

    Type

    Description

    Content-Type

    Yes

    String

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

    X-Auth-Token

    Yes

    String

    Authenticated token with the Security Administrator permission.

  • Request body parameter description

    Parameter

    Mandatory

    Type

    Description

    description

    No

    String

    Description for a user group. The length is less than or equal to 255 bytes.

    domain_id

    No

    String

    ID of the domain to which a user group belongs.

    name

    Yes

    String

    Name of a user group. The length is less than or equal to 64 bytes.

  • Sample request
    curl -i -k -H 'Accept:application/json' -H 'Content-Type:application/json;charset=utf8' -H "X-Auth-Token:$token" -X POST -d'{"group": {"description": "Contract developers","domain_id": "d54061ebcb5145dd814f8eb3fe9b7ac0","name": "jixiang2"}}' https://172.30.48.86:31943/v3/groups

Response

  • Response body parameter description

    Parameter

    Mandatory

    Type

    Description

    description

    Yes

    String

    Description for a user group.

    domain_id

    Yes

    String

    ID of the domain to which a user group belongs.

    id

    Yes

    String

    ID of a user group.

    links

    Yes

    JSONObject

    Links to a user group.

    name

    Yes

    String

    Name of a user group.

  • Sample response
    {
        "group":{ 
            "domain_id":"d54061ebcb5145dd814f8eb3fe9b7ac0",
            "description":"Contract developers",
            "id":"ab9f261180d746ef8624beb5ae39b5aa",
            "links":{
                "self":"https://sample.domain.com/v3/groups/ab9f261180d746ef8624beb5ae39b5aa"
            },
            "name":"abcdef"
        }
    }

Status Codes

Status Code

Description

201

The user group is successfully created.

400

The server failed to process the request.

401

You must enter a username and password to access the requested page.

403

You are forbidden to access the requested page.

409

A resource conflict occurs.