# SCIM UserGroup examples

## Operations

This page shows the operations that can be performed for the object that establishes the relationship between groups and users. You can add, delete and or modify users in a group.

### List all

##### Request

```MarkDown
GET https://<your-domain>/soffid/webservice/scim2/v1/UserGroup
```

##### Response 200 OK

```JSON
{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:ListResponse"
  ],
  "totalResults": 1,
  "startIndex": 1,
  "Resources": [
    {
      "updatedBy": "admin",
      "groupId": 647,
      "start": "2026-03-06 09:08:42",
      "fullName": "Cas Kelp",
      "updatedOn": "2026-03-06 09:08:42",
      "userId": 18327,
      "createdOn": "2026-03-06 09:08:42",
      "groupDescription": "World",
      "createdBy": "admin",
      "meta": {
        "location": "https://console.soffid4.local:8443/soffid/webservice/scim2/v1/UserGroup/24560",
        "resourceType": "UserGroup"
      },
      "schemas": [
        "urn:soffid:com.soffid.iam.iga.api.UserGroup"
      ],
      "disabled": false,
      "attributes": {},
      "id": 24560,
      "user": "ckelp",
      "primaryGroup": true,
      "group": "world"
    }
  ]
}
```

### List by filter

List all GroupUsers with a filter expression.

