> This page is for Developers.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://zuora.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://zuora.ferndocs.com/_mcp/server.

# Create a group

POST https://rest.test.zuora.com/scim/v2/Groups
Content-Type: application/json

Creates a new group. Must include the displayName attribute. Users can be added to the group during creation by supplying the user ID values in the members array attribute.

Reference: https://zuora.ferndocs.com/developers/api-reference/zuora-api/oneid/scim/create-a-new-group

## Authentication

- `Authorization` header (bearer token, required) — Use `Bearer {{token}}` in the `Authorization` header for authentication.

## Servers

- `https://rest.test.zuora.com` (US Developer & Central Sandbox (incl. Test Drive), default)
- `https://rest.sandbox.na.zuora.com` (US API Sandbox Cloud 1)
- `https://rest.apisandbox.zuora.com` (US API Sandbox Cloud 2)
- `https://rest.na.zuora.com` (US Production Cloud 1)
- `https://rest.zuora.com` (US Production Cloud 2)
- `https://rest.test.eu.zuora.com` (EU Developer & Central Sandbox)
- `https://rest.sandbox.eu.zuora.com` (EU API Sandbox)
- `https://rest.eu.zuora.com` (EU Production)
- `https://rest.test.ap.zuora.com` (APAC Developer & Central Sandbox)
- `https://rest.ap.zuora.com` (APAC Production)

## Request

### Query parameters

- `count` (integer, optional) — The number of records returned per page in the response.
- `filter` (string, optional) — The filter used to filter the group, either by organization id.
- `startIndex` (integer, optional) — The index number of the page that you want to retrieve. You must set count before specifying startIndex. For example, if you set count to 20 and startIndex to 2, the 21st to 40th records are returned in the response.

### Body (application/json)

This endpoint expects an object.

- `schemas` (list of string, optional) — List of schema URNs defining the structure of the group resource.
- `displayName` (string, optional) — Name of the group.
- `urn:zuora:scim:schemas:1.0:GroupExtension` (ScimV2GroupsPostRequestBodyContentApplicationJsonSchemaUrnZuoraScimSchemas10GroupExtension, optional)

## Response

### 201

Created

- `schemas` (list of string, optional)
- `id` (string, optional) — Unique identifier for the group.
- `displayName` (string, optional) — Name of the group.
- `urn:zuora:scim:schemas:1.0:GroupExtension` (ScimV2GroupsPostResponsesContentApplicationJsonSchemaUrnZuoraScimSchemas10GroupExtension, optional) — Custom extension schema with additional group attributes.
- `meta` (ScimV2GroupsPostResponsesContentApplicationJsonSchemaMeta, optional) — Metadata about the resource.

## Errors

### 401 Unauthorized Error

Unauthorized

- `success` (boolean, optional) — Indicates if the request was successful (false for errors).
- `reasons` (list of ScimV2GroupsPostResponsesContentApplicationJsonSchemaReasonsItems, optional) — List of reasons for the unauthorized error.

### 403 Forbidden Error

Forbidden

- `timestamp` (string, optional) — Time when the error occurred.
- `status` (integer, optional) — HTTP status code.
- `error` (string, optional) — Error type.
- `message` (string, optional) — Details about the access denial.
- `path` (string, optional) — Endpoint path where the error occurred.

### 404 Not Found Error

Not Found

- `schemas` (list of string, optional) — List of schema identifiers that define the format of the group resource.
- `status` (string, optional) — HTTP status code.
- `detail` (string, optional) — Reason for the resource not being found.

## Types

### ScimV2GroupsPostRequestBodyContentApplicationJsonSchemaUrnZuoraScimSchemas10GroupExtension

- `schemas` (list of string, optional) — List of URNs for the extension schemas.
- `description` (string, optional) — Description of the group.
- `organizationId` (string, optional) — Identifier for the associated organization.

### ScimV2GroupsPostResponsesContentApplicationJsonSchemaUrnZuoraScimSchemas10GroupExtension

Custom extension schema with additional group attributes.

- `schemas` (list of string, optional) — List of schema identifiers that define the format of the group resource.
- `description` (string, optional) — Description of the group.
- `organizationId` (string, optional) — Identifier for the associated organization.
- `active` (boolean, optional) — Indicates if the group is active.

### ScimV2GroupsPostResponsesContentApplicationJsonSchemaMeta

Metadata about the resource.

- `resourceType` (string, optional) — Type of the resource.
- `location` (string, optional) — URL of the group resource.

### ScimV2GroupsPostResponsesContentApplicationJsonSchemaReasonsItems

- `message` (string, optional) — Error message.
- `code` (string, optional) — Error code.

## Examples

**Request**

```json
{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:Group",
    "urn:zuora:scim:schemas:1.0:GroupExtension"
  ],
  "displayName": "Amy Laurance test scim",
  "urn:zuora:scim:schemas:1.0:GroupExtension": {
    "schemas": [
      "urn:zuora:scim:schemas:1.0:GroupExtension"
    ],
    "description": "",
    "organizationId": "ec141dc2-901e-4813-a25d-ef480cff1e26"
  }
}
```

**Response**

```json
{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:Group",
    "urn:zuora:scim:schemas:1.0:GroupExtension"
  ],
  "id": "6cd663a3-39b6-49bf-9ec0-113381e40669",
  "displayName": "Amy Lawrence",
  "urn:zuora:scim:schemas:1.0:GroupExtension": {
    "schemas": [
      "urn:zuora:scim:schemas:1.0:GroupExtension"
    ],
    "description": "",
    "organizationId": "ec141dc2-901e-4813-a25d-ef480cff1e26",
    "active": true
  },
  "meta": {
    "resourceType": "Group",
    "location": "http://localhost:9900/scim/v2/Groups/6cd663a3-39b6-49bf-9ec0-113381e40669"
  }
}
```

