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

# Delete a list of users

POST https://one.zuora.com/scim/v2/Users/delete
Content-Type: application/json

Sets multiple users to deactivate.
The value of the `id` should be the user's corresponding user ID.


Reference: https://zuora.ferndocs.com/developers/api-reference/zuora-api/oneid/scim/delete-a-list-of-users

## Authentication

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

## Request

### Headers

- `Idempotency-Key` (string, optional) — Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types. With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident.
- `Accept-Encoding` (string, optional) — Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it.
- `Content-Encoding` (string, optional) — Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload.
- `Zuora-Track-Id` (string, optional) — A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`"`), and quote (`'`).
- `Zuora-Entity-Ids` (string, optional) — An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you should not set this header.

### Body (application/json)

This endpoint expects a list of string.

- `list of string`

## Response

### 200

OK

- `resources` (list of ScimV2UsersDeletePostResponsesContentApplicationJsonSchemaResourcesItems, optional)
- `externalId` (string, optional, nullable) — An external identifier associated with the collection of resources, if available.
- `id` (string, optional, nullable) — The unique identifier for the collection of resources.
- `itemsPerPage` (integer, optional) — The number of items returned per page in the response.
- `meta` (ScimV2UsersDeletePostResponsesContentApplicationJsonSchemaMeta, optional, nullable)
- `schemas` (list of string, optional) — A list of URNs for SCIM schemas applicable to the collection of resources.
- `startIndex` (integer, optional) — The index of the first item in the current page of results.
- `totalResults` (long, optional) — The total number of results available across all pages.

### 201

Created

- `schemas` (list of string, optional) — A list of URNs for SCIM schemas that this resource conforms to.
- `id` (string, optional) — The unique identifier for the resource.
- `meta` (ScimV2UsersDeletePostResponsesContentApplicationJsonSchemaMeta, optional)
- `userName` (string, optional) — The username of the user.
- `name` (ScimV2UsersDeletePostResponsesContentApplicationJsonSchemaName, optional)
- `displayName` (string, optional) — The display name of the user.
- `preferredLanguage` (string, optional) — The preferred language of the user.
- `locale` (string, optional) — The locale of the user, typically in the format 'language-COUNTRY' (e.g., 'en-US').
- `active` (boolean, optional) — Indicates whether the user is active.
- `emails` (list of ScimV2UsersDeletePostResponsesContentApplicationJsonSchemaEmailsItems, optional) — A list of email addresses associated with the user.
- `groups` (list of ScimV2UsersDeletePostResponsesContentApplicationJsonSchemaGroupsItems, optional) — A list of groups the user is a member of.
- `roles` (list of ScimV2UsersDeletePostResponsesContentApplicationJsonSchemaRolesItems, optional) — A list of roles assigned to the user.
- `urn:zuora:scim:schemas:1.0:UserExtension` (ScimV2UsersDeletePostResponsesContentApplicationJsonSchemaUrnZuoraScimSchemas10UserExtension, optional)

## Errors

### 401 Unauthorized Error

Unauthorized

- `success` (boolean, optional) — Indicates whether the request was successful. A value of `false` indicates that an error occurred.
- `reasons` (list of ScimV2UsersDeletePostResponsesContentApplicationJsonSchemaReasonsItems, optional)

### 403 Forbidden Error

Forbidden

- `timestamp` (datetime, optional) — The date and time when the error occurred, formatted according to ISO 8601.
- `status` (integer, optional) — The HTTP status code associated with the error response. Indicates the type of error that occurred.
- `error` (string, optional) — A short, descriptive name for the error. Often corresponds to the HTTP status code.
- `message` (string, optional) — A detailed message describing the error that occurred. This message is intended to help the client understand the nature of the problem.
- `path` (string, optional) — The URI path of the request that resulted in the error. This can help identify which resource or endpoint caused the issue.

### 404 Not Found Error

Not Found

