Skip to main content

Create a Group

Create a new group, checking if the group already exists before adding.

POST
/api/scim/v2/Groups

Headers

KeyValue
Acceptapplication/json
AuthorizationBearer <API Token>
Content-Typeapplication/json

Request Body

The request body should contain the following parameters:

{
"displayName": "Group Name",
"members": [
{
"value": "user1@example.com",
"display": "User 1"
},
{
"value": "user2@example.com",
"display": "User 2"
}
]
}

Example cURL

curl --location --request POST 'http://localhost:8080/api/scim/v2/Groups' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' \
--header 'Content-Type: application/json' \
--data-raw '{
"displayName": "Developers",
"members": [
{
"value": 1,
"display": "user1@example.com"
},
{
"value": 2,
"display": "user2@example.com"
}
]
}'

Responses

Status CodeDescriptionResponse
200Group created successfullyapplication/json
400Invalid Requestempty
401Unauthorizedempty
500Internal Server Errorempty

Sample response

200 : Group created successfully

{
"id": "123",
"displayName": "Developers",
"members": [
{
"value": 1,
"display": "user1@example.com"
},
{
"value": 2,
"display": "user2@example.com"
}
],
"meta": {
"location": "http://localhost:8080/api/scim/v2/Groups/123",
"created": "2023-08-04T08:38:02.3732123Z"
}
}