---
title: "Create role"
method: POST
path: "/api/v2/roles"
tags: ["Roles"]
---

# Create role

`POST /api/v2/roles`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/roles`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token` scopes: `user_access_manage`

Create a new role for your organization.

The following read permissions are automatically added to every new role, even if they are not included in the request:

- Dashboards Read
- Notebooks Read
- Monitors Read
- APM Read
- Vulnerability Management Read
- RUM Apps Read
- Incidents Read
- SLOs Read
- CI Visibility Read
- CD Visibility Read

## Request body

- RoleCreateRequest: Create a role.
  - `data` RoleCreateData, required: Data related to the creation of a role.
    - `attributes` RoleCreateAttributes, required: Attributes of the created role.
      - `created_at` string, date-time: Creation time of the role.
      - `modified_at` string, date-time: Time of last role modification.
      - `name` string, required: 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.
    - `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': Roles type.

## Response `200`

OK

- RoleCreateResponse: Response containing information about a created role.
  - `data` RoleCreateResponseData: Role object returned by the API.
    - `attributes` RoleCreateAttributes: Attributes of the created role.
      - `created_at` string, date-time: Creation time of the role.
      - `modified_at` string, date-time: Time of last role modification.
      - `name` string, required: 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.
    - `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
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/da68bf029e4c?raw)
