---
title: "Update a role"
method: PATCH
path: "/api/v2/roles/{role_id}"
tags: ["Roles"]
---

# Update a role

`PATCH /api/v2/roles/{role_id}`

Edit a role. Can only be used with application keys belonging to administrators.

## Path parameters

- `role_id` string, required

## Request body

- RoleUpdateRequest — Update a role.
  - `data` RoleUpdateData, required — Data related to the update of a role.
    - `attributes` RoleUpdateAttributes, required — Attributes of the role.
      - `created_at` string, date-time — Creation time of the role.
      - `modified_at` string, date-time — Time of last role modification.
      - `name` string — Name of the role.
      - `receives_permissions_from` string[] — The managed role from which this role automatically inherits new permissions. Specify one of the following: "Datadog Admin Role", "Datadog Standard Role", or "Datadog Read Only Role". If empty or not specified, the role does not automatically inherit permissions from any managed role.
      - `user_count` integer — The user count.
    - `id` string, required — The unique identifier of the role.
    - `relationships` RoleRelationships — Relationships of the role object.
      - `permissions` RelationshipToPermissions — Relationship to multiple permissions objects.
        - `data` RelationshipToPermissionData[] — Relationships to permission objects.
          - `id` string — ID of the permission.
          - `type` 'permissions' — Permissions resource type.
    - `type` 'roles', required — Roles type.

## Response `200`

OK

- RoleUpdateResponse — Response containing information about an updated role.
  - `data` RoleUpdateResponseData — Role object returned by the API.
    - `attributes` RoleUpdateAttributes — Attributes of the role.
      - `created_at` string, date-time — Creation time of the role.
      - `modified_at` string, date-time — Time of last role modification.
      - `name` string — Name of the role.
      - `receives_permissions_from` string[] — The managed role from which this role automatically inherits new permissions. Specify one of the following: "Datadog Admin Role", "Datadog Standard Role", or "Datadog Read Only Role". If empty or not specified, the role does not automatically inherit permissions from any managed role.
      - `user_count` integer — The user count.
    - `id` string — The unique identifier of the role.
    - `relationships` RoleResponseRelationships — Relationships of the role object returned by the API.
      - `permissions` RelationshipToPermissions — Relationship to multiple permissions objects.
        - `data` RelationshipToPermissionData[] — Relationships to permission objects.
          - `id` string — ID of the permission.
          - `type` 'permissions' — Permissions resource type.
    - `type` 'roles', required — Roles type.

## Other responses

- `400` — Bad Request
- `403` — Authentication error
- `404` — Not found
- `422` — Unprocessable Entity
- `429` — Too many requests

---

[API](https://skmtc.net/datadog/apis/api-v2.md) · [All operations](https://skmtc.net/datadog/apis/api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/datadog/api-v2/versions/da68bf029e4c/schema)
