Group-User Assignment

Endpoints in this section allow you to assign users to groups.


Data Structures

GroupUser

Attribute

Type

Required

Description

id

string

Read-only; protected. Unique identifier.

group_id

string

yes

Immutable. Uniqueness is required in the combination of attribute group_id with attribute user_id. Requires rights on the group object: read for GET, user-add for POST, user-remove for DELETE.

user_id

string

yes

Immutable. Uniqueness is required in the combination of attribute user_id with attribute group_id. Requires read right on the user object for all operations.

group_name

string

Read-only; expensive to use.

user_name

string

Read-only; expensive to use.

created_at

datetime

Read-only. Timestamp of creation.

modified_at

datetime

Read-only. Timestamp of modification.

removed

boolean

Read-only.

Retrieve Available Attributes of the GroupUser

Request

Method

GET

Path

/api/v2/objspec/group_user

GET /api/v2/objspec/group_user

Example Request

curl -s -k -X GET \
  -H 'Authorization: sgfeea6jsaz4mum9su8w6' \
  'https://10.31.135.179/api/v2/objspec/group_user'

Get Group-User Assignment List

Request

Method

GET

Path

/api/v2/group/user

GET /api/v2/group/user

Example Request

curl -s -k -X GET \
  -H 'Authorization: sgfeea6jsaz4mum9su8w6' \
  'https://10.0.214.98/api/v2/group/user'

Response

{
    "result": "success",
    "group_user": [
        {
            "group_id": "9115285645797883906",
            "user_id": "9115285645797883906",
            "group_name": "QA_team",
            "user_name": "User_1",
            "created_at": "2025-05-07 23:56:45.451806-07",
            "modified_at": "2025-05-07 23:56:45.451806-07"
        },
        {
            "group_id": "9115285645797883906",
            "user_id": "9115285645797883907",
            "group_name": "QA_team",
            "user_name": "User_2",
            "created_at": "2025-05-07 23:56:45.462326-07",
            "modified_at": "2025-05-07 23:56:45.462326-07"
        }
    ]
}

Get Group-User Assignment by Their IDs

Request

Method

GET

Path

/group/<group_id>/user/<user_id>

GET /api/v2/group/<group_id>/user/<user_id>

Example Request

curl -s -k -X GET \
  -H 'Authorization: sgfeea6jsaz4mum9su8w6' \
  'https://10.0.214.98/api/v2/group/9115285645797883906/user/9115285645797883907'

Response

{
    "result": "success",
    "group_user": {
        "group_id": "9115285645797883906",
        "user_id": "9115285645797883907",
        "group_name": "QA_team",
        "user_name": "User_2",
        "created_at": "2025-05-07 23:56:45.462326-07",
        "modified_at": "2025-05-07 23:56:45.462326-07"
    }
}

Create Group-User Assignment

Request

Method

POST

Path

/api/v2/group/user

Headers

Content-Type: Application/json

Body

GroupUser

POST /api/v2/group/user

Example Request

curl -s -k -X POST \
  -H 'Authorization: sgfeea6jsaz4mum9su8w6' \
  -H 'Content-Type: application/json' \
  'https://10.0.214.98/api/v2/group/user' \
  -d'{"group_id":"9115285645797883906","user_id":"9115285645797883909"}'

Response

{
    "result": "success"
}

Delete Group-User Assignment

Request

Method

DELETE

Path

/api/v2/group/<group_id>/user/<user_id>

DELETE /api/v2/group/<group_id>/user/<user_id>

Example Request

curl -s -k -X DELETE \
  -H 'Authorization: sgfeea6jsaz4mum9su8w6' \
  'https://10.31.135.179/api/v2/group/9115285645797883906/user/9115285645797883909'

Response

{
    "result": "success"
}