> 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.

# Bulk delete groups

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

Permanently removes groups from an organization (members are not deleted, only the group).


Reference: https://zuora.ferndocs.com/developers/api-reference/zuora-api/oneid/scim/post-bulk-delete-groups

## 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

### Headers

- `Idempotency-Key` (string, optional)
- `Accept-Encoding` (string, optional)
- `Content-Encoding` (string, optional)
- `Authorization` (string, optional)
- `Zuora-Track-Id` (string, optional)
- `Zuora-Entity-Ids-Single` (string, optional)

### Body (application/json)

This endpoint expects an object.

- `schemas` (list of string, required)
- `operations` (list of ScimV2GroupsDeletePostRequestBodyContentApplicationJsonSchemaOperationsItems, required)

## Response

### 200

OK

- `schemas` (list of string, optional) — List of schema identifiers that define the structure of the response.
- `id` (string, optional, nullable)
- `externalId` (string, optional, nullable) — An external identifier for the resource, often used for integration with external systems.
- `meta` (ScimV2GroupsDeletePostResponsesContentApplicationJsonSchemaMeta, optional, nullable) — Metadata about the group resource.
- `totalResults` (integer, optional) — Total number of groups returned in the response.
- `resources` (list of ScimV2GroupsDeletePostResponsesContentApplicationJsonSchemaResourcesItems, optional) — List of group resources included in the response.
- `startIndex` (integer, optional)
- `itemsPerPage` (integer, optional)

### 201

Created

## Errors

### 401 Unauthorized Error

Unauthorized

- `success` (boolean, optional) — Indicates whether the request was successful (false in this case).
- `reasons` (list of ScimV2GroupsDeletePostResponsesContentApplicationJsonSchemaReasonsItems, optional) — List of reasons for the unauthorized error.

### 403 Forbidden Error

Forbidden

- `timestamp` (string, optional) — The time at which the error occurred.
- `status` (integer, optional) — HTTP status code indicating that the request is forbidden.
- `error` (string, optional) — Type of error indicating that access is forbidden.
- `message` (string, optional) — Description of why the request is forbidden.
- `path` (string, optional) — Endpoint path where the forbidden error occurred.

### 404 Not Found Error

Not Found

- `schemas` (list of string, optional) — List of schema identifiers that define the structure of the error response.
- `status` (string, optional) — HTTP status code indicating that the resource was not found.
- `detail` (string, optional) — Description of the error detailing why the resource was not found.

## Types

### ScimV2GroupsDeletePostRequestBodyContentApplicationJsonSchemaOperationsItems

- `op` (enum, optional)
  - Allowed values: `add`, `remove`, `replace`
- `path` (string, optional)
- `value` (list of ScimV2GroupsDeletePostRequestBodyContentApplicationJsonSchemaOperationsItemsValueItems, optional)

### ScimV2GroupsDeletePostResponsesContentApplicationJsonSchemaMeta

Metadata about the group resource.

- `resourceType` (string, optional) — Type of resource, which is 'Group' for this object.
- `location` (string, optional)

### ScimV2GroupsDeletePostResponsesContentApplicationJsonSchemaResourcesItems

- `schemas` (list of string, optional) — List of schema identifiers that define the format of the group resource.
- `id` (string, optional) — Unique identifier for the group.
- `externalId` (string, optional, nullable) — An external identifier for the resource, often used for integration with external systems.
- `displayName` (string, optional) — Name of the group.
- `urn:zuora:scim:schemas:1.0:GroupExtension` (ScimV2GroupsDeletePostResponsesContentApplicationJsonSchemaResourcesItemsUrnZuoraScimSchemas10GroupExtension, optional) — Custom attributes for the group defined by the extension schema.
- `meta` (ScimV2GroupsDeletePostResponsesContentApplicationJsonSchemaResourcesItemsMeta, optional) — Metadata about the group resource.

### ScimV2GroupsDeletePostResponsesContentApplicationJsonSchemaReasonsItems

- `message` (string, optional) — Message explaining why the request is unauthorized.
- `code` (string, optional) — Error code representing the unauthorized access issue.

### ScimV2GroupsDeletePostRequestBodyContentApplicationJsonSchemaOperationsItemsValueItems

- `value` (string, optional)

### ScimV2GroupsDeletePostResponsesContentApplicationJsonSchemaResourcesItemsUrnZuoraScimSchemas10GroupExtension

Custom attributes for the group defined by the extension schema.

- `description` (string, optional) — Additional description for the group.
- `organizationId` (string, optional) — Identifier for the organization associated with the group.
- `active` (boolean, optional) — Indicates whether the group is active.

### ScimV2GroupsDeletePostResponsesContentApplicationJsonSchemaResourcesItemsMeta

Metadata about the group resource.

- `resourceType` (string, optional) — Type of resource, which is 'Group' for this object.
- `location` (string, optional)

## Examples

### SCIM_postBulkDeleteGroups_example

**Request**

