For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/api/latest/incidents/get-an-incident-user-defined-role.md. A documentation index is available at /llms.txt.

Get an incident user-defined role

Note: This endpoint is in preview and is subject to change. If you have any feedback, contact Datadog support.

GET https://api.ap1.datadoghq.com/api/v2/incidents/config/user-defined-roles/{role_id}https://api.ap2.datadoghq.com/api/v2/incidents/config/user-defined-roles/{role_id}https://api.datadoghq.eu/api/v2/incidents/config/user-defined-roles/{role_id}https://api.ddog-gov.com/api/v2/incidents/config/user-defined-roles/{role_id}https://api.us2.ddog-gov.com/api/v2/incidents/config/user-defined-roles/{role_id}https://api.uk1.datadoghq.com/api/v2/incidents/config/user-defined-roles/{role_id}https://api.datadoghq.com/api/v2/incidents/config/user-defined-roles/{role_id}https://api.us3.datadoghq.com/api/v2/incidents/config/user-defined-roles/{role_id}https://api.us5.datadoghq.com/api/v2/incidents/config/user-defined-roles/{role_id}

Overview

Retrieve a single user-defined role for incidents.

OAuth apps require the incident_settings_read authorization scope to access this endpoint.

Arguments

Path Parameters

Name

Type

Description

role_id [required]

string

The UUID of the incident user-defined role.

Query Strings

Name

Type

Description

include

string

Comma-separated list of related resources to include in the response.

Response

OK

Response with a single incident user-defined role.

Expand All

Field

Type

Description

data [required]

object

Data for an incident user-defined role response.

attributes [required]

object

Attributes of an incident user-defined role.

created [required]

date-time

Timestamp when the role was created.

description

string

A description of the user-defined role.

modified [required]

date-time

Timestamp when the role was last modified.

name [required]

string

The name of the user-defined role.

policy [required]

object

Policy configuration for a user-defined role.

is_single [required]

boolean

Whether this role can only be assigned to one responder at a time.

id [required]

uuid

The ID of the user-defined role.

relationships

object

Relationships of a user-defined role response.

created_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

incident_type

object

Relationship to an incident type for a user-defined role.

data [required]

object

Data for the incident type relationship of a user-defined role.

id [required]

uuid

The ID of the incident type.

type [required]

string

The type of the resource.

last_modified_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

type [required]

enum

Incident user-defined role resource type. Allowed enum values: incident_user_defined_roles

included

[ <oneOf>]

Included resources for an incident user-defined role response.

<type=users>

object

User object returned by the API.

attributes

object

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

Name of the user.

uuid

string

UUID of the user.

id

string

ID of the user.

type

enum

Users resource type. Allowed enum values: users

default: users

<type=incident_types>

object

Incident type response data.

attributes

object

Incident type's attributes.

configuration

object

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.

default: true

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

enum

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. Allowed enum values: default,servicenow

default: default

test_incidents

boolean

Whether incidents of this type are treated as test incidents.

default: true

createdAt

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

date-time

Timestamp when the incident type was last modified.

name [required]

string

The name of the incident type.

prefix

string

The string that will be prepended to the incident title across the Datadog app.

id [required]

string

The incident type's ID.

relationships

object

The incident type's resource relationships.

created_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

google_meet_configuration

object

A reference to a Google Meet Configuration resource.

data [required]

object

The Google Meet configuration relationship data object.

id [required]

string

The unique identifier of the Google Meet configuration.

type [required]

string

The type of the Google Meet configuration.

last_modified_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

microsoft_teams_configuration

object

A reference to a Microsoft Teams Configuration resource.

data [required]

object

The Microsoft Teams configuration relationship data object.

id [required]

string

The unique identifier of the Microsoft Teams configuration.

type [required]

string

The type of the Microsoft Teams configuration.

zoom_configuration

object

A reference to a Zoom configuration resource.

data [required]

object

The Zoom configuration relationship data object.

id [required]

string

The unique identifier of the Zoom configuration.

type [required]

string

The type of the Zoom configuration.

type [required]

enum

Incident type resource type. Allowed enum values: incident_types

default: incident_types

{
  "data": {
    "attributes": {
      "created": "2024-01-01T00:00:00.000Z",
      "description": "The technical lead for the incident.",
      "modified": "2024-01-01T00:00:00.000Z",
      "name": "Tech Lead",
      "policy": {
        "is_single": true
      }
    },
    "id": "00000000-0000-0000-0000-000000000002",
    "relationships": {
      "created_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "incident_type": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000001",
          "type": "incident_types"
        }
      },
      "last_modified_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      }
    },
    "type": "incident_user_defined_roles"
  },
  "included": [
    {
      "attributes": {
        "email": "string",
        "handle": "string",
        "icon": "string",
        "name": "string",
        "uuid": "string"
      },
      "id": "string",
      "type": "users"
    }
  ]
}

Bad Request

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Not Found

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Code Example

                  # Path parameters
export role_id="00000000-0000-0000-0000-000000000002"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.us2.ddog-gov.com"https://api.uk1.datadoghq.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/config/user-defined-roles/${role_id}" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
Get an incident user-defined role returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi
from uuid import UUID

configuration = Configuration()
configuration.unstable_operations["get_incident_user_defined_role"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.get_incident_user_defined_role(
        role_id=UUID("00000000-0000-0000-0000-000000000002"),
    )

    print(response)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Get an incident user-defined role returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.get_incident_user_defined_role".to_sym] = true
end
api_instance = DatadogAPIClient::V2::IncidentsAPI.new
p api_instance.get_incident_user_defined_role("00000000-0000-0000-0000-000000000002")

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Get an incident user-defined role returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
	"github.com/google/uuid"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.GetIncidentUserDefinedRole", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.GetIncidentUserDefinedRole(ctx, uuid.MustParse("00000000-0000-0000-0000-000000000002"), *datadogV2.NewGetIncidentUserDefinedRoleOptionalParameters())

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `IncidentsApi.GetIncidentUserDefinedRole`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `IncidentsApi.GetIncidentUserDefinedRole`:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Get an incident user-defined role returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.IncidentsApi;
import com.datadog.api.client.v2.model.IncidentUserDefinedRoleResponse;
import java.util.UUID;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setUnstableOperationEnabled("v2.getIncidentUserDefinedRole", true);
    IncidentsApi apiInstance = new IncidentsApi(defaultClient);

    try {
      IncidentUserDefinedRoleResponse result =
          apiInstance.getIncidentUserDefinedRole(
              UUID.fromString("00000000-0000-0000-0000-000000000002"));
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#getIncidentUserDefinedRole");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Instructions

First install the library and its dependencies and then save the example to Example.java and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// Get an incident user-defined role returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::GetIncidentUserDefinedRoleOptionalParams;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use uuid::Uuid;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.GetIncidentUserDefinedRole", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .get_incident_user_defined_role(
            Uuid::parse_str("00000000-0000-0000-0000-000000000002").expect("invalid UUID"),
            GetIncidentUserDefinedRoleOptionalParams::default(),
        )
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

First install the library and its dependencies and then save the example to src/main.rs and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Get an incident user-defined role returns "OK" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.getIncidentUserDefinedRole"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

const params: v2.IncidentsApiGetIncidentUserDefinedRoleRequest = {
  roleId: "00000000-0000-0000-0000-000000000002",
};

apiInstance
  .getIncidentUserDefinedRole(params)
  .then((data: v2.IncidentUserDefinedRoleResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"