> 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 update users

PATCH https://one.zuora.com/scim/v2/Users/bulk
Content-Type: application/json

Updates an existing multiple user resource, overwriting values for specified attributes.

Reference: https://zuora.ferndocs.com/developers/api-reference/zuora-api/oneid/scim/bulk-update-users

## Authentication

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

## Request

### Body (application/json)

This endpoint expects a list of ScimV2UsersBulkPatchRequestBodyContentApplicationJsonSchemaItems.

- `list of ScimV2UsersBulkPatchRequestBodyContentApplicationJsonSchemaItems`

## Response

### 200

OK

- `itemsPerPage` (integer, optional) — The items that are allowed on each page.
- `startIndex` (integer, optional)
- `schemas` (list of string, optional) — A list of schema URNs that apply to this resource, indicating the structure and attributes of the response.
- `id` (string, optional, nullable) — A unique identifier for the response resource, typically the ID of the user or group.
- `externalId` (string, optional, nullable) — An external identifier for the resource, often used for integration with external systems.
- `meta` (ScimV2UsersBulkPatchResponsesContentApplicationJsonSchemaMeta, optional, nullable)
- `totalResults` (integer, optional) — The total number of results returned by the request. This helps in pagination and determining the total size of the dataset.
- `resources` (list of ScimV2UsersBulkPatchResponsesContentApplicationJsonSchemaResourcesItems, optional)

## Errors

### 401 Unauthorized Error

Unauthorized

- `success` (boolean, optional) — Indicates whether the request was successful. For unauthorized requests, this will be `false`.
- `reasons` (list of ScimV2UsersBulkPatchResponsesContentApplicationJsonSchemaReasonsItems, optional)

### 403 Forbidden Error

Forbidden

- `timestamp` (datetime, optional) — The timestamp when the error occurred, in ISO 8601 format.
- `status` (integer, optional) — The HTTP status code for the error, which will be `403` for Forbidden.
- `error` (string, optional) — A short description of the error (e.g., 'Forbidden').
- `message` (string, optional) — A detailed message explaining why access was denied (e.g., 'Admin access denied').
- `path` (string, optional) — The API endpoint path where the error occurred (e.g., '/scim/v2/Users').

## Types

### ScimV2UsersBulkPatchRequestBodyContentApplicationJsonSchemaItems

- `schemas` (list of string, optional) — A list of schema URNs that apply to this resource, indicating the structure and attributes of the resource.
- `id` (string, optional) — A unique identifier for the resource within the system.
- `externalId` (string, optional) — An external identifier for the resource, often used for integration with external systems.
- `meta` (ScimV2UsersBulkPatchRequestBodyContentApplicationJsonSchemaItemsMeta, optional)
- `userName` (string, optional) — The username of the user. This is typically a unique identifier for the user within the system.
- `name` (ScimV2UsersBulkPatchRequestBodyContentApplicationJsonSchemaItemsName, optional)
- `displayName` (string, optional) — A name that is suitable for display to end-users, which may be different from the username or full name.
- `preferredLanguage` (string, optional) — The preferred language of the user for communication and content.
- `locale` (string, optional) — The locale of the user, typically used to determine regional settings (e.g., 'en-US' for English, United States).
- `active` (boolean, optional) — Indicates whether the user account is currently active. A value of `true` means the account is active, and `false` means it is inactive.
- `emails` (list of ScimV2UsersBulkPatchRequestBodyContentApplicationJsonSchemaItemsEmailsItems, optional)
- `roles` (list of ScimV2UsersBulkPatchRequestBodyContentApplicationJsonSchemaItemsRolesItems, optional)
- `urn:zuora:scim:schemas:1.0:UserExtension` (ScimV2UsersBulkPatchRequestBodyContentApplicationJsonSchemaItemsUrnZuoraScimSchemas10UserExtension, optional)

### ScimV2UsersBulkPatchResponsesContentApplicationJsonSchemaMeta

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

### ScimV2UsersBulkPatchResponsesContentApplicationJsonSchemaResourcesItems