- `schemas` (list of enum, optional) — A list of URNs indicating the schemas that describe the structure of the error response. This provides information on the format and content of the error message.
  - Allowed values: `urn:ietf:params:scim:api:messages:2.0:Error`
- `status` (string, optional) — A string representation of the HTTP status code indicating the error. This helps in identifying the type of error that occurred.
- `detail` (string, optional) — A detailed message providing additional context or explanation about the error. This helps in understanding the specific issue or reason for the error.

## Types

### ScimV2UsersDeletePostResponsesContentApplicationJsonSchemaResourcesItems

- `schemas` (list of string, optional)
- `externalId` (string, optional, nullable) — An external identifier associated with the resource, if available.
- `id` (string, optional, nullable) — The unique identifier assigned to the resource.
- `meta` (ScimV2UsersDeletePostResponsesContentApplicationJsonSchemaResourcesItemsMeta, optional, nullable)
- `schemaUrns` (list of string, optional) — A list of URNs for SCIM schemas that this resource conforms to.

### ScimV2UsersDeletePostResponsesContentApplicationJsonSchemaMeta

- `created` (datetime, optional) — The date and time when the resource was created.
- `resourceType` (string, optional) — The type of the resource (e.g., 'User').
- `location` (string, optional) — The URL where the resource can be accessed.

### ScimV2UsersDeletePostResponsesContentApplicationJsonSchemaName

- `formatted` (string, optional) — The full name of the user, formatted for display.
- `familyName` (string, optional) — The user's family (last) name.
- `givenName` (string, optional) — The user's given (first) name.

### ScimV2UsersDeletePostResponsesContentApplicationJsonSchemaEmailsItems

- `value` (string, optional) — The email address.
- `display` (string, optional) — A human-readable form of the email address.
- `type` (string, optional) — The type of email address (e.g., 'work', 'home').
- `primary` (boolean, optional) — Indicates whether this is the primary email address.

### ScimV2UsersDeletePostResponsesContentApplicationJsonSchemaGroupsItems

- `value` (string, optional) — The unique identifier for the group.
- `display` (string, optional) — The display name of the group.

### ScimV2UsersDeletePostResponsesContentApplicationJsonSchemaRolesItems

- `value` (string, optional) — The role assigned to the user.
- `display` (string, optional) — The display name of the role.

### ScimV2UsersDeletePostResponsesContentApplicationJsonSchemaUrnZuoraScimSchemas10UserExtension

- `schemas` (list of string, optional) — A list of URNs for SCIM schemas that this extension conforms to.
- `organizationId` (string, optional) — The identifier for the organization to which the user belongs.
- `status` (string, optional) — The status of the user (e.g., 'ACTIVE', 'INACTIVE').
- `ssoEnabled` (boolean, optional) — Indicates whether Single Sign-On (SSO) is enabled for the user.
- `region` (string, optional) — The region or geographic location associated with the user.

### ScimV2UsersDeletePostResponsesContentApplicationJsonSchemaReasonsItems

- `message` (string, optional) — A human-readable message describing the error or reason for the failure.
- `code` (string, optional) — A specific error code representing the type of error. This code can be used for programmatic error handling.

### ScimV2UsersDeletePostResponsesContentApplicationJsonSchemaResourcesItemsMeta

- `resourceType` (string, optional) — The type of resource (e.g., 'User').
- `location` (string, optional) — The URL where the resource can be accessed.
- `created` (string, optional) — The creation date and time when the resource was created.

## Examples

### SCIM_deleteAListOfUsers_example

**Request**

```json
[
  "ebc229f7-aef2-44ad-8e5f-9d1cf0b4c724",
  "bb5c5d37-0707-4aee-b4b2-c818f4b3503b"
]
```

**Response**

