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

# Partially update a user

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

Updates an existing user resource, overwriting values for specified attributes.
The value of the \{id} should be the user's corresponding user ID. Attributes that are not provided in the request will remain unchanged. Updating a value to " " will clear and remove the field from the user's profile.

Reference: https://zuora.ferndocs.com/developers/api-reference/zuora-api/oneid/scim/partial-update-a-specific-user

## Authentication

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

## Request

### Path parameters

- `id` (string, required) — User ID to update

### 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 an object.

- `schemas` (list of enum, required)
  - Allowed values: `urn:ietf:params:scim:api:messages:2.0:PatchOp`
- `Operations` (list of ScimV2UsersIdPatchRequestBodyContentApplicationJsonSchemaOperationsItems, required)

## Response

### 200

OK

- `schemas` (list of enum, optional) — A list of schema URNs that are applicable to the user resource. This helps to identify the structure and format of the returned data.
  - Allowed values: `urn:zuora:scim:schemas:1.0:UserExtension`, `urn:ietf:params:scim:schemas:core:2.0:User`
- `id` (string, optional) — The unique identifier for the user resource.
- `meta` (ScimV2UsersIdPatchResponsesContentApplicationJsonSchemaMeta, optional)
- `userName` (string, optional) — The username for the user. This is a unique identifier for the user in the system.
- `name` (ScimV2UsersIdPatchResponsesContentApplicationJsonSchemaName, optional)
- `displayName` (string, optional) — The display name of the user, which may be used in UIs.
- `preferredLanguage` (string, optional) — The preferred language of the user for communication.
- `locale` (string, optional) — The locale of the user, typically a language code combined with a region (e.g., 'en-US').
- `active` (boolean, optional) — Indicates whether the user account is active or not.
- `emails` (list of ScimV2UsersIdPatchResponsesContentApplicationJsonSchemaEmailsItems, optional)
- `groups` (list of ScimV2UsersIdPatchResponsesContentApplicationJsonSchemaGroupsItems, optional)
- `roles` (list of ScimV2UsersIdPatchResponsesContentApplicationJsonSchemaRolesItems, optional)
- `urn:zuora:scim:schemas:1.0:UserExtension` (ScimV2UsersIdPatchResponsesContentApplicationJsonSchemaUrnZuoraScimSchemas10UserExtension, optional)

## Errors

### 401 Unauthorized Error

Unauthorized - The request lacks valid authentication credentials.

- `success` (boolean, optional) — Indicates whether the request was successful. For unauthorized responses, this is always false.
- `reasons` (list of ScimV2UsersIdPatchResponsesContentApplicationJsonSchemaReasonsItems, optional)

### 403 Forbidden Error

Forbidden - The server understands the request but refuses to authorize it.

- `timestamp` (datetime, optional) — The date and time when the error occurred, in ISO 8601 format.
- `status` (integer, optional) — The HTTP status code of the response, which is 403 for forbidden errors.
- `error` (string, optional) — A short description of the error type. For forbidden errors, this is always 'Forbidden'.
- `message` (string, optional) — A detailed message explaining why the request was forbidden. This might include additional context about access control issues.
- `path` (string, optional) — The path of the request that resulted in the error. This helps identify which resource or endpoint was being accessed when the error occurred.

## Types

### ScimV2UsersIdPatchRequestBodyContentApplicationJsonSchemaOperationsItems

- `op` (enum, optional)
  - Allowed values: `replace`, `add`, `remove`, `copy`, `move`, `test`
- `path` (string, optional)
- `value` (ScimV2UsersIdPatchRequestBodyContentApplicationJsonSchemaOperationsItemsValue, optional)

### ScimV2UsersIdPatchResponsesContentApplicationJsonSchemaMeta

- `created` (datetime, optional) — The timestamp when the user resource was created, in ISO 8601 format.
- `resourceType` (string, optional) — The type of the resource, in this case, it is always 'User' for user resources.
- `location` (string, optional) — The URL where the full representation of the user resource can be retrieved.

### ScimV2UsersIdPatchResponsesContentApplicationJsonSchemaName

- `formatted` (string, optional) — The full name of the user formatted as a single 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.

### ScimV2UsersIdPatchResponsesContentApplicationJsonSchemaEmailsItems

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

### ScimV2UsersIdPatchResponsesContentApplicationJsonSchemaGroupsItems

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

### ScimV2UsersIdPatchResponsesContentApplicationJsonSchemaRolesItems

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

### ScimV2UsersIdPatchResponsesContentApplicationJsonSchemaUrnZuoraScimSchemas10UserExtension

- `schemas` (list of enum, optional) — A list of schema URNs that are specific to Zuora's extended user schema.
  - Allowed values: `urn:zuora:scim:schemas:1.0:UserExtension`
- `organizationId` (string, optional) — The unique identifier for the organization to which the user belongs.
- `status` (string, optional) — The current status of the user (e.g., ACTIVE, INACTIVE).
- `ssoEnabled` (boolean, optional) — Indicates whether Single Sign-On (SSO) is enabled for this user.
- `region` (string, optional)

### ScimV2UsersIdPatchResponsesContentApplicationJsonSchemaReasonsItems

- `message` (string, optional) — A human-readable message explaining the reason for the unauthorized response.
- `code` (string, optional) — A specific error code associated with the unauthorized response. This code can be used for programmatic handling of the error.

### ScimV2UsersIdPatchRequestBodyContentApplicationJsonSchemaOperationsItemsValue