- `schemas` (list of string, optional) — A list of schema URNs that define the structure and attributes of the user resource.
- `id` (string, optional, nullable) — A unique identifier for the user resource.
- `externalId` (string, optional, nullable) — An external identifier for the resource, often used for integration with external systems.
- `meta` (ScimV2UsersBulkPatchResponsesContentApplicationJsonSchemaResourcesItemsMeta, optional)
- `userName` (string, optional) — The username of the user, typically used as a unique identifier.
- `name` (ScimV2UsersBulkPatchResponsesContentApplicationJsonSchemaResourcesItemsName, optional)
- `displayName` (string, optional) — A display name for the user, which may differ from the username or full name.
- `preferredLanguage` (string, optional) — The user's preferred language for communication and content.
- `locale` (string, optional) — The user's locale, which typically indicates regional settings (e.g., 'en-US').
- `active` (boolean, optional) — Indicates whether the user account is currently active. `true` means active, `false` means inactive.
- `emails` (list of ScimV2UsersBulkPatchResponsesContentApplicationJsonSchemaResourcesItemsEmailsItems, optional)
- `roles` (list of ScimV2UsersBulkPatchResponsesContentApplicationJsonSchemaResourcesItemsRolesItems, optional)
- `urn:zuora:scim:schemas:1.0:UserExtension` (ScimV2UsersBulkPatchResponsesContentApplicationJsonSchemaResourcesItemsUrnZuoraScimSchemas10UserExtension, optional)

### ScimV2UsersBulkPatchResponsesContentApplicationJsonSchemaReasonsItems

- `message` (string, optional) — A description of why the request is unauthorized (e.g., 'Invalid credentials').
- `code` (string, optional) — A code representing the specific reason for the unauthorized access (e.g., '90000011').

### ScimV2UsersBulkPatchRequestBodyContentApplicationJsonSchemaItemsMeta

- `created` (datetime, optional) — The date and time when the resource was created, in ISO 8601 format.
- `resourceType` (string, optional) — The type of resource (e.g., User) this metadata pertains to.
- `location` (string, optional) — The URL where the resource can be accessed or retrieved.

### ScimV2UsersBulkPatchRequestBodyContentApplicationJsonSchemaItemsName

- `formatted` (string, optional) — The full name of the user in a formatted string (e.g., 'John Doe').
- `familyName` (string, optional) — The family name (or surname) of the user.
- `givenName` (string, optional) — The given name (or first name) of the user.

### ScimV2UsersBulkPatchRequestBodyContentApplicationJsonSchemaItemsEmailsItems

- `value` (string, optional) — The email address of the user.
- `display` (string, optional) — A display name for the email address, often the same as the email address itself.
- `type` (string, optional) — The type of email address (e.g., 'work', 'home').
- `primary` (boolean, optional) — Indicates whether this email address is the primary one for the user. A value of `true` means it is the primary email.

### ScimV2UsersBulkPatchRequestBodyContentApplicationJsonSchemaItemsRolesItems

- `value` (string, optional) — The role assigned to the user (e.g., 'ADMIN', 'USER').
- `display` (string, optional, nullable)

### ScimV2UsersBulkPatchRequestBodyContentApplicationJsonSchemaItemsUrnZuoraScimSchemas10UserExtension

- `schemas` (list of string, optional) — A list of schema URNs specific to the user extension, indicating additional attributes.
- `organizationId` (string, optional) — An identifier for the organization associated with the user, often used for organizational contexts.
- `status` (string, optional) — The current status of the user within the system (e.g., 'ACTIVE', 'PENDING').
- `ssoEnabled` (boolean, optional) — Indicates whether Single Sign-On (SSO) is enabled for the user. A value of `true` means SSO is enabled.
- `region` (string, optional)

### ScimV2UsersBulkPatchResponsesContentApplicationJsonSchemaResourcesItemsMeta

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

### ScimV2UsersBulkPatchResponsesContentApplicationJsonSchemaResourcesItemsName

- `formatted` (string, optional) — The full name of the user formatted as a single string (e.g., 'John Doe').
- `familyName` (string, optional) — The user's family name (surname).
- `givenName` (string, optional) — The user's given name (first name).

### ScimV2UsersBulkPatchResponsesContentApplicationJsonSchemaResourcesItemsEmailsItems

- `value` (string, optional) — The email address of the user.
- `display` (string, optional) — A display name for the email address, often the same as the email address itself.
- `type` (string, optional) — The type of email address (e.g., 'work', 'home').
- `primary` (boolean, optional) — Indicates whether this email address is the primary one for the user. `true` means primary.

### ScimV2UsersBulkPatchResponsesContentApplicationJsonSchemaResourcesItemsRolesItems

- `value` (string, optional) — The role assigned to the user (e.g., 'ADMIN').
- `display` (string, optional, nullable)

### ScimV2UsersBulkPatchResponsesContentApplicationJsonSchemaResourcesItemsUrnZuoraScimSchemas10UserExtension

- `schemas` (list of string, optional) — A list of schema URNs specific to the user extension, detailing additional attributes.
- `organizationId` (string, optional) — An identifier for the organization associated with the user.
- `status` (string, optional) — The current status of the user (e.g., 'ACTIVE', 'NEW').
- `ssoEnabled` (boolean, optional) — Indicates whether Single Sign-On (SSO) is enabled for the user. `true` means SSO is enabled.
- `region` (string, optional)