```json
{
  "resources": [
    {
      "schemas": [
        "urn:zuora:scim:schemas:1.0:UserExtension",
        "urn:ietf:params:scim:schemas:core:2.0:User"
      ],
      "id": "ebc229f7-aef2-44ad-8e5f-9d1cf0b4c724",
      "meta": {
        "resourceType": "User",
        "location": "http://localhost:9900/scim/v2/Users/delete/ebc229f7-aef2-44ad-8e5f-9d1cf0b4c724",
        "created": "2024-02-19T08:23:08.488Z"
      },
      "active": false,
      "displayName": "Amy Lawrence",
      "emails": [
        {
          "display": "0392538e-caf3-4125-aa1d-82fe1f5132b3@zuora.com",
          "primary": true,
          "type": "work",
          "value": "0392538e-caf3-4125-aa1d-82fe1f5132b3@zuora.com"
        }
      ],
      "locale": "en-US",
      "name": {
        "familyName": "Amy",
        "formatted": "Amy Lawrence",
        "givenName": "Lawrence"
      },
      "preferredLanguage": "en",
      "roles": [
        {
          "display": "USER",
          "value": "USER"
        }
      ],
      "urn:zuora:scim:schemas:1.0:UserExtension": {
        "organizationId": "5619df2e-fa8c-47fa-9c1e-16ab5af4936e",
        "region": "US",
        "schemas": [
          "urn:zuora:scim:schemas:1.0:UserExtension"
        ],
        "ssoEnabled": false,
        "status": "INACTIVE"
      },
      "userName": "0392538e-caf3-4125-aa1d-82fe1f5132b3"
    }
  ],
  "externalId": null,
  "id": null,
  "itemsPerPage": 2,
  "meta": null,
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:ListResponse"
  ],
  "startIndex": 1,
  "totalResults": 2
}
```

**SDK Code**

```python SCIM_deleteAListOfUsers_example
import requests

url = "https://one.zuora.com/scim/v2/Users/delete"

payload = ["ebc229f7-aef2-44ad-8e5f-9d1cf0b4c724", "bb5c5d37-0707-4aee-b4b2-c818f4b3503b"]
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript SCIM_deleteAListOfUsers_example
const url = 'https://one.zuora.com/scim/v2/Users/delete';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '["ebc229f7-aef2-44ad-8e5f-9d1cf0b4c724","bb5c5d37-0707-4aee-b4b2-c818f4b3503b"]'
};

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

```go SCIM_deleteAListOfUsers_example
package main

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