**SDK Code**

```python SCIM_createANewGroup_example
import requests

url = "https://rest.test.zuora.com/scim/v2/Groups"

payload = {
    "schemas": ["urn:ietf:params:scim:schemas:core:2.0:Group", "urn:zuora:scim:schemas:1.0:GroupExtension"],
    "displayName": "Amy Laurance test scim",
    "urn:zuora:scim:schemas:1.0:GroupExtension": {
        "schemas": ["urn:zuora:scim:schemas:1.0:GroupExtension"],
        "description": "",
        "organizationId": "ec141dc2-901e-4813-a25d-ef480cff1e26"
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript SCIM_createANewGroup_example
const url = 'https://rest.test.zuora.com/scim/v2/Groups';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"schemas":["urn:ietf:params:scim:schemas:core:2.0:Group","urn:zuora:scim:schemas:1.0:GroupExtension"],"displayName":"Amy Laurance test scim","urn:zuora:scim:schemas:1.0:GroupExtension":{"schemas":["urn:zuora:scim:schemas:1.0:GroupExtension"],"description":"","organizationId":"ec141dc2-901e-4813-a25d-ef480cff1e26"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go SCIM_createANewGroup_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://rest.test.zuora.com/scim/v2/Groups"

	payload := strings.NewReader("{\n  \"schemas\": [\n    \"urn:ietf:params:scim:schemas:core:2.0:Group\",\n    \"urn:zuora:scim:schemas:1.0:GroupExtension\"\n  ],\n  \"displayName\": \"Amy Laurance test scim\",\n  \"urn:zuora:scim:schemas:1.0:GroupExtension\": {\n    \"schemas\": [\n      \"urn:zuora:scim:schemas:1.0:GroupExtension\"\n    ],\n    \"description\": \"\",\n    \"organizationId\": \"ec141dc2-901e-4813-a25d-ef480cff1e26\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby SCIM_createANewGroup_example
require 'uri'
require 'net/http'

url = URI("https://rest.test.zuora.com/scim/v2/Groups")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"schemas\": [\n    \"urn:ietf:params:scim:schemas:core:2.0:Group\",\n    \"urn:zuora:scim:schemas:1.0:GroupExtension\"\n  ],\n  \"displayName\": \"Amy Laurance test scim\",\n  \"urn:zuora:scim:schemas:1.0:GroupExtension\": {\n    \"schemas\": [\n      \"urn:zuora:scim:schemas:1.0:GroupExtension\"\n    ],\n    \"description\": \"\",\n    \"organizationId\": \"ec141dc2-901e-4813-a25d-ef480cff1e26\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java SCIM_createANewGroup_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://rest.test.zuora.com/scim/v2/Groups")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"schemas\": [\n    \"urn:ietf:params:scim:schemas:core:2.0:Group\",\n    \"urn:zuora:scim:schemas:1.0:GroupExtension\"\n  ],\n  \"displayName\": \"Amy Laurance test scim\",\n  \"urn:zuora:scim:schemas:1.0:GroupExtension\": {\n    \"schemas\": [\n      \"urn:zuora:scim:schemas:1.0:GroupExtension\"\n    ],\n    \"description\": \"\",\n    \"organizationId\": \"ec141dc2-901e-4813-a25d-ef480cff1e26\"\n  }\n}")
  .asString();
```

```php SCIM_createANewGroup_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://rest.test.zuora.com/scim/v2/Groups', [
  'body' => '{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:Group",
    "urn:zuora:scim:schemas:1.0:GroupExtension"
  ],
  "displayName": "Amy Laurance test scim",
  "urn:zuora:scim:schemas:1.0:GroupExtension": {
    "schemas": [
      "urn:zuora:scim:schemas:1.0:GroupExtension"
    ],
    "description": "",
    "organizationId": "ec141dc2-901e-4813-a25d-ef480cff1e26"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp SCIM_createANewGroup_example
using RestSharp;

var client = new RestClient("https://rest.test.zuora.com/scim/v2/Groups");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"schemas\": [\n    \"urn:ietf:params:scim:schemas:core:2.0:Group\",\n    \"urn:zuora:scim:schemas:1.0:GroupExtension\"\n  ],\n  \"displayName\": \"Amy Laurance test scim\",\n  \"urn:zuora:scim:schemas:1.0:GroupExtension\": {\n    \"schemas\": [\n      \"urn:zuora:scim:schemas:1.0:GroupExtension\"\n    ],\n    \"description\": \"\",\n    \"organizationId\": \"ec141dc2-901e-4813-a25d-ef480cff1e26\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift SCIM_createANewGroup_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "schemas": ["urn:ietf:params:scim:schemas:core:2.0:Group", "urn:zuora:scim:schemas:1.0:GroupExtension"],
  "displayName": "Amy Laurance test scim",
  "urn:zuora:scim:schemas:1.0:GroupExtension": [
    "schemas": ["urn:zuora:scim:schemas:1.0:GroupExtension"],
    "description": "",
    "organizationId": "ec141dc2-901e-4813-a25d-ef480cff1e26"
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://rest.test.zuora.com/scim/v2/Groups")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```