---
title: Patch user
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > SCIM
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Patch user{% #patch-user %}
Copy pageCopied
{% tab title="v2" %}

| Datadog site      | API endpoint                                                      |
| ----------------- | ----------------------------------------------------------------- |
| ap1.datadoghq.com | PATCH https://api.ap1.datadoghq.com/api/v2/scim/Users/{user_uuid} |
| ap2.datadoghq.com | PATCH https://api.ap2.datadoghq.com/api/v2/scim/Users/{user_uuid} |
| app.datadoghq.eu  | PATCH https://api.datadoghq.eu/api/v2/scim/Users/{user_uuid}      |
| app.ddog-gov.com  | PATCH https://api.ddog-gov.com/api/v2/scim/Users/{user_uuid}      |
| us2.ddog-gov.com  | PATCH https://api.us2.ddog-gov.com/api/v2/scim/Users/{user_uuid}  |
| uk1.datadoghq.com | PATCH https://api.uk1.datadoghq.com/api/v2/scim/Users/{user_uuid} |
| app.datadoghq.com | PATCH https://api.datadoghq.com/api/v2/scim/Users/{user_uuid}     |
| us3.datadoghq.com | PATCH https://api.us3.datadoghq.com/api/v2/scim/Users/{user_uuid} |
| us5.datadoghq.com | PATCH https://api.us5.datadoghq.com/api/v2/scim/Users/{user_uuid} |

### Overview

Patch the user with the given `user_uuid`. To update Datadog roles, send an operation with `path` set to `roles` and `value` set to an array of role objects containing role UUIDs. This endpoint requires all of the following permissions:
`user_access_invite``user_access_manage` 


### Arguments

#### Path Parameters

| Name                        | Type   | Description |
| --------------------------- | ------ | ----------- |
| user_uuid [*required*] | string | None        |

### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field | Field      | Type     | Description                                                                                                                    |
| ------------ | ---------- | -------- | ------------------------------------------------------------------------------------------------------------------------------ |
|              | Operations | [object] | A list of update operations to be performed on a user.                                                                         |
| Operations   | op         | enum     | The operation to be performed. Allowed enum values: `add,replace`                                                              |
| Operations   | path       | string   | An attribute path describing the target of the operation.                                                                      |
| Operations   | value      |          | New value to use for the patch operation. When `path` is `roles`, use an array of role objects with each role UUID in `value`. |
|              | schemas    | [string] | Input JSON Schemas                                                                                                             |

{% /tab %}

{% tab title="Example" %}

```json
{
  "Operations": [
    {
      "op": "string",
      "path": "roles",
      "value": [
        "00000000-0000-0000-0000-000000000001"
      ]
    }
  ],
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:PatchOp"
  ]
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Definition of a user.

| Parent field | Field                   | Type      | Description                                                                                                            |
| ------------ | ----------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------- |
|              | active                  | boolean   | A Boolean value indicating the User's administrative status.                                                           |
|              | emails                  | [object]  | Email addresses for the user.                                                                                          |
| emails       | primary                 | boolean   | Boolean indicating if this email is the primary email address.                                                         |
| emails       | type                    | enum      | The type of email. Allowed enum values: `work`                                                                         |
| emails       | value                   | string    | Email addresses for the user.                                                                                          |
|              | id                      | string    | The identifier of the resource. Not required when creating a user.                                                     |
|              | meta                    | object    | Metadata associated with a user.                                                                                       |
| meta         | created                 | date-time | The date and time the user was created.                                                                                |
| meta         | lastModified            | date-time | The date and time the user was last changed.                                                                           |
| meta         | location                | string    | URL identifying the resource.                                                                                          |
| meta         | resourceType            | string    | Type of resource.                                                                                                      |
|              | name                    | object    | The components of user's real name                                                                                     |
| name         | formatted               | string    | The full name, including all middle names, titles, and suffixes as appropriate, formatted for display.                 |
|              | roles                   | [object]  | Datadog roles assigned to the user. Provide the role UUID in `value` when provisioning or updating roles through SCIM. |
| roles        | display                 | string    | Human-readable Datadog role name returned in responses.                                                                |
| roles        | value [*required*] | string    | Datadog role UUID.                                                                                                     |
|              | schemas                 | [string]  | User JSON Schemas.                                                                                                     |
|              | title                   | string    | The user's title.                                                                                                      |
|              | userName                | string    | Unique identifier for the User.                                                                                        |

{% /tab %}

{% tab title="Example" %}

```json
{
  "active": false,
  "emails": [
    {
      "primary": false,
      "type": "string",
      "value": "string"
    }
  ],
  "id": "string",
  "meta": {
    "created": "2024-10-17T12:53:35.793Z",
    "lastModified": "2024-10-19T12:53:35.793Z",
    "location": "https://app.datadoghq.com/api/scim/v2/Users/13a95654-b76d-478d-8636-157a7e461d7c",
    "resourceType": "User"
  },
  "name": {
    "formatted": "string"
  },
  "roles": [
    {
      "display": "Datadog Read Only Role",
      "value": "00000000-0000-0000-0000-000000000001"
    }
  ],
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:User"
  ],
  "title": "string",
  "userName": "string"
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="404" %}
Not Found
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \## default
# 
 \# Path parameters export user_uuid="CHANGE_ME" \# Curl command curl -X PATCH "https://api.datadoghq.com/api/v2/scim/Users/${user_uuid}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "Operations": [
    {
      "op": "replace",
      "path": "title",
      "value": "CEO"
    },
    {
      "op": "replace",
      "path": "roles",
      "value": [
        {
          "value": "00000000-0000-0000-0000-000000000001"
        }
      ]
    },
    {
      "op": "replace",
      "value": {
        "name": {
          "formatted": "John Doe"
        }
      }
    }
  ],
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:PatchOp"
  ]
}
EOF \## json-request-body
# 
 \# Path parameters export user_uuid="CHANGE_ME" \# Curl command curl -X PATCH "https://api.datadoghq.com/api/v2/scim/Users/${user_uuid}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "Operations": [
    {
      "op": "replace",
      "path": "title",
      "value": "CEO"
    },
    {
      "op": "replace",
      "path": "roles",
      "value": [
        {
          "value": "00000000-0000-0000-0000-000000000001"
        }
      ]
    },
    {
      "op": "replace",
      "value": {
        "name": {
          "formatted": "John Doe"
        }
      }
    }
  ],
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:PatchOp"
  ]
}
EOF 
                
{% /tab %}