func main() {

	url := "https://one.zuora.com/scim/v2/Users/delete"

	payload := strings.NewReader("[\n  \"ebc229f7-aef2-44ad-8e5f-9d1cf0b4c724\",\n  \"bb5c5d37-0707-4aee-b4b2-c818f4b3503b\"\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_deleteAListOfUsers_example
require 'uri'
require 'net/http'

url = URI("https://one.zuora.com/scim/v2/Users/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  \"ebc229f7-aef2-44ad-8e5f-9d1cf0b4c724\",\n  \"bb5c5d37-0707-4aee-b4b2-c818f4b3503b\"\n]"

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

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

HttpResponse<String> response = Unirest.post("https://one.zuora.com/scim/v2/Users/delete")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("[\n  \"ebc229f7-aef2-44ad-8e5f-9d1cf0b4c724\",\n  \"bb5c5d37-0707-4aee-b4b2-c818f4b3503b\"\n]")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://one.zuora.com/scim/v2/Users/delete', [
  'body' => '[
  "ebc229f7-aef2-44ad-8e5f-9d1cf0b4c724",
  "bb5c5d37-0707-4aee-b4b2-c818f4b3503b"
]',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp SCIM_deleteAListOfUsers_example
using RestSharp;

var client = new RestClient("https://one.zuora.com/scim/v2/Users/delete");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "[\n  \"ebc229f7-aef2-44ad-8e5f-9d1cf0b4c724\",\n  \"bb5c5d37-0707-4aee-b4b2-c818f4b3503b\"\n]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift SCIM_deleteAListOfUsers_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["ebc229f7-aef2-44ad-8e5f-9d1cf0b4c724", "bb5c5d37-0707-4aee-b4b2-c818f4b3503b"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://one.zuora.com/scim/v2/Users/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()
```

### Example 2

**Request**

```json
[
  "ebc229f7-aef2-44ad-8e5f-9d1cf0b4c724",
  "bb5c5d37-0707-4aee-b4b2-c818f4b3503b"
]
```

**Response**

```json
{
  "application/json": {
    "value": {
      "active": false,
      "displayName": "Jane Doe",
      "emails": [
        {
          "display": "jane.doe@example.com",
          "primary": true,
          "type": "work",
          "value": "jane.doe@example.com"
        }
      ],
      "groups": [
        {
          "display": "Group 2",
          "value": "group2"
        }
      ],
      "id": "791aad21-0036-4138-b9b0-350516bac4ac",
      "locale": "en-US",
      "meta": {
        "created": "2023-07-13T06:15:25.836Z",
        "location": "http://localhost:9900/scim/v2/Users/791aad21-0036-4138-b9b0-350516bac4ac",
        "resourceType": "User"
      },
      "name": {
        "familyName": "Doe",
        "formatted": "Jane Doe",
        "givenName": "Jane"
      },
      "preferredLanguage": "en",
      "roles": [
        {
          "display": "USER",
          "value": "USER"
        }
      ],
      "schemas": [
        "urn:zuora:scim:schemas:1.0:UserExtension",
        "urn:ietf:params:scim:schemas:core:2.0:User"
      ],
      "urn:zuora:scim:schemas:1.0:UserExtension": {
        "organizationId": "org2",
        "region": "EU",
        "schemas": [
          "urn:zuora:scim:schemas:1.0:UserExtension"
        ],
        "ssoEnabled": false,
        "status": "INACTIVE"
      },
      "userName": "username2"
    }
  }
}
```

**SDK Code**

```python
import requests

url = "https://one.zuora.com/scim/v2/Users/delete"

payload = ["ebc229f7-aef2-44ad-8e5f-9d1cf0b4c724", "bb5c5d37-0707-4aee-b4b2-c818f4b3503b"]
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://one.zuora.com/scim/v2/Users/delete';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '["ebc229f7-aef2-44ad-8e5f-9d1cf0b4c724","bb5c5d37-0707-4aee-b4b2-c818f4b3503b"]'
};

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

```go
package main

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

func main() {

	url := "https://one.zuora.com/scim/v2/Users/delete"

	payload := strings.NewReader("[\n  \"ebc229f7-aef2-44ad-8e5f-9d1cf0b4c724\",\n  \"bb5c5d37-0707-4aee-b4b2-c818f4b3503b\"\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
require 'uri'
require 'net/http'

url = URI("https://one.zuora.com/scim/v2/Users/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  \"ebc229f7-aef2-44ad-8e5f-9d1cf0b4c724\",\n  \"bb5c5d37-0707-4aee-b4b2-c818f4b3503b\"\n]"

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

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

HttpResponse<String> response = Unirest.post("https://one.zuora.com/scim/v2/Users/delete")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("[\n  \"ebc229f7-aef2-44ad-8e5f-9d1cf0b4c724\",\n  \"bb5c5d37-0707-4aee-b4b2-c818f4b3503b\"\n]")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://one.zuora.com/scim/v2/Users/delete', [
  'body' => '[
  "ebc229f7-aef2-44ad-8e5f-9d1cf0b4c724",
  "bb5c5d37-0707-4aee-b4b2-c818f4b3503b"
]',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://one.zuora.com/scim/v2/Users/delete");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "[\n  \"ebc229f7-aef2-44ad-8e5f-9d1cf0b4c724\",\n  \"bb5c5d37-0707-4aee-b4b2-c818f4b3503b\"\n]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["ebc229f7-aef2-44ad-8e5f-9d1cf0b4c724", "bb5c5d37-0707-4aee-b4b2-c818f4b3503b"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://one.zuora.com/scim/v2/Users/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()
```