# Update user

`PATCH https://api.agilitycredit.net/scim/v2/{tenantId}/Users/{userId}`

Docs page: https://apidocs.agilitycredit.com/sso/scim-api/patch-user · Tag: Users

Partial update via SCIM PATCH. Accepts both pathed and Okta-style no-path
operations (the server normalises no-path ops into pathed ops). See the
[custom integration guide](https://apidocs.agilitycredit.com/sso/scim-provisioning/custom-integration#update-user--patch-usersid)
for the full table of supported paths.

Authentication: `Authorization: Bearer <api key>`.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `userId` | path | yes | Server-assigned user id, returned in the `id` field on creation. |

## Request body (`application/scim+json`), required

Schema: `PatchRequest`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `schemas` | array of string | yes |  |
| `Operations` | array of object | yes |  |
| `Operations[].op` | string: `add`, `replace`, `remove` | yes |  |
| `Operations[].path` | string |  | SCIM path. Optional for `replace`/`add` when `value` is an object — the server normalises Okta-style no-path ops into pathed ops. |
| `Operations[].value` | any |  | Scalar, object, or array — shape depends on `path`. For role updates this also accepts `{ value: "<role>" }` (Okta `SingleAppRoleAssignment`). |

Example:

```json
{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:PatchOp"
  ],
  "Operations": [
    {
      "op": "replace",
      "path": "name.givenName",
      "value": "Janet"
    },
    {
      "op": "replace",
      "path": "active",
      "value": false
    }
  ]
}
```

## Responses

| Status | Description | Body |
| --- | --- | --- |
| 200 | User updated | User |
| 400 | Payload validation failed. | Error |
| 404 | Resource not found. | Error |
| 503 | SCIM provisioning is disabled on the tenant. | Error |

### Error bodies

400:

```json
{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:Error"
  ],
  "status": "400",
  "scimType": "invalidValue",
  "detail": "userName or emails[0].value is required"
}
```

404:

```json
{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:Error"
  ],
  "status": "404",
  "detail": "User not found"
}
```

503:

```json
{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:Error"
  ],
  "status": "503",
  "detail": "SCIM provisioning is disabled for this tenant"
}
```