<p class="callout info">It is allowed to use pagination and sort the information, for more information visit the [Sorting](https://bookstack.soffid.com/link/116#bkmrk-sorting) and [Pagination](https://bookstack.soffid.com/link/116#bkmrk-pagination) information.</p>

##### Request

```MarkDown
GET https://<your-domain>/soffid/webservice/scim2/v1/UserGroup?filter=groupDescription co  "wo"
```

##### Response 200 OK

```JSON
{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:ListResponse"
  ],
  "totalResults": 1,
  "startIndex": 1,
  "Resources": [
    {
      "updatedBy": "admin",
      "groupId": 647,
      "start": "2026-03-06 09:08:42",
      "fullName": "Cas Kelp",
      "updatedOn": "2026-03-06 09:08:42",
      "userId": 18327,
      "createdOn": "2026-03-06 09:08:42",
      "groupDescription": "World",
      "createdBy": "admin",
      "meta": {
        "location": "https://console.soffid4.local:8443/soffid/webservice/scim2/v1/UserGroup/24560",
        "resourceType": "UserGroup"
      },
      "schemas": [
        "urn:soffid:com.soffid.iam.iga.api.UserGroup"
      ],
      "disabled": false,
      "attributes": {},
      "id": 24560,
      "user": "ckelp",
      "primaryGroup": true,
      "group": "world"
    }
  ]
}
```

### Query by id

Query a GroupUser by its id (primary key).

##### Request

```MarkDown
GET https://<your-domain>/soffid/webservice/scim2/v1/UserGroup/1974296
```

##### Response 200 OK

```JSON
{
    "groupDescription": "Help desk support team",
    "meta": {
        "location": "http://soffid.pat.lab:8080/soffid/webservice/scim2/v1/UserGroup/1974296",
        "resourceType": "UserGroup"
    },
    "schemas": [
        "urn:soffid:com.soffid.iam.api.UserGroup"
    ],
    "start": "2021-05-05 12:49:51",
    "fullName": "John Smith",
    "disabled": false,
    "attributes": {
        "startDate": "2021-05-04 00:00:00"
    },
    "id": 1974296,
    "user": "jsmith",
    "primaryGroup": false,
    "group": "it"
}
```

### Create

This option allows you to add a user to a specific group.

#### Request

```XML
POST https://<your-domain>/soffid/webservice/scim2/v1/UserGroup
```

**JSON**

```JSON
{
    "schemas": [
        "urn:soffid:com.soffid.iam.iga.api.UserGroup"
    ],
    "group": "world",
    "groupDescription": "Help desk support team",
    "user": "ckelp",
    "fullName": "Casey Kelp",
    "primaryGroup": true,
    "attributes": {}
}
```

##### Response 201 Created

```JSON
{
  "updatedBy": "admin",
  "groupId": 647,
  "start": "2026-03-06 09:08:42.103",
  "fullName": "Cas Kelp",
  "updatedOn": "2026-03-06 09:08:42.136",
  "userId": 18327,
  "createdOn": "2026-03-06 09:08:42.128",
  "groupDescription": "World",
  "createdBy": "admin",
  "meta": {
    "location": "https://console.soffid4.local:8443/soffid/webservice/scim2/v1/UserGroup/24560",
    "resourceType": "UserGroup"
  },
  "schemas": [
    "urn:soffid:com.soffid.iam.iga.api.UserGroup"
  ],
  "disabled": false,
  "attributes": {},
  "id": 24560,
  "user": "ckelp",
  "primaryGroup": true,
  "group": "world"
}
```

### Update partial

Only attributes with changes will be updated, the other will maintain the same value.

##### Request

```
PATCH https://<your-domain>/soffid/webservice/scim2/v1/UserGroup/1976741
```

**JSON**

```JSON
{
    "Operations": [
        {
            "op": "replace",
            "path": "groupDescription",
            "value": "Enterprise engineering team"
        },
        {
            "op": "replace",
            "path": "group",
            "value": "EngineeringTeam"
        }
    ]
}
```

##### Response 200 OK

```JSON
{
    "groupDescription": "Enterprise engineering team",
    "meta": {
        "location": "http://soffid.pat.lab:8080/soffid/webservice/scim2/v1/GroupUser/1976741",
        "resourceType": "GroupUser"
    },
    "schemas": [
        "urn:soffid:com.soffid.iam.api.GroupUser"
    ],
    "start": "2021-05-11 10:39:23",
    "fullName": "Casey Kelp",
    "disabled": false,
    "attributes": {},
    "id": 1976741,
    "user": "ckelp",
    "primaryGroup": true,
    "group": "EngineeringTeam"
}
```

### Update all

This operation replaces all values in the GroupUser.

- Note that the attribute id is required to confirm that the resource "...GroupUser/&lt;id&gt;" is the same that the JSON GroupUser.
- Note that all the attributes not included in the request will be cleared in the GroupUser type and their data will be lost.
- Note that not all the attributes are updatable, for example, tag meta, avoid these tags. For more information see [Resource data model page](https://bookstack.soffid.com/books/scim/chapter/resource-data-model-schema)

##### Request

```XML
PUT https://<your-domain>/soffid/webservice/scim2/v1/UserGroup/1976741
```

**JSON**

```JSON
{
    "schemas": [
        "urn:soffid:com.soffid.iam.iga.api.GroupUser"
    ],
    "id": 1976741,
    "group": "it",
    "groupDescription": "Help desk support team",
     "user": "ckelp",
    "fullName": "Casey Kelp",
    "primaryGroup": true,
    "attributes": {}
}
```

##### Response 200 OK

```JSON
{
    "groupDescription": "Help desk support team",
    "meta": {
        "location": "http://soffid.pat.lab:8080/soffid/webservice/scim2/v1/GroupUser/1976741",
        "resourceType": "GroupUser"
    },
    "schemas": [
        "urn:soffid:com.soffid.iam.api.GroupUser"
    ],
    "fullName": "Casey Kelp",
    "disabled": false,
    "attributes": {},
    "id": 1976741,
    "user": "ckelp",
    "primaryGroup": true,
    "group": "it"
}
```

### Delete

This option allows you to remove a user from a specific group.

<p class="callout warning">Please note after this delete, the group user has to be created again to use it in the next examples.</p>

##### Request

```MarkDown
DELETE https://<your-omain>/soffid/webservice/scim2/v1/UserGroup/1976741
```

##### Response 204 No Content

```
204 No Content
```

### Error response

<p class="callout info">For more information about error response visit [https://bookstack.soffid.com/link/116#bkmrk-error-response](https://bookstack.soffid.com/link/116#bkmrk-error-response)</p>