```json
{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:PatchOp"
  ],
  "operations": [
    {
      "op": "add",
      "path": "members",
      "value": [
        {
          "value": "71d3c0ec-48db-4522-b5c9-053e051204d7"
        },
        {
          "value": "62c20400-6470-4992-8a01-c181efc2ce54"
        }
      ]
    }
  ]
}
```

**Response**

```json
{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:ListResponse"
  ],
  "id": null,
  "externalId": null,
  "meta": null,
  "totalResults": 2,
  "resources": [
    {
      "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:Group",
        "urn:zuora:scim:schemas:1.0:GroupExtension"
      ],
      "id": "71d3c0ec-48db-4522-b5c9-053e051204d7",
      "displayName": "test_group_22",
      "urn:zuora:scim:schemas:1.0:GroupExtension": {
        "description": "",
        "organizationId": "5619df2e-fa8c-47fa-9c1e-16ab5af4936e",
        "active": false,
        "schemas": [
          "urn:zuora:scim:schemas:1.0:GroupExtension"
        ]
      },
      "meta": {
        "resourceType": "Group",
        "location": "http://localhost:9900/scim/v2/Groups/delete/71d3c0ec-48db-4522-b5c9-053e051204d7"
      }
    },
    {
      "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:Group",
        "urn:zuora:scim:schemas:1.0:GroupExtension"
      ],
      "id": "62c20400-6470-4992-8a01-c181efc2ce54",
      "displayName": "test_group_11",
      "urn:zuora:scim:schemas:1.0:GroupExtension": {
        "description": "",
        "organizationId": "5619df2e-fa8c-47fa-9c1e-16ab5af4936e",
        "active": false,
        "schemas": [
          "urn:zuora:scim:schemas:1.0:GroupExtension"
        ]
      },
      "meta": {
        "resourceType": "Group",
        "location": "http://localhost:9900/scim/v2/Groups/delete/62c20400-6470-4992-8a01-c181efc2ce54"
      }
    }
  ],
  "startIndex": 1,
  "itemsPerPage": 2
}
```

**SDK Code**

```python SCIM_postBulkDeleteGroups_example
import requests

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

payload = {
    "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
    "operations": [
        {
            "op": "add",
            "path": "members",
            "value": [{ "value": "71d3c0ec-48db-4522-b5c9-053e051204d7" }, { "value": "62c20400-6470-4992-8a01-c181efc2ce54" }]
        }
    ]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript SCIM_postBulkDeleteGroups_example
const url = 'https://rest.test.zuora.com/scim/v2/Groups/delete';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"schemas":["urn:ietf:params:scim:api:messages:2.0:PatchOp"],"operations":[{"op":"add","path":"members","value":[{"value":"71d3c0ec-48db-4522-b5c9-053e051204d7"},{"value":"62c20400-6470-4992-8a01-c181efc2ce54"}]}]}'
};

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

```go SCIM_postBulkDeleteGroups_example
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"schemas\": [\n    \"urn:ietf:params:scim:api:messages:2.0:PatchOp\"\n  ],\n  \"operations\": [\n    {\n      \"op\": \"add\",\n      \"path\": \"members\",\n      \"value\": [\n        {\n          \"value\": \"71d3c0ec-48db-4522-b5c9-053e051204d7\"\n        },\n        {\n          \"value\": \"62c20400-6470-4992-8a01-c181efc2ce54\"\n        }\n      ]\n    }\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_postBulkDeleteGroups_example
require 'uri'
require 'net/http'

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

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:api:messages:2.0:PatchOp\"\n  ],\n  \"operations\": [\n    {\n      \"op\": \"add\",\n      \"path\": \"members\",\n      \"value\": [\n        {\n          \"value\": \"71d3c0ec-48db-4522-b5c9-053e051204d7\"\n        },\n        {\n          \"value\": \"62c20400-6470-4992-8a01-c181efc2ce54\"\n        }\n      ]\n    }\n  ]\n}"

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

```java SCIM_postBulkDeleteGroups_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/delete")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"schemas\": [\n    \"urn:ietf:params:scim:api:messages:2.0:PatchOp\"\n  ],\n  \"operations\": [\n    {\n      \"op\": \"add\",\n      \"path\": \"members\",\n      \"value\": [\n        {\n          \"value\": \"71d3c0ec-48db-4522-b5c9-053e051204d7\"\n        },\n        {\n          \"value\": \"62c20400-6470-4992-8a01-c181efc2ce54\"\n        }\n      ]\n    }\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://rest.test.zuora.com/scim/v2/Groups/delete', [
  'body' => '{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:PatchOp"
  ],
  "operations": [
    {
      "op": "add",
      "path": "members",
      "value": [
        {
          "value": "71d3c0ec-48db-4522-b5c9-053e051204d7"
        },
        {
          "value": "62c20400-6470-4992-8a01-c181efc2ce54"
        }
      ]
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp SCIM_postBulkDeleteGroups_example
using RestSharp;

var client = new RestClient("https://rest.test.zuora.com/scim/v2/Groups/delete");
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:api:messages:2.0:PatchOp\"\n  ],\n  \"operations\": [\n    {\n      \"op\": \"add\",\n      \"path\": \"members\",\n      \"value\": [\n        {\n          \"value\": \"71d3c0ec-48db-4522-b5c9-053e051204d7\"\n        },\n        {\n          \"value\": \"62c20400-6470-4992-8a01-c181efc2ce54\"\n        }\n      ]\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift SCIM_postBulkDeleteGroups_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
  "operations": [
    [
      "op": "add",
      "path": "members",
      "value": [["value": "71d3c0ec-48db-4522-b5c9-053e051204d7"], ["value": "62c20400-6470-4992-8a01-c181efc2ce54"]]
    ]
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://rest.test.zuora.com/scim/v2/Groups/delete")! 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()
```