- `emails` (list of ScimV2UsersIdPatchRequestBodyContentApplicationJsonSchemaOperationsItemsValueEmailsItems, optional)

### ScimV2UsersIdPatchRequestBodyContentApplicationJsonSchemaOperationsItemsValueEmailsItems

- `value` (string, optional)
- `display` (string, optional)
- `type` (enum, optional)
  - Allowed values: `work`, `home`, `other`
- `primary` (boolean, optional)

## Examples

**Request**

```json
{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:PatchOp"
  ],
  "Operations": [
    {
      "op": "replace",
      "path": "/emails",
      "value": {
        "emails": [
          {
            "value": "updatedEmail@zuora.com",
            "display": "updatedEmail@zuora.com",
            "type": "home",
            "primary": false
          }
        ]
      }
    }
  ]
}
```

**Response**

```json
{
  "schemas": [
    "urn:zuora:scim:schemas:1.0:UserExtension",
    "urn:ietf:params:scim:schemas:core:2.0:User"
  ],
  "id": "4ae68f98-2762-4001-b95c-34569b413e8e",
  "meta": {
    "created": "2024-10-03T10:22:09.727Z",
    "resourceType": "User",
    "location": "http://localhost:9900/scim/v2/Users/4ae68f98-2762-4001-b95c-34569b413e8e/4ae68f98-2762-4001-b95c-34569b413e8e"
  },
  "userName": "assingh151@zuora.com",
  "name": {
    "formatted": "Amy Lawrence",
    "familyName": "Amy",
    "givenName": "Lawrence"
  },
  "displayName": "Amy Lawrence",
  "preferredLanguage": "en",
  "locale": "en-US",
  "active": true,
  "emails": [
    {
      "value": "updatedEmail@zuora.com",
      "display": "updatedEmail@zuora.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"
  },
  "externalId": "assingh151@zuora.com"
}
```

**SDK Code**

```python SCIM_partialUpdateASpecificUser_example
import requests

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

payload = {
    "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
    "Operations": [
        {
            "op": "replace",
            "path": "/emails",
            "value": { "emails": [
                    {
                        "value": "updatedEmail@zuora.com",
                        "display": "updatedEmail@zuora.com",
                        "type": "home",
                        "primary": False
                    }
                ] }
        }
    ]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript SCIM_partialUpdateASpecificUser_example
const url = 'https://one.zuora.com/scim/v2/Users/id';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"schemas":["urn:ietf:params:scim:api:messages:2.0:PatchOp"],"Operations":[{"op":"replace","path":"/emails","value":{"emails":[{"value":"updatedEmail@zuora.com","display":"updatedEmail@zuora.com","type":"home","primary":false}]}}]}'
};

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

```go SCIM_partialUpdateASpecificUser_example
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"schemas\": [\n    \"urn:ietf:params:scim:api:messages:2.0:PatchOp\"\n  ],\n  \"Operations\": [\n    {\n      \"op\": \"replace\",\n      \"path\": \"/emails\",\n      \"value\": {\n        \"emails\": [\n          {\n            \"value\": \"updatedEmail@zuora.com\",\n            \"display\": \"updatedEmail@zuora.com\",\n            \"type\": \"home\",\n            \"primary\": false\n          }\n        ]\n      }\n    }\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_partialUpdateASpecificUser_example
require 'uri'
require 'net/http'

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

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  \"schemas\": [\n    \"urn:ietf:params:scim:api:messages:2.0:PatchOp\"\n  ],\n  \"Operations\": [\n    {\n      \"op\": \"replace\",\n      \"path\": \"/emails\",\n      \"value\": {\n        \"emails\": [\n          {\n            \"value\": \"updatedEmail@zuora.com\",\n            \"display\": \"updatedEmail@zuora.com\",\n            \"type\": \"home\",\n            \"primary\": false\n          }\n        ]\n      }\n    }\n  ]\n}"

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

```java SCIM_partialUpdateASpecificUser_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/id")
  .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\": \"replace\",\n      \"path\": \"/emails\",\n      \"value\": {\n        \"emails\": [\n          {\n            \"value\": \"updatedEmail@zuora.com\",\n            \"display\": \"updatedEmail@zuora.com\",\n            \"type\": \"home\",\n            \"primary\": false\n          }\n        ]\n      }\n    }\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://one.zuora.com/scim/v2/Users/id', [
  'body' => '{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:PatchOp"
  ],
  "Operations": [
    {
      "op": "replace",
      "path": "/emails",
      "value": {
        "emails": [
          {
            "value": "updatedEmail@zuora.com",
            "display": "updatedEmail@zuora.com",
            "type": "home",
            "primary": false
          }
        ]
      }
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp SCIM_partialUpdateASpecificUser_example
using RestSharp;

var client = new RestClient("https://one.zuora.com/scim/v2/Users/id");
var request = new RestRequest(Method.PATCH);
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\": \"replace\",\n      \"path\": \"/emails\",\n      \"value\": {\n        \"emails\": [\n          {\n            \"value\": \"updatedEmail@zuora.com\",\n            \"display\": \"updatedEmail@zuora.com\",\n            \"type\": \"home\",\n            \"primary\": false\n          }\n        ]\n      }\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift SCIM_partialUpdateASpecificUser_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": "replace",
      "path": "/emails",
      "value": ["emails": [
          [
            "value": "updatedEmail@zuora.com",
            "display": "updatedEmail@zuora.com",
            "type": "home",
            "primary": false
          ]
        ]]
    ]
  ]
] as [String : Any]

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

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