## Examples

**Request**

```json
[
  {}
]
```

**Response**

```json
{
  "itemsPerPage": 2,
  "startIndex": 1,
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:ListResponse"
  ],
  "id": null,
  "externalId": null,
  "meta": null,
  "totalResults": 2,
  "resources": [
    {
      "schemas": [
        "urn:zuora:scim:schemas:1.0:UserExtension",
        "urn:ietf:params:scim:schemas:core:2.0:User"
      ],
      "id": "41aa4e47-01e2-4d85-a6bc-d88e18477011",
      "externalId": "Amy+test4@zuora.com",
      "meta": {
        "created": "2024-10-03T09:37:40.161Z",
        "resourceType": "User",
        "location": "http://localhost:9900/scim/v2/Users/bulk/41aa4e47-01e2-4d85-a6bc-d88e18477011"
      },
      "userName": "Amy+test4@zuora.com",
      "name": {
        "formatted": "Amy Lawrence",
        "familyName": "Amy",
        "givenName": "Lawrence"
      },
      "displayName": "Amy Lawrence",
      "preferredLanguage": "en",
      "locale": "en-US",
      "active": true,
      "emails": [
        {
          "value": "updated2@example.com",
          "display": "updated2@example.com",
          "type": "work",
          "primary": true
        }
      ],
      "roles": [
        {
          "value": "USER",
          "display": "USER"
        }
      ],
      "urn:zuora:scim:schemas:1.0:UserExtension": {
        "schemas": [
          "urn:zuora:scim:schemas:1.0:UserExtension"
        ],
        "organizationId": "5619df2e-fa8c-47fa-9c1e-16ab5af4936e",
        "status": "ACTIVE",
        "ssoEnabled": true,
        "region": "EU"
      }
    },
    {
      "schemas": [
        "urn:zuora:scim:schemas:1.0:UserExtension",
        "urn:ietf:params:scim:schemas:core:2.0:User"
      ],
      "id": "8b40ccce-5fb7-4643-9b78-e194fe5303e6",
      "externalId": "Amy+test3@zuora.com",
      "meta": {
        "created": "2024-10-03T09:37:39.851Z",
        "resourceType": "User",
        "location": "http://localhost:9900/scim/v2/Users/bulk/8b40ccce-5fb7-4643-9b78-e194fe5303e6"
      },
      "userName": "Amy+test3@zuora.com",
      "name": {
        "formatted": "Amy Lawrence",
        "familyName": "Amy",
        "givenName": "Lawrence"
      },
      "displayName": "Amy Lawrence",
      "preferredLanguage": "en",
      "locale": "en-US",
      "active": true,
      "emails": [
        {
          "value": "updated3@example.com",
          "display": "updated3@example.com",
          "type": "work",
          "primary": true
        }
      ],
      "roles": [
        {
          "value": "USER",
          "display": "USER"
        }
      ],
      "urn:zuora:scim:schemas:1.0:UserExtension": {
        "schemas": [
          "urn:zuora:scim:schemas:1.0:UserExtension"
        ],
        "organizationId": "5619df2e-fa8c-47fa-9c1e-16ab5af4936e",
        "status": "ACTIVE",
        "ssoEnabled": true,
        "region": "EU"
      }
    }
  ]
}
```

**SDK Code**

```python SCIM_bulkUpdateUsers_example
import requests

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

payload = [{}]
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript SCIM_bulkUpdateUsers_example
const url = 'https://one.zuora.com/scim/v2/Users/bulk';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '[{}]'
};

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

```go SCIM_bulkUpdateUsers_example
package main

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

func main() {

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

	payload := strings.NewReader("[\n  {}\n]")

	req, _ := http.NewRequest("PATCH", 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_bulkUpdateUsers_example
require 'uri'
require 'net/http'

url = URI("https://one.zuora.com/scim/v2/Users/bulk")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n  {}\n]"

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

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

HttpResponse<String> response = Unirest.patch("https://one.zuora.com/scim/v2/Users/bulk")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("[\n  {}\n]")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://one.zuora.com/scim/v2/Users/bulk', [
  'body' => '[
  {}
]',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp SCIM_bulkUpdateUsers_example
using RestSharp;

var client = new RestClient("https://one.zuora.com/scim/v2/Users/bulk");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "[\n  {}\n]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift SCIM_bulkUpdateUsers_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [[]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://one.zuora.com/scim/v2/Users/bulk")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```