# Patch user

`PATCH https://api.airtable.com/scim/v2/Users/{userId}`

Perform a list of SCIM patch operations in sequence on an existing user.

See [SCIM specification](https://datatracker.ietf.org/doc/html/rfc7644#section-3.5.2) for more.

## Requirements

- **Authentication:** [Personal access token](https://airtable.com/developers/web/api/authentication.md#types-of-token), [OAuth integration](https://airtable.com/developers/web/api/authentication.md#types-of-token)
- **Scope:** [`enterprise.scim.usersAndGroups:manage`](https://airtable.com/developers/web/api/scopes.md#enterprise-scim-users-and-groups-manage)
- **User role:** Enterprise admin _Note: Admins of multiple enterprises should use a service account's token when calling this route._
- **Billing plans:** Business, Enterprise (pre-2023.08 legacy plan), Enterprise Scale

## Path parameters

- `userId: string`

## Request body

- `schemas: array<string>` — required

  A list of schemas, including at least SCIM's PatchOp schema.

- `Operations: array<object>` — required

  A list of SCIM patch operations to perform.

  See the [SCIM PATCH protocol](https://datatracker.ietf.org/doc/html/rfc7644#section-3.5.2) for details.

  - `path: string` — required

    Path for a [SCIM user](https://airtable.com/developers/web/api/scim-overview.md#scim-user-objects) field.

  - `value: string | unknown` — optional

    Replacment value. Not used when performing the `'remove'` operation.

  - `op: "add" | "replace" | "remove"` — required

## Response format

Returns `SCIM-user-schema`:

[SCIM User](https://datatracker.ietf.org/doc/html/rfc7643#section-4.1) objects with optional user metadata.

See [SCIM Field Types](https://airtable.com/developers/web/api/scim-overview.md#scim-user-objects) for more information about optional
user metadata.

- `id: string` — optional

  Airtable's unique user ID for this user.

- `urn:airtable:params:scim:schemas:extension:sso:2.0:User: object | null` — optional

  Airtable-specific extension for routing provisioning through a particular
  SSO identity provider when the enterprise has multiple IdPs configured. See [SCIM Field
  Types](https://airtable.com/developers/web/api/scim-overview.md#scim-user-objects) for more.

- `urn:ietf:params:scim:schemas:extension:enterprise:2.0:User: object | null` — optional

  Custom extension, see [SCIM Field Types](https://airtable.com/developers/web/api/scim-overview.md#scim-user-objects) for more

- `schemas: array<string>` — required

  A list of schemas, including at least SCIM's core user schema URI.

  You can add the [enterprise extension](https://datatracker.ietf.org/doc/html/rfc7643#section-4.3)
  schema URI if you want to send extra properties for reporting.

  See the optional user metadata table for details.

- `userName: string` — required

  Becomes the "email" field in Airtable. It must not be in use already, and
  the email's domain must match the enterprise account.

- `active: boolean | null` — optional

  Indicates if the user is active or deactivated.

  Setting this is possible via the put and patch endpoints.

- `externalId: string | null` — optional

  Provisioning client defined identifier.

- `addresses: array<object> | null` — optional

- `displayName: string | null` — optional

- `emails: array<object> | null` — optional

- `entitlements: array<unknown> | null` — optional

- `groups: array<object> | null` — optional

- `ims: array<object> | null` — optional

- `locale: string | null` — optional

- `meta: unknown` — optional

- `name: object | null` — optional

- `nickName: string | null` — optional

- `password: string | null` — optional

- `phoneNumbers: array<object> | null` — optional

- `photos: array<object> | null` — optional

- `preferredLanguage: string | null` — optional

- `profileUrl: string | null` — optional

- `roles: array<unknown> | null` — optional

- `timezone: string | null` — optional

- `title: string | null` — optional

- `userType: string | null` — optional

### Example — Patch user example

```sh
curl -X PATCH "https://api.airtable.com/scim/v2/Users/{userId}" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
--data '{
    "Operations": [
      {
        "op": "replace",
        "path": "title",
        "value": "Manager"
      }
    ],
    "schemas": [
      "urn:ietf:params:scim:api:messages:2.0:PatchOp"
    ]
  }'
```

```json
{
  "active": true,
  "displayName": "Jane Doe",
  "emails": [
    {
      "primary": true,
      "type": "work",
      "value": "jane.doe@example.com"
    }
  ],
  "externalId": "00u19pelnizu7vExD0h8",
  "groups": [],
  "id": "usrogvSbotRtzdtZW",
  "locale": "en-US",
  "meta": {
    "created": "2022-06-29T18:16:07.990Z",
    "lastModified": "2022-07-06T17:36:19.513Z",
    "location": "/scim/v2/Users/usr00000000000000",
    "resourceType": "User"
  },
  "name": {
    "familyName": "Doe",
    "givenName": "Jane"
  },
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:User",
    "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"
  ],
  "title": "Manager",
  "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": {
    "costCenter": "Example Cost Center",
    "department": "Example Department",
    "division": "Example Division"
  },
  "userName": "jane.doe@example.com"
}
```