### SCIM_postBulkDeleteGroups_example

**Request**

```json
{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:PatchOp"
  ],
  "operations": [
    {
      "op": "add",
      "path": "members",
      "value": [
        {
          "value": "71d3c0ec-48db-4522-b5c9-053e051204d7"
        },
        {
          "value": "62c20400-6470-4992-8a01-c181efc2ce54"
        }
      ]
    }
  ]
}
```

**Response**

```json
{}
```

**SDK Code**

```python SCIM_postBulkDeleteGroups_example
import requests

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

payload = {
    "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
    "operations": [
        {
            "op": "add",
            "path": "members",
            "value": [{ "value": "71d3c0ec-48db-4522-b5c9-053e051204d7" }, { "value": "62c20400-6470-4992-8a01-c181efc2ce54" }]
        }
    ]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript SCIM_postBulkDeleteGroups_example
const url = 'https://rest.test.zuora.com/scim/v2/Groups/delete';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"schemas":["urn:ietf:params:scim:api:messages:2.0:PatchOp"],"operations":[{"op":"add","path":"members","value":[{"value":"71d3c0ec-48db-4522-b5c9-053e051204d7"},{"value":"62c20400-6470-4992-8a01-c181efc2ce54"}]}]}'
};

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

```go SCIM_postBulkDeleteGroups_example
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"schemas\": [\n    \"urn:ietf:params:scim:api:messages:2.0:PatchOp\"\n  ],\n  \"operations\": [\n    {\n      \"op\": \"add\",\n      \"path\": \"members\",\n      \"value\": [\n        {\n          \"value\": \"71d3c0ec-48db-4522-b5c9-053e051204d7\"\n        },\n        {\n          \"value\": \"62c20400-6470-4992-8a01-c181efc2ce54\"\n        }\n      ]\n    }\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_postBulkDeleteGroups_example
require 'uri'
require 'net/http'

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

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:api:messages:2.0:PatchOp\"\n  ],\n  \"operations\": [\n    {\n      \"op\": \"add\",\n      \"path\": \"members\",\n      \"value\": [\n        {\n          \"value\": \"71d3c0ec-48db-4522-b5c9-053e051204d7\"\n        },\n        {\n          \"value\": \"62c20400-6470-4992-8a01-c181efc2ce54\"\n        }\n      ]\n    }\n  ]\n}"

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

```java SCIM_postBulkDeleteGroups_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/delete")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"schemas\": [\n    \"urn:ietf:params:scim:api:messages:2.0:PatchOp\"\n  ],\n  \"operations\": [\n    {\n      \"op\": \"add\",\n      \"path\": \"members\",\n      \"value\": [\n        {\n          \"value\": \"71d3c0ec-48db-4522-b5c9-053e051204d7\"\n        },\n        {\n          \"value\": \"62c20400-6470-4992-8a01-c181efc2ce54\"\n        }\n      ]\n    }\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://rest.test.zuora.com/scim/v2/Groups/delete', [
  'body' => '{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:PatchOp"
  ],
  "operations": [
    {
      "op": "add",
      "path": "members",
      "value": [
        {
          "value": "71d3c0ec-48db-4522-b5c9-053e051204d7"
        },
        {
          "value": "62c20400-6470-4992-8a01-c181efc2ce54"
        }
      ]
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp SCIM_postBulkDeleteGroups_example
using RestSharp;

var client = new RestClient("https://rest.test.zuora.com/scim/v2/Groups/delete");
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:api:messages:2.0:PatchOp\"\n  ],\n  \"operations\": [\n    {\n      \"op\": \"add\",\n      \"path\": \"members\",\n      \"value\": [\n        {\n          \"value\": \"71d3c0ec-48db-4522-b5c9-053e051204d7\"\n        },\n        {\n          \"value\": \"62c20400-6470-4992-8a01-c181efc2ce54\"\n        }\n      ]\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift SCIM_postBulkDeleteGroups_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
  "operations": [
    [
      "op": "add",
      "path": "members",
      "value": [["value": "71d3c0ec-48db-4522-b5c9-053e051204d7"], ["value": "62c20400-6470-4992-8a01-c181efc2ce54"]]
    ]
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://rest.test.zuora.com/scim/v2/Groups/delete")! 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()
```