---
title: "Create an incident user-defined role"
method: POST
path: "/api/v2/incidents/config/user-defined-roles"
tags: ["Incidents"]
---

# Create an incident user-defined role

`POST /api/v2/incidents/config/user-defined-roles`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/incidents/config/user-defined-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: `incident_settings_write`
- TypeScript: <https://skmtc.dev/datadog/apis/datadog-api-v2-collection/docs/api/v2/incidents/config/user-defined-roles/post.ts> (a function with typed inputs; its response is checked against the schema)

Create a new user-defined role for incidents.

## Query parameters

- `include` string

## Request body

- IncidentUserDefinedRoleRequest: Request for creating an incident user-defined role.
  - `data` IncidentUserDefinedRoleDataRequest, required: Data for creating an incident user-defined role.
    - `attributes` IncidentUserDefinedRoleDataAttributesRequest, required: Attributes for creating an incident user-defined role.
      - `description` string, nullable: A description of the user-defined role.
      - `name` string, required: The name of the user-defined role.
      - `policy` IncidentUserDefinedRolePolicy: Policy configuration for a user-defined role.
        - `is_single` boolean, required: Whether this role can only be assigned to one responder at a time.
    - `relationships` IncidentUserDefinedRoleRelationshipsRequest, required: Relationships for creating a user-defined role.
      - `incident_type` IncidentUserDefinedRoleIncidentTypeRelationship, required: Relationship to an incident type for a user-defined role.
        - `data` IncidentUserDefinedRoleIncidentTypeRelationshipData, required: Data for the incident type relationship of a user-defined role.
          - `id` string, uuid, required: The ID of the incident type.
          - `type` string, required: The type of the resource.
    - `type` 'incident_user_defined_roles', required: Incident user-defined role resource type.

## Response `201`

Created

- IncidentUserDefinedRoleResponse: Response with a single incident user-defined role.
  - `data` IncidentUserDefinedRoleDataResponse, required: Data for an incident user-defined role response.
    - `attributes` IncidentUserDefinedRoleDataAttributesResponse, required: Attributes of an incident user-defined role.
      - `created` string, date-time, required: Timestamp when the role was created.
      - `description` string, nullable: A description of the user-defined role.
      - `modified` string, date-time, required: Timestamp when the role was last modified.
      - `name` string, required: The name of the user-defined role.
      - `policy` IncidentUserDefinedRolePolicy, required: Policy configuration for a user-defined role.
        - `is_single` boolean, required: Whether this role can only be assigned to one responder at a time.
    - `id` string, uuid, required: The ID of the user-defined role.
    - `relationships` IncidentUserDefinedRoleRelationshipsResponse: Relationships of a user-defined role response.
      - `created_by_user` RelationshipToUser: Relationship to user.
        - `data` RelationshipToUserData, required: Relationship to user object.
          - `id` string, required: A unique identifier that represents the user.
          - `type` 'users', required: Users resource type.
      - `incident_type` IncidentUserDefinedRoleIncidentTypeRelationship: Relationship to an incident type for a user-defined role.
        - `data` IncidentUserDefinedRoleIncidentTypeRelationshipData, required: Data for the incident type relationship of a user-defined role.
          - `id` string, uuid, required: The ID of the incident type.
          - `type` string, required: The type of the resource.
      - `last_modified_by_user` RelationshipToUser: Relationship to user.
        - `data` RelationshipToUserData, required: Relationship to user object.
          - `id` string, required: A unique identifier that represents the user.
          - `type` 'users', required: Users resource type.
    - `type` 'incident_user_defined_roles', required: Incident user-defined role resource type.
  - `included` IncidentUserDefinedRoleIncludedItem[]: Included resources for an incident user-defined role response.
    - union: A single included resource in a user-defined role response.
      - IncidentUserData: User object returned by the API.
        - `attributes` IncidentUserAttributes: Attributes of user object returned by the API.
          - `email` string: Email of the user.
          - `handle` string: Handle of the user.
          - `icon` string: URL of the user's icon.
          - `name` string, nullable: Name of the user.
          - `uuid` string: UUID of the user.
        - `id` string: ID of the user.
        - `type` 'users': Users resource type.
      - IncidentTypeObject: Incident type response data.
        - `attributes` IncidentTypeAttributes: Incident type's attributes.
          - `configuration` IncidentTypeConfiguration: The incident-type-scoped behavior settings. All fields are optional on update. Any field omitted from a PATCH request keeps its current value. This object is read-only on the incident type resource itself and is only mutated through the update (PATCH) endpoint.
            - `allow_incident_deletion` boolean: Whether incidents of this type can be deleted.
            - `allow_workflows` boolean: Whether automation workflows can be triggered for incidents of this type.
            - `create_message` string: An optional message shown to users when they declare an incident of this type.
            - `editable_timestamps` boolean: Whether responders can edit incident timestamps for incidents of this type.
            - `private_incidents` boolean: Whether responders can create private incidents of this type. This is an opt-in setting, distinct from `private_incidents_by_default`, which controls whether incidents are created private automatically.
            - `private_incidents_by_default` boolean: Whether incidents of this type are created as private by default.
            - `slug_source` 'default' | 'servicenow': When set to `servicenow`, incidents will display the ServiceNow record ID instead of the public ID. If no ServiceNow integration exists, the public ID will be displayed.
            - `test_incidents` boolean: Whether incidents of this type are treated as test incidents.
          - `createdAt` string, date-time: Timestamp when the incident type was created.
          - `createdBy` string: A unique identifier that represents the user that created the incident type.
          - `description` string: Text that describes the incident type.
          - `is_default` boolean: If true, this incident type will be used as the default incident type if a type is not specified during the creation of incident resources.
          - `lastModifiedBy` string: A unique identifier that represents the user that last modified the incident type.
          - `modifiedAt` string, date-time: Timestamp when the incident type was last modified.
          - `name` string, required: The name of the incident type.
          - `prefix` string: The string that will be prepended to the incident title across the Datadog app.
        - `id` string, required: The incident type's ID.
        - `relationships` IncidentTypeRelationships: The incident type's resource relationships.
          - `created_by_user` RelationshipToUser: Relationship to user.
            - `data` RelationshipToUserData, required: Relationship to user object.
              - …
          - `google_meet_configuration` GoogleMeetConfigurationReference, nullable: A reference to a Google Meet Configuration resource.
            - `data` GoogleMeetConfigurationReferenceData, nullable, required: The Google Meet configuration relationship data object.
              - …
          - `last_modified_by_user` RelationshipToUser: Relationship to user.
            - `data` RelationshipToUserData, required: Relationship to user object.
              - …
          - `microsoft_teams_configuration` MicrosoftTeamsConfigurationReference, nullable: A reference to a Microsoft Teams Configuration resource.
            - `data` MicrosoftTeamsConfigurationReferenceData, nullable, required: The Microsoft Teams configuration relationship data object.
              - …
          - `zoom_configuration` ZoomConfigurationReference, nullable: A reference to a Zoom configuration resource.
            - `data` ZoomConfigurationReferenceData, nullable, required: The Zoom configuration relationship data object.
              - …
        - `type` 'incident_types', required: Incident type resource type.

## Other responses

- `400`: Bad Request
- `403`: Forbidden
- `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/3f70db624329?raw)
