---
title: "Creating an OCI Group and Adding the Service User to it (REST)"
slug: "creating-an-oci-group-and-adding-the-service-user-to-it-rest"
updated: 2026-06-29T12:45:47Z
published: 2026-06-29T12:45:47Z
canonical: "docs.britive.com/creating-an-oci-group-and-adding-the-service-user-to-it-rest"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.britive.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Creating an OCI Group and Adding the Service User to it (REST)

1. Use the following cURL command to create an OCI group:

```shell
curl -X POST <DOMAIN_URL>/admin/v1/Groups \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -H "Content-Type: application/scim+json" \
  -d '{
    "schemas": ["urn:ietf:params:scim:schemas:core:2.0:Group"],
    "displayName": "<DISPLAY_NAME>"
  }'
```

Replace the following fields in the above CURL:

| Parameter | Value |
| --- | --- |
| **<DOMAIN_URL>** | The domain URL of your Oracle Cloud. |
| **<ACCESS_TOKEN>** | The access token you got from this step: [Getting an OCI access token (REST)](/v1/docs/getting-an-oci-access-token-rest) |
| **<DISPLAY_NAME>** | Give any display name |

1. Use the following cURL command to add the service user to the group:

```shell
curl -X PATCH <DOMAIN_URL>/admin/v1/Groups/<GROUP_ID> \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -H "Content-Type: application/scim+json" \
  -d '{
    "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
    "Operations": [{"op":"add","path":"members",
      "value":[{"value":"<USER_ID>","type":"User"}]}]
  }'
```

Replace the following fields in the above cURL command:

| Parameter | Value |
| --- | --- |
| **<DOMAIN_URL>** | The domain URL of your Oracle Cloud. |
| **<ACCESS_TOKEN>** | The access token you got from this step: [Getting an OCI access token (REST)](/v1/docs/getting-an-oci-access-token-rest) |
| **<GROUP_ID>** | The ID of the group that we had created in step #1. |
| **<USER_ID>** | The ID of the service user that we had created in this article: [Creating an OCI Service User (REST)](/v1/docs/creating-an-oci-service-user-rest). |
