Case Management

View and manage cases and projects within Case Management. See the Case Management page for more information.

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/cases/projects/{project_id}/ruleshttps://api.ap2.datadoghq.com/api/v2/cases/projects/{project_id}/ruleshttps://api.datadoghq.eu/api/v2/cases/projects/{project_id}/ruleshttps://api.ddog-gov.com/api/v2/cases/projects/{project_id}/ruleshttps://api.us2.ddog-gov.com/api/v2/cases/projects/{project_id}/ruleshttps://api.datadoghq.com/api/v2/cases/projects/{project_id}/ruleshttps://api.us3.datadoghq.com/api/v2/cases/projects/{project_id}/ruleshttps://api.us5.datadoghq.com/api/v2/cases/projects/{project_id}/rules

Información general

Returns all automation rules configured for a project. Automation rules allow automatic actions to be triggered by case events like creation, status transitions, or attribute changes.

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

project_id [required]

string

The UUID of the project that owns the automation rules.

Respuesta

OK

Response containing a list of automation rules for a project.

Expand All

Campo

Tipo

Descripción

data [required]

[object]

List of automation rules.

attributes [required]

object

Core attributes of an automation rule, including its name, trigger condition, action to execute, and current state.

action [required]

object

Defines what happens when the rule triggers. Combines an action type with action-specific configuration data.

data [required]

object

Configuration for the action to execute, dependent on the action type.

agent_type

string

The type of AI agent to assign. Required when the action type is assign_agent.

assigned_agent_id

string

The identifier of the AI agent to assign to the case. Required when the action type is assign_agent.

handle

string

The handle of the Datadog workflow to execute. Required when the action type is execute_workflow.

type [required]

enum

The type of automated action to perform when the rule triggers. execute_workflow runs a Datadog workflow; assign_agent assigns an AI agent to the case. Allowed enum values: execute_workflow,assign_agent

created_at [required]

date-time

Timestamp when the automation rule was created.

modified_at

date-time

Timestamp when the automation rule was last modified.

name [required]

string

A human-readable name for the automation rule, used to identify the rule in the UI and API responses.

state [required]

enum

Whether the automation rule is active. Enabled rules trigger on matching case events; disabled rules are inactive but preserve their configuration. Allowed enum values: ENABLED,DISABLED

trigger [required]

object

Defines when the rule activates. Combines a trigger type (the case event to listen for) with optional trigger data (conditions that narrow when the trigger fires).

data

object

Additional configuration for the trigger, dependent on the trigger type. For status_transitioned triggers, specify from_status_name and to_status_name. For attribute_value_changed triggers, specify field and change_type.

approval_type

string

The approval outcome to match. Used with case_review_approved triggers.

change_type

string

The kind of attribute change to match. Allowed values: VALUE_ADDED, VALUE_DELETED, ANY_CHANGES. Used with attribute_value_changed triggers.

field

string

The case attribute field name to monitor for changes. Used with attribute_value_changed triggers.

from_status_name

string

The originating status name. Used with status_transitioned triggers to match transitions from this status.

to_status_name

string

The destination status name. Used with status_transitioned triggers to match transitions to this status.

type [required]

enum

The case event that activates the automation rule. Allowed enum values: case_created,status_transitioned,attribute_value_changed,event_correlation_signal_correlated,case_review_approved,comment_added

id [required]

string

Automation rule identifier.

relationships

object

Related resources for the automation rule, including the users who created and last modified it.

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

type [required]

enum

JSON:API resource type for case automation rules. Allowed enum values: rule

default: rule

{
  "data": [
    {
      "attributes": {
        "action": {
          "data": {
            "agent_type": "string",
            "assigned_agent_id": "string",
            "handle": "workflow-handle-123"
          },
          "type": "execute_workflow"
        },
        "created_at": "2024-01-01T00:00:00.000Z",
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "Auto-assign workflow",
        "state": "ENABLED",
        "trigger": {
          "data": {
            "approval_type": "string",
            "change_type": "string",
            "field": "string",
            "from_status_name": "string",
            "to_status_name": "string"
          },
          "type": "case_created"
        }
      },
      "id": "e6773723-fe58-49ff-9975-dff00f14e28d",
      "relationships": {
        "created_by": {
          "data": {
            "id": "00000000-0000-0000-0000-000000000000",
            "type": "user"
          }
        },
        "modified_by": {
          "data": {
            "id": "00000000-0000-0000-0000-000000000000",
            "type": "user"
          }
        }
      },
      "type": "rule"
    }
  ]
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  # Path parameters
export project_id="e555e290-ed65-49bd-ae18-8acbfcf18db7"
# 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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/projects/${project_id}/rules" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

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

POST https://api.ap1.datadoghq.com/api/v2/cases/projects/{project_id}/ruleshttps://api.ap2.datadoghq.com/api/v2/cases/projects/{project_id}/ruleshttps://api.datadoghq.eu/api/v2/cases/projects/{project_id}/ruleshttps://api.ddog-gov.com/api/v2/cases/projects/{project_id}/ruleshttps://api.us2.ddog-gov.com/api/v2/cases/projects/{project_id}/ruleshttps://api.datadoghq.com/api/v2/cases/projects/{project_id}/ruleshttps://api.us3.datadoghq.com/api/v2/cases/projects/{project_id}/ruleshttps://api.us5.datadoghq.com/api/v2/cases/projects/{project_id}/rules

Información general

Creates an automation rule for a project. The rule defines a trigger event (for example, case created, status transitioned) and an action to execute.

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

project_id [required]

string

The UUID of the project that owns the automation rules.

Solicitud

Body Data (required)

Automation rule payload.

Expand All

Campo

Tipo

Descripción

data [required]

object

Data object for creating an automation rule.

attributes [required]

object

Attributes required to create an automation rule.

action [required]

object

Defines what happens when the rule triggers. Combines an action type with action-specific configuration data.

data [required]

object

Configuration for the action to execute, dependent on the action type.

agent_type

string

The type of AI agent to assign. Required when the action type is assign_agent.

assigned_agent_id

string

The identifier of the AI agent to assign to the case. Required when the action type is assign_agent.

handle

string

The handle of the Datadog workflow to execute. Required when the action type is execute_workflow.

type [required]

enum

The type of automated action to perform when the rule triggers. execute_workflow runs a Datadog workflow; assign_agent assigns an AI agent to the case. Allowed enum values: execute_workflow,assign_agent

name [required]

string

Name of the automation rule.

state

enum

Whether the automation rule is active. Enabled rules trigger on matching case events; disabled rules are inactive but preserve their configuration. Allowed enum values: ENABLED,DISABLED

trigger [required]

object

Defines when the rule activates. Combines a trigger type (the case event to listen for) with optional trigger data (conditions that narrow when the trigger fires).

data

object

Additional configuration for the trigger, dependent on the trigger type. For status_transitioned triggers, specify from_status_name and to_status_name. For attribute_value_changed triggers, specify field and change_type.

approval_type

string

The approval outcome to match. Used with case_review_approved triggers.

change_type

string

The kind of attribute change to match. Allowed values: VALUE_ADDED, VALUE_DELETED, ANY_CHANGES. Used with attribute_value_changed triggers.

field

string

The case attribute field name to monitor for changes. Used with attribute_value_changed triggers.

from_status_name

string

The originating status name. Used with status_transitioned triggers to match transitions from this status.

to_status_name

string

The destination status name. Used with status_transitioned triggers to match transitions to this status.

type [required]

enum

The case event that activates the automation rule. Allowed enum values: case_created,status_transitioned,attribute_value_changed,event_correlation_signal_correlated,case_review_approved,comment_added

type [required]

enum

JSON:API resource type for case automation rules. Allowed enum values: rule

default: rule

{
  "data": {
    "attributes": {
      "action": {
        "data": {
          "agent_type": "string",
          "assigned_agent_id": "string",
          "handle": "workflow-handle-123"
        },
        "type": "execute_workflow"
      },
      "name": "Auto-assign workflow",
      "state": "ENABLED",
      "trigger": {
        "data": {
          "approval_type": "string",
          "change_type": "string",
          "field": "string",
          "from_status_name": "string",
          "to_status_name": "string"
        },
        "type": "case_created"
      }
    },
    "type": "rule"
  }
}

Respuesta

Created

Response containing a single automation rule.

Expand All

Campo

Tipo

Descripción

data [required]

object

An automation rule that executes an action (such as running a Datadog workflow or assigning an AI agent) when a specified case event occurs within a project.

attributes [required]

object

Core attributes of an automation rule, including its name, trigger condition, action to execute, and current state.

action [required]

object

Defines what happens when the rule triggers. Combines an action type with action-specific configuration data.

data [required]

object

Configuration for the action to execute, dependent on the action type.

agent_type

string

The type of AI agent to assign. Required when the action type is assign_agent.

assigned_agent_id

string

The identifier of the AI agent to assign to the case. Required when the action type is assign_agent.

handle

string

The handle of the Datadog workflow to execute. Required when the action type is execute_workflow.

type [required]

enum

The type of automated action to perform when the rule triggers. execute_workflow runs a Datadog workflow; assign_agent assigns an AI agent to the case. Allowed enum values: execute_workflow,assign_agent

created_at [required]

date-time

Timestamp when the automation rule was created.

modified_at

date-time

Timestamp when the automation rule was last modified.

name [required]

string

A human-readable name for the automation rule, used to identify the rule in the UI and API responses.

state [required]

enum

Whether the automation rule is active. Enabled rules trigger on matching case events; disabled rules are inactive but preserve their configuration. Allowed enum values: ENABLED,DISABLED

trigger [required]

object

Defines when the rule activates. Combines a trigger type (the case event to listen for) with optional trigger data (conditions that narrow when the trigger fires).

data

object

Additional configuration for the trigger, dependent on the trigger type. For status_transitioned triggers, specify from_status_name and to_status_name. For attribute_value_changed triggers, specify field and change_type.

approval_type

string

The approval outcome to match. Used with case_review_approved triggers.

change_type

string

The kind of attribute change to match. Allowed values: VALUE_ADDED, VALUE_DELETED, ANY_CHANGES. Used with attribute_value_changed triggers.

field

string

The case attribute field name to monitor for changes. Used with attribute_value_changed triggers.

from_status_name

string

The originating status name. Used with status_transitioned triggers to match transitions from this status.

to_status_name

string

The destination status name. Used with status_transitioned triggers to match transitions to this status.

type [required]

enum

The case event that activates the automation rule. Allowed enum values: case_created,status_transitioned,attribute_value_changed,event_correlation_signal_correlated,case_review_approved,comment_added

id [required]

string

Automation rule identifier.

relationships

object

Related resources for the automation rule, including the users who created and last modified it.

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

type [required]

enum

JSON:API resource type for case automation rules. Allowed enum values: rule

default: rule

{
  "data": {
    "attributes": {
      "action": {
        "data": {
          "agent_type": "string",
          "assigned_agent_id": "string",
          "handle": "workflow-handle-123"
        },
        "type": "execute_workflow"
      },
      "created_at": "2024-01-01T00:00:00.000Z",
      "modified_at": "2019-09-19T10:00:00.000Z",
      "name": "Auto-assign workflow",
      "state": "ENABLED",
      "trigger": {
        "data": {
          "approval_type": "string",
          "change_type": "string",
          "field": "string",
          "from_status_name": "string",
          "to_status_name": "string"
        },
        "type": "case_created"
      }
    },
    "id": "e6773723-fe58-49ff-9975-dff00f14e28d",
    "relationships": {
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      }
    },
    "type": "rule"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  ## default
# 

# Path parameters
export project_id="e555e290-ed65-49bd-ae18-8acbfcf18db7"
# Curl command
curl -X POST "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/projects/${project_id}/rules" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "action": { "data": { "handle": "workflow-handle-123" }, "type": "execute_workflow" }, "name": "Auto-assign workflow", "state": "ENABLED", "trigger": { "type": "case_created" } }, "type": "rule" } } EOF

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/cases/projects/{project_id}/rules/{rule_id}https://api.ap2.datadoghq.com/api/v2/cases/projects/{project_id}/rules/{rule_id}https://api.datadoghq.eu/api/v2/cases/projects/{project_id}/rules/{rule_id}https://api.ddog-gov.com/api/v2/cases/projects/{project_id}/rules/{rule_id}https://api.us2.ddog-gov.com/api/v2/cases/projects/{project_id}/rules/{rule_id}https://api.datadoghq.com/api/v2/cases/projects/{project_id}/rules/{rule_id}https://api.us3.datadoghq.com/api/v2/cases/projects/{project_id}/rules/{rule_id}https://api.us5.datadoghq.com/api/v2/cases/projects/{project_id}/rules/{rule_id}

Información general

Returns a single automation rule identified by its UUID, including its trigger, action, and current state (enabled/disabled).

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

project_id [required]

string

The UUID of the project that owns the automation rules.

rule_id [required]

string

The UUID of the automation rule.

Respuesta

OK

Response containing a single automation rule.

Expand All

Campo

Tipo

Descripción

data [required]

object

An automation rule that executes an action (such as running a Datadog workflow or assigning an AI agent) when a specified case event occurs within a project.

attributes [required]

object

Core attributes of an automation rule, including its name, trigger condition, action to execute, and current state.

action [required]

object

Defines what happens when the rule triggers. Combines an action type with action-specific configuration data.

data [required]

object

Configuration for the action to execute, dependent on the action type.

agent_type

string

The type of AI agent to assign. Required when the action type is assign_agent.

assigned_agent_id

string

The identifier of the AI agent to assign to the case. Required when the action type is assign_agent.

handle

string

The handle of the Datadog workflow to execute. Required when the action type is execute_workflow.

type [required]

enum

The type of automated action to perform when the rule triggers. execute_workflow runs a Datadog workflow; assign_agent assigns an AI agent to the case. Allowed enum values: execute_workflow,assign_agent

created_at [required]

date-time

Timestamp when the automation rule was created.

modified_at

date-time

Timestamp when the automation rule was last modified.

name [required]

string

A human-readable name for the automation rule, used to identify the rule in the UI and API responses.

state [required]

enum

Whether the automation rule is active. Enabled rules trigger on matching case events; disabled rules are inactive but preserve their configuration. Allowed enum values: ENABLED,DISABLED

trigger [required]

object

Defines when the rule activates. Combines a trigger type (the case event to listen for) with optional trigger data (conditions that narrow when the trigger fires).

data

object

Additional configuration for the trigger, dependent on the trigger type. For status_transitioned triggers, specify from_status_name and to_status_name. For attribute_value_changed triggers, specify field and change_type.

approval_type

string

The approval outcome to match. Used with case_review_approved triggers.

change_type

string

The kind of attribute change to match. Allowed values: VALUE_ADDED, VALUE_DELETED, ANY_CHANGES. Used with attribute_value_changed triggers.

field

string

The case attribute field name to monitor for changes. Used with attribute_value_changed triggers.

from_status_name

string

The originating status name. Used with status_transitioned triggers to match transitions from this status.

to_status_name

string

The destination status name. Used with status_transitioned triggers to match transitions to this status.

type [required]

enum

The case event that activates the automation rule. Allowed enum values: case_created,status_transitioned,attribute_value_changed,event_correlation_signal_correlated,case_review_approved,comment_added

id [required]

string

Automation rule identifier.

relationships

object

Related resources for the automation rule, including the users who created and last modified it.

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

type [required]

enum

JSON:API resource type for case automation rules. Allowed enum values: rule

default: rule

{
  "data": {
    "attributes": {
      "action": {
        "data": {
          "agent_type": "string",
          "assigned_agent_id": "string",
          "handle": "workflow-handle-123"
        },
        "type": "execute_workflow"
      },
      "created_at": "2024-01-01T00:00:00.000Z",
      "modified_at": "2019-09-19T10:00:00.000Z",
      "name": "Auto-assign workflow",
      "state": "ENABLED",
      "trigger": {
        "data": {
          "approval_type": "string",
          "change_type": "string",
          "field": "string",
          "from_status_name": "string",
          "to_status_name": "string"
        },
        "type": "case_created"
      }
    },
    "id": "e6773723-fe58-49ff-9975-dff00f14e28d",
    "relationships": {
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      }
    },
    "type": "rule"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  # Path parameters
export project_id="e555e290-ed65-49bd-ae18-8acbfcf18db7"
export rule_id="e6773723-fe58-49ff-9975-dff00f14e28d"
# 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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/projects/${project_id}/rules/${rule_id}" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

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

PUT https://api.ap1.datadoghq.com/api/v2/cases/projects/{project_id}/rules/{rule_id}https://api.ap2.datadoghq.com/api/v2/cases/projects/{project_id}/rules/{rule_id}https://api.datadoghq.eu/api/v2/cases/projects/{project_id}/rules/{rule_id}https://api.ddog-gov.com/api/v2/cases/projects/{project_id}/rules/{rule_id}https://api.us2.ddog-gov.com/api/v2/cases/projects/{project_id}/rules/{rule_id}https://api.datadoghq.com/api/v2/cases/projects/{project_id}/rules/{rule_id}https://api.us3.datadoghq.com/api/v2/cases/projects/{project_id}/rules/{rule_id}https://api.us5.datadoghq.com/api/v2/cases/projects/{project_id}/rules/{rule_id}

Información general

Updates the trigger, action, name, or state of an existing automation rule.

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

project_id [required]

string

The UUID of the project that owns the automation rules.

rule_id [required]

string

The UUID of the automation rule.

Solicitud

Body Data (required)

Automation rule payload.

Expand All

Campo

Tipo

Descripción

data [required]

object

Data object for updating an automation rule.

attributes

object

Attributes required to create an automation rule.

action [required]

object

Defines what happens when the rule triggers. Combines an action type with action-specific configuration data.

data [required]

object

Configuration for the action to execute, dependent on the action type.

agent_type

string

The type of AI agent to assign. Required when the action type is assign_agent.

assigned_agent_id

string

The identifier of the AI agent to assign to the case. Required when the action type is assign_agent.

handle

string

The handle of the Datadog workflow to execute. Required when the action type is execute_workflow.

type [required]

enum

The type of automated action to perform when the rule triggers. execute_workflow runs a Datadog workflow; assign_agent assigns an AI agent to the case. Allowed enum values: execute_workflow,assign_agent

name [required]

string

Name of the automation rule.

state

enum

Whether the automation rule is active. Enabled rules trigger on matching case events; disabled rules are inactive but preserve their configuration. Allowed enum values: ENABLED,DISABLED

trigger [required]

object

Defines when the rule activates. Combines a trigger type (the case event to listen for) with optional trigger data (conditions that narrow when the trigger fires).

data

object

Additional configuration for the trigger, dependent on the trigger type. For status_transitioned triggers, specify from_status_name and to_status_name. For attribute_value_changed triggers, specify field and change_type.

approval_type

string

The approval outcome to match. Used with case_review_approved triggers.

change_type

string

The kind of attribute change to match. Allowed values: VALUE_ADDED, VALUE_DELETED, ANY_CHANGES. Used with attribute_value_changed triggers.

field

string

The case attribute field name to monitor for changes. Used with attribute_value_changed triggers.

from_status_name

string

The originating status name. Used with status_transitioned triggers to match transitions from this status.

to_status_name

string

The destination status name. Used with status_transitioned triggers to match transitions to this status.

type [required]

enum

The case event that activates the automation rule. Allowed enum values: case_created,status_transitioned,attribute_value_changed,event_correlation_signal_correlated,case_review_approved,comment_added

type [required]

enum

JSON:API resource type for case automation rules. Allowed enum values: rule

default: rule

{
  "data": {
    "attributes": {
      "action": {
        "data": {
          "agent_type": "string",
          "assigned_agent_id": "string",
          "handle": "workflow-handle-123"
        },
        "type": "execute_workflow"
      },
      "name": "Auto-assign workflow",
      "state": "ENABLED",
      "trigger": {
        "data": {
          "approval_type": "string",
          "change_type": "string",
          "field": "string",
          "from_status_name": "string",
          "to_status_name": "string"
        },
        "type": "case_created"
      }
    },
    "type": "rule"
  }
}

Respuesta

OK

Response containing a single automation rule.

Expand All

Campo

Tipo

Descripción

data [required]

object

An automation rule that executes an action (such as running a Datadog workflow or assigning an AI agent) when a specified case event occurs within a project.

attributes [required]

object

Core attributes of an automation rule, including its name, trigger condition, action to execute, and current state.

action [required]

object

Defines what happens when the rule triggers. Combines an action type with action-specific configuration data.

data [required]

object

Configuration for the action to execute, dependent on the action type.

agent_type

string

The type of AI agent to assign. Required when the action type is assign_agent.

assigned_agent_id

string

The identifier of the AI agent to assign to the case. Required when the action type is assign_agent.

handle

string

The handle of the Datadog workflow to execute. Required when the action type is execute_workflow.

type [required]

enum

The type of automated action to perform when the rule triggers. execute_workflow runs a Datadog workflow; assign_agent assigns an AI agent to the case. Allowed enum values: execute_workflow,assign_agent

created_at [required]

date-time

Timestamp when the automation rule was created.

modified_at

date-time

Timestamp when the automation rule was last modified.

name [required]

string

A human-readable name for the automation rule, used to identify the rule in the UI and API responses.

state [required]

enum

Whether the automation rule is active. Enabled rules trigger on matching case events; disabled rules are inactive but preserve their configuration. Allowed enum values: ENABLED,DISABLED

trigger [required]

object

Defines when the rule activates. Combines a trigger type (the case event to listen for) with optional trigger data (conditions that narrow when the trigger fires).

data

object

Additional configuration for the trigger, dependent on the trigger type. For status_transitioned triggers, specify from_status_name and to_status_name. For attribute_value_changed triggers, specify field and change_type.

approval_type

string

The approval outcome to match. Used with case_review_approved triggers.

change_type

string

The kind of attribute change to match. Allowed values: VALUE_ADDED, VALUE_DELETED, ANY_CHANGES. Used with attribute_value_changed triggers.

field

string

The case attribute field name to monitor for changes. Used with attribute_value_changed triggers.

from_status_name

string

The originating status name. Used with status_transitioned triggers to match transitions from this status.

to_status_name

string

The destination status name. Used with status_transitioned triggers to match transitions to this status.

type [required]

enum

The case event that activates the automation rule. Allowed enum values: case_created,status_transitioned,attribute_value_changed,event_correlation_signal_correlated,case_review_approved,comment_added

id [required]

string

Automation rule identifier.

relationships

object

Related resources for the automation rule, including the users who created and last modified it.

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

type [required]

enum

JSON:API resource type for case automation rules. Allowed enum values: rule

default: rule

{
  "data": {
    "attributes": {
      "action": {
        "data": {
          "agent_type": "string",
          "assigned_agent_id": "string",
          "handle": "workflow-handle-123"
        },
        "type": "execute_workflow"
      },
      "created_at": "2024-01-01T00:00:00.000Z",
      "modified_at": "2019-09-19T10:00:00.000Z",
      "name": "Auto-assign workflow",
      "state": "ENABLED",
      "trigger": {
        "data": {
          "approval_type": "string",
          "change_type": "string",
          "field": "string",
          "from_status_name": "string",
          "to_status_name": "string"
        },
        "type": "case_created"
      }
    },
    "id": "e6773723-fe58-49ff-9975-dff00f14e28d",
    "relationships": {
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      }
    },
    "type": "rule"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  ## default
# 

# Path parameters
export project_id="e555e290-ed65-49bd-ae18-8acbfcf18db7"
export rule_id="e6773723-fe58-49ff-9975-dff00f14e28d"
# Curl command
curl -X PUT "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/projects/${project_id}/rules/${rule_id}" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "action": { "data": { "handle": "workflow-handle-123" }, "type": "execute_workflow" }, "name": "Auto-assign workflow", "state": "ENABLED", "trigger": { "type": "case_created" } }, "type": "rule" } } EOF

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

DELETE https://api.ap1.datadoghq.com/api/v2/cases/projects/{project_id}/rules/{rule_id}https://api.ap2.datadoghq.com/api/v2/cases/projects/{project_id}/rules/{rule_id}https://api.datadoghq.eu/api/v2/cases/projects/{project_id}/rules/{rule_id}https://api.ddog-gov.com/api/v2/cases/projects/{project_id}/rules/{rule_id}https://api.us2.ddog-gov.com/api/v2/cases/projects/{project_id}/rules/{rule_id}https://api.datadoghq.com/api/v2/cases/projects/{project_id}/rules/{rule_id}https://api.us3.datadoghq.com/api/v2/cases/projects/{project_id}/rules/{rule_id}https://api.us5.datadoghq.com/api/v2/cases/projects/{project_id}/rules/{rule_id}

Información general

Permanently deletes an automation rule from a project.

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

project_id [required]

string

The UUID of the project that owns the automation rules.

rule_id [required]

string

The UUID of the automation rule.

Respuesta

No Content

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  # Path parameters
export project_id="e555e290-ed65-49bd-ae18-8acbfcf18db7"
export rule_id="e6773723-fe58-49ff-9975-dff00f14e28d"
# Curl command
curl -X DELETE "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/projects/${project_id}/rules/${rule_id}" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

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

POST https://api.ap1.datadoghq.com/api/v2/cases/projects/{project_id}/rules/{rule_id}/enablehttps://api.ap2.datadoghq.com/api/v2/cases/projects/{project_id}/rules/{rule_id}/enablehttps://api.datadoghq.eu/api/v2/cases/projects/{project_id}/rules/{rule_id}/enablehttps://api.ddog-gov.com/api/v2/cases/projects/{project_id}/rules/{rule_id}/enablehttps://api.us2.ddog-gov.com/api/v2/cases/projects/{project_id}/rules/{rule_id}/enablehttps://api.datadoghq.com/api/v2/cases/projects/{project_id}/rules/{rule_id}/enablehttps://api.us3.datadoghq.com/api/v2/cases/projects/{project_id}/rules/{rule_id}/enablehttps://api.us5.datadoghq.com/api/v2/cases/projects/{project_id}/rules/{rule_id}/enable

Información general

Enables a previously disabled automation rule so it triggers on matching case events.

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

project_id [required]

string

The UUID of the project that owns the automation rules.

rule_id [required]

string

The UUID of the automation rule.

Respuesta

OK

Response containing a single automation rule.

Expand All

Campo

Tipo

Descripción

data [required]

object

An automation rule that executes an action (such as running a Datadog workflow or assigning an AI agent) when a specified case event occurs within a project.

attributes [required]

object

Core attributes of an automation rule, including its name, trigger condition, action to execute, and current state.

action [required]

object

Defines what happens when the rule triggers. Combines an action type with action-specific configuration data.

data [required]

object

Configuration for the action to execute, dependent on the action type.

agent_type

string

The type of AI agent to assign. Required when the action type is assign_agent.

assigned_agent_id

string

The identifier of the AI agent to assign to the case. Required when the action type is assign_agent.

handle

string

The handle of the Datadog workflow to execute. Required when the action type is execute_workflow.

type [required]

enum

The type of automated action to perform when the rule triggers. execute_workflow runs a Datadog workflow; assign_agent assigns an AI agent to the case. Allowed enum values: execute_workflow,assign_agent

created_at [required]

date-time

Timestamp when the automation rule was created.

modified_at

date-time

Timestamp when the automation rule was last modified.

name [required]

string

A human-readable name for the automation rule, used to identify the rule in the UI and API responses.

state [required]

enum

Whether the automation rule is active. Enabled rules trigger on matching case events; disabled rules are inactive but preserve their configuration. Allowed enum values: ENABLED,DISABLED

trigger [required]

object

Defines when the rule activates. Combines a trigger type (the case event to listen for) with optional trigger data (conditions that narrow when the trigger fires).

data

object

Additional configuration for the trigger, dependent on the trigger type. For status_transitioned triggers, specify from_status_name and to_status_name. For attribute_value_changed triggers, specify field and change_type.

approval_type

string

The approval outcome to match. Used with case_review_approved triggers.

change_type

string

The kind of attribute change to match. Allowed values: VALUE_ADDED, VALUE_DELETED, ANY_CHANGES. Used with attribute_value_changed triggers.

field

string

The case attribute field name to monitor for changes. Used with attribute_value_changed triggers.

from_status_name

string

The originating status name. Used with status_transitioned triggers to match transitions from this status.

to_status_name

string

The destination status name. Used with status_transitioned triggers to match transitions to this status.

type [required]

enum

The case event that activates the automation rule. Allowed enum values: case_created,status_transitioned,attribute_value_changed,event_correlation_signal_correlated,case_review_approved,comment_added

id [required]

string

Automation rule identifier.

relationships

object

Related resources for the automation rule, including the users who created and last modified it.

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

type [required]

enum

JSON:API resource type for case automation rules. Allowed enum values: rule

default: rule

{
  "data": {
    "attributes": {
      "action": {
        "data": {
          "agent_type": "string",
          "assigned_agent_id": "string",
          "handle": "workflow-handle-123"
        },
        "type": "execute_workflow"
      },
      "created_at": "2024-01-01T00:00:00.000Z",
      "modified_at": "2019-09-19T10:00:00.000Z",
      "name": "Auto-assign workflow",
      "state": "ENABLED",
      "trigger": {
        "data": {
          "approval_type": "string",
          "change_type": "string",
          "field": "string",
          "from_status_name": "string",
          "to_status_name": "string"
        },
        "type": "case_created"
      }
    },
    "id": "e6773723-fe58-49ff-9975-dff00f14e28d",
    "relationships": {
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      }
    },
    "type": "rule"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  # Path parameters
export project_id="e555e290-ed65-49bd-ae18-8acbfcf18db7"
export rule_id="e6773723-fe58-49ff-9975-dff00f14e28d"
# Curl command
curl -X POST "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/projects/${project_id}/rules/${rule_id}/enable" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

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

POST https://api.ap1.datadoghq.com/api/v2/cases/projects/{project_id}/rules/{rule_id}/disablehttps://api.ap2.datadoghq.com/api/v2/cases/projects/{project_id}/rules/{rule_id}/disablehttps://api.datadoghq.eu/api/v2/cases/projects/{project_id}/rules/{rule_id}/disablehttps://api.ddog-gov.com/api/v2/cases/projects/{project_id}/rules/{rule_id}/disablehttps://api.us2.ddog-gov.com/api/v2/cases/projects/{project_id}/rules/{rule_id}/disablehttps://api.datadoghq.com/api/v2/cases/projects/{project_id}/rules/{rule_id}/disablehttps://api.us3.datadoghq.com/api/v2/cases/projects/{project_id}/rules/{rule_id}/disablehttps://api.us5.datadoghq.com/api/v2/cases/projects/{project_id}/rules/{rule_id}/disable

Información general

Disables an automation rule so it no longer triggers on case events. The rule configuration is preserved.

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

project_id [required]

string

The UUID of the project that owns the automation rules.

rule_id [required]

string

The UUID of the automation rule.

Respuesta

OK

Response containing a single automation rule.

Expand All

Campo

Tipo

Descripción

data [required]

object

An automation rule that executes an action (such as running a Datadog workflow or assigning an AI agent) when a specified case event occurs within a project.

attributes [required]

object

Core attributes of an automation rule, including its name, trigger condition, action to execute, and current state.

action [required]

object

Defines what happens when the rule triggers. Combines an action type with action-specific configuration data.

data [required]

object

Configuration for the action to execute, dependent on the action type.

agent_type

string

The type of AI agent to assign. Required when the action type is assign_agent.

assigned_agent_id

string

The identifier of the AI agent to assign to the case. Required when the action type is assign_agent.

handle

string

The handle of the Datadog workflow to execute. Required when the action type is execute_workflow.

type [required]

enum

The type of automated action to perform when the rule triggers. execute_workflow runs a Datadog workflow; assign_agent assigns an AI agent to the case. Allowed enum values: execute_workflow,assign_agent

created_at [required]

date-time

Timestamp when the automation rule was created.

modified_at

date-time

Timestamp when the automation rule was last modified.

name [required]

string

A human-readable name for the automation rule, used to identify the rule in the UI and API responses.

state [required]

enum

Whether the automation rule is active. Enabled rules trigger on matching case events; disabled rules are inactive but preserve their configuration. Allowed enum values: ENABLED,DISABLED

trigger [required]

object

Defines when the rule activates. Combines a trigger type (the case event to listen for) with optional trigger data (conditions that narrow when the trigger fires).

data

object

Additional configuration for the trigger, dependent on the trigger type. For status_transitioned triggers, specify from_status_name and to_status_name. For attribute_value_changed triggers, specify field and change_type.

approval_type

string

The approval outcome to match. Used with case_review_approved triggers.

change_type

string

The kind of attribute change to match. Allowed values: VALUE_ADDED, VALUE_DELETED, ANY_CHANGES. Used with attribute_value_changed triggers.

field

string

The case attribute field name to monitor for changes. Used with attribute_value_changed triggers.

from_status_name

string

The originating status name. Used with status_transitioned triggers to match transitions from this status.

to_status_name

string

The destination status name. Used with status_transitioned triggers to match transitions to this status.

type [required]

enum

The case event that activates the automation rule. Allowed enum values: case_created,status_transitioned,attribute_value_changed,event_correlation_signal_correlated,case_review_approved,comment_added

id [required]

string

Automation rule identifier.

relationships

object

Related resources for the automation rule, including the users who created and last modified it.

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

type [required]

enum

JSON:API resource type for case automation rules. Allowed enum values: rule

default: rule

{
  "data": {
    "attributes": {
      "action": {
        "data": {
          "agent_type": "string",
          "assigned_agent_id": "string",
          "handle": "workflow-handle-123"
        },
        "type": "execute_workflow"
      },
      "created_at": "2024-01-01T00:00:00.000Z",
      "modified_at": "2019-09-19T10:00:00.000Z",
      "name": "Auto-assign workflow",
      "state": "ENABLED",
      "trigger": {
        "data": {
          "approval_type": "string",
          "change_type": "string",
          "field": "string",
          "from_status_name": "string",
          "to_status_name": "string"
        },
        "type": "case_created"
      }
    },
    "id": "e6773723-fe58-49ff-9975-dff00f14e28d",
    "relationships": {
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      }
    },
    "type": "rule"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  # Path parameters
export project_id="e555e290-ed65-49bd-ae18-8acbfcf18db7"
export rule_id="e6773723-fe58-49ff-9975-dff00f14e28d"
# Curl command
curl -X POST "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/projects/${project_id}/rules/${rule_id}/disable" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

POST https://api.ap1.datadoghq.com/api/v2/caseshttps://api.ap2.datadoghq.com/api/v2/caseshttps://api.datadoghq.eu/api/v2/caseshttps://api.ddog-gov.com/api/v2/caseshttps://api.us2.ddog-gov.com/api/v2/caseshttps://api.datadoghq.com/api/v2/caseshttps://api.us3.datadoghq.com/api/v2/caseshttps://api.us5.datadoghq.com/api/v2/cases

Información general

Create a Case

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

Solicitud

Body Data (required)

Case payload

Expand All

Campo

Tipo

Descripción

data [required]

object

Case creation data

attributes [required]

object

Case creation attributes

custom_attributes

object

Case custom attributes

<any-key>

object

A typed value for a custom attribute on a specific case.

is_multi [required]

boolean

If true, value must be an array

type [required]

enum

The data type of the custom attribute, which determines the allowed values and UI input control. Allowed enum values: URL,TEXT,NUMBER,SELECT

value [required]

 <oneOf>

The value of a custom attribute. The accepted format depends on the attribute's type and whether it accepts multiple values.

Option 1

string

A string value for a TEXT, URL, or SELECT-type custom attribute.

Option 2

[string]

An array of string values for a multi-value TEXT, URL, or SELECT-type custom attribute.

Option 3

double

A numeric value for a NUMBER-type custom attribute.

Option 4

[number]

An array of numeric values for a multi-value NUMBER-type custom attribute.

description

string

Description

priority

enum

Case priority Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5

default: NOT_DEFINED

status_name

string

Status of the case. Must be one of the existing statuses for the case's type.

title [required]

string

Title

type_id [required]

string

Case type UUID

relationships

object

Relationships formed with the case on creation

assignee

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

project [required]

object

Relationship to project.

data [required]

object

Relationship to project object.

id [required]

string

A unique identifier that represents the project.

type [required]

enum

Project resource type. Allowed enum values: project

default: project

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "priority": "NOT_DEFINED",
      "title": "Security breach investigation in 0cfbc5cbc676ee71",
      "type_id": "00000000-0000-0000-0000-000000000001"
    },
    "relationships": {
      "assignee": {
        "data": {
          "id": "string",
          "type": "user"
        }
      },
      "project": {
        "data": {
          "id": "d4bbe1af-f36e-42f1-87c1-493ca35c320e",
          "type": "project"
        }
      }
    },
    "type": "case"
  }
}

Respuesta

CREATED

Case response

Expand All

Campo

Tipo

Descripción

data

object

A case

attributes [required]

object

Case resource attributes

archived_at

date-time

Timestamp of when the case was archived

attributes

object

Key-value pairs of case attributes. Each key maps to an array of string values, used for flexible metadata such as labels or tags.

<any-key>

[string]

closed_at

date-time

Timestamp of when the case was closed

created_at

date-time

Timestamp of when the case was created

custom_attributes

object

Case custom attributes

<any-key>

object

A typed value for a custom attribute on a specific case.

is_multi [required]

boolean

If true, value must be an array

type [required]

enum

The data type of the custom attribute, which determines the allowed values and UI input control. Allowed enum values: URL,TEXT,NUMBER,SELECT

value [required]

 <oneOf>

The value of a custom attribute. The accepted format depends on the attribute's type and whether it accepts multiple values.

Option 1

string

A string value for a TEXT, URL, or SELECT-type custom attribute.

Option 2

[string]

An array of string values for a multi-value TEXT, URL, or SELECT-type custom attribute.

Option 3

double

A numeric value for a NUMBER-type custom attribute.

Option 4

[number]

An array of numeric values for a multi-value NUMBER-type custom attribute.

description

string

Description

jira_issue

object

Jira issue attached to case

result

object

Jira issue information

issue_id

string

Jira issue ID

issue_key

string

Jira issue key

issue_url

string

Jira issue URL

project_key

string

Jira project key

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

key

string

Key

modified_at

date-time

Timestamp of when the case was last modified

priority

enum

Case priority Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5

default: NOT_DEFINED

service_now_ticket

object

ServiceNow ticket attached to case

result

object

ServiceNow ticket information

sys_target_link

string

Link to the Incident created on ServiceNow

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

status

enum

DEPRECATED: Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use status_name instead. Allowed enum values: OPEN,IN_PROGRESS,CLOSED

status_group

enum

Status group of the case. Allowed enum values: SG_OPEN,SG_IN_PROGRESS,SG_CLOSED

status_name

string

Status of the case. Must be one of the existing statuses for the case's type.

title

string

Title

type

enum

DEPRECATED: Case type Allowed enum values: STANDARD

type_id

string

Case type UUID

id [required]

string

Case's identifier

relationships

object

Resources related to a case

assignee

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

project

object

Relationship to project.

data [required]

object

Relationship to project object.

id [required]

string

A unique identifier that represents the project.

type [required]

enum

Project resource type. Allowed enum values: project

default: project

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "archived_at": "2019-09-19T10:00:00.000Z",
      "attributes": {
        "<any-key>": []
      },
      "closed_at": "2019-09-19T10:00:00.000Z",
      "created_at": "2019-09-19T10:00:00.000Z",
      "custom_attributes": {
        "<any-key>": {
          "is_multi": false,
          "type": "NUMBER",
          "value": {
            "description": "",
            "type": ""
          }
        }
      },
      "description": "string",
      "jira_issue": {
        "result": {
          "issue_id": "string",
          "issue_key": "string",
          "issue_url": "string",
          "project_key": "string"
        },
        "status": "COMPLETED"
      },
      "key": "CASEM-4523",
      "modified_at": "2019-09-19T10:00:00.000Z",
      "priority": "NOT_DEFINED",
      "service_now_ticket": {
        "result": {
          "sys_target_link": "string"
        },
        "status": "COMPLETED"
      },
      "status": "OPEN",
      "status_group": "SG_OPEN",
      "status_name": "Open",
      "title": "Memory leak investigation on API",
      "type": "STANDARD",
      "type_id": "3b010bde-09ce-4449-b745-71dd5f861963"
    },
    "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
    "relationships": {
      "assignee": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "project": {
        "data": {
          "id": "e555e290-ed65-49bd-ae18-8acbfcf18db7",
          "type": "project"
        }
      }
    },
    "type": "case"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                          ## default
# 

# Curl command
curl -X POST "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "priority": "NOT_DEFINED", "status_name": "Open", "title": "Security breach investigation", "type_id": "3b010bde-09ce-4449-b745-71dd5f861963" }, "relationships": { "assignee": { "data": { "id": "00000000-0000-0000-0000-000000000000", "type": "user" } }, "project": { "data": { "id": "e555e290-ed65-49bd-ae18-8acbfcf18db7", "type": "project" } } }, "type": "case" } } EOF
// Create a case returns "CREATED" 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"
)

func main() {
	// there is a valid "user" in the system
	UserDataID := os.Getenv("USER_DATA_ID")

	body := datadogV2.CaseCreateRequest{
		Data: datadogV2.CaseCreate{
			Attributes: datadogV2.CaseCreateAttributes{
				Priority: datadogV2.CASEPRIORITY_NOT_DEFINED.Ptr(),
				Title:    "Security breach investigation in 0cfbc5cbc676ee71",
				TypeId:   "00000000-0000-0000-0000-000000000001",
			},
			Relationships: &datadogV2.CaseCreateRelationships{
				Assignee: *datadogV2.NewNullableNullableUserRelationship(&datadogV2.NullableUserRelationship{
					Data: *datadogV2.NewNullableNullableUserRelationshipData(&datadogV2.NullableUserRelationshipData{
						Id:   UserDataID,
						Type: datadogV2.USERRESOURCETYPE_USER,
					}),
				}),
				Project: datadogV2.ProjectRelationship{
					Data: datadogV2.ProjectRelationshipData{
						Id:   "d4bbe1af-f36e-42f1-87c1-493ca35c320e",
						Type: datadogV2.PROJECTRESOURCETYPE_PROJECT,
					},
				},
			},
			Type: datadogV2.CASERESOURCETYPE_CASE,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCaseManagementApi(apiClient)
	resp, r, err := api.CreateCase(ctx, body)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.CreateCase`:\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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Create a case returns "CREATED" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.CaseCreate;
import com.datadog.api.client.v2.model.CaseCreateAttributes;
import com.datadog.api.client.v2.model.CaseCreateRelationships;
import com.datadog.api.client.v2.model.CaseCreateRequest;
import com.datadog.api.client.v2.model.CasePriority;
import com.datadog.api.client.v2.model.CaseResourceType;
import com.datadog.api.client.v2.model.CaseResponse;
import com.datadog.api.client.v2.model.NullableUserRelationship;
import com.datadog.api.client.v2.model.NullableUserRelationshipData;
import com.datadog.api.client.v2.model.ProjectRelationship;
import com.datadog.api.client.v2.model.ProjectRelationshipData;
import com.datadog.api.client.v2.model.ProjectResourceType;
import com.datadog.api.client.v2.model.UserResourceType;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

    // there is a valid "user" in the system
    String USER_DATA_ID = System.getenv("USER_DATA_ID");

    CaseCreateRequest body =
        new CaseCreateRequest()
            .data(
                new CaseCreate()
                    .attributes(
                        new CaseCreateAttributes()
                            .priority(CasePriority.NOT_DEFINED)
                            .title("Security breach investigation in 0cfbc5cbc676ee71")
                            .typeId("00000000-0000-0000-0000-000000000001"))
                    .relationships(
                        new CaseCreateRelationships()
                            .assignee(
                                new NullableUserRelationship()
                                    .data(
                                        new NullableUserRelationshipData()
                                            .id(USER_DATA_ID)
                                            .type(UserResourceType.USER)))
                            .project(
                                new ProjectRelationship()
                                    .data(
                                        new ProjectRelationshipData()
                                            .id("d4bbe1af-f36e-42f1-87c1-493ca35c320e")
                                            .type(ProjectResourceType.PROJECT))))
                    .type(CaseResourceType.CASE));

    try {
      CaseResponse result = apiInstance.createCase(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseManagementApi#createCase");
      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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
"""
Create a case returns "CREATED" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi
from datadog_api_client.v2.model.case_create import CaseCreate
from datadog_api_client.v2.model.case_create_attributes import CaseCreateAttributes
from datadog_api_client.v2.model.case_create_relationships import CaseCreateRelationships
from datadog_api_client.v2.model.case_create_request import CaseCreateRequest
from datadog_api_client.v2.model.case_priority import CasePriority
from datadog_api_client.v2.model.case_resource_type import CaseResourceType
from datadog_api_client.v2.model.nullable_user_relationship import NullableUserRelationship
from datadog_api_client.v2.model.nullable_user_relationship_data import NullableUserRelationshipData
from datadog_api_client.v2.model.project_relationship import ProjectRelationship
from datadog_api_client.v2.model.project_relationship_data import ProjectRelationshipData
from datadog_api_client.v2.model.project_resource_type import ProjectResourceType
from datadog_api_client.v2.model.user_resource_type import UserResourceType

# there is a valid "user" in the system
USER_DATA_ID = environ["USER_DATA_ID"]

body = CaseCreateRequest(
    data=CaseCreate(
        attributes=CaseCreateAttributes(
            priority=CasePriority.NOT_DEFINED,
            title="Security breach investigation in 0cfbc5cbc676ee71",
            type_id="00000000-0000-0000-0000-000000000001",
        ),
        relationships=CaseCreateRelationships(
            assignee=NullableUserRelationship(
                data=NullableUserRelationshipData(
                    id=USER_DATA_ID,
                    type=UserResourceType.USER,
                ),
            ),
            project=ProjectRelationship(
                data=ProjectRelationshipData(
                    id="d4bbe1af-f36e-42f1-87c1-493ca35c320e",
                    type=ProjectResourceType.PROJECT,
                ),
            ),
        ),
        type=CaseResourceType.CASE,
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = CaseManagementApi(api_client)
    response = api_instance.create_case(body=body)

    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Create a case returns "CREATED" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

# there is a valid "user" in the system
USER_DATA_ID = ENV["USER_DATA_ID"]

body = DatadogAPIClient::V2::CaseCreateRequest.new({
  data: DatadogAPIClient::V2::CaseCreate.new({
    attributes: DatadogAPIClient::V2::CaseCreateAttributes.new({
      priority: DatadogAPIClient::V2::CasePriority::NOT_DEFINED,
      title: "Security breach investigation in 0cfbc5cbc676ee71",
      type_id: "00000000-0000-0000-0000-000000000001",
    }),
    relationships: DatadogAPIClient::V2::CaseCreateRelationships.new({
      assignee: DatadogAPIClient::V2::NullableUserRelationship.new({
        data: DatadogAPIClient::V2::NullableUserRelationshipData.new({
          id: USER_DATA_ID,
          type: DatadogAPIClient::V2::UserResourceType::USER,
        }),
      }),
      project: DatadogAPIClient::V2::ProjectRelationship.new({
        data: DatadogAPIClient::V2::ProjectRelationshipData.new({
          id: "d4bbe1af-f36e-42f1-87c1-493ca35c320e",
          type: DatadogAPIClient::V2::ProjectResourceType::PROJECT,
        }),
      }),
    }),
    type: DatadogAPIClient::V2::CaseResourceType::CASE,
  }),
})
p api_instance.create_case(body)

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Create a case returns "CREATED" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
use datadog_api_client::datadogV2::model::CaseCreate;
use datadog_api_client::datadogV2::model::CaseCreateAttributes;
use datadog_api_client::datadogV2::model::CaseCreateRelationships;
use datadog_api_client::datadogV2::model::CaseCreateRequest;
use datadog_api_client::datadogV2::model::CasePriority;
use datadog_api_client::datadogV2::model::CaseResourceType;
use datadog_api_client::datadogV2::model::NullableUserRelationship;
use datadog_api_client::datadogV2::model::NullableUserRelationshipData;
use datadog_api_client::datadogV2::model::ProjectRelationship;
use datadog_api_client::datadogV2::model::ProjectRelationshipData;
use datadog_api_client::datadogV2::model::ProjectResourceType;
use datadog_api_client::datadogV2::model::UserResourceType;

#[tokio::main]
async fn main() {
    // there is a valid "user" in the system
    let user_data_id = std::env::var("USER_DATA_ID").unwrap();
    let body = CaseCreateRequest::new(
        CaseCreate::new(
            CaseCreateAttributes::new(
                "Security breach investigation in 0cfbc5cbc676ee71".to_string(),
                "00000000-0000-0000-0000-000000000001".to_string(),
            )
            .priority(CasePriority::NOT_DEFINED),
            CaseResourceType::CASE,
        )
        .relationships(
            CaseCreateRelationships::new(ProjectRelationship::new(ProjectRelationshipData::new(
                "d4bbe1af-f36e-42f1-87c1-493ca35c320e".to_string(),
                ProjectResourceType::PROJECT,
            )))
            .assignee(Some(NullableUserRelationship::new(Some(
                NullableUserRelationshipData::new(user_data_id.clone(), UserResourceType::USER),
            )))),
        ),
    );
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.create_case(body).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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Create a case returns "CREATED" response
 */

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

const configuration = client.createConfiguration();
const apiInstance = new v2.CaseManagementApi(configuration);

// there is a valid "user" in the system
const USER_DATA_ID = process.env.USER_DATA_ID as string;

const params: v2.CaseManagementApiCreateCaseRequest = {
  body: {
    data: {
      attributes: {
        priority: "NOT_DEFINED",
        title: "Security breach investigation in 0cfbc5cbc676ee71",
        typeId: "00000000-0000-0000-0000-000000000001",
      },
      relationships: {
        assignee: {
          data: {
            id: USER_DATA_ID,
            type: "user",
          },
        },
        project: {
          data: {
            id: "d4bbe1af-f36e-42f1-87c1-493ca35c320e",
            type: "project",
          },
        },
      },
      type: "case",
    },
  },
};

apiInstance
  .createCase(params)
  .then((data: v2.CaseResponse) => {
    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"

GET https://api.ap1.datadoghq.com/api/v2/caseshttps://api.ap2.datadoghq.com/api/v2/caseshttps://api.datadoghq.eu/api/v2/caseshttps://api.ddog-gov.com/api/v2/caseshttps://api.us2.ddog-gov.com/api/v2/caseshttps://api.datadoghq.com/api/v2/caseshttps://api.us3.datadoghq.com/api/v2/caseshttps://api.us5.datadoghq.com/api/v2/cases

Información general

Search cases.

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

Argumentos

Cadenas de consulta

Nombre

Tipo

Descripción

page[size]

integer

Size for a given page. The maximum allowed value is 100.

page[number]

integer

Specific page number to return.

sort[field]

enum

Specify which field to sort
Allowed enum values: created_at, priority, status

filter

string

Search query

sort[asc]

boolean

Specify if order is ascending or not

Respuesta

OK

Response with cases

Expand All

Campo

Tipo

Descripción

data

[object]

Cases response data

attributes [required]

object

Case resource attributes

archived_at

date-time

Timestamp of when the case was archived

attributes

object

Key-value pairs of case attributes. Each key maps to an array of string values, used for flexible metadata such as labels or tags.

<any-key>

[string]

closed_at

date-time

Timestamp of when the case was closed

created_at

date-time

Timestamp of when the case was created

custom_attributes

object

Case custom attributes

<any-key>

object

A typed value for a custom attribute on a specific case.

is_multi [required]

boolean

If true, value must be an array

type [required]

enum

The data type of the custom attribute, which determines the allowed values and UI input control. Allowed enum values: URL,TEXT,NUMBER,SELECT

value [required]

 <oneOf>

The value of a custom attribute. The accepted format depends on the attribute's type and whether it accepts multiple values.

Option 1

string

A string value for a TEXT, URL, or SELECT-type custom attribute.

Option 2

[string]

An array of string values for a multi-value TEXT, URL, or SELECT-type custom attribute.

Option 3

double

A numeric value for a NUMBER-type custom attribute.

Option 4

[number]

An array of numeric values for a multi-value NUMBER-type custom attribute.

description

string

Description

jira_issue

object

Jira issue attached to case

result

object

Jira issue information

issue_id

string

Jira issue ID

issue_key

string

Jira issue key

issue_url

string

Jira issue URL

project_key

string

Jira project key

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

key

string

Key

modified_at

date-time

Timestamp of when the case was last modified

priority

enum

Case priority Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5

default: NOT_DEFINED

service_now_ticket

object

ServiceNow ticket attached to case

result

object

ServiceNow ticket information

sys_target_link

string

Link to the Incident created on ServiceNow

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

status

enum

DEPRECATED: Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use status_name instead. Allowed enum values: OPEN,IN_PROGRESS,CLOSED

status_group

enum

Status group of the case. Allowed enum values: SG_OPEN,SG_IN_PROGRESS,SG_CLOSED

status_name

string

Status of the case. Must be one of the existing statuses for the case's type.

title

string

Title

type

enum

DEPRECATED: Case type Allowed enum values: STANDARD

type_id

string

Case type UUID

id [required]

string

Case's identifier

relationships

object

Resources related to a case

assignee

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

project

object

Relationship to project.

data [required]

object

Relationship to project object.

id [required]

string

A unique identifier that represents the project.

type [required]

enum

Project resource type. Allowed enum values: project

default: project

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

meta

object

Cases response metadata

page

object

Pagination metadata

current

int64

Current page number

size

int64

Number of cases in current page

total

int64

Total number of pages

{
  "data": [
    {
      "attributes": {
        "archived_at": "2019-09-19T10:00:00.000Z",
        "attributes": {
          "<any-key>": []
        },
        "closed_at": "2019-09-19T10:00:00.000Z",
        "created_at": "2019-09-19T10:00:00.000Z",
        "custom_attributes": {
          "<any-key>": {
            "is_multi": false,
            "type": "NUMBER",
            "value": {
              "description": "",
              "type": ""
            }
          }
        },
        "description": "string",
        "jira_issue": {
          "result": {
            "issue_id": "string",
            "issue_key": "string",
            "issue_url": "string",
            "project_key": "string"
          },
          "status": "COMPLETED"
        },
        "key": "CASEM-4523",
        "modified_at": "2019-09-19T10:00:00.000Z",
        "priority": "NOT_DEFINED",
        "service_now_ticket": {
          "result": {
            "sys_target_link": "string"
          },
          "status": "COMPLETED"
        },
        "status": "OPEN",
        "status_group": "SG_OPEN",
        "status_name": "Open",
        "title": "Memory leak investigation on API",
        "type": "STANDARD",
        "type_id": "3b010bde-09ce-4449-b745-71dd5f861963"
      },
      "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
      "relationships": {
        "assignee": {
          "data": {
            "id": "00000000-0000-0000-0000-000000000000",
            "type": "user"
          }
        },
        "created_by": {
          "data": {
            "id": "00000000-0000-0000-0000-000000000000",
            "type": "user"
          }
        },
        "modified_by": {
          "data": {
            "id": "00000000-0000-0000-0000-000000000000",
            "type": "user"
          }
        },
        "project": {
          "data": {
            "id": "e555e290-ed65-49bd-ae18-8acbfcf18db7",
            "type": "project"
          }
        }
      },
      "type": "case"
    }
  ],
  "meta": {
    "page": {
      "current": "integer",
      "size": "integer",
      "total": "integer"
    }
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  # 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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
Search cases returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = CaseManagementApi(api_client)
    response = api_instance.search_cases()

    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Search cases returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new
p api_instance.search_cases()

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Search cases 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"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCaseManagementApi(apiClient)
	resp, r, err := api.SearchCases(ctx, *datadogV2.NewSearchCasesOptionalParameters())

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.SearchCases`:\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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Search cases returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.CasesResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

    try {
      CasesResponse result = apiInstance.searchCases();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseManagementApi#searchCases");
      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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// Search cases returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
use datadog_api_client::datadogV2::api_case_management::SearchCasesOptionalParams;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.search_cases(SearchCasesOptionalParams::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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Search cases returns "OK" response
 */

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

const configuration = client.createConfiguration();
const apiInstance = new v2.CaseManagementApi(configuration);

apiInstance
  .searchCases()
  .then((data: v2.CasesResponse) => {
    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"

GET https://api.ap1.datadoghq.com/api/v2/cases/{case_id}https://api.ap2.datadoghq.com/api/v2/cases/{case_id}https://api.datadoghq.eu/api/v2/cases/{case_id}https://api.ddog-gov.com/api/v2/cases/{case_id}https://api.us2.ddog-gov.com/api/v2/cases/{case_id}https://api.datadoghq.com/api/v2/cases/{case_id}https://api.us3.datadoghq.com/api/v2/cases/{case_id}https://api.us5.datadoghq.com/api/v2/cases/{case_id}

Información general

Get the details of case by case_id

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

case_id [required]

string

Case’s UUID or key

Respuesta

OK

Case response

Expand All

Campo

Tipo

Descripción

data

object

A case

attributes [required]

object

Case resource attributes

archived_at

date-time

Timestamp of when the case was archived

attributes

object

Key-value pairs of case attributes. Each key maps to an array of string values, used for flexible metadata such as labels or tags.

<any-key>

[string]

closed_at

date-time

Timestamp of when the case was closed

created_at

date-time

Timestamp of when the case was created

custom_attributes

object

Case custom attributes

<any-key>

object

A typed value for a custom attribute on a specific case.

is_multi [required]

boolean

If true, value must be an array

type [required]

enum

The data type of the custom attribute, which determines the allowed values and UI input control. Allowed enum values: URL,TEXT,NUMBER,SELECT

value [required]

 <oneOf>

The value of a custom attribute. The accepted format depends on the attribute's type and whether it accepts multiple values.

Option 1

string

A string value for a TEXT, URL, or SELECT-type custom attribute.

Option 2

[string]

An array of string values for a multi-value TEXT, URL, or SELECT-type custom attribute.

Option 3

double

A numeric value for a NUMBER-type custom attribute.

Option 4

[number]

An array of numeric values for a multi-value NUMBER-type custom attribute.

description

string

Description

jira_issue

object

Jira issue attached to case

result

object

Jira issue information

issue_id

string

Jira issue ID

issue_key

string

Jira issue key

issue_url

string

Jira issue URL

project_key

string

Jira project key

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

key

string

Key

modified_at

date-time

Timestamp of when the case was last modified

priority

enum

Case priority Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5

default: NOT_DEFINED

service_now_ticket

object

ServiceNow ticket attached to case

result

object

ServiceNow ticket information

sys_target_link

string

Link to the Incident created on ServiceNow

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

status

enum

DEPRECATED: Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use status_name instead. Allowed enum values: OPEN,IN_PROGRESS,CLOSED

status_group

enum

Status group of the case. Allowed enum values: SG_OPEN,SG_IN_PROGRESS,SG_CLOSED

status_name

string

Status of the case. Must be one of the existing statuses for the case's type.

title

string

Title

type

enum

DEPRECATED: Case type Allowed enum values: STANDARD

type_id

string

Case type UUID

id [required]

string

Case's identifier

relationships

object

Resources related to a case

assignee

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

project

object

Relationship to project.

data [required]

object

Relationship to project object.

id [required]

string

A unique identifier that represents the project.

type [required]

enum

Project resource type. Allowed enum values: project

default: project

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "archived_at": "2019-09-19T10:00:00.000Z",
      "attributes": {
        "<any-key>": []
      },
      "closed_at": "2019-09-19T10:00:00.000Z",
      "created_at": "2019-09-19T10:00:00.000Z",
      "custom_attributes": {
        "<any-key>": {
          "is_multi": false,
          "type": "NUMBER",
          "value": {
            "description": "",
            "type": ""
          }
        }
      },
      "description": "string",
      "jira_issue": {
        "result": {
          "issue_id": "string",
          "issue_key": "string",
          "issue_url": "string",
          "project_key": "string"
        },
        "status": "COMPLETED"
      },
      "key": "CASEM-4523",
      "modified_at": "2019-09-19T10:00:00.000Z",
      "priority": "NOT_DEFINED",
      "service_now_ticket": {
        "result": {
          "sys_target_link": "string"
        },
        "status": "COMPLETED"
      },
      "status": "OPEN",
      "status_group": "SG_OPEN",
      "status_name": "Open",
      "title": "Memory leak investigation on API",
      "type": "STANDARD",
      "type_id": "3b010bde-09ce-4449-b745-71dd5f861963"
    },
    "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
    "relationships": {
      "assignee": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "project": {
        "data": {
          "id": "e555e290-ed65-49bd-ae18-8acbfcf18db7",
          "type": "project"
        }
      }
    },
    "type": "case"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  # Path parameters
export case_id="f98a5a5b-e0ff-45d4-b2f5-afe6e74de504"
# 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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/${case_id}" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
Get the details of a case returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi

# there is a valid "case" in the system
CASE_ID = environ["CASE_ID"]

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = CaseManagementApi(api_client)
    response = api_instance.get_case(
        case_id=CASE_ID,
    )

    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Get the details of a case returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

# there is a valid "case" in the system
CASE_ID = ENV["CASE_ID"]
p api_instance.get_case(CASE_ID)

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Get the details of a case 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"
)

func main() {
	// there is a valid "case" in the system
	CaseID := os.Getenv("CASE_ID")

	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCaseManagementApi(apiClient)
	resp, r, err := api.GetCase(ctx, CaseID)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.GetCase`:\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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Get the details of a case returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.CaseResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

    // there is a valid "case" in the system
    String CASE_ID = System.getenv("CASE_ID");

    try {
      CaseResponse result = apiInstance.getCase(CASE_ID);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseManagementApi#getCase");
      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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// Get the details of a case returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;

#[tokio::main]
async fn main() {
    // there is a valid "case" in the system
    let case_id = std::env::var("CASE_ID").unwrap();
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.get_case(case_id.clone()).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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Get the details of a case returns "OK" response
 */

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

const configuration = client.createConfiguration();
const apiInstance = new v2.CaseManagementApi(configuration);

// there is a valid "case" in the system
const CASE_ID = process.env.CASE_ID as string;

const params: v2.CaseManagementApiGetCaseRequest = {
  caseId: CASE_ID,
};

apiInstance
  .getCase(params)
  .then((data: v2.CaseResponse) => {
    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"

POST https://api.ap1.datadoghq.com/api/v2/cases/{case_id}/titlehttps://api.ap2.datadoghq.com/api/v2/cases/{case_id}/titlehttps://api.datadoghq.eu/api/v2/cases/{case_id}/titlehttps://api.ddog-gov.com/api/v2/cases/{case_id}/titlehttps://api.us2.ddog-gov.com/api/v2/cases/{case_id}/titlehttps://api.datadoghq.com/api/v2/cases/{case_id}/titlehttps://api.us3.datadoghq.com/api/v2/cases/{case_id}/titlehttps://api.us5.datadoghq.com/api/v2/cases/{case_id}/title

Información general

Update case title

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

case_id [required]

string

Case’s UUID or key

Solicitud

Body Data (required)

Case title update payload

Expand All

Campo

Tipo

Descripción

data [required]

object

Case update title

attributes [required]

object

Case update title attributes

title [required]

string

Case new title

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "title": "[UPDATED] Memory leak investigation on API"
    },
    "type": "case"
  }
}

Respuesta

OK

Case response

Expand All

Campo

Tipo

Descripción

data

object

A case

attributes [required]

object

Case resource attributes

archived_at

date-time

Timestamp of when the case was archived

attributes

object

Key-value pairs of case attributes. Each key maps to an array of string values, used for flexible metadata such as labels or tags.

<any-key>

[string]

closed_at

date-time

Timestamp of when the case was closed

created_at

date-time

Timestamp of when the case was created

custom_attributes

object

Case custom attributes

<any-key>

object

A typed value for a custom attribute on a specific case.

is_multi [required]

boolean

If true, value must be an array

type [required]

enum

The data type of the custom attribute, which determines the allowed values and UI input control. Allowed enum values: URL,TEXT,NUMBER,SELECT

value [required]

 <oneOf>

The value of a custom attribute. The accepted format depends on the attribute's type and whether it accepts multiple values.

Option 1

string

A string value for a TEXT, URL, or SELECT-type custom attribute.

Option 2

[string]

An array of string values for a multi-value TEXT, URL, or SELECT-type custom attribute.

Option 3

double

A numeric value for a NUMBER-type custom attribute.

Option 4

[number]

An array of numeric values for a multi-value NUMBER-type custom attribute.

description

string

Description

jira_issue

object

Jira issue attached to case

result

object

Jira issue information

issue_id

string

Jira issue ID

issue_key

string

Jira issue key

issue_url

string

Jira issue URL

project_key

string

Jira project key

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

key

string

Key

modified_at

date-time

Timestamp of when the case was last modified

priority

enum

Case priority Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5

default: NOT_DEFINED

service_now_ticket

object

ServiceNow ticket attached to case

result

object

ServiceNow ticket information

sys_target_link

string

Link to the Incident created on ServiceNow

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

status

enum

DEPRECATED: Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use status_name instead. Allowed enum values: OPEN,IN_PROGRESS,CLOSED

status_group

enum

Status group of the case. Allowed enum values: SG_OPEN,SG_IN_PROGRESS,SG_CLOSED

status_name

string

Status of the case. Must be one of the existing statuses for the case's type.

title

string

Title

type

enum

DEPRECATED: Case type Allowed enum values: STANDARD

type_id

string

Case type UUID

id [required]

string

Case's identifier

relationships

object

Resources related to a case

assignee

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

project

object

Relationship to project.

data [required]

object

Relationship to project object.

id [required]

string

A unique identifier that represents the project.

type [required]

enum

Project resource type. Allowed enum values: project

default: project

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "archived_at": "2019-09-19T10:00:00.000Z",
      "attributes": {
        "<any-key>": []
      },
      "closed_at": "2019-09-19T10:00:00.000Z",
      "created_at": "2019-09-19T10:00:00.000Z",
      "custom_attributes": {
        "<any-key>": {
          "is_multi": false,
          "type": "NUMBER",
          "value": {
            "description": "",
            "type": ""
          }
        }
      },
      "description": "string",
      "jira_issue": {
        "result": {
          "issue_id": "string",
          "issue_key": "string",
          "issue_url": "string",
          "project_key": "string"
        },
        "status": "COMPLETED"
      },
      "key": "CASEM-4523",
      "modified_at": "2019-09-19T10:00:00.000Z",
      "priority": "NOT_DEFINED",
      "service_now_ticket": {
        "result": {
          "sys_target_link": "string"
        },
        "status": "COMPLETED"
      },
      "status": "OPEN",
      "status_group": "SG_OPEN",
      "status_name": "Open",
      "title": "Memory leak investigation on API",
      "type": "STANDARD",
      "type_id": "3b010bde-09ce-4449-b745-71dd5f861963"
    },
    "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
    "relationships": {
      "assignee": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "project": {
        "data": {
          "id": "e555e290-ed65-49bd-ae18-8acbfcf18db7",
          "type": "project"
        }
      }
    },
    "type": "case"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                          ## default
# 

# Path parameters
export case_id="f98a5a5b-e0ff-45d4-b2f5-afe6e74de504"
# Curl command
curl -X POST "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/${case_id}/title" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "title": "Memory leak investigation on API" }, "type": "case" } } EOF
// Update case title 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"
)

func main() {
	// there is a valid "case" in the system
	CaseID := os.Getenv("CASE_ID")

	body := datadogV2.CaseUpdateTitleRequest{
		Data: datadogV2.CaseUpdateTitle{
			Attributes: datadogV2.CaseUpdateTitleAttributes{
				Title: "[UPDATED] Memory leak investigation on API",
			},
			Type: datadogV2.CASERESOURCETYPE_CASE,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCaseManagementApi(apiClient)
	resp, r, err := api.UpdateCaseTitle(ctx, CaseID, body)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.UpdateCaseTitle`:\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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Update case title returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.CaseResourceType;
import com.datadog.api.client.v2.model.CaseResponse;
import com.datadog.api.client.v2.model.CaseUpdateTitle;
import com.datadog.api.client.v2.model.CaseUpdateTitleAttributes;
import com.datadog.api.client.v2.model.CaseUpdateTitleRequest;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

    // there is a valid "case" in the system
    String CASE_ID = System.getenv("CASE_ID");

    CaseUpdateTitleRequest body =
        new CaseUpdateTitleRequest()
            .data(
                new CaseUpdateTitle()
                    .attributes(
                        new CaseUpdateTitleAttributes()
                            .title("[UPDATED] Memory leak investigation on API"))
                    .type(CaseResourceType.CASE));

    try {
      CaseResponse result = apiInstance.updateCaseTitle(CASE_ID, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseManagementApi#updateCaseTitle");
      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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
"""
Update case title returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi
from datadog_api_client.v2.model.case_resource_type import CaseResourceType
from datadog_api_client.v2.model.case_update_title import CaseUpdateTitle
from datadog_api_client.v2.model.case_update_title_attributes import CaseUpdateTitleAttributes
from datadog_api_client.v2.model.case_update_title_request import CaseUpdateTitleRequest

# there is a valid "case" in the system
CASE_ID = environ["CASE_ID"]

body = CaseUpdateTitleRequest(
    data=CaseUpdateTitle(
        attributes=CaseUpdateTitleAttributes(
            title="[UPDATED] Memory leak investigation on API",
        ),
        type=CaseResourceType.CASE,
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = CaseManagementApi(api_client)
    response = api_instance.update_case_title(case_id=CASE_ID, body=body)

    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Update case title returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

# there is a valid "case" in the system
CASE_ID = ENV["CASE_ID"]

body = DatadogAPIClient::V2::CaseUpdateTitleRequest.new({
  data: DatadogAPIClient::V2::CaseUpdateTitle.new({
    attributes: DatadogAPIClient::V2::CaseUpdateTitleAttributes.new({
      title: "[UPDATED] Memory leak investigation on API",
    }),
    type: DatadogAPIClient::V2::CaseResourceType::CASE,
  }),
})
p api_instance.update_case_title(CASE_ID, body)

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Update case title returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
use datadog_api_client::datadogV2::model::CaseResourceType;
use datadog_api_client::datadogV2::model::CaseUpdateTitle;
use datadog_api_client::datadogV2::model::CaseUpdateTitleAttributes;
use datadog_api_client::datadogV2::model::CaseUpdateTitleRequest;

#[tokio::main]
async fn main() {
    // there is a valid "case" in the system
    let case_id = std::env::var("CASE_ID").unwrap();
    let body = CaseUpdateTitleRequest::new(CaseUpdateTitle::new(
        CaseUpdateTitleAttributes::new("[UPDATED] Memory leak investigation on API".to_string()),
        CaseResourceType::CASE,
    ));
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.update_case_title(case_id.clone(), body).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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Update case title returns "OK" response
 */

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

const configuration = client.createConfiguration();
const apiInstance = new v2.CaseManagementApi(configuration);

// there is a valid "case" in the system
const CASE_ID = process.env.CASE_ID as string;

const params: v2.CaseManagementApiUpdateCaseTitleRequest = {
  body: {
    data: {
      attributes: {
        title: "[UPDATED] Memory leak investigation on API",
      },
      type: "case",
    },
  },
  caseId: CASE_ID,
};

apiInstance
  .updateCaseTitle(params)
  .then((data: v2.CaseResponse) => {
    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"

POST https://api.ap1.datadoghq.com/api/v2/cases/{case_id}/descriptionhttps://api.ap2.datadoghq.com/api/v2/cases/{case_id}/descriptionhttps://api.datadoghq.eu/api/v2/cases/{case_id}/descriptionhttps://api.ddog-gov.com/api/v2/cases/{case_id}/descriptionhttps://api.us2.ddog-gov.com/api/v2/cases/{case_id}/descriptionhttps://api.datadoghq.com/api/v2/cases/{case_id}/descriptionhttps://api.us3.datadoghq.com/api/v2/cases/{case_id}/descriptionhttps://api.us5.datadoghq.com/api/v2/cases/{case_id}/description

Información general

Update case description

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

case_id [required]

string

Case’s UUID or key

Solicitud

Body Data (required)

Case description update payload

Expand All

Campo

Tipo

Descripción

data [required]

object

Case update description

attributes [required]

object

Case update description attributes

description [required]

string

Case new description

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "description": "Seeing some weird memory increase... Updating the description"
    },
    "type": "case"
  }
}

Respuesta

OK

Case response

Expand All

Campo

Tipo

Descripción

data

object

A case

attributes [required]

object

Case resource attributes

archived_at

date-time

Timestamp of when the case was archived

attributes

object

Key-value pairs of case attributes. Each key maps to an array of string values, used for flexible metadata such as labels or tags.

<any-key>

[string]

closed_at

date-time

Timestamp of when the case was closed

created_at

date-time

Timestamp of when the case was created

custom_attributes

object

Case custom attributes

<any-key>

object

A typed value for a custom attribute on a specific case.

is_multi [required]

boolean

If true, value must be an array

type [required]

enum

The data type of the custom attribute, which determines the allowed values and UI input control. Allowed enum values: URL,TEXT,NUMBER,SELECT

value [required]

 <oneOf>

The value of a custom attribute. The accepted format depends on the attribute's type and whether it accepts multiple values.

Option 1

string

A string value for a TEXT, URL, or SELECT-type custom attribute.

Option 2

[string]

An array of string values for a multi-value TEXT, URL, or SELECT-type custom attribute.

Option 3

double

A numeric value for a NUMBER-type custom attribute.

Option 4

[number]

An array of numeric values for a multi-value NUMBER-type custom attribute.

description

string

Description

jira_issue

object

Jira issue attached to case

result

object

Jira issue information

issue_id

string

Jira issue ID

issue_key

string

Jira issue key

issue_url

string

Jira issue URL

project_key

string

Jira project key

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

key

string

Key

modified_at

date-time

Timestamp of when the case was last modified

priority

enum

Case priority Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5

default: NOT_DEFINED

service_now_ticket

object

ServiceNow ticket attached to case

result

object

ServiceNow ticket information

sys_target_link

string

Link to the Incident created on ServiceNow

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

status

enum

DEPRECATED: Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use status_name instead. Allowed enum values: OPEN,IN_PROGRESS,CLOSED

status_group

enum

Status group of the case. Allowed enum values: SG_OPEN,SG_IN_PROGRESS,SG_CLOSED

status_name

string

Status of the case. Must be one of the existing statuses for the case's type.

title

string

Title

type

enum

DEPRECATED: Case type Allowed enum values: STANDARD

type_id

string

Case type UUID

id [required]

string

Case's identifier

relationships

object

Resources related to a case

assignee

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

project

object

Relationship to project.

data [required]

object

Relationship to project object.

id [required]

string

A unique identifier that represents the project.

type [required]

enum

Project resource type. Allowed enum values: project

default: project

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "archived_at": "2019-09-19T10:00:00.000Z",
      "attributes": {
        "<any-key>": []
      },
      "closed_at": "2019-09-19T10:00:00.000Z",
      "created_at": "2019-09-19T10:00:00.000Z",
      "custom_attributes": {
        "<any-key>": {
          "is_multi": false,
          "type": "NUMBER",
          "value": {
            "description": "",
            "type": ""
          }
        }
      },
      "description": "string",
      "jira_issue": {
        "result": {
          "issue_id": "string",
          "issue_key": "string",
          "issue_url": "string",
          "project_key": "string"
        },
        "status": "COMPLETED"
      },
      "key": "CASEM-4523",
      "modified_at": "2019-09-19T10:00:00.000Z",
      "priority": "NOT_DEFINED",
      "service_now_ticket": {
        "result": {
          "sys_target_link": "string"
        },
        "status": "COMPLETED"
      },
      "status": "OPEN",
      "status_group": "SG_OPEN",
      "status_name": "Open",
      "title": "Memory leak investigation on API",
      "type": "STANDARD",
      "type_id": "3b010bde-09ce-4449-b745-71dd5f861963"
    },
    "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
    "relationships": {
      "assignee": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "project": {
        "data": {
          "id": "e555e290-ed65-49bd-ae18-8acbfcf18db7",
          "type": "project"
        }
      }
    },
    "type": "case"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                          ## default
# 

# Path parameters
export case_id="f98a5a5b-e0ff-45d4-b2f5-afe6e74de504"
# Curl command
curl -X POST "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/${case_id}/description" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "description": "Seeing some weird memory increase... We shouldn't ignore this" }, "type": "case" } } EOF
// Update case description 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"
)

func main() {
	// there is a valid "case" in the system
	CaseID := os.Getenv("CASE_ID")

	body := datadogV2.CaseUpdateDescriptionRequest{
		Data: datadogV2.CaseUpdateDescription{
			Attributes: datadogV2.CaseUpdateDescriptionAttributes{
				Description: "Seeing some weird memory increase... Updating the description",
			},
			Type: datadogV2.CASERESOURCETYPE_CASE,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCaseManagementApi(apiClient)
	resp, r, err := api.UpdateCaseDescription(ctx, CaseID, body)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.UpdateCaseDescription`:\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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Update case description returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.CaseResourceType;
import com.datadog.api.client.v2.model.CaseResponse;
import com.datadog.api.client.v2.model.CaseUpdateDescription;
import com.datadog.api.client.v2.model.CaseUpdateDescriptionAttributes;
import com.datadog.api.client.v2.model.CaseUpdateDescriptionRequest;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

    // there is a valid "case" in the system
    String CASE_ID = System.getenv("CASE_ID");

    CaseUpdateDescriptionRequest body =
        new CaseUpdateDescriptionRequest()
            .data(
                new CaseUpdateDescription()
                    .attributes(
                        new CaseUpdateDescriptionAttributes()
                            .description(
                                "Seeing some weird memory increase... Updating the description"))
                    .type(CaseResourceType.CASE));

    try {
      CaseResponse result = apiInstance.updateCaseDescription(CASE_ID, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseManagementApi#updateCaseDescription");
      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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
"""
Update case description returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi
from datadog_api_client.v2.model.case_resource_type import CaseResourceType
from datadog_api_client.v2.model.case_update_description import CaseUpdateDescription
from datadog_api_client.v2.model.case_update_description_attributes import CaseUpdateDescriptionAttributes
from datadog_api_client.v2.model.case_update_description_request import CaseUpdateDescriptionRequest

# there is a valid "case" in the system
CASE_ID = environ["CASE_ID"]

body = CaseUpdateDescriptionRequest(
    data=CaseUpdateDescription(
        attributes=CaseUpdateDescriptionAttributes(
            description="Seeing some weird memory increase... Updating the description",
        ),
        type=CaseResourceType.CASE,
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = CaseManagementApi(api_client)
    response = api_instance.update_case_description(case_id=CASE_ID, body=body)

    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Update case description returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

# there is a valid "case" in the system
CASE_ID = ENV["CASE_ID"]

body = DatadogAPIClient::V2::CaseUpdateDescriptionRequest.new({
  data: DatadogAPIClient::V2::CaseUpdateDescription.new({
    attributes: DatadogAPIClient::V2::CaseUpdateDescriptionAttributes.new({
      description: "Seeing some weird memory increase... Updating the description",
    }),
    type: DatadogAPIClient::V2::CaseResourceType::CASE,
  }),
})
p api_instance.update_case_description(CASE_ID, body)

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Update case description returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
use datadog_api_client::datadogV2::model::CaseResourceType;
use datadog_api_client::datadogV2::model::CaseUpdateDescription;
use datadog_api_client::datadogV2::model::CaseUpdateDescriptionAttributes;
use datadog_api_client::datadogV2::model::CaseUpdateDescriptionRequest;

#[tokio::main]
async fn main() {
    // there is a valid "case" in the system
    let case_id = std::env::var("CASE_ID").unwrap();
    let body = CaseUpdateDescriptionRequest::new(CaseUpdateDescription::new(
        CaseUpdateDescriptionAttributes::new(
            "Seeing some weird memory increase... Updating the description".to_string(),
        ),
        CaseResourceType::CASE,
    ));
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.update_case_description(case_id.clone(), body).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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Update case description returns "OK" response
 */

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

const configuration = client.createConfiguration();
const apiInstance = new v2.CaseManagementApi(configuration);

// there is a valid "case" in the system
const CASE_ID = process.env.CASE_ID as string;

const params: v2.CaseManagementApiUpdateCaseDescriptionRequest = {
  body: {
    data: {
      attributes: {
        description:
          "Seeing some weird memory increase... Updating the description",
      },
      type: "case",
    },
  },
  caseId: CASE_ID,
};

apiInstance
  .updateCaseDescription(params)
  .then((data: v2.CaseResponse) => {
    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"

POST https://api.ap1.datadoghq.com/api/v2/cases/{case_id}/statushttps://api.ap2.datadoghq.com/api/v2/cases/{case_id}/statushttps://api.datadoghq.eu/api/v2/cases/{case_id}/statushttps://api.ddog-gov.com/api/v2/cases/{case_id}/statushttps://api.us2.ddog-gov.com/api/v2/cases/{case_id}/statushttps://api.datadoghq.com/api/v2/cases/{case_id}/statushttps://api.us3.datadoghq.com/api/v2/cases/{case_id}/statushttps://api.us5.datadoghq.com/api/v2/cases/{case_id}/status

Información general

Update case status

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

case_id [required]

string

Case’s UUID or key

Solicitud

Body Data (required)

Case status update payload

Expand All

Campo

Tipo

Descripción

data [required]

object

Case update status

attributes [required]

object

Case update status attributes

status

enum

DEPRECATED: Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use status_name instead. Allowed enum values: OPEN,IN_PROGRESS,CLOSED

status_name

string

Status of the case. Must be one of the existing statuses for the case's type.

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "status": "IN_PROGRESS"
    },
    "type": "case"
  }
}

Respuesta

OK

Case response

Expand All

Campo

Tipo

Descripción

data

object

A case

attributes [required]

object

Case resource attributes

archived_at

date-time

Timestamp of when the case was archived

attributes

object

Key-value pairs of case attributes. Each key maps to an array of string values, used for flexible metadata such as labels or tags.

<any-key>

[string]

closed_at

date-time

Timestamp of when the case was closed

created_at

date-time

Timestamp of when the case was created

custom_attributes

object

Case custom attributes

<any-key>

object

A typed value for a custom attribute on a specific case.

is_multi [required]

boolean

If true, value must be an array

type [required]

enum

The data type of the custom attribute, which determines the allowed values and UI input control. Allowed enum values: URL,TEXT,NUMBER,SELECT

value [required]

 <oneOf>

The value of a custom attribute. The accepted format depends on the attribute's type and whether it accepts multiple values.

Option 1

string

A string value for a TEXT, URL, or SELECT-type custom attribute.

Option 2

[string]

An array of string values for a multi-value TEXT, URL, or SELECT-type custom attribute.

Option 3

double

A numeric value for a NUMBER-type custom attribute.

Option 4

[number]

An array of numeric values for a multi-value NUMBER-type custom attribute.

description

string

Description

jira_issue

object

Jira issue attached to case

result

object

Jira issue information

issue_id

string

Jira issue ID

issue_key

string

Jira issue key

issue_url

string

Jira issue URL

project_key

string

Jira project key

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

key

string

Key

modified_at

date-time

Timestamp of when the case was last modified

priority

enum

Case priority Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5

default: NOT_DEFINED

service_now_ticket

object

ServiceNow ticket attached to case

result

object

ServiceNow ticket information

sys_target_link

string

Link to the Incident created on ServiceNow

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

status

enum

DEPRECATED: Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use status_name instead. Allowed enum values: OPEN,IN_PROGRESS,CLOSED

status_group

enum

Status group of the case. Allowed enum values: SG_OPEN,SG_IN_PROGRESS,SG_CLOSED

status_name

string

Status of the case. Must be one of the existing statuses for the case's type.

title

string

Title

type

enum

DEPRECATED: Case type Allowed enum values: STANDARD

type_id

string

Case type UUID

id [required]

string

Case's identifier

relationships

object

Resources related to a case

assignee

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

project

object

Relationship to project.

data [required]

object

Relationship to project object.

id [required]

string

A unique identifier that represents the project.

type [required]

enum

Project resource type. Allowed enum values: project

default: project

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "archived_at": "2019-09-19T10:00:00.000Z",
      "attributes": {
        "<any-key>": []
      },
      "closed_at": "2019-09-19T10:00:00.000Z",
      "created_at": "2019-09-19T10:00:00.000Z",
      "custom_attributes": {
        "<any-key>": {
          "is_multi": false,
          "type": "NUMBER",
          "value": {
            "description": "",
            "type": ""
          }
        }
      },
      "description": "string",
      "jira_issue": {
        "result": {
          "issue_id": "string",
          "issue_key": "string",
          "issue_url": "string",
          "project_key": "string"
        },
        "status": "COMPLETED"
      },
      "key": "CASEM-4523",
      "modified_at": "2019-09-19T10:00:00.000Z",
      "priority": "NOT_DEFINED",
      "service_now_ticket": {
        "result": {
          "sys_target_link": "string"
        },
        "status": "COMPLETED"
      },
      "status": "OPEN",
      "status_group": "SG_OPEN",
      "status_name": "Open",
      "title": "Memory leak investigation on API",
      "type": "STANDARD",
      "type_id": "3b010bde-09ce-4449-b745-71dd5f861963"
    },
    "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
    "relationships": {
      "assignee": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "project": {
        "data": {
          "id": "e555e290-ed65-49bd-ae18-8acbfcf18db7",
          "type": "project"
        }
      }
    },
    "type": "case"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                          ## default
# 

# Path parameters
export case_id="f98a5a5b-e0ff-45d4-b2f5-afe6e74de504"
# Curl command
curl -X POST "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/${case_id}/status" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "status": "OPEN", "status_name": "Open" }, "type": "case" } } EOF
// Update case status 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"
)

func main() {
	// there is a valid "case" in the system
	CaseID := os.Getenv("CASE_ID")

	body := datadogV2.CaseUpdateStatusRequest{
		Data: datadogV2.CaseUpdateStatus{
			Attributes: datadogV2.CaseUpdateStatusAttributes{
				Status: datadogV2.CASESTATUS_IN_PROGRESS.Ptr(),
			},
			Type: datadogV2.CASERESOURCETYPE_CASE,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCaseManagementApi(apiClient)
	resp, r, err := api.UpdateStatus(ctx, CaseID, body)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.UpdateStatus`:\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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Update case status returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.CaseResourceType;
import com.datadog.api.client.v2.model.CaseResponse;
import com.datadog.api.client.v2.model.CaseStatus;
import com.datadog.api.client.v2.model.CaseUpdateStatus;
import com.datadog.api.client.v2.model.CaseUpdateStatusAttributes;
import com.datadog.api.client.v2.model.CaseUpdateStatusRequest;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

    // there is a valid "case" in the system
    String CASE_ID = System.getenv("CASE_ID");

    CaseUpdateStatusRequest body =
        new CaseUpdateStatusRequest()
            .data(
                new CaseUpdateStatus()
                    .attributes(new CaseUpdateStatusAttributes().status(CaseStatus.IN_PROGRESS))
                    .type(CaseResourceType.CASE));

    try {
      CaseResponse result = apiInstance.updateStatus(CASE_ID, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseManagementApi#updateStatus");
      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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
"""
Update case status returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi
from datadog_api_client.v2.model.case_resource_type import CaseResourceType
from datadog_api_client.v2.model.case_status import CaseStatus
from datadog_api_client.v2.model.case_update_status import CaseUpdateStatus
from datadog_api_client.v2.model.case_update_status_attributes import CaseUpdateStatusAttributes
from datadog_api_client.v2.model.case_update_status_request import CaseUpdateStatusRequest

# there is a valid "case" in the system
CASE_ID = environ["CASE_ID"]

body = CaseUpdateStatusRequest(
    data=CaseUpdateStatus(
        attributes=CaseUpdateStatusAttributes(
            status=CaseStatus.IN_PROGRESS,
        ),
        type=CaseResourceType.CASE,
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = CaseManagementApi(api_client)
    response = api_instance.update_status(case_id=CASE_ID, body=body)

    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Update case status returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

# there is a valid "case" in the system
CASE_ID = ENV["CASE_ID"]

body = DatadogAPIClient::V2::CaseUpdateStatusRequest.new({
  data: DatadogAPIClient::V2::CaseUpdateStatus.new({
    attributes: DatadogAPIClient::V2::CaseUpdateStatusAttributes.new({
      status: DatadogAPIClient::V2::CaseStatus::IN_PROGRESS,
    }),
    type: DatadogAPIClient::V2::CaseResourceType::CASE,
  }),
})
p api_instance.update_status(CASE_ID, body)

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Update case status returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
use datadog_api_client::datadogV2::model::CaseResourceType;
use datadog_api_client::datadogV2::model::CaseStatus;
use datadog_api_client::datadogV2::model::CaseUpdateStatus;
use datadog_api_client::datadogV2::model::CaseUpdateStatusAttributes;
use datadog_api_client::datadogV2::model::CaseUpdateStatusRequest;

#[tokio::main]
async fn main() {
    // there is a valid "case" in the system
    let case_id = std::env::var("CASE_ID").unwrap();
    let body = CaseUpdateStatusRequest::new(CaseUpdateStatus::new(
        CaseUpdateStatusAttributes::new().status(CaseStatus::IN_PROGRESS),
        CaseResourceType::CASE,
    ));
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.update_status(case_id.clone(), body).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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Update case status returns "OK" response
 */

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

const configuration = client.createConfiguration();
const apiInstance = new v2.CaseManagementApi(configuration);

// there is a valid "case" in the system
const CASE_ID = process.env.CASE_ID as string;

const params: v2.CaseManagementApiUpdateStatusRequest = {
  body: {
    data: {
      attributes: {
        status: "IN_PROGRESS",
      },
      type: "case",
    },
  },
  caseId: CASE_ID,
};

apiInstance
  .updateStatus(params)
  .then((data: v2.CaseResponse) => {
    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"

POST https://api.ap1.datadoghq.com/api/v2/cases/{case_id}/priorityhttps://api.ap2.datadoghq.com/api/v2/cases/{case_id}/priorityhttps://api.datadoghq.eu/api/v2/cases/{case_id}/priorityhttps://api.ddog-gov.com/api/v2/cases/{case_id}/priorityhttps://api.us2.ddog-gov.com/api/v2/cases/{case_id}/priorityhttps://api.datadoghq.com/api/v2/cases/{case_id}/priorityhttps://api.us3.datadoghq.com/api/v2/cases/{case_id}/priorityhttps://api.us5.datadoghq.com/api/v2/cases/{case_id}/priority

Información general

Update case priority

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

case_id [required]

string

Case’s UUID or key

Solicitud

Body Data (required)

Case priority update payload

Expand All

Campo

Tipo

Descripción

data [required]

object

Case priority status

attributes [required]

object

Case update priority attributes

priority [required]

enum

Case priority Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5

default: NOT_DEFINED

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "priority": "P3"
    },
    "type": "case"
  }
}

Respuesta

OK

Case response

Expand All

Campo

Tipo

Descripción

data

object

A case

attributes [required]

object

Case resource attributes

archived_at

date-time

Timestamp of when the case was archived

attributes

object

Key-value pairs of case attributes. Each key maps to an array of string values, used for flexible metadata such as labels or tags.

<any-key>

[string]

closed_at

date-time

Timestamp of when the case was closed

created_at

date-time

Timestamp of when the case was created

custom_attributes

object

Case custom attributes

<any-key>

object

A typed value for a custom attribute on a specific case.

is_multi [required]

boolean

If true, value must be an array

type [required]

enum

The data type of the custom attribute, which determines the allowed values and UI input control. Allowed enum values: URL,TEXT,NUMBER,SELECT

value [required]

 <oneOf>

The value of a custom attribute. The accepted format depends on the attribute's type and whether it accepts multiple values.

Option 1

string

A string value for a TEXT, URL, or SELECT-type custom attribute.

Option 2

[string]

An array of string values for a multi-value TEXT, URL, or SELECT-type custom attribute.

Option 3

double

A numeric value for a NUMBER-type custom attribute.

Option 4

[number]

An array of numeric values for a multi-value NUMBER-type custom attribute.

description

string

Description

jira_issue

object

Jira issue attached to case

result

object

Jira issue information

issue_id

string

Jira issue ID

issue_key

string

Jira issue key

issue_url

string

Jira issue URL

project_key

string

Jira project key

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

key

string

Key

modified_at

date-time

Timestamp of when the case was last modified

priority

enum

Case priority Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5

default: NOT_DEFINED

service_now_ticket

object

ServiceNow ticket attached to case

result

object

ServiceNow ticket information

sys_target_link

string

Link to the Incident created on ServiceNow

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

status

enum

DEPRECATED: Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use status_name instead. Allowed enum values: OPEN,IN_PROGRESS,CLOSED

status_group

enum

Status group of the case. Allowed enum values: SG_OPEN,SG_IN_PROGRESS,SG_CLOSED

status_name

string

Status of the case. Must be one of the existing statuses for the case's type.

title

string

Title

type

enum

DEPRECATED: Case type Allowed enum values: STANDARD

type_id

string

Case type UUID

id [required]

string

Case's identifier

relationships

object

Resources related to a case

assignee

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

project

object

Relationship to project.

data [required]

object

Relationship to project object.

id [required]

string

A unique identifier that represents the project.

type [required]

enum

Project resource type. Allowed enum values: project

default: project

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "archived_at": "2019-09-19T10:00:00.000Z",
      "attributes": {
        "<any-key>": []
      },
      "closed_at": "2019-09-19T10:00:00.000Z",
      "created_at": "2019-09-19T10:00:00.000Z",
      "custom_attributes": {
        "<any-key>": {
          "is_multi": false,
          "type": "NUMBER",
          "value": {
            "description": "",
            "type": ""
          }
        }
      },
      "description": "string",
      "jira_issue": {
        "result": {
          "issue_id": "string",
          "issue_key": "string",
          "issue_url": "string",
          "project_key": "string"
        },
        "status": "COMPLETED"
      },
      "key": "CASEM-4523",
      "modified_at": "2019-09-19T10:00:00.000Z",
      "priority": "NOT_DEFINED",
      "service_now_ticket": {
        "result": {
          "sys_target_link": "string"
        },
        "status": "COMPLETED"
      },
      "status": "OPEN",
      "status_group": "SG_OPEN",
      "status_name": "Open",
      "title": "Memory leak investigation on API",
      "type": "STANDARD",
      "type_id": "3b010bde-09ce-4449-b745-71dd5f861963"
    },
    "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
    "relationships": {
      "assignee": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "project": {
        "data": {
          "id": "e555e290-ed65-49bd-ae18-8acbfcf18db7",
          "type": "project"
        }
      }
    },
    "type": "case"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                          ## default
# 

# Path parameters
export case_id="f98a5a5b-e0ff-45d4-b2f5-afe6e74de504"
# Curl command
curl -X POST "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/${case_id}/priority" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "priority": "NOT_DEFINED" }, "type": "case" } } EOF
// Update case priority 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"
)

func main() {
	// there is a valid "case" in the system
	CaseID := os.Getenv("CASE_ID")

	body := datadogV2.CaseUpdatePriorityRequest{
		Data: datadogV2.CaseUpdatePriority{
			Attributes: datadogV2.CaseUpdatePriorityAttributes{
				Priority: datadogV2.CASEPRIORITY_P3,
			},
			Type: datadogV2.CASERESOURCETYPE_CASE,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCaseManagementApi(apiClient)
	resp, r, err := api.UpdatePriority(ctx, CaseID, body)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.UpdatePriority`:\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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Update case priority returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.CasePriority;
import com.datadog.api.client.v2.model.CaseResourceType;
import com.datadog.api.client.v2.model.CaseResponse;
import com.datadog.api.client.v2.model.CaseUpdatePriority;
import com.datadog.api.client.v2.model.CaseUpdatePriorityAttributes;
import com.datadog.api.client.v2.model.CaseUpdatePriorityRequest;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

    // there is a valid "case" in the system
    String CASE_ID = System.getenv("CASE_ID");

    CaseUpdatePriorityRequest body =
        new CaseUpdatePriorityRequest()
            .data(
                new CaseUpdatePriority()
                    .attributes(new CaseUpdatePriorityAttributes().priority(CasePriority.P3))
                    .type(CaseResourceType.CASE));

    try {
      CaseResponse result = apiInstance.updatePriority(CASE_ID, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseManagementApi#updatePriority");
      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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
"""
Update case priority returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi
from datadog_api_client.v2.model.case_priority import CasePriority
from datadog_api_client.v2.model.case_resource_type import CaseResourceType
from datadog_api_client.v2.model.case_update_priority import CaseUpdatePriority
from datadog_api_client.v2.model.case_update_priority_attributes import CaseUpdatePriorityAttributes
from datadog_api_client.v2.model.case_update_priority_request import CaseUpdatePriorityRequest

# there is a valid "case" in the system
CASE_ID = environ["CASE_ID"]

body = CaseUpdatePriorityRequest(
    data=CaseUpdatePriority(
        attributes=CaseUpdatePriorityAttributes(
            priority=CasePriority.P3,
        ),
        type=CaseResourceType.CASE,
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = CaseManagementApi(api_client)
    response = api_instance.update_priority(case_id=CASE_ID, body=body)

    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Update case priority returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

# there is a valid "case" in the system
CASE_ID = ENV["CASE_ID"]

body = DatadogAPIClient::V2::CaseUpdatePriorityRequest.new({
  data: DatadogAPIClient::V2::CaseUpdatePriority.new({
    attributes: DatadogAPIClient::V2::CaseUpdatePriorityAttributes.new({
      priority: DatadogAPIClient::V2::CasePriority::P3,
    }),
    type: DatadogAPIClient::V2::CaseResourceType::CASE,
  }),
})
p api_instance.update_priority(CASE_ID, body)

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Update case priority returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
use datadog_api_client::datadogV2::model::CasePriority;
use datadog_api_client::datadogV2::model::CaseResourceType;
use datadog_api_client::datadogV2::model::CaseUpdatePriority;
use datadog_api_client::datadogV2::model::CaseUpdatePriorityAttributes;
use datadog_api_client::datadogV2::model::CaseUpdatePriorityRequest;

#[tokio::main]
async fn main() {
    // there is a valid "case" in the system
    let case_id = std::env::var("CASE_ID").unwrap();
    let body = CaseUpdatePriorityRequest::new(CaseUpdatePriority::new(
        CaseUpdatePriorityAttributes::new(CasePriority::P3),
        CaseResourceType::CASE,
    ));
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.update_priority(case_id.clone(), body).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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Update case priority returns "OK" response
 */

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

const configuration = client.createConfiguration();
const apiInstance = new v2.CaseManagementApi(configuration);

// there is a valid "case" in the system
const CASE_ID = process.env.CASE_ID as string;

const params: v2.CaseManagementApiUpdatePriorityRequest = {
  body: {
    data: {
      attributes: {
        priority: "P3",
      },
      type: "case",
    },
  },
  caseId: CASE_ID,
};

apiInstance
  .updatePriority(params)
  .then((data: v2.CaseResponse) => {
    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"

POST https://api.ap1.datadoghq.com/api/v2/cases/{case_id}/assignhttps://api.ap2.datadoghq.com/api/v2/cases/{case_id}/assignhttps://api.datadoghq.eu/api/v2/cases/{case_id}/assignhttps://api.ddog-gov.com/api/v2/cases/{case_id}/assignhttps://api.us2.ddog-gov.com/api/v2/cases/{case_id}/assignhttps://api.datadoghq.com/api/v2/cases/{case_id}/assignhttps://api.us3.datadoghq.com/api/v2/cases/{case_id}/assignhttps://api.us5.datadoghq.com/api/v2/cases/{case_id}/assign

Información general

Assign case to a user

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

case_id [required]

string

Case’s UUID or key

Solicitud

Body Data (required)

Assign case payload

Expand All

Campo

Tipo

Descripción

data [required]

object

Case assign

attributes [required]

object

Case assign attributes

assignee_id [required]

string

Assignee's UUID

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "assignee_id": "string"
    },
    "type": "case"
  }
}

Respuesta

OK

Case response

Expand All

Campo

Tipo

Descripción

data

object

A case

attributes [required]

object

Case resource attributes

archived_at

date-time

Timestamp of when the case was archived

attributes

object

Key-value pairs of case attributes. Each key maps to an array of string values, used for flexible metadata such as labels or tags.

<any-key>

[string]

closed_at

date-time

Timestamp of when the case was closed

created_at

date-time

Timestamp of when the case was created

custom_attributes

object

Case custom attributes

<any-key>

object

A typed value for a custom attribute on a specific case.

is_multi [required]

boolean

If true, value must be an array

type [required]

enum

The data type of the custom attribute, which determines the allowed values and UI input control. Allowed enum values: URL,TEXT,NUMBER,SELECT

value [required]

 <oneOf>

The value of a custom attribute. The accepted format depends on the attribute's type and whether it accepts multiple values.

Option 1

string

A string value for a TEXT, URL, or SELECT-type custom attribute.

Option 2

[string]

An array of string values for a multi-value TEXT, URL, or SELECT-type custom attribute.

Option 3

double

A numeric value for a NUMBER-type custom attribute.

Option 4

[number]

An array of numeric values for a multi-value NUMBER-type custom attribute.

description

string

Description

jira_issue

object

Jira issue attached to case

result

object

Jira issue information

issue_id

string

Jira issue ID

issue_key

string

Jira issue key

issue_url

string

Jira issue URL

project_key

string

Jira project key

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

key

string

Key

modified_at

date-time

Timestamp of when the case was last modified

priority

enum

Case priority Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5

default: NOT_DEFINED

service_now_ticket

object

ServiceNow ticket attached to case

result

object

ServiceNow ticket information

sys_target_link

string

Link to the Incident created on ServiceNow

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

status

enum

DEPRECATED: Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use status_name instead. Allowed enum values: OPEN,IN_PROGRESS,CLOSED

status_group

enum

Status group of the case. Allowed enum values: SG_OPEN,SG_IN_PROGRESS,SG_CLOSED

status_name

string

Status of the case. Must be one of the existing statuses for the case's type.

title

string

Title

type

enum

DEPRECATED: Case type Allowed enum values: STANDARD

type_id

string

Case type UUID

id [required]

string

Case's identifier

relationships

object

Resources related to a case

assignee

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

project

object

Relationship to project.

data [required]

object

Relationship to project object.

id [required]

string

A unique identifier that represents the project.

type [required]

enum

Project resource type. Allowed enum values: project

default: project

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "archived_at": "2019-09-19T10:00:00.000Z",
      "attributes": {
        "<any-key>": []
      },
      "closed_at": "2019-09-19T10:00:00.000Z",
      "created_at": "2019-09-19T10:00:00.000Z",
      "custom_attributes": {
        "<any-key>": {
          "is_multi": false,
          "type": "NUMBER",
          "value": {
            "description": "",
            "type": ""
          }
        }
      },
      "description": "string",
      "jira_issue": {
        "result": {
          "issue_id": "string",
          "issue_key": "string",
          "issue_url": "string",
          "project_key": "string"
        },
        "status": "COMPLETED"
      },
      "key": "CASEM-4523",
      "modified_at": "2019-09-19T10:00:00.000Z",
      "priority": "NOT_DEFINED",
      "service_now_ticket": {
        "result": {
          "sys_target_link": "string"
        },
        "status": "COMPLETED"
      },
      "status": "OPEN",
      "status_group": "SG_OPEN",
      "status_name": "Open",
      "title": "Memory leak investigation on API",
      "type": "STANDARD",
      "type_id": "3b010bde-09ce-4449-b745-71dd5f861963"
    },
    "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
    "relationships": {
      "assignee": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "project": {
        "data": {
          "id": "e555e290-ed65-49bd-ae18-8acbfcf18db7",
          "type": "project"
        }
      }
    },
    "type": "case"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                          ## default
# 

# Path parameters
export case_id="f98a5a5b-e0ff-45d4-b2f5-afe6e74de504"
# Curl command
curl -X POST "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/${case_id}/assign" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "assignee_id": "f98a5a5b-e0ff-45d4-b2f5-afe6e74de504" }, "type": "case" } } EOF
// Assign case 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"
)

func main() {
	// there is a valid "case" in the system
	CaseID := os.Getenv("CASE_ID")

	// there is a valid "user" in the system
	UserDataID := os.Getenv("USER_DATA_ID")

	body := datadogV2.CaseAssignRequest{
		Data: datadogV2.CaseAssign{
			Attributes: datadogV2.CaseAssignAttributes{
				AssigneeId: UserDataID,
			},
			Type: datadogV2.CASERESOURCETYPE_CASE,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCaseManagementApi(apiClient)
	resp, r, err := api.AssignCase(ctx, CaseID, body)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.AssignCase`:\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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Assign case returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.CaseAssign;
import com.datadog.api.client.v2.model.CaseAssignAttributes;
import com.datadog.api.client.v2.model.CaseAssignRequest;
import com.datadog.api.client.v2.model.CaseResourceType;
import com.datadog.api.client.v2.model.CaseResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

    // there is a valid "case" in the system
    String CASE_ID = System.getenv("CASE_ID");

    // there is a valid "user" in the system
    String USER_DATA_ID = System.getenv("USER_DATA_ID");

    CaseAssignRequest body =
        new CaseAssignRequest()
            .data(
                new CaseAssign()
                    .attributes(new CaseAssignAttributes().assigneeId(USER_DATA_ID))
                    .type(CaseResourceType.CASE));

    try {
      CaseResponse result = apiInstance.assignCase(CASE_ID, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseManagementApi#assignCase");
      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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
"""
Assign case returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi
from datadog_api_client.v2.model.case_assign import CaseAssign
from datadog_api_client.v2.model.case_assign_attributes import CaseAssignAttributes
from datadog_api_client.v2.model.case_assign_request import CaseAssignRequest
from datadog_api_client.v2.model.case_resource_type import CaseResourceType

# there is a valid "case" in the system
CASE_ID = environ["CASE_ID"]

# there is a valid "user" in the system
USER_DATA_ID = environ["USER_DATA_ID"]

body = CaseAssignRequest(
    data=CaseAssign(
        attributes=CaseAssignAttributes(
            assignee_id=USER_DATA_ID,
        ),
        type=CaseResourceType.CASE,
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = CaseManagementApi(api_client)
    response = api_instance.assign_case(case_id=CASE_ID, body=body)

    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Assign case returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

# there is a valid "case" in the system
CASE_ID = ENV["CASE_ID"]

# there is a valid "user" in the system
USER_DATA_ID = ENV["USER_DATA_ID"]

body = DatadogAPIClient::V2::CaseAssignRequest.new({
  data: DatadogAPIClient::V2::CaseAssign.new({
    attributes: DatadogAPIClient::V2::CaseAssignAttributes.new({
      assignee_id: USER_DATA_ID,
    }),
    type: DatadogAPIClient::V2::CaseResourceType::CASE,
  }),
})
p api_instance.assign_case(CASE_ID, body)

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Assign case returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
use datadog_api_client::datadogV2::model::CaseAssign;
use datadog_api_client::datadogV2::model::CaseAssignAttributes;
use datadog_api_client::datadogV2::model::CaseAssignRequest;
use datadog_api_client::datadogV2::model::CaseResourceType;

#[tokio::main]
async fn main() {
    // there is a valid "case" in the system
    let case_id = std::env::var("CASE_ID").unwrap();

    // there is a valid "user" in the system
    let user_data_id = std::env::var("USER_DATA_ID").unwrap();
    let body = CaseAssignRequest::new(CaseAssign::new(
        CaseAssignAttributes::new(user_data_id.clone()),
        CaseResourceType::CASE,
    ));
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.assign_case(case_id.clone(), body).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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Assign case returns "OK" response
 */

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

const configuration = client.createConfiguration();
const apiInstance = new v2.CaseManagementApi(configuration);

// there is a valid "case" in the system
const CASE_ID = process.env.CASE_ID as string;

// there is a valid "user" in the system
const USER_DATA_ID = process.env.USER_DATA_ID as string;

const params: v2.CaseManagementApiAssignCaseRequest = {
  body: {
    data: {
      attributes: {
        assigneeId: USER_DATA_ID,
      },
      type: "case",
    },
  },
  caseId: CASE_ID,
};

apiInstance
  .assignCase(params)
  .then((data: v2.CaseResponse) => {
    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"

POST https://api.ap1.datadoghq.com/api/v2/cases/{case_id}/unassignhttps://api.ap2.datadoghq.com/api/v2/cases/{case_id}/unassignhttps://api.datadoghq.eu/api/v2/cases/{case_id}/unassignhttps://api.ddog-gov.com/api/v2/cases/{case_id}/unassignhttps://api.us2.ddog-gov.com/api/v2/cases/{case_id}/unassignhttps://api.datadoghq.com/api/v2/cases/{case_id}/unassignhttps://api.us3.datadoghq.com/api/v2/cases/{case_id}/unassignhttps://api.us5.datadoghq.com/api/v2/cases/{case_id}/unassign

Información general

Unassign case

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

case_id [required]

string

Case’s UUID or key

Solicitud

Body Data (required)

Unassign case payload

Expand All

Campo

Tipo

Descripción

data [required]

object

Case empty request data

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "type": "case"
  }
}

Respuesta

OK

Case response

Expand All

Campo

Tipo

Descripción

data

object

A case

attributes [required]

object

Case resource attributes

archived_at

date-time

Timestamp of when the case was archived

attributes

object

Key-value pairs of case attributes. Each key maps to an array of string values, used for flexible metadata such as labels or tags.

<any-key>

[string]

closed_at

date-time

Timestamp of when the case was closed

created_at

date-time

Timestamp of when the case was created

custom_attributes

object

Case custom attributes

<any-key>

object

A typed value for a custom attribute on a specific case.

is_multi [required]

boolean

If true, value must be an array

type [required]

enum

The data type of the custom attribute, which determines the allowed values and UI input control. Allowed enum values: URL,TEXT,NUMBER,SELECT

value [required]

 <oneOf>

The value of a custom attribute. The accepted format depends on the attribute's type and whether it accepts multiple values.

Option 1

string

A string value for a TEXT, URL, or SELECT-type custom attribute.

Option 2

[string]

An array of string values for a multi-value TEXT, URL, or SELECT-type custom attribute.

Option 3

double

A numeric value for a NUMBER-type custom attribute.

Option 4

[number]

An array of numeric values for a multi-value NUMBER-type custom attribute.

description

string

Description

jira_issue

object

Jira issue attached to case

result

object

Jira issue information

issue_id

string

Jira issue ID

issue_key

string

Jira issue key

issue_url

string

Jira issue URL

project_key

string

Jira project key

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

key

string

Key

modified_at

date-time

Timestamp of when the case was last modified

priority

enum

Case priority Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5

default: NOT_DEFINED

service_now_ticket

object

ServiceNow ticket attached to case

result

object

ServiceNow ticket information

sys_target_link

string

Link to the Incident created on ServiceNow

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

status

enum

DEPRECATED: Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use status_name instead. Allowed enum values: OPEN,IN_PROGRESS,CLOSED

status_group

enum

Status group of the case. Allowed enum values: SG_OPEN,SG_IN_PROGRESS,SG_CLOSED

status_name

string

Status of the case. Must be one of the existing statuses for the case's type.

title

string

Title

type

enum

DEPRECATED: Case type Allowed enum values: STANDARD

type_id

string

Case type UUID

id [required]

string

Case's identifier

relationships

object

Resources related to a case

assignee

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

project

object

Relationship to project.

data [required]

object

Relationship to project object.

id [required]

string

A unique identifier that represents the project.

type [required]

enum

Project resource type. Allowed enum values: project

default: project

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "archived_at": "2019-09-19T10:00:00.000Z",
      "attributes": {
        "<any-key>": []
      },
      "closed_at": "2019-09-19T10:00:00.000Z",
      "created_at": "2019-09-19T10:00:00.000Z",
      "custom_attributes": {
        "<any-key>": {
          "is_multi": false,
          "type": "NUMBER",
          "value": {
            "description": "",
            "type": ""
          }
        }
      },
      "description": "string",
      "jira_issue": {
        "result": {
          "issue_id": "string",
          "issue_key": "string",
          "issue_url": "string",
          "project_key": "string"
        },
        "status": "COMPLETED"
      },
      "key": "CASEM-4523",
      "modified_at": "2019-09-19T10:00:00.000Z",
      "priority": "NOT_DEFINED",
      "service_now_ticket": {
        "result": {
          "sys_target_link": "string"
        },
        "status": "COMPLETED"
      },
      "status": "OPEN",
      "status_group": "SG_OPEN",
      "status_name": "Open",
      "title": "Memory leak investigation on API",
      "type": "STANDARD",
      "type_id": "3b010bde-09ce-4449-b745-71dd5f861963"
    },
    "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
    "relationships": {
      "assignee": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "project": {
        "data": {
          "id": "e555e290-ed65-49bd-ae18-8acbfcf18db7",
          "type": "project"
        }
      }
    },
    "type": "case"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                          ## default
# 

# Path parameters
export case_id="f98a5a5b-e0ff-45d4-b2f5-afe6e74de504"
# Curl command
curl -X POST "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/${case_id}/unassign" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "type": "case" } } EOF
// Unassign case 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"
)

func main() {
	// there is a valid "case" in the system
	CaseID := os.Getenv("CASE_ID")

	body := datadogV2.CaseEmptyRequest{
		Data: datadogV2.CaseEmpty{
			Type: datadogV2.CASERESOURCETYPE_CASE,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCaseManagementApi(apiClient)
	resp, r, err := api.UnassignCase(ctx, CaseID, body)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.UnassignCase`:\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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Unassign case returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.CaseEmpty;
import com.datadog.api.client.v2.model.CaseEmptyRequest;
import com.datadog.api.client.v2.model.CaseResourceType;
import com.datadog.api.client.v2.model.CaseResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

    // there is a valid "case" in the system
    String CASE_ID = System.getenv("CASE_ID");

    CaseEmptyRequest body =
        new CaseEmptyRequest().data(new CaseEmpty().type(CaseResourceType.CASE));

    try {
      CaseResponse result = apiInstance.unassignCase(CASE_ID, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseManagementApi#unassignCase");
      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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
"""
Unassign case returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi
from datadog_api_client.v2.model.case_empty import CaseEmpty
from datadog_api_client.v2.model.case_empty_request import CaseEmptyRequest
from datadog_api_client.v2.model.case_resource_type import CaseResourceType

# there is a valid "case" in the system
CASE_ID = environ["CASE_ID"]

body = CaseEmptyRequest(
    data=CaseEmpty(
        type=CaseResourceType.CASE,
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = CaseManagementApi(api_client)
    response = api_instance.unassign_case(case_id=CASE_ID, body=body)

    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Unassign case returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

# there is a valid "case" in the system
CASE_ID = ENV["CASE_ID"]

body = DatadogAPIClient::V2::CaseEmptyRequest.new({
  data: DatadogAPIClient::V2::CaseEmpty.new({
    type: DatadogAPIClient::V2::CaseResourceType::CASE,
  }),
})
p api_instance.unassign_case(CASE_ID, body)

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Unassign case returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
use datadog_api_client::datadogV2::model::CaseEmpty;
use datadog_api_client::datadogV2::model::CaseEmptyRequest;
use datadog_api_client::datadogV2::model::CaseResourceType;

#[tokio::main]
async fn main() {
    // there is a valid "case" in the system
    let case_id = std::env::var("CASE_ID").unwrap();
    let body = CaseEmptyRequest::new(CaseEmpty::new(CaseResourceType::CASE));
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.unassign_case(case_id.clone(), body).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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Unassign case returns "OK" response
 */

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

const configuration = client.createConfiguration();
const apiInstance = new v2.CaseManagementApi(configuration);

// there is a valid "case" in the system
const CASE_ID = process.env.CASE_ID as string;

const params: v2.CaseManagementApiUnassignCaseRequest = {
  body: {
    data: {
      type: "case",
    },
  },
  caseId: CASE_ID,
};

apiInstance
  .unassignCase(params)
  .then((data: v2.CaseResponse) => {
    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"

POST https://api.ap1.datadoghq.com/api/v2/cases/{case_id}/archivehttps://api.ap2.datadoghq.com/api/v2/cases/{case_id}/archivehttps://api.datadoghq.eu/api/v2/cases/{case_id}/archivehttps://api.ddog-gov.com/api/v2/cases/{case_id}/archivehttps://api.us2.ddog-gov.com/api/v2/cases/{case_id}/archivehttps://api.datadoghq.com/api/v2/cases/{case_id}/archivehttps://api.us3.datadoghq.com/api/v2/cases/{case_id}/archivehttps://api.us5.datadoghq.com/api/v2/cases/{case_id}/archive

Información general

Archive case

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

case_id [required]

string

Case’s UUID or key

Solicitud

Body Data (required)

Archive case payload

Expand All

Campo

Tipo

Descripción

data [required]

object

Case empty request data

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "type": "case"
  }
}

Respuesta

OK

Case response

Expand All

Campo

Tipo

Descripción

data

object

A case

attributes [required]

object

Case resource attributes

archived_at

date-time

Timestamp of when the case was archived

attributes

object

Key-value pairs of case attributes. Each key maps to an array of string values, used for flexible metadata such as labels or tags.

<any-key>

[string]

closed_at

date-time

Timestamp of when the case was closed

created_at

date-time

Timestamp of when the case was created

custom_attributes

object

Case custom attributes

<any-key>

object

A typed value for a custom attribute on a specific case.

is_multi [required]

boolean

If true, value must be an array

type [required]

enum

The data type of the custom attribute, which determines the allowed values and UI input control. Allowed enum values: URL,TEXT,NUMBER,SELECT

value [required]

 <oneOf>

The value of a custom attribute. The accepted format depends on the attribute's type and whether it accepts multiple values.

Option 1

string

A string value for a TEXT, URL, or SELECT-type custom attribute.

Option 2

[string]

An array of string values for a multi-value TEXT, URL, or SELECT-type custom attribute.

Option 3

double

A numeric value for a NUMBER-type custom attribute.

Option 4

[number]

An array of numeric values for a multi-value NUMBER-type custom attribute.

description

string

Description

jira_issue

object

Jira issue attached to case

result

object

Jira issue information

issue_id

string

Jira issue ID

issue_key

string

Jira issue key

issue_url

string

Jira issue URL

project_key

string

Jira project key

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

key

string

Key

modified_at

date-time

Timestamp of when the case was last modified

priority

enum

Case priority Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5

default: NOT_DEFINED

service_now_ticket

object

ServiceNow ticket attached to case

result

object

ServiceNow ticket information

sys_target_link

string

Link to the Incident created on ServiceNow

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

status

enum

DEPRECATED: Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use status_name instead. Allowed enum values: OPEN,IN_PROGRESS,CLOSED

status_group

enum

Status group of the case. Allowed enum values: SG_OPEN,SG_IN_PROGRESS,SG_CLOSED

status_name

string

Status of the case. Must be one of the existing statuses for the case's type.

title

string

Title

type

enum

DEPRECATED: Case type Allowed enum values: STANDARD

type_id

string

Case type UUID

id [required]

string

Case's identifier

relationships

object

Resources related to a case

assignee

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

project

object

Relationship to project.

data [required]

object

Relationship to project object.

id [required]

string

A unique identifier that represents the project.

type [required]

enum

Project resource type. Allowed enum values: project

default: project

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "archived_at": "2019-09-19T10:00:00.000Z",
      "attributes": {
        "<any-key>": []
      },
      "closed_at": "2019-09-19T10:00:00.000Z",
      "created_at": "2019-09-19T10:00:00.000Z",
      "custom_attributes": {
        "<any-key>": {
          "is_multi": false,
          "type": "NUMBER",
          "value": {
            "description": "",
            "type": ""
          }
        }
      },
      "description": "string",
      "jira_issue": {
        "result": {
          "issue_id": "string",
          "issue_key": "string",
          "issue_url": "string",
          "project_key": "string"
        },
        "status": "COMPLETED"
      },
      "key": "CASEM-4523",
      "modified_at": "2019-09-19T10:00:00.000Z",
      "priority": "NOT_DEFINED",
      "service_now_ticket": {
        "result": {
          "sys_target_link": "string"
        },
        "status": "COMPLETED"
      },
      "status": "OPEN",
      "status_group": "SG_OPEN",
      "status_name": "Open",
      "title": "Memory leak investigation on API",
      "type": "STANDARD",
      "type_id": "3b010bde-09ce-4449-b745-71dd5f861963"
    },
    "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
    "relationships": {
      "assignee": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "project": {
        "data": {
          "id": "e555e290-ed65-49bd-ae18-8acbfcf18db7",
          "type": "project"
        }
      }
    },
    "type": "case"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                          ## default
# 

# Path parameters
export case_id="f98a5a5b-e0ff-45d4-b2f5-afe6e74de504"
# Curl command
curl -X POST "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/${case_id}/archive" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "type": "case" } } EOF
// Archive case 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"
)

func main() {
	// there is a valid "case" in the system
	CaseID := os.Getenv("CASE_ID")

	body := datadogV2.CaseEmptyRequest{
		Data: datadogV2.CaseEmpty{
			Type: datadogV2.CASERESOURCETYPE_CASE,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCaseManagementApi(apiClient)
	resp, r, err := api.ArchiveCase(ctx, CaseID, body)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.ArchiveCase`:\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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Archive case returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.CaseEmpty;
import com.datadog.api.client.v2.model.CaseEmptyRequest;
import com.datadog.api.client.v2.model.CaseResourceType;
import com.datadog.api.client.v2.model.CaseResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

    // there is a valid "case" in the system
    String CASE_ID = System.getenv("CASE_ID");

    CaseEmptyRequest body =
        new CaseEmptyRequest().data(new CaseEmpty().type(CaseResourceType.CASE));

    try {
      CaseResponse result = apiInstance.archiveCase(CASE_ID, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseManagementApi#archiveCase");
      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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
"""
Archive case returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi
from datadog_api_client.v2.model.case_empty import CaseEmpty
from datadog_api_client.v2.model.case_empty_request import CaseEmptyRequest
from datadog_api_client.v2.model.case_resource_type import CaseResourceType

# there is a valid "case" in the system
CASE_ID = environ["CASE_ID"]

body = CaseEmptyRequest(
    data=CaseEmpty(
        type=CaseResourceType.CASE,
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = CaseManagementApi(api_client)
    response = api_instance.archive_case(case_id=CASE_ID, body=body)

    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Archive case returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

# there is a valid "case" in the system
CASE_ID = ENV["CASE_ID"]

body = DatadogAPIClient::V2::CaseEmptyRequest.new({
  data: DatadogAPIClient::V2::CaseEmpty.new({
    type: DatadogAPIClient::V2::CaseResourceType::CASE,
  }),
})
p api_instance.archive_case(CASE_ID, body)

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Archive case returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
use datadog_api_client::datadogV2::model::CaseEmpty;
use datadog_api_client::datadogV2::model::CaseEmptyRequest;
use datadog_api_client::datadogV2::model::CaseResourceType;

#[tokio::main]
async fn main() {
    // there is a valid "case" in the system
    let case_id = std::env::var("CASE_ID").unwrap();
    let body = CaseEmptyRequest::new(CaseEmpty::new(CaseResourceType::CASE));
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.archive_case(case_id.clone(), body).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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Archive case returns "OK" response
 */

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

const configuration = client.createConfiguration();
const apiInstance = new v2.CaseManagementApi(configuration);

// there is a valid "case" in the system
const CASE_ID = process.env.CASE_ID as string;

const params: v2.CaseManagementApiArchiveCaseRequest = {
  body: {
    data: {
      type: "case",
    },
  },
  caseId: CASE_ID,
};

apiInstance
  .archiveCase(params)
  .then((data: v2.CaseResponse) => {
    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"

POST https://api.ap1.datadoghq.com/api/v2/cases/{case_id}/unarchivehttps://api.ap2.datadoghq.com/api/v2/cases/{case_id}/unarchivehttps://api.datadoghq.eu/api/v2/cases/{case_id}/unarchivehttps://api.ddog-gov.com/api/v2/cases/{case_id}/unarchivehttps://api.us2.ddog-gov.com/api/v2/cases/{case_id}/unarchivehttps://api.datadoghq.com/api/v2/cases/{case_id}/unarchivehttps://api.us3.datadoghq.com/api/v2/cases/{case_id}/unarchivehttps://api.us5.datadoghq.com/api/v2/cases/{case_id}/unarchive

Información general

Unarchive case

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

case_id [required]

string

Case’s UUID or key

Solicitud

Body Data (required)

Unarchive case payload

Expand All

Campo

Tipo

Descripción

data [required]

object

Case empty request data

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "type": "case"
  }
}

Respuesta

OK

Case response

Expand All

Campo

Tipo

Descripción

data

object

A case

attributes [required]

object

Case resource attributes

archived_at

date-time

Timestamp of when the case was archived

attributes

object

Key-value pairs of case attributes. Each key maps to an array of string values, used for flexible metadata such as labels or tags.

<any-key>

[string]

closed_at

date-time

Timestamp of when the case was closed

created_at

date-time

Timestamp of when the case was created

custom_attributes

object

Case custom attributes

<any-key>

object

A typed value for a custom attribute on a specific case.

is_multi [required]

boolean

If true, value must be an array

type [required]

enum

The data type of the custom attribute, which determines the allowed values and UI input control. Allowed enum values: URL,TEXT,NUMBER,SELECT

value [required]

 <oneOf>

The value of a custom attribute. The accepted format depends on the attribute's type and whether it accepts multiple values.

Option 1

string

A string value for a TEXT, URL, or SELECT-type custom attribute.

Option 2

[string]

An array of string values for a multi-value TEXT, URL, or SELECT-type custom attribute.

Option 3

double

A numeric value for a NUMBER-type custom attribute.

Option 4

[number]

An array of numeric values for a multi-value NUMBER-type custom attribute.

description

string

Description

jira_issue

object

Jira issue attached to case

result

object

Jira issue information

issue_id

string

Jira issue ID

issue_key

string

Jira issue key

issue_url

string

Jira issue URL

project_key

string

Jira project key

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

key

string

Key

modified_at

date-time

Timestamp of when the case was last modified

priority

enum

Case priority Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5

default: NOT_DEFINED

service_now_ticket

object

ServiceNow ticket attached to case

result

object

ServiceNow ticket information

sys_target_link

string

Link to the Incident created on ServiceNow

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

status

enum

DEPRECATED: Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use status_name instead. Allowed enum values: OPEN,IN_PROGRESS,CLOSED

status_group

enum

Status group of the case. Allowed enum values: SG_OPEN,SG_IN_PROGRESS,SG_CLOSED

status_name

string

Status of the case. Must be one of the existing statuses for the case's type.

title

string

Title

type

enum

DEPRECATED: Case type Allowed enum values: STANDARD

type_id

string

Case type UUID

id [required]

string

Case's identifier

relationships

object

Resources related to a case

assignee

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

project

object

Relationship to project.

data [required]

object

Relationship to project object.

id [required]

string

A unique identifier that represents the project.

type [required]

enum

Project resource type. Allowed enum values: project

default: project

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "archived_at": "2019-09-19T10:00:00.000Z",
      "attributes": {
        "<any-key>": []
      },
      "closed_at": "2019-09-19T10:00:00.000Z",
      "created_at": "2019-09-19T10:00:00.000Z",
      "custom_attributes": {
        "<any-key>": {
          "is_multi": false,
          "type": "NUMBER",
          "value": {
            "description": "",
            "type": ""
          }
        }
      },
      "description": "string",
      "jira_issue": {
        "result": {
          "issue_id": "string",
          "issue_key": "string",
          "issue_url": "string",
          "project_key": "string"
        },
        "status": "COMPLETED"
      },
      "key": "CASEM-4523",
      "modified_at": "2019-09-19T10:00:00.000Z",
      "priority": "NOT_DEFINED",
      "service_now_ticket": {
        "result": {
          "sys_target_link": "string"
        },
        "status": "COMPLETED"
      },
      "status": "OPEN",
      "status_group": "SG_OPEN",
      "status_name": "Open",
      "title": "Memory leak investigation on API",
      "type": "STANDARD",
      "type_id": "3b010bde-09ce-4449-b745-71dd5f861963"
    },
    "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
    "relationships": {
      "assignee": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "project": {
        "data": {
          "id": "e555e290-ed65-49bd-ae18-8acbfcf18db7",
          "type": "project"
        }
      }
    },
    "type": "case"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                          ## default
# 

# Path parameters
export case_id="f98a5a5b-e0ff-45d4-b2f5-afe6e74de504"
# Curl command
curl -X POST "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/${case_id}/unarchive" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "type": "case" } } EOF
// Unarchive case 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"
)

func main() {
	// there is a valid "case" in the system
	CaseID := os.Getenv("CASE_ID")

	body := datadogV2.CaseEmptyRequest{
		Data: datadogV2.CaseEmpty{
			Type: datadogV2.CASERESOURCETYPE_CASE,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCaseManagementApi(apiClient)
	resp, r, err := api.UnarchiveCase(ctx, CaseID, body)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.UnarchiveCase`:\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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Unarchive case returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.CaseEmpty;
import com.datadog.api.client.v2.model.CaseEmptyRequest;
import com.datadog.api.client.v2.model.CaseResourceType;
import com.datadog.api.client.v2.model.CaseResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

    // there is a valid "case" in the system
    String CASE_ID = System.getenv("CASE_ID");

    CaseEmptyRequest body =
        new CaseEmptyRequest().data(new CaseEmpty().type(CaseResourceType.CASE));

    try {
      CaseResponse result = apiInstance.unarchiveCase(CASE_ID, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseManagementApi#unarchiveCase");
      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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
"""
Unarchive case returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi
from datadog_api_client.v2.model.case_empty import CaseEmpty
from datadog_api_client.v2.model.case_empty_request import CaseEmptyRequest
from datadog_api_client.v2.model.case_resource_type import CaseResourceType

# there is a valid "case" in the system
CASE_ID = environ["CASE_ID"]

body = CaseEmptyRequest(
    data=CaseEmpty(
        type=CaseResourceType.CASE,
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = CaseManagementApi(api_client)
    response = api_instance.unarchive_case(case_id=CASE_ID, body=body)

    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Unarchive case returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

# there is a valid "case" in the system
CASE_ID = ENV["CASE_ID"]

body = DatadogAPIClient::V2::CaseEmptyRequest.new({
  data: DatadogAPIClient::V2::CaseEmpty.new({
    type: DatadogAPIClient::V2::CaseResourceType::CASE,
  }),
})
p api_instance.unarchive_case(CASE_ID, body)

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Unarchive case returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
use datadog_api_client::datadogV2::model::CaseEmpty;
use datadog_api_client::datadogV2::model::CaseEmptyRequest;
use datadog_api_client::datadogV2::model::CaseResourceType;

#[tokio::main]
async fn main() {
    // there is a valid "case" in the system
    let case_id = std::env::var("CASE_ID").unwrap();
    let body = CaseEmptyRequest::new(CaseEmpty::new(CaseResourceType::CASE));
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.unarchive_case(case_id.clone(), body).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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Unarchive case returns "OK" response
 */

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

const configuration = client.createConfiguration();
const apiInstance = new v2.CaseManagementApi(configuration);

// there is a valid "case" in the system
const CASE_ID = process.env.CASE_ID as string;

const params: v2.CaseManagementApiUnarchiveCaseRequest = {
  body: {
    data: {
      type: "case",
    },
  },
  caseId: CASE_ID,
};

apiInstance
  .unarchiveCase(params)
  .then((data: v2.CaseResponse) => {
    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"

POST https://api.ap1.datadoghq.com/api/v2/cases/{case_id}/attributeshttps://api.ap2.datadoghq.com/api/v2/cases/{case_id}/attributeshttps://api.datadoghq.eu/api/v2/cases/{case_id}/attributeshttps://api.ddog-gov.com/api/v2/cases/{case_id}/attributeshttps://api.us2.ddog-gov.com/api/v2/cases/{case_id}/attributeshttps://api.datadoghq.com/api/v2/cases/{case_id}/attributeshttps://api.us3.datadoghq.com/api/v2/cases/{case_id}/attributeshttps://api.us5.datadoghq.com/api/v2/cases/{case_id}/attributes

Información general

Update case attributes

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

case_id [required]

string

Case’s UUID or key

Solicitud

Body Data (required)

Case attributes update payload

Expand All

Campo

Tipo

Descripción

data [required]

object

Case update attributes

attributes [required]

object

Case update attributes attributes

attributes [required]

object

Key-value pairs of case attributes. Each key maps to an array of string values, used for flexible metadata such as labels or tags.

<any-key>

[string]

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "attributes": {
        "env": [
          "test"
        ],
        "service": [
          "web-store",
          "web-api"
        ],
        "team": [
          "engineer"
        ]
      }
    },
    "type": "case"
  }
}

Respuesta

OK

Case response

Expand All

Campo

Tipo

Descripción

data

object

A case

attributes [required]

object

Case resource attributes

archived_at

date-time

Timestamp of when the case was archived

attributes

object

Key-value pairs of case attributes. Each key maps to an array of string values, used for flexible metadata such as labels or tags.

<any-key>

[string]

closed_at

date-time

Timestamp of when the case was closed

created_at

date-time

Timestamp of when the case was created

custom_attributes

object

Case custom attributes

<any-key>

object

A typed value for a custom attribute on a specific case.

is_multi [required]

boolean

If true, value must be an array

type [required]

enum

The data type of the custom attribute, which determines the allowed values and UI input control. Allowed enum values: URL,TEXT,NUMBER,SELECT

value [required]

 <oneOf>

The value of a custom attribute. The accepted format depends on the attribute's type and whether it accepts multiple values.

Option 1

string

A string value for a TEXT, URL, or SELECT-type custom attribute.

Option 2

[string]

An array of string values for a multi-value TEXT, URL, or SELECT-type custom attribute.

Option 3

double

A numeric value for a NUMBER-type custom attribute.

Option 4

[number]

An array of numeric values for a multi-value NUMBER-type custom attribute.

description

string

Description

jira_issue

object

Jira issue attached to case

result

object

Jira issue information

issue_id

string

Jira issue ID

issue_key

string

Jira issue key

issue_url

string

Jira issue URL

project_key

string

Jira project key

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

key

string

Key

modified_at

date-time

Timestamp of when the case was last modified

priority

enum

Case priority Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5

default: NOT_DEFINED

service_now_ticket

object

ServiceNow ticket attached to case

result

object

ServiceNow ticket information

sys_target_link

string

Link to the Incident created on ServiceNow

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

status

enum

DEPRECATED: Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use status_name instead. Allowed enum values: OPEN,IN_PROGRESS,CLOSED

status_group

enum

Status group of the case. Allowed enum values: SG_OPEN,SG_IN_PROGRESS,SG_CLOSED

status_name

string

Status of the case. Must be one of the existing statuses for the case's type.

title

string

Title

type

enum

DEPRECATED: Case type Allowed enum values: STANDARD

type_id

string

Case type UUID

id [required]

string

Case's identifier

relationships

object

Resources related to a case

assignee

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

project

object

Relationship to project.

data [required]

object

Relationship to project object.

id [required]

string

A unique identifier that represents the project.

type [required]

enum

Project resource type. Allowed enum values: project

default: project

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "archived_at": "2019-09-19T10:00:00.000Z",
      "attributes": {
        "<any-key>": []
      },
      "closed_at": "2019-09-19T10:00:00.000Z",
      "created_at": "2019-09-19T10:00:00.000Z",
      "custom_attributes": {
        "<any-key>": {
          "is_multi": false,
          "type": "NUMBER",
          "value": {
            "description": "",
            "type": ""
          }
        }
      },
      "description": "string",
      "jira_issue": {
        "result": {
          "issue_id": "string",
          "issue_key": "string",
          "issue_url": "string",
          "project_key": "string"
        },
        "status": "COMPLETED"
      },
      "key": "CASEM-4523",
      "modified_at": "2019-09-19T10:00:00.000Z",
      "priority": "NOT_DEFINED",
      "service_now_ticket": {
        "result": {
          "sys_target_link": "string"
        },
        "status": "COMPLETED"
      },
      "status": "OPEN",
      "status_group": "SG_OPEN",
      "status_name": "Open",
      "title": "Memory leak investigation on API",
      "type": "STANDARD",
      "type_id": "3b010bde-09ce-4449-b745-71dd5f861963"
    },
    "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
    "relationships": {
      "assignee": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "project": {
        "data": {
          "id": "e555e290-ed65-49bd-ae18-8acbfcf18db7",
          "type": "project"
        }
      }
    },
    "type": "case"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                          ## default
# 

# Path parameters
export case_id="f98a5a5b-e0ff-45d4-b2f5-afe6e74de504"
# Curl command
curl -X POST "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/${case_id}/attributes" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "attributes": { "env": [ "prod" ], "service": [ "web-store", "web-api" ], "team": [ "engineering" ] } }, "type": "case" } } EOF
// Update case attributes 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"
)

func main() {
	// there is a valid "case" in the system
	CaseID := os.Getenv("CASE_ID")

	body := datadogV2.CaseUpdateAttributesRequest{
		Data: datadogV2.CaseUpdateAttributes{
			Attributes: datadogV2.CaseUpdateAttributesAttributes{
				Attributes: map[string][]string{
					"env": []string{
						"test",
					},
					"service": []string{
						"web-store",
						"web-api",
					},
					"team": []string{
						"engineer",
					},
				},
			},
			Type: datadogV2.CASERESOURCETYPE_CASE,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCaseManagementApi(apiClient)
	resp, r, err := api.UpdateAttributes(ctx, CaseID, body)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.UpdateAttributes`:\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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Update case attributes returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.CaseResourceType;
import com.datadog.api.client.v2.model.CaseResponse;
import com.datadog.api.client.v2.model.CaseUpdateAttributes;
import com.datadog.api.client.v2.model.CaseUpdateAttributesAttributes;
import com.datadog.api.client.v2.model.CaseUpdateAttributesRequest;
import java.util.Arrays;
import java.util.Collections;
import java.util.Map;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

    // there is a valid "case" in the system
    String CASE_ID = System.getenv("CASE_ID");

    CaseUpdateAttributesRequest body =
        new CaseUpdateAttributesRequest()
            .data(
                new CaseUpdateAttributes()
                    .attributes(
                        new CaseUpdateAttributesAttributes()
                            .attributes(
                                Map.ofEntries(
                                    Map.entry("env", Collections.singletonList("test")),
                                    Map.entry("service", Arrays.asList("web-store", "web-api")),
                                    Map.entry("team", Collections.singletonList("engineer")))))
                    .type(CaseResourceType.CASE));

    try {
      CaseResponse result = apiInstance.updateAttributes(CASE_ID, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseManagementApi#updateAttributes");
      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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
"""
Update case attributes returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi
from datadog_api_client.v2.model.case_object_attributes import CaseObjectAttributes
from datadog_api_client.v2.model.case_resource_type import CaseResourceType
from datadog_api_client.v2.model.case_update_attributes import CaseUpdateAttributes
from datadog_api_client.v2.model.case_update_attributes_attributes import CaseUpdateAttributesAttributes
from datadog_api_client.v2.model.case_update_attributes_request import CaseUpdateAttributesRequest

# there is a valid "case" in the system
CASE_ID = environ["CASE_ID"]

body = CaseUpdateAttributesRequest(
    data=CaseUpdateAttributes(
        attributes=CaseUpdateAttributesAttributes(
            attributes=CaseObjectAttributes(
                env=[
                    "test",
                ],
                service=[
                    "web-store",
                    "web-api",
                ],
                team=[
                    "engineer",
                ],
            ),
        ),
        type=CaseResourceType.CASE,
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = CaseManagementApi(api_client)
    response = api_instance.update_attributes(case_id=CASE_ID, body=body)

    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Update case attributes returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

# there is a valid "case" in the system
CASE_ID = ENV["CASE_ID"]

body = DatadogAPIClient::V2::CaseUpdateAttributesRequest.new({
  data: DatadogAPIClient::V2::CaseUpdateAttributes.new({
    attributes: DatadogAPIClient::V2::CaseUpdateAttributesAttributes.new({
      attributes: {
        env: [
          "test",
        ], service: [
          "web-store",
          "web-api",
        ], team: [
          "engineer",
        ],
      },
    }),
    type: DatadogAPIClient::V2::CaseResourceType::CASE,
  }),
})
p api_instance.update_attributes(CASE_ID, body)

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Update case attributes returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
use datadog_api_client::datadogV2::model::CaseResourceType;
use datadog_api_client::datadogV2::model::CaseUpdateAttributes;
use datadog_api_client::datadogV2::model::CaseUpdateAttributesAttributes;
use datadog_api_client::datadogV2::model::CaseUpdateAttributesRequest;
use std::collections::BTreeMap;

#[tokio::main]
async fn main() {
    // there is a valid "case" in the system
    let case_id = std::env::var("CASE_ID").unwrap();
    let body = CaseUpdateAttributesRequest::new(CaseUpdateAttributes::new(
        CaseUpdateAttributesAttributes::new(BTreeMap::from([
            ("env".to_string(), vec!["test".to_string()]),
            (
                "service".to_string(),
                vec!["web-store".to_string(), "web-api".to_string()],
            ),
            ("team".to_string(), vec!["engineer".to_string()]),
        ])),
        CaseResourceType::CASE,
    ));
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.update_attributes(case_id.clone(), body).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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Update case attributes returns "OK" response
 */

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

const configuration = client.createConfiguration();
const apiInstance = new v2.CaseManagementApi(configuration);

// there is a valid "case" in the system
const CASE_ID = process.env.CASE_ID as string;

const params: v2.CaseManagementApiUpdateAttributesRequest = {
  body: {
    data: {
      attributes: {
        attributes: {
          env: ["test"],
          service: ["web-store", "web-api"],
          team: ["engineer"],
        },
      },
      type: "case",
    },
  },
  caseId: CASE_ID,
};

apiInstance
  .updateAttributes(params)
  .then((data: v2.CaseResponse) => {
    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"

POST https://api.ap1.datadoghq.com/api/v2/cases/{case_id}/commenthttps://api.ap2.datadoghq.com/api/v2/cases/{case_id}/commenthttps://api.datadoghq.eu/api/v2/cases/{case_id}/commenthttps://api.ddog-gov.com/api/v2/cases/{case_id}/commenthttps://api.us2.ddog-gov.com/api/v2/cases/{case_id}/commenthttps://api.datadoghq.com/api/v2/cases/{case_id}/commenthttps://api.us3.datadoghq.com/api/v2/cases/{case_id}/commenthttps://api.us5.datadoghq.com/api/v2/cases/{case_id}/comment

Información general

Comment case

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

case_id [required]

string

Case’s UUID or key

Solicitud

Body Data (required)

Case comment payload

Expand All

Campo

Tipo

Descripción

data [required]

object

Case comment

attributes [required]

object

Case comment attributes

comment [required]

string

The CaseCommentAttributes message.

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "comment": "Hello World !"
    },
    "type": "case"
  }
}

Respuesta

OK

Response containing the chronological list of timeline cells for a case.

Expand All

Campo

Tipo

Descripción

data

[object]

The TimelineResponse data.

attributes [required]

object

Attributes of a timeline cell, representing a single event in a case's chronological activity log (for example, a comment, status change, or assignment update).

author

 <oneOf>

The author of the timeline cell. Currently only user authors are supported.

Option 1

object

A user who authored a timeline cell.

content

object

Profile information for the user who authored the timeline cell.

email

string

The email address of the user.

handle

string

The Datadog handle of the user.

id

string

The UUID of the user.

name

string

The display name of the user.

type

enum

The type of timeline cell author. Currently only USER is supported. Allowed enum values: USER

cell_content

 <oneOf>

The content payload of a timeline cell, varying by cell type.

Option 1

object

The content of a comment timeline cell.

message

string

The text content of the comment. Supports Markdown formatting.

created_at

date-time

Timestamp of when the cell was created

deleted_at

date-time

Timestamp of when the cell was deleted

modified_at

date-time

Timestamp of when the cell was last modified

type

enum

The type of content in the timeline cell. Currently only COMMENT is supported in this endpoint. Allowed enum values: COMMENT

id [required]

string

Timeline cell's identifier

type [required]

enum

JSON:API resource type for timeline cells. Allowed enum values: timeline_cell

default: timeline_cell

{
  "data": [
    {
      "attributes": {
        "author": {
          "content": {
            "email": "string",
            "handle": "string",
            "id": "string",
            "name": "string"
          },
          "type": "USER"
        },
        "cell_content": {
          "message": "string"
        },
        "created_at": "2019-09-19T10:00:00.000Z",
        "deleted_at": "2019-09-19T10:00:00.000Z",
        "modified_at": "2019-09-19T10:00:00.000Z",
        "type": "COMMENT"
      },
      "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
      "type": "timeline_cell"
    }
  ]
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                          ## default
# 

# Path parameters
export case_id="f98a5a5b-e0ff-45d4-b2f5-afe6e74de504"
# Curl command
curl -X POST "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/${case_id}/comment" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "comment": "This is my comment !" }, "type": "case" } } EOF
// Comment case 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"
)

func main() {
	// there is a valid "case" in the system
	CaseID := os.Getenv("CASE_ID")

	body := datadogV2.CaseCommentRequest{
		Data: datadogV2.CaseComment{
			Attributes: datadogV2.CaseCommentAttributes{
				Comment: "Hello World !",
			},
			Type: datadogV2.CASERESOURCETYPE_CASE,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCaseManagementApi(apiClient)
	resp, r, err := api.CommentCase(ctx, CaseID, body)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.CommentCase`:\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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
// Comment case returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.CaseComment;
import com.datadog.api.client.v2.model.CaseCommentAttributes;
import com.datadog.api.client.v2.model.CaseCommentRequest;
import com.datadog.api.client.v2.model.CaseResourceType;
import com.datadog.api.client.v2.model.TimelineResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

    // there is a valid "case" in the system
    String CASE_ID = System.getenv("CASE_ID");

    CaseCommentRequest body =
        new CaseCommentRequest()
            .data(
                new CaseComment()
                    .attributes(new CaseCommentAttributes().comment("Hello World !"))
                    .type(CaseResourceType.CASE));

    try {
      TimelineResponse result = apiInstance.commentCase(CASE_ID, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseManagementApi#commentCase");
      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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"
"""
Comment case returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi
from datadog_api_client.v2.model.case_comment import CaseComment
from datadog_api_client.v2.model.case_comment_attributes import CaseCommentAttributes
from datadog_api_client.v2.model.case_comment_request import CaseCommentRequest
from datadog_api_client.v2.model.case_resource_type import CaseResourceType

# there is a valid "case" in the system
CASE_ID = environ["CASE_ID"]

body = CaseCommentRequest(
    data=CaseComment(
        attributes=CaseCommentAttributes(
            comment="Hello World !",
        ),
        type=CaseResourceType.CASE,
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = CaseManagementApi(api_client)
    response = api_instance.comment_case(case_id=CASE_ID, body=body)

    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
# Comment case returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

# there is a valid "case" in the system
CASE_ID = ENV["CASE_ID"]

body = DatadogAPIClient::V2::CaseCommentRequest.new({
  data: DatadogAPIClient::V2::CaseComment.new({
    attributes: DatadogAPIClient::V2::CaseCommentAttributes.new({
      comment: "Hello World !",
    }),
    type: DatadogAPIClient::V2::CaseResourceType::CASE,
  }),
})
p api_instance.comment_case(CASE_ID, body)

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
// Comment case returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
use datadog_api_client::datadogV2::model::CaseComment;
use datadog_api_client::datadogV2::model::CaseCommentAttributes;
use datadog_api_client::datadogV2::model::CaseCommentRequest;
use datadog_api_client::datadogV2::model::CaseResourceType;

#[tokio::main]
async fn main() {
    // there is a valid "case" in the system
    let case_id = std::env::var("CASE_ID").unwrap();
    let body = CaseCommentRequest::new(CaseComment::new(
        CaseCommentAttributes::new("Hello World !".to_string()),
        CaseResourceType::CASE,
    ));
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.comment_case(case_id.clone(), body).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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run
/**
 * Comment case returns "OK" response
 */

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

const configuration = client.createConfiguration();
const apiInstance = new v2.CaseManagementApi(configuration);

// there is a valid "case" in the system
const CASE_ID = process.env.CASE_ID as string;

const params: v2.CaseManagementApiCommentCaseRequest = {
  body: {
    data: {
      attributes: {
        comment: "Hello World !",
      },
      type: "case",
    },
  },
  caseId: CASE_ID,
};

apiInstance
  .commentCase(params)
  .then((data: v2.TimelineResponse) => {
    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"

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

PUT https://api.ap1.datadoghq.com/api/v2/cases/{case_id}/comment/{cell_id}https://api.ap2.datadoghq.com/api/v2/cases/{case_id}/comment/{cell_id}https://api.datadoghq.eu/api/v2/cases/{case_id}/comment/{cell_id}https://api.ddog-gov.com/api/v2/cases/{case_id}/comment/{cell_id}https://api.us2.ddog-gov.com/api/v2/cases/{case_id}/comment/{cell_id}https://api.datadoghq.com/api/v2/cases/{case_id}/comment/{cell_id}https://api.us3.datadoghq.com/api/v2/cases/{case_id}/comment/{cell_id}https://api.us5.datadoghq.com/api/v2/cases/{case_id}/comment/{cell_id}

Información general

Updates the text content of an existing comment on a case timeline. The comment is identified by its cell ID.

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

case_id [required]

string

Case’s UUID or key

cell_id [required]

string

The UUID of the timeline cell (comment) to update.

Solicitud

Body Data (required)

Case update comment payload.

Expand All

Campo

Tipo

Descripción

data [required]

object

Data object for updating a case comment.

attributes [required]

object

Attributes for updating a comment.

comment [required]

string

The updated comment message.

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "comment": "Updated comment text"
    },
    "type": "case"
  }
}

Respuesta

OK

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  ## default
# 

# Path parameters
export case_id="f98a5a5b-e0ff-45d4-b2f5-afe6e74de504"
export cell_id="f98a5a5b-e0ff-45d4-b2f5-afe6e74de504"
# Curl command
curl -X PUT "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/${case_id}/comment/${cell_id}" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "comment": "Updated comment text" }, "type": "case" } } EOF

DELETE https://api.ap1.datadoghq.com/api/v2/cases/{case_id}/comment/{cell_id}https://api.ap2.datadoghq.com/api/v2/cases/{case_id}/comment/{cell_id}https://api.datadoghq.eu/api/v2/cases/{case_id}/comment/{cell_id}https://api.ddog-gov.com/api/v2/cases/{case_id}/comment/{cell_id}https://api.us2.ddog-gov.com/api/v2/cases/{case_id}/comment/{cell_id}https://api.datadoghq.com/api/v2/cases/{case_id}/comment/{cell_id}https://api.us3.datadoghq.com/api/v2/cases/{case_id}/comment/{cell_id}https://api.us5.datadoghq.com/api/v2/cases/{case_id}/comment/{cell_id}

Información general

Delete case comment

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

case_id [required]

string

Case’s UUID or key

cell_id [required]

string

The UUID of the timeline cell (comment) to update.

Respuesta

No Content

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  # Path parameters
export case_id="f98a5a5b-e0ff-45d4-b2f5-afe6e74de504"
export cell_id="f98a5a5b-e0ff-45d4-b2f5-afe6e74de504"
# Curl command
curl -X DELETE "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/${case_id}/comment/${cell_id}" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
Delete case comment returns "No Content" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi

# there is a valid "case" in the system
CASE_ID = environ["CASE_ID"]

# there is a valid "comment" in the system
COMMENT_ID = environ["COMMENT_ID"]

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = CaseManagementApi(api_client)
    api_instance.delete_case_comment(
        case_id=CASE_ID,
        cell_id=COMMENT_ID,
    )

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
# Delete case comment returns "No Content" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

# there is a valid "case" in the system
CASE_ID = ENV["CASE_ID"]

# there is a valid "comment" in the system
COMMENT_ID = ENV["COMMENT_ID"]
api_instance.delete_case_comment(CASE_ID, COMMENT_ID)

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
// Delete case comment returns "No Content" response

package main

import (
	"context"
	"fmt"
	"os"

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

func main() {
	// there is a valid "case" in the system
	CaseID := os.Getenv("CASE_ID")

	// there is a valid "comment" in the system
	CommentID := os.Getenv("COMMENT_ID")

	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCaseManagementApi(apiClient)
	r, err := api.DeleteCaseComment(ctx, CaseID, CommentID)

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

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
// Delete case comment returns "No Content" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

    // there is a valid "case" in the system
    String CASE_ID = System.getenv("CASE_ID");

    // there is a valid "comment" in the system
    String COMMENT_ID = System.getenv("COMMENT_ID");

    try {
      apiInstance.deleteCaseComment(CASE_ID, COMMENT_ID);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseManagementApi#deleteCaseComment");
      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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"
// Delete case comment returns "No Content" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;

#[tokio::main]
async fn main() {
    // there is a valid "case" in the system
    let case_id = std::env::var("CASE_ID").unwrap();

    // there is a valid "comment" in the system
    let comment_id = std::env::var("COMMENT_ID").unwrap();
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api
        .delete_case_comment(case_id.clone(), comment_id.clone())
        .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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run
/**
 * Delete case comment returns "No Content" response
 */

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

const configuration = client.createConfiguration();
const apiInstance = new v2.CaseManagementApi(configuration);

// there is a valid "case" in the system
const CASE_ID = process.env.CASE_ID as string;

// there is a valid "comment" in the system
const COMMENT_ID = process.env.COMMENT_ID as string;

const params: v2.CaseManagementApiDeleteCaseCommentRequest = {
  caseId: CASE_ID,
  cellId: COMMENT_ID,
};

apiInstance
  .deleteCaseComment(params)
  .then((data: any) => {
    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"

POST https://api.ap1.datadoghq.com/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}https://api.ap2.datadoghq.com/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}https://api.datadoghq.eu/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}https://api.ddog-gov.com/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}https://api.us2.ddog-gov.com/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}https://api.datadoghq.com/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}https://api.us3.datadoghq.com/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}https://api.us5.datadoghq.com/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}

Información general

Update case custom attribute

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

case_id [required]

string

Case’s UUID or key

custom_attribute_key [required]

string

Case Custom attribute’s key

Solicitud

Body Data (required)

Update case custom attribute payload

Expand All

Campo

Tipo

Descripción

data [required]

object

Case update custom attribute

attributes [required]

object

A typed value for a custom attribute on a specific case.

is_multi [required]

boolean

If true, value must be an array

type [required]

enum

The data type of the custom attribute, which determines the allowed values and UI input control. Allowed enum values: URL,TEXT,NUMBER,SELECT

value [required]

 <oneOf>

The value of a custom attribute. The accepted format depends on the attribute's type and whether it accepts multiple values.

Option 1

string

A string value for a TEXT, URL, or SELECT-type custom attribute.

Option 2

[string]

An array of string values for a multi-value TEXT, URL, or SELECT-type custom attribute.

Option 3

double

A numeric value for a NUMBER-type custom attribute.

Option 4

[number]

An array of numeric values for a multi-value NUMBER-type custom attribute.

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "is_multi": false,
      "type": "NUMBER",
      "value": {
        "description": "",
        "type": ""
      }
    },
    "type": "case"
  }
}

Respuesta

OK

Case response

Expand All

Campo

Tipo

Descripción

data

object

A case

attributes [required]

object

Case resource attributes

archived_at

date-time

Timestamp of when the case was archived

attributes

object

Key-value pairs of case attributes. Each key maps to an array of string values, used for flexible metadata such as labels or tags.

<any-key>

[string]

closed_at

date-time

Timestamp of when the case was closed

created_at

date-time

Timestamp of when the case was created

custom_attributes

object

Case custom attributes

<any-key>

object

A typed value for a custom attribute on a specific case.

is_multi [required]

boolean

If true, value must be an array

type [required]

enum

The data type of the custom attribute, which determines the allowed values and UI input control. Allowed enum values: URL,TEXT,NUMBER,SELECT

value [required]

 <oneOf>

The value of a custom attribute. The accepted format depends on the attribute's type and whether it accepts multiple values.

Option 1

string

A string value for a TEXT, URL, or SELECT-type custom attribute.

Option 2

[string]

An array of string values for a multi-value TEXT, URL, or SELECT-type custom attribute.

Option 3

double

A numeric value for a NUMBER-type custom attribute.

Option 4

[number]

An array of numeric values for a multi-value NUMBER-type custom attribute.

description

string

Description

jira_issue

object

Jira issue attached to case

result

object

Jira issue information

issue_id

string

Jira issue ID

issue_key

string

Jira issue key

issue_url

string

Jira issue URL

project_key

string

Jira project key

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

key

string

Key

modified_at

date-time

Timestamp of when the case was last modified

priority

enum

Case priority Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5

default: NOT_DEFINED

service_now_ticket

object

ServiceNow ticket attached to case

result

object

ServiceNow ticket information

sys_target_link

string

Link to the Incident created on ServiceNow

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

status

enum

DEPRECATED: Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use status_name instead. Allowed enum values: OPEN,IN_PROGRESS,CLOSED

status_group

enum

Status group of the case. Allowed enum values: SG_OPEN,SG_IN_PROGRESS,SG_CLOSED

status_name

string

Status of the case. Must be one of the existing statuses for the case's type.

title

string

Title

type

enum

DEPRECATED: Case type Allowed enum values: STANDARD

type_id

string

Case type UUID

id [required]

string

Case's identifier

relationships

object

Resources related to a case

assignee

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

project

object

Relationship to project.

data [required]

object

Relationship to project object.

id [required]

string

A unique identifier that represents the project.

type [required]

enum

Project resource type. Allowed enum values: project

default: project

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "archived_at": "2019-09-19T10:00:00.000Z",
      "attributes": {
        "<any-key>": []
      },
      "closed_at": "2019-09-19T10:00:00.000Z",
      "created_at": "2019-09-19T10:00:00.000Z",
      "custom_attributes": {
        "<any-key>": {
          "is_multi": false,
          "type": "NUMBER",
          "value": {
            "description": "",
            "type": ""
          }
        }
      },
      "description": "string",
      "jira_issue": {
        "result": {
          "issue_id": "string",
          "issue_key": "string",
          "issue_url": "string",
          "project_key": "string"
        },
        "status": "COMPLETED"
      },
      "key": "CASEM-4523",
      "modified_at": "2019-09-19T10:00:00.000Z",
      "priority": "NOT_DEFINED",
      "service_now_ticket": {
        "result": {
          "sys_target_link": "string"
        },
        "status": "COMPLETED"
      },
      "status": "OPEN",
      "status_group": "SG_OPEN",
      "status_name": "Open",
      "title": "Memory leak investigation on API",
      "type": "STANDARD",
      "type_id": "3b010bde-09ce-4449-b745-71dd5f861963"
    },
    "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
    "relationships": {
      "assignee": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "project": {
        "data": {
          "id": "e555e290-ed65-49bd-ae18-8acbfcf18db7",
          "type": "project"
        }
      }
    },
    "type": "case"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  ## default
# 

# Path parameters
export case_id="f98a5a5b-e0ff-45d4-b2f5-afe6e74de504"
export custom_attribute_key="aws_region"
# Curl command
curl -X POST "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/${case_id}/custom_attributes/${custom_attribute_key}" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "is_multi": false, "type": "NUMBER", "value": 42 }, "type": "case" } } EOF
"""
Update case custom attribute returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi
from datadog_api_client.v2.model.case_resource_type import CaseResourceType
from datadog_api_client.v2.model.case_update_custom_attribute import CaseUpdateCustomAttribute
from datadog_api_client.v2.model.case_update_custom_attribute_request import CaseUpdateCustomAttributeRequest
from datadog_api_client.v2.model.custom_attribute_type import CustomAttributeType
from datadog_api_client.v2.model.custom_attribute_value import CustomAttributeValue

# there is a valid "case" with a custom "case_type" in the system
CASE_WITH_TYPE_ID = environ["CASE_WITH_TYPE_ID"]

# there is a valid "custom_attribute" in the system
CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY = environ["CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY"]

body = CaseUpdateCustomAttributeRequest(
    data=CaseUpdateCustomAttribute(
        attributes=CustomAttributeValue(
            type=CustomAttributeType.TEXT,
            is_multi=True,
            value=["Abba", "The Cure"],
        ),
        type=CaseResourceType.CASE,
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = CaseManagementApi(api_client)
    response = api_instance.update_case_custom_attribute(
        case_id=CASE_WITH_TYPE_ID, custom_attribute_key=CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY, body=body
    )

    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Update case custom attribute returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

# there is a valid "case" with a custom "case_type" in the system
CASE_WITH_TYPE_ID = ENV["CASE_WITH_TYPE_ID"]

# there is a valid "custom_attribute" in the system
CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY = ENV["CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY"]

body = DatadogAPIClient::V2::CaseUpdateCustomAttributeRequest.new({
  data: DatadogAPIClient::V2::CaseUpdateCustomAttribute.new({
    attributes: DatadogAPIClient::V2::CustomAttributeValue.new({
      type: DatadogAPIClient::V2::CustomAttributeType::TEXT,
      is_multi: true,
      value: [
        "Abba",
        "The Cure",
      ],
    }),
    type: DatadogAPIClient::V2::CaseResourceType::CASE,
  }),
})
p api_instance.update_case_custom_attribute(CASE_WITH_TYPE_ID, CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY, body)

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Update case custom attribute 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"
)

func main() {
	// there is a valid "case" with a custom "case_type" in the system
	CaseWithTypeID := os.Getenv("CASE_WITH_TYPE_ID")

	// there is a valid "custom_attribute" in the system
	CustomAttributeAttributesKey := os.Getenv("CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY")

	body := datadogV2.CaseUpdateCustomAttributeRequest{
		Data: datadogV2.CaseUpdateCustomAttribute{
			Attributes: datadogV2.CustomAttributeValue{
				Type:    datadogV2.CUSTOMATTRIBUTETYPE_TEXT,
				IsMulti: true,
				Value: datadogV2.CustomAttributeValuesUnion{
					CustomAttributeMultiStringValue: &[]string{
						"Abba",
						"The Cure",
					}},
			},
			Type: datadogV2.CASERESOURCETYPE_CASE,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCaseManagementApi(apiClient)
	resp, r, err := api.UpdateCaseCustomAttribute(ctx, CaseWithTypeID, CustomAttributeAttributesKey, body)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.UpdateCaseCustomAttribute`:\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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Update case custom attribute returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.CaseResourceType;
import com.datadog.api.client.v2.model.CaseResponse;
import com.datadog.api.client.v2.model.CaseUpdateCustomAttribute;
import com.datadog.api.client.v2.model.CaseUpdateCustomAttributeRequest;
import com.datadog.api.client.v2.model.CustomAttributeType;
import com.datadog.api.client.v2.model.CustomAttributeValue;
import com.datadog.api.client.v2.model.CustomAttributeValuesUnion;
import java.util.Arrays;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

    // there is a valid "case" with a custom "case_type" in the system
    String CASE_WITH_TYPE_ID = System.getenv("CASE_WITH_TYPE_ID");

    // there is a valid "custom_attribute" in the system
    String CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY = System.getenv("CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY");

    CaseUpdateCustomAttributeRequest body =
        new CaseUpdateCustomAttributeRequest()
            .data(
                new CaseUpdateCustomAttribute()
                    .attributes(
                        new CustomAttributeValue()
                            .type(CustomAttributeType.TEXT)
                            .isMulti(true)
                            .value(
                                CustomAttributeValuesUnion.fromStringList(
                                    Arrays.asList("Abba", "The Cure"))))
                    .type(CaseResourceType.CASE));

    try {
      CaseResponse result =
          apiInstance.updateCaseCustomAttribute(
              CASE_WITH_TYPE_ID, CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseManagementApi#updateCaseCustomAttribute");
      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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// Update case custom attribute returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
use datadog_api_client::datadogV2::model::CaseResourceType;
use datadog_api_client::datadogV2::model::CaseUpdateCustomAttribute;
use datadog_api_client::datadogV2::model::CaseUpdateCustomAttributeRequest;
use datadog_api_client::datadogV2::model::CustomAttributeType;
use datadog_api_client::datadogV2::model::CustomAttributeValue;
use datadog_api_client::datadogV2::model::CustomAttributeValuesUnion;

#[tokio::main]
async fn main() {
    // there is a valid "case" with a custom "case_type" in the system
    let case_with_type_id = std::env::var("CASE_WITH_TYPE_ID").unwrap();

    // there is a valid "custom_attribute" in the system
    let custom_attribute_attributes_key = std::env::var("CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY").unwrap();
    let body = CaseUpdateCustomAttributeRequest::new(CaseUpdateCustomAttribute::new(
        CustomAttributeValue::new(
            true,
            CustomAttributeType::TEXT,
            CustomAttributeValuesUnion::CustomAttributeMultiStringValue(vec![
                "Abba".to_string(),
                "The Cure".to_string(),
            ]),
        ),
        CaseResourceType::CASE,
    ));
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api
        .update_case_custom_attribute(
            case_with_type_id.clone(),
            custom_attribute_attributes_key.clone(),
            body,
        )
        .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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Update case custom attribute returns "OK" response
 */

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

const configuration = client.createConfiguration();
const apiInstance = new v2.CaseManagementApi(configuration);

// there is a valid "case" with a custom "case_type" in the system
const CASE_WITH_TYPE_ID = process.env.CASE_WITH_TYPE_ID as string;

// there is a valid "custom_attribute" in the system
const CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY = process.env
  .CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY as string;

const params: v2.CaseManagementApiUpdateCaseCustomAttributeRequest = {
  body: {
    data: {
      attributes: {
        type: "TEXT",
        isMulti: true,
        value: ["Abba", "The Cure"],
      },
      type: "case",
    },
  },
  caseId: CASE_WITH_TYPE_ID,
  customAttributeKey: CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY,
};

apiInstance
  .updateCaseCustomAttribute(params)
  .then((data: v2.CaseResponse) => {
    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"

DELETE https://api.ap1.datadoghq.com/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}https://api.ap2.datadoghq.com/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}https://api.datadoghq.eu/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}https://api.ddog-gov.com/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}https://api.us2.ddog-gov.com/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}https://api.datadoghq.com/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}https://api.us3.datadoghq.com/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}https://api.us5.datadoghq.com/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}

Información general

Delete custom attribute from case

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

case_id [required]

string

Case’s UUID or key

custom_attribute_key [required]

string

Case Custom attribute’s key

Respuesta

OK

Case response

Expand All

Campo

Tipo

Descripción

data

object

A case

attributes [required]

object

Case resource attributes

archived_at

date-time

Timestamp of when the case was archived

attributes

object

Key-value pairs of case attributes. Each key maps to an array of string values, used for flexible metadata such as labels or tags.

<any-key>

[string]

closed_at

date-time

Timestamp of when the case was closed

created_at

date-time

Timestamp of when the case was created

custom_attributes

object

Case custom attributes

<any-key>

object

A typed value for a custom attribute on a specific case.

is_multi [required]

boolean

If true, value must be an array

type [required]

enum

The data type of the custom attribute, which determines the allowed values and UI input control. Allowed enum values: URL,TEXT,NUMBER,SELECT

value [required]

 <oneOf>

The value of a custom attribute. The accepted format depends on the attribute's type and whether it accepts multiple values.

Option 1

string

A string value for a TEXT, URL, or SELECT-type custom attribute.

Option 2

[string]

An array of string values for a multi-value TEXT, URL, or SELECT-type custom attribute.

Option 3

double

A numeric value for a NUMBER-type custom attribute.

Option 4

[number]

An array of numeric values for a multi-value NUMBER-type custom attribute.

description

string

Description

jira_issue

object

Jira issue attached to case

result

object

Jira issue information

issue_id

string

Jira issue ID

issue_key

string

Jira issue key

issue_url

string

Jira issue URL

project_key

string

Jira project key

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

key

string

Key

modified_at

date-time

Timestamp of when the case was last modified

priority

enum

Case priority Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5

default: NOT_DEFINED

service_now_ticket

object

ServiceNow ticket attached to case

result

object

ServiceNow ticket information

sys_target_link

string

Link to the Incident created on ServiceNow

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

status

enum

DEPRECATED: Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use status_name instead. Allowed enum values: OPEN,IN_PROGRESS,CLOSED

status_group

enum

Status group of the case. Allowed enum values: SG_OPEN,SG_IN_PROGRESS,SG_CLOSED

status_name

string

Status of the case. Must be one of the existing statuses for the case's type.

title

string

Title

type

enum

DEPRECATED: Case type Allowed enum values: STANDARD

type_id

string

Case type UUID

id [required]

string

Case's identifier

relationships

object

Resources related to a case

assignee

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

project

object

Relationship to project.

data [required]

object

Relationship to project object.

id [required]

string

A unique identifier that represents the project.

type [required]

enum

Project resource type. Allowed enum values: project

default: project

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "archived_at": "2019-09-19T10:00:00.000Z",
      "attributes": {
        "<any-key>": []
      },
      "closed_at": "2019-09-19T10:00:00.000Z",
      "created_at": "2019-09-19T10:00:00.000Z",
      "custom_attributes": {
        "<any-key>": {
          "is_multi": false,
          "type": "NUMBER",
          "value": {
            "description": "",
            "type": ""
          }
        }
      },
      "description": "string",
      "jira_issue": {
        "result": {
          "issue_id": "string",
          "issue_key": "string",
          "issue_url": "string",
          "project_key": "string"
        },
        "status": "COMPLETED"
      },
      "key": "CASEM-4523",
      "modified_at": "2019-09-19T10:00:00.000Z",
      "priority": "NOT_DEFINED",
      "service_now_ticket": {
        "result": {
          "sys_target_link": "string"
        },
        "status": "COMPLETED"
      },
      "status": "OPEN",
      "status_group": "SG_OPEN",
      "status_name": "Open",
      "title": "Memory leak investigation on API",
      "type": "STANDARD",
      "type_id": "3b010bde-09ce-4449-b745-71dd5f861963"
    },
    "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
    "relationships": {
      "assignee": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "project": {
        "data": {
          "id": "e555e290-ed65-49bd-ae18-8acbfcf18db7",
          "type": "project"
        }
      }
    },
    "type": "case"
  }
}

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  # Path parameters
export case_id="f98a5a5b-e0ff-45d4-b2f5-afe6e74de504"
export custom_attribute_key="aws_region"
# Curl command
curl -X DELETE "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/${case_id}/custom_attributes/${custom_attribute_key}" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
Delete custom attribute from case returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi

# there is a valid "case" with a custom "case_type" in the system
CASE_WITH_TYPE_ID = environ["CASE_WITH_TYPE_ID"]

# there is a valid "custom_attribute" in the system
CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY = environ["CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY"]

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = CaseManagementApi(api_client)
    response = api_instance.delete_case_custom_attribute(
        case_id=CASE_WITH_TYPE_ID,
        custom_attribute_key=CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY,
    )

    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Delete custom attribute from case returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

# there is a valid "case" with a custom "case_type" in the system
CASE_WITH_TYPE_ID = ENV["CASE_WITH_TYPE_ID"]

# there is a valid "custom_attribute" in the system
CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY = ENV["CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY"]
p api_instance.delete_case_custom_attribute(CASE_WITH_TYPE_ID, CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY)

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Delete custom attribute from case 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"
)

func main() {
	// there is a valid "case" with a custom "case_type" in the system
	CaseWithTypeID := os.Getenv("CASE_WITH_TYPE_ID")

	// there is a valid "custom_attribute" in the system
	CustomAttributeAttributesKey := os.Getenv("CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY")

	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCaseManagementApi(apiClient)
	resp, r, err := api.DeleteCaseCustomAttribute(ctx, CaseWithTypeID, CustomAttributeAttributesKey)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.DeleteCaseCustomAttribute`:\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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Delete custom attribute from case returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.CaseResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

    // there is a valid "case" with a custom "case_type" in the system
    String CASE_WITH_TYPE_ID = System.getenv("CASE_WITH_TYPE_ID");

    // there is a valid "custom_attribute" in the system
    String CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY = System.getenv("CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY");

    try {
      CaseResponse result =
          apiInstance.deleteCaseCustomAttribute(CASE_WITH_TYPE_ID, CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseManagementApi#deleteCaseCustomAttribute");
      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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// Delete custom attribute from case returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;

#[tokio::main]
async fn main() {
    // there is a valid "case" with a custom "case_type" in the system
    let case_with_type_id = std::env::var("CASE_WITH_TYPE_ID").unwrap();

    // there is a valid "custom_attribute" in the system
    let custom_attribute_attributes_key = std::env::var("CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY").unwrap();
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api
        .delete_case_custom_attribute(
            case_with_type_id.clone(),
            custom_attribute_attributes_key.clone(),
        )
        .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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Delete custom attribute from case returns "OK" response
 */

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

const configuration = client.createConfiguration();
const apiInstance = new v2.CaseManagementApi(configuration);

// there is a valid "case" with a custom "case_type" in the system
const CASE_WITH_TYPE_ID = process.env.CASE_WITH_TYPE_ID as string;

// there is a valid "custom_attribute" in the system
const CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY = process.env
  .CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY as string;

const params: v2.CaseManagementApiDeleteCaseCustomAttributeRequest = {
  caseId: CASE_WITH_TYPE_ID,
  customAttributeKey: CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY,
};

apiInstance
  .deleteCaseCustomAttribute(params)
  .then((data: v2.CaseResponse) => {
    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"

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

POST https://api.ap1.datadoghq.com/api/v2/cases/{case_id}/due_datehttps://api.ap2.datadoghq.com/api/v2/cases/{case_id}/due_datehttps://api.datadoghq.eu/api/v2/cases/{case_id}/due_datehttps://api.ddog-gov.com/api/v2/cases/{case_id}/due_datehttps://api.us2.ddog-gov.com/api/v2/cases/{case_id}/due_datehttps://api.datadoghq.com/api/v2/cases/{case_id}/due_datehttps://api.us3.datadoghq.com/api/v2/cases/{case_id}/due_datehttps://api.us5.datadoghq.com/api/v2/cases/{case_id}/due_date

Información general

Sets or updates the due date for a case. The due date is a calendar date (without a time component) indicating when the case should be resolved.

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

case_id [required]

string

Case’s UUID or key

Solicitud

Body Data (required)

Case due date update payload.

Expand All

Campo

Tipo

Descripción

data [required]

object

Data object for updating a case's due date.

attributes [required]

object

Attributes for setting or clearing a case's due date.

due_date [required]

string

The target resolution date for the case, in YYYY-MM-DD format. Set to null to clear the due date.

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "due_date": "2026-12-31"
    },
    "type": "case"
  }
}

Respuesta

OK

Case response

Expand All

Campo

Tipo

Descripción

data

object

A case

attributes [required]

object

Case resource attributes

archived_at

date-time

Timestamp of when the case was archived

attributes

object

Key-value pairs of case attributes. Each key maps to an array of string values, used for flexible metadata such as labels or tags.

<any-key>

[string]

closed_at

date-time

Timestamp of when the case was closed

created_at

date-time

Timestamp of when the case was created

custom_attributes

object

Case custom attributes

<any-key>

object

A typed value for a custom attribute on a specific case.

is_multi [required]

boolean

If true, value must be an array

type [required]

enum

The data type of the custom attribute, which determines the allowed values and UI input control. Allowed enum values: URL,TEXT,NUMBER,SELECT

value [required]

 <oneOf>

The value of a custom attribute. The accepted format depends on the attribute's type and whether it accepts multiple values.

Option 1

string

A string value for a TEXT, URL, or SELECT-type custom attribute.

Option 2

[string]

An array of string values for a multi-value TEXT, URL, or SELECT-type custom attribute.

Option 3

double

A numeric value for a NUMBER-type custom attribute.

Option 4

[number]

An array of numeric values for a multi-value NUMBER-type custom attribute.

description

string

Description

jira_issue

object

Jira issue attached to case

result

object

Jira issue information

issue_id

string

Jira issue ID

issue_key

string

Jira issue key

issue_url

string

Jira issue URL

project_key

string

Jira project key

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

key

string

Key

modified_at

date-time

Timestamp of when the case was last modified

priority

enum

Case priority Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5

default: NOT_DEFINED

service_now_ticket

object

ServiceNow ticket attached to case

result

object

ServiceNow ticket information

sys_target_link

string

Link to the Incident created on ServiceNow

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

status

enum

DEPRECATED: Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use status_name instead. Allowed enum values: OPEN,IN_PROGRESS,CLOSED

status_group

enum

Status group of the case. Allowed enum values: SG_OPEN,SG_IN_PROGRESS,SG_CLOSED

status_name

string

Status of the case. Must be one of the existing statuses for the case's type.

title

string

Title

type

enum

DEPRECATED: Case type Allowed enum values: STANDARD

type_id

string

Case type UUID

id [required]

string

Case's identifier

relationships

object

Resources related to a case

assignee

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

project

object

Relationship to project.

data [required]

object

Relationship to project object.

id [required]

string

A unique identifier that represents the project.

type [required]

enum

Project resource type. Allowed enum values: project

default: project

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "archived_at": "2019-09-19T10:00:00.000Z",
      "attributes": {
        "<any-key>": []
      },
      "closed_at": "2019-09-19T10:00:00.000Z",
      "created_at": "2019-09-19T10:00:00.000Z",
      "custom_attributes": {
        "<any-key>": {
          "is_multi": false,
          "type": "NUMBER",
          "value": {
            "description": "",
            "type": ""
          }
        }
      },
      "description": "string",
      "jira_issue": {
        "result": {
          "issue_id": "string",
          "issue_key": "string",
          "issue_url": "string",
          "project_key": "string"
        },
        "status": "COMPLETED"
      },
      "key": "CASEM-4523",
      "modified_at": "2019-09-19T10:00:00.000Z",
      "priority": "NOT_DEFINED",
      "service_now_ticket": {
        "result": {
          "sys_target_link": "string"
        },
        "status": "COMPLETED"
      },
      "status": "OPEN",
      "status_group": "SG_OPEN",
      "status_name": "Open",
      "title": "Memory leak investigation on API",
      "type": "STANDARD",
      "type_id": "3b010bde-09ce-4449-b745-71dd5f861963"
    },
    "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
    "relationships": {
      "assignee": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "project": {
        "data": {
          "id": "e555e290-ed65-49bd-ae18-8acbfcf18db7",
          "type": "project"
        }
      }
    },
    "type": "case"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  ## default
# 

# Path parameters
export case_id="f98a5a5b-e0ff-45d4-b2f5-afe6e74de504"
# Curl command
curl -X POST "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/${case_id}/due_date" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "due_date": "2026-12-31" }, "type": "case" } } EOF

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

POST https://api.ap1.datadoghq.com/api/v2/cases/{case_id}/resolved_reasonhttps://api.ap2.datadoghq.com/api/v2/cases/{case_id}/resolved_reasonhttps://api.datadoghq.eu/api/v2/cases/{case_id}/resolved_reasonhttps://api.ddog-gov.com/api/v2/cases/{case_id}/resolved_reasonhttps://api.us2.ddog-gov.com/api/v2/cases/{case_id}/resolved_reasonhttps://api.datadoghq.com/api/v2/cases/{case_id}/resolved_reasonhttps://api.us3.datadoghq.com/api/v2/cases/{case_id}/resolved_reasonhttps://api.us5.datadoghq.com/api/v2/cases/{case_id}/resolved_reason

Información general

Sets the resolved reason for a security case (for example, FALSE_POSITIVE, TRUE_POSITIVE). Applicable to security-type cases.

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

case_id [required]

string

Case’s UUID or key

Solicitud

Body Data (required)

Case resolved reason update payload.

Expand All

Campo

Tipo

Descripción

data [required]

object

Data object for updating a case's resolved reason.

attributes [required]

object

Attributes for setting the resolution reason on a security case.

security_resolved_reason [required]

string

The reason the security case was resolved (for example, FALSE_POSITIVE, TRUE_POSITIVE, BENIGN_POSITIVE).

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "security_resolved_reason": "FALSE_POSITIVE"
    },
    "type": "case"
  }
}

Respuesta

OK

Case response

Expand All

Campo

Tipo

Descripción

data

object

A case

attributes [required]

object

Case resource attributes

archived_at

date-time

Timestamp of when the case was archived

attributes

object

Key-value pairs of case attributes. Each key maps to an array of string values, used for flexible metadata such as labels or tags.

<any-key>

[string]

closed_at

date-time

Timestamp of when the case was closed

created_at

date-time

Timestamp of when the case was created

custom_attributes

object

Case custom attributes

<any-key>

object

A typed value for a custom attribute on a specific case.

is_multi [required]

boolean

If true, value must be an array

type [required]

enum

The data type of the custom attribute, which determines the allowed values and UI input control. Allowed enum values: URL,TEXT,NUMBER,SELECT

value [required]

 <oneOf>

The value of a custom attribute. The accepted format depends on the attribute's type and whether it accepts multiple values.

Option 1

string

A string value for a TEXT, URL, or SELECT-type custom attribute.

Option 2

[string]

An array of string values for a multi-value TEXT, URL, or SELECT-type custom attribute.

Option 3

double

A numeric value for a NUMBER-type custom attribute.

Option 4

[number]

An array of numeric values for a multi-value NUMBER-type custom attribute.

description

string

Description

jira_issue

object

Jira issue attached to case

result

object

Jira issue information

issue_id

string

Jira issue ID

issue_key

string

Jira issue key

issue_url

string

Jira issue URL

project_key

string

Jira project key

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

key

string

Key

modified_at

date-time

Timestamp of when the case was last modified

priority

enum

Case priority Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5

default: NOT_DEFINED

service_now_ticket

object

ServiceNow ticket attached to case

result

object

ServiceNow ticket information

sys_target_link

string

Link to the Incident created on ServiceNow

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

status

enum

DEPRECATED: Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use status_name instead. Allowed enum values: OPEN,IN_PROGRESS,CLOSED

status_group

enum

Status group of the case. Allowed enum values: SG_OPEN,SG_IN_PROGRESS,SG_CLOSED

status_name

string

Status of the case. Must be one of the existing statuses for the case's type.

title

string

Title

type

enum

DEPRECATED: Case type Allowed enum values: STANDARD

type_id

string

Case type UUID

id [required]

string

Case's identifier

relationships

object

Resources related to a case

assignee

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

project

object

Relationship to project.

data [required]

object

Relationship to project object.

id [required]

string

A unique identifier that represents the project.

type [required]

enum

Project resource type. Allowed enum values: project

default: project

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "archived_at": "2019-09-19T10:00:00.000Z",
      "attributes": {
        "<any-key>": []
      },
      "closed_at": "2019-09-19T10:00:00.000Z",
      "created_at": "2019-09-19T10:00:00.000Z",
      "custom_attributes": {
        "<any-key>": {
          "is_multi": false,
          "type": "NUMBER",
          "value": {
            "description": "",
            "type": ""
          }
        }
      },
      "description": "string",
      "jira_issue": {
        "result": {
          "issue_id": "string",
          "issue_key": "string",
          "issue_url": "string",
          "project_key": "string"
        },
        "status": "COMPLETED"
      },
      "key": "CASEM-4523",
      "modified_at": "2019-09-19T10:00:00.000Z",
      "priority": "NOT_DEFINED",
      "service_now_ticket": {
        "result": {
          "sys_target_link": "string"
        },
        "status": "COMPLETED"
      },
      "status": "OPEN",
      "status_group": "SG_OPEN",
      "status_name": "Open",
      "title": "Memory leak investigation on API",
      "type": "STANDARD",
      "type_id": "3b010bde-09ce-4449-b745-71dd5f861963"
    },
    "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
    "relationships": {
      "assignee": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "project": {
        "data": {
          "id": "e555e290-ed65-49bd-ae18-8acbfcf18db7",
          "type": "project"
        }
      }
    },
    "type": "case"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  ## default
# 

# Path parameters
export case_id="f98a5a5b-e0ff-45d4-b2f5-afe6e74de504"
# Curl command
curl -X POST "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/${case_id}/resolved_reason" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "security_resolved_reason": "FALSE_POSITIVE" }, "type": "case" } } EOF

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

POST https://api.ap1.datadoghq.com/api/v2/cases/aggregatehttps://api.ap2.datadoghq.com/api/v2/cases/aggregatehttps://api.datadoghq.eu/api/v2/cases/aggregatehttps://api.ddog-gov.com/api/v2/cases/aggregatehttps://api.us2.ddog-gov.com/api/v2/cases/aggregatehttps://api.datadoghq.com/api/v2/cases/aggregatehttps://api.us3.datadoghq.com/api/v2/cases/aggregatehttps://api.us5.datadoghq.com/api/v2/cases/aggregate

Información general

Performs an aggregation query over cases, grouping results by specified fields and returning counts per group along with a total. Useful for dashboards and analytics.

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

Solicitud

Body Data (required)

Case aggregate request payload.

Expand All

Campo

Tipo

Descripción

data [required]

object

Data object wrapping the aggregation query type and attributes.

attributes [required]

object

Attributes for the aggregation request, including the search query and grouping configuration.

group_by [required]

object

Configuration for grouping aggregated results by one or more case fields.

groups [required]

[string]

Fields to group by.

limit [required]

int32

Maximum number of groups to return.

query_filter [required]

string

A search query to filter which cases are included in the aggregation. Uses the same syntax as the Case Management search bar.

type [required]

enum

JSON:API resource type for case aggregation requests. Allowed enum values: aggregate

{
  "data": {
    "attributes": {
      "group_by": {
        "groups": [
          "status"
        ],
        "limit": 14
      },
      "query_filter": "service:case-api"
    },
    "type": "aggregate"
  }
}

Respuesta

OK

Response containing aggregated case counts grouped by the requested fields.

Expand All

Campo

Tipo

Descripción

data [required]

object

Data object containing the aggregation results, including total count and per-group breakdowns.

attributes [required]

object

Attributes of the aggregation result, including the total count across all groups and the per-group breakdowns.

groups [required]

[object]

Aggregated groups.

group [required]

string

The value of the field being grouped on (for example, OPEN when grouping by status).

value [required]

[number]

The count of cases in this group.

total [required]

double

Total count of aggregated cases.

id [required]

string

Aggregate response identifier.

type [required]

string

Aggregate resource type.

{
  "data": {
    "attributes": {
      "groups": [
        {
          "group": "OPEN",
          "value": [
            42
          ]
        }
      ],
      "total": 100
    },
    "id": "agg-result-001",
    "type": "aggregate"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  ## default
# 

# Curl command
curl -X POST "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/aggregate" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "group_by": { "groups": [ "status" ], "limit": 14 }, "query_filter": "service:case-api" }, "type": "aggregate" } } EOF

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/cases/counthttps://api.ap2.datadoghq.com/api/v2/cases/counthttps://api.datadoghq.eu/api/v2/cases/counthttps://api.ddog-gov.com/api/v2/cases/counthttps://api.us2.ddog-gov.com/api/v2/cases/counthttps://api.datadoghq.com/api/v2/cases/counthttps://api.us3.datadoghq.com/api/v2/cases/counthttps://api.us5.datadoghq.com/api/v2/cases/count

Información general

Returns case counts, optionally grouped by one or more fields (for example, status, priority). Supports a query filter to narrow the scope.

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

Argumentos

Cadenas de consulta

Nombre

Tipo

Descripción

query_filter

string

Filter query for cases.

group_bys

string

Comma-separated fields to group by.

limit

integer

Maximum facet values to return.

Respuesta

OK

Response containing the total number of cases matching a query, optionally grouped by specified fields.

Expand All

Campo

Tipo

Descripción

data [required]

object

Data object containing the count results, including per-field group breakdowns.

attributes [required]

object

Attributes for the count response, including the total count and optional facet breakdowns.

groups [required]

[object]

List of facet groups, one per field specified in group_bys.

group [required]

string

The name of the field being grouped on (for example, status or priority).

group_values [required]

[object]

Values within this group.

count [required]

int64

Count of cases for this value.

value [required]

string

The group value.

id [required]

string

Count response identifier.

type [required]

string

Count resource type.

{
  "data": {
    "attributes": {
      "groups": [
        {
          "group": "status",
          "group_values": [
            {
              "count": 42,
              "value": "OPEN"
            }
          ]
        }
      ]
    },
    "id": "count-result-001",
    "type": "count"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  # 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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/count" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

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

POST https://api.ap1.datadoghq.com/api/v2/cases/bulkhttps://api.ap2.datadoghq.com/api/v2/cases/bulkhttps://api.datadoghq.eu/api/v2/cases/bulkhttps://api.ddog-gov.com/api/v2/cases/bulkhttps://api.us2.ddog-gov.com/api/v2/cases/bulkhttps://api.datadoghq.com/api/v2/cases/bulkhttps://api.us3.datadoghq.com/api/v2/cases/bulkhttps://api.us5.datadoghq.com/api/v2/cases/bulk

Información general

Applies a single action (such as changing priority, status, assignment, or archiving) to multiple cases at once. The list of case IDs and the action type with its payload are specified in the request body.

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

Solicitud

Body Data (required)

Case bulk update request payload.

Expand All

Campo

Tipo

Descripción

data [required]

object

Data object wrapping the bulk update type and attributes.

attributes [required]

object

Attributes for the bulk update, specifying which cases to update and the action to apply.

case_ids [required]

[string]

An array of case identifiers to apply the bulk action to.

payload

object

A key-value map of action-specific parameters. The required keys depend on the action type (for example, priority for the priority action, assignee_id for assign).

<any-key>

string

type [required]

enum

The type of action to apply in a bulk update. Allowed values are priority, status, assign, unassign, archive, unarchive, jira, servicenow, linear, update_project. Allowed enum values: priority,status,assign,unassign,archive,unarchive,jira,servicenow,linear,update_project

type [required]

enum

JSON:API resource type for bulk case operations. Allowed enum values: bulk

{
  "data": {
    "attributes": {
      "case_ids": [
        "case-id-1",
        "case-id-2"
      ],
      "payload": {
        "<any-key>": "string"
      },
      "type": "priority"
    },
    "type": "bulk"
  }
}

Respuesta

OK

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  ## default
# 

# Curl command
curl -X POST "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/bulk" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "case_ids": [ "case-id-1", "case-id-2" ], "payload": { "priority": "P1" }, "type": "priority" }, "type": "bulk" } } EOF

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/cases/projects/favoriteshttps://api.ap2.datadoghq.com/api/v2/cases/projects/favoriteshttps://api.datadoghq.eu/api/v2/cases/projects/favoriteshttps://api.ddog-gov.com/api/v2/cases/projects/favoriteshttps://api.us2.ddog-gov.com/api/v2/cases/projects/favoriteshttps://api.datadoghq.com/api/v2/cases/projects/favoriteshttps://api.us3.datadoghq.com/api/v2/cases/projects/favoriteshttps://api.us5.datadoghq.com/api/v2/cases/projects/favorites

Información general

Returns the list of case projects that the current authenticated user has marked as favorites.

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

Respuesta

OK

Response containing the list of projects the current user has favorited.

Expand All

Campo

Tipo

Descripción

data [required]

[object]

List of project favorites.

id [required]

string

The UUID of the favorited project.

type [required]

enum

JSON:API resource type for project favorites. Allowed enum values: project_favorite

default: project_favorite

{
  "data": [
    {
      "id": "e555e290-ed65-49bd-ae18-8acbfcf18db7",
      "type": "project_favorite"
    }
  ]
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  # 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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/projects/favorites" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

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

POST https://api.ap1.datadoghq.com/api/v2/cases/projects/{project_id}/favoriteshttps://api.ap2.datadoghq.com/api/v2/cases/projects/{project_id}/favoriteshttps://api.datadoghq.eu/api/v2/cases/projects/{project_id}/favoriteshttps://api.ddog-gov.com/api/v2/cases/projects/{project_id}/favoriteshttps://api.us2.ddog-gov.com/api/v2/cases/projects/{project_id}/favoriteshttps://api.datadoghq.com/api/v2/cases/projects/{project_id}/favoriteshttps://api.us3.datadoghq.com/api/v2/cases/projects/{project_id}/favoriteshttps://api.us5.datadoghq.com/api/v2/cases/projects/{project_id}/favorites

Información general

Marks a case project as a favorite for the current authenticated user.

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

project_id [required]

string

Project UUID.

Respuesta

No Content

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  # Path parameters
export project_id="e555e290-ed65-49bd-ae18-8acbfcf18db7"
# Curl command
curl -X POST "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/projects/${project_id}/favorites" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

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

DELETE https://api.ap1.datadoghq.com/api/v2/cases/projects/{project_id}/favoriteshttps://api.ap2.datadoghq.com/api/v2/cases/projects/{project_id}/favoriteshttps://api.datadoghq.eu/api/v2/cases/projects/{project_id}/favoriteshttps://api.ddog-gov.com/api/v2/cases/projects/{project_id}/favoriteshttps://api.us2.ddog-gov.com/api/v2/cases/projects/{project_id}/favoriteshttps://api.datadoghq.com/api/v2/cases/projects/{project_id}/favoriteshttps://api.us3.datadoghq.com/api/v2/cases/projects/{project_id}/favoriteshttps://api.us5.datadoghq.com/api/v2/cases/projects/{project_id}/favorites

Información general

Removes a case project from the current user’s favorites list.

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

project_id [required]

string

Project UUID.

Respuesta

No Content

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  # Path parameters
export project_id="e555e290-ed65-49bd-ae18-8acbfcf18db7"
# Curl command
curl -X DELETE "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/projects/${project_id}/favorites" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

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

PUT https://api.ap1.datadoghq.com/api/v2/cases/{case_id}/insightshttps://api.ap2.datadoghq.com/api/v2/cases/{case_id}/insightshttps://api.datadoghq.eu/api/v2/cases/{case_id}/insightshttps://api.ddog-gov.com/api/v2/cases/{case_id}/insightshttps://api.us2.ddog-gov.com/api/v2/cases/{case_id}/insightshttps://api.datadoghq.com/api/v2/cases/{case_id}/insightshttps://api.us3.datadoghq.com/api/v2/cases/{case_id}/insightshttps://api.us5.datadoghq.com/api/v2/cases/{case_id}/insights

Información general

Adds one or more insights to a case. Insights are references to related Datadog resources (such as monitors, security signals, incidents, or error tracking issues) that provide investigative context. Up to 100 insights can be added per request. Each insight requires a type (see CaseInsightType for allowed values), a ref (URL path to the resource), and a resource_id.

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

case_id [required]

string

Case’s UUID or key

Solicitud

Body Data (required)

Case insights request.

Expand All

Campo

Tipo

Descripción

data [required]

object

Data object containing the insights to add or remove.

attributes [required]

object

Attributes for adding or removing insights from a case.

insights [required]

[object]

Array of insights to add to or remove from a case.

ref [required]

string

The URL path or deep link to the insight resource within Datadog (for example, /monitors/12345?q=total).

resource_id [required]

string

The unique identifier of the referenced Datadog resource (for example, a monitor ID, incident ID, or signal ID).

type [required]

enum

The type of Datadog resource linked to the case as contextual evidence. Each type corresponds to a different Datadog product signal (for example, a security finding, a monitor alert, or an incident). Allowed enum values: SECURITY_SIGNAL,MONITOR,EVENT_CORRELATION,ERROR_TRACKING,CLOUD_COST_RECOMMENDATION,INCIDENT,SENSITIVE_DATA_SCANNER_ISSUE,EVENT,WATCHDOG_STORY,WIDGET

Show 6 more,SECURITY_FINDING,INSIGHT_SCORECARD_CAMPAIGN,RESOURCE_POLICY,APM_RECOMMENDATION,SCM_URL,PROFILING_DOWNSIZING_EXPERIMENT

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "insights": [
        {
          "ref": "/monitors/12345?q=total",
          "resource_id": "12345",
          "type": "SECURITY_SIGNAL"
        }
      ]
    },
    "type": "case"
  }
}

Respuesta

OK

Case response

Expand All

Campo

Tipo

Descripción

data

object

A case

attributes [required]

object

Case resource attributes

archived_at

date-time

Timestamp of when the case was archived

attributes

object

Key-value pairs of case attributes. Each key maps to an array of string values, used for flexible metadata such as labels or tags.

<any-key>

[string]

closed_at

date-time

Timestamp of when the case was closed

created_at

date-time

Timestamp of when the case was created

custom_attributes

object

Case custom attributes

<any-key>

object

A typed value for a custom attribute on a specific case.

is_multi [required]

boolean

If true, value must be an array

type [required]

enum

The data type of the custom attribute, which determines the allowed values and UI input control. Allowed enum values: URL,TEXT,NUMBER,SELECT

value [required]

 <oneOf>

The value of a custom attribute. The accepted format depends on the attribute's type and whether it accepts multiple values.

Option 1

string

A string value for a TEXT, URL, or SELECT-type custom attribute.

Option 2

[string]

An array of string values for a multi-value TEXT, URL, or SELECT-type custom attribute.

Option 3

double

A numeric value for a NUMBER-type custom attribute.

Option 4

[number]

An array of numeric values for a multi-value NUMBER-type custom attribute.

description

string

Description

jira_issue

object

Jira issue attached to case

result

object

Jira issue information

issue_id

string

Jira issue ID

issue_key

string

Jira issue key

issue_url

string

Jira issue URL

project_key

string

Jira project key

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

key

string

Key

modified_at

date-time

Timestamp of when the case was last modified

priority

enum

Case priority Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5

default: NOT_DEFINED

service_now_ticket

object

ServiceNow ticket attached to case

result

object

ServiceNow ticket information

sys_target_link

string

Link to the Incident created on ServiceNow

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

status

enum

DEPRECATED: Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use status_name instead. Allowed enum values: OPEN,IN_PROGRESS,CLOSED

status_group

enum

Status group of the case. Allowed enum values: SG_OPEN,SG_IN_PROGRESS,SG_CLOSED

status_name

string

Status of the case. Must be one of the existing statuses for the case's type.

title

string

Title

type

enum

DEPRECATED: Case type Allowed enum values: STANDARD

type_id

string

Case type UUID

id [required]

string

Case's identifier

relationships

object

Resources related to a case

assignee

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

project

object

Relationship to project.

data [required]

object

Relationship to project object.

id [required]

string

A unique identifier that represents the project.

type [required]

enum

Project resource type. Allowed enum values: project

default: project

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "archived_at": "2019-09-19T10:00:00.000Z",
      "attributes": {
        "<any-key>": []
      },
      "closed_at": "2019-09-19T10:00:00.000Z",
      "created_at": "2019-09-19T10:00:00.000Z",
      "custom_attributes": {
        "<any-key>": {
          "is_multi": false,
          "type": "NUMBER",
          "value": {
            "description": "",
            "type": ""
          }
        }
      },
      "description": "string",
      "jira_issue": {
        "result": {
          "issue_id": "string",
          "issue_key": "string",
          "issue_url": "string",
          "project_key": "string"
        },
        "status": "COMPLETED"
      },
      "key": "CASEM-4523",
      "modified_at": "2019-09-19T10:00:00.000Z",
      "priority": "NOT_DEFINED",
      "service_now_ticket": {
        "result": {
          "sys_target_link": "string"
        },
        "status": "COMPLETED"
      },
      "status": "OPEN",
      "status_group": "SG_OPEN",
      "status_name": "Open",
      "title": "Memory leak investigation on API",
      "type": "STANDARD",
      "type_id": "3b010bde-09ce-4449-b745-71dd5f861963"
    },
    "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
    "relationships": {
      "assignee": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "project": {
        "data": {
          "id": "e555e290-ed65-49bd-ae18-8acbfcf18db7",
          "type": "project"
        }
      }
    },
    "type": "case"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

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"
    }
  ]
}

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

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"
    }
  ]
}

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

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

Campo

Tipo

Descripción

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

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  ## default
# 

# Path parameters
export case_id="f98a5a5b-e0ff-45d4-b2f5-afe6e74de504"
# Curl command
curl -X PUT "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/${case_id}/insights" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "insights": [ { "ref": "/monitors/12345?q=total", "resource_id": "12345", "type": "SECURITY_SIGNAL" } ] }, "type": "case" } } EOF

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

DELETE https://api.ap1.datadoghq.com/api/v2/cases/{case_id}/insightshttps://api.ap2.datadoghq.com/api/v2/cases/{case_id}/insightshttps://api.datadoghq.eu/api/v2/cases/{case_id}/insightshttps://api.ddog-gov.com/api/v2/cases/{case_id}/insightshttps://api.us2.ddog-gov.com/api/v2/cases/{case_id}/insightshttps://api.datadoghq.com/api/v2/cases/{case_id}/insightshttps://api.us3.datadoghq.com/api/v2/cases/{case_id}/insightshttps://api.us5.datadoghq.com/api/v2/cases/{case_id}/insights

Información general

Removes one or more previously added insights from a case by specifying their type and resource identifier in the request body.

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

case_id [required]

string

Case’s UUID or key

Solicitud

Body Data (required)

Case insights request.

Expand All

Campo

Tipo

Descripción

data [required]

object

Data object containing the insights to add or remove.

attributes [required]

object

Attributes for adding or removing insights from a case.

insights [required]

[object]

Array of insights to add to or remove from a case.

ref [required]

string

The URL path or deep link to the insight resource within Datadog (for example, /monitors/12345?q=total).

resource_id [required]

string

The unique identifier of the referenced Datadog resource (for example, a monitor ID, incident ID, or signal ID).

type [required]

enum

The type of Datadog resource linked to the case as contextual evidence. Each type corresponds to a different Datadog product signal (for example, a security finding, a monitor alert, or an incident). Allowed enum values: SECURITY_SIGNAL,MONITOR,EVENT_CORRELATION,ERROR_TRACKING,CLOUD_COST_RECOMMENDATION,INCIDENT,SENSITIVE_DATA_SCANNER_ISSUE,EVENT,WATCHDOG_STORY,WIDGET

Show 6 more,SECURITY_FINDING,INSIGHT_SCORECARD_CAMPAIGN,RESOURCE_POLICY,APM_RECOMMENDATION,SCM_URL,PROFILING_DOWNSIZING_EXPERIMENT

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "insights": [
        {
          "ref": "/monitors/12345?q=total",
          "resource_id": "12345",
          "type": "SECURITY_SIGNAL"
        }
      ]
    },
    "type": "case"
  }
}

Respuesta

OK

Case response

Expand All

Campo

Tipo

Descripción

data

object

A case

attributes [required]

object

Case resource attributes

archived_at

date-time

Timestamp of when the case was archived

attributes

object

Key-value pairs of case attributes. Each key maps to an array of string values, used for flexible metadata such as labels or tags.

<any-key>

[string]

closed_at

date-time

Timestamp of when the case was closed

created_at

date-time

Timestamp of when the case was created

custom_attributes

object

Case custom attributes

<any-key>

object

A typed value for a custom attribute on a specific case.

is_multi [required]

boolean

If true, value must be an array

type [required]

enum

The data type of the custom attribute, which determines the allowed values and UI input control. Allowed enum values: URL,TEXT,NUMBER,SELECT

value [required]

 <oneOf>

The value of a custom attribute. The accepted format depends on the attribute's type and whether it accepts multiple values.

Option 1

string

A string value for a TEXT, URL, or SELECT-type custom attribute.

Option 2

[string]

An array of string values for a multi-value TEXT, URL, or SELECT-type custom attribute.

Option 3

double

A numeric value for a NUMBER-type custom attribute.

Option 4

[number]

An array of numeric values for a multi-value NUMBER-type custom attribute.

description

string

Description

jira_issue

object

Jira issue attached to case

result

object

Jira issue information

issue_id

string

Jira issue ID

issue_key

string

Jira issue key

issue_url

string

Jira issue URL

project_key

string

Jira project key

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

key

string

Key

modified_at

date-time

Timestamp of when the case was last modified

priority

enum

Case priority Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5

default: NOT_DEFINED

service_now_ticket

object

ServiceNow ticket attached to case

result

object

ServiceNow ticket information

sys_target_link

string

Link to the Incident created on ServiceNow

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

status

enum

DEPRECATED: Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use status_name instead. Allowed enum values: OPEN,IN_PROGRESS,CLOSED

status_group

enum

Status group of the case. Allowed enum values: SG_OPEN,SG_IN_PROGRESS,SG_CLOSED

status_name

string

Status of the case. Must be one of the existing statuses for the case's type.

title

string

Title

type

enum

DEPRECATED: Case type Allowed enum values: STANDARD

type_id

string

Case type UUID

id [required]

string

Case's identifier

relationships

object

Resources related to a case

assignee

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

project

object

Relationship to project.

data [required]

object

Relationship to project object.

id [required]

string

A unique identifier that represents the project.

type [required]

enum

Project resource type. Allowed enum values: project

default: project

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "archived_at": "2019-09-19T10:00:00.000Z",
      "attributes": {
        "<any-key>": []
      },
      "closed_at": "2019-09-19T10:00:00.000Z",
      "created_at": "2019-09-19T10:00:00.000Z",
      "custom_attributes": {
        "<any-key>": {
          "is_multi": false,
          "type": "NUMBER",
          "value": {
            "description": "",
            "type": ""
          }
        }
      },
      "description": "string",
      "jira_issue": {
        "result": {
          "issue_id": "string",
          "issue_key": "string",
          "issue_url": "string",
          "project_key": "string"
        },
        "status": "COMPLETED"
      },
      "key": "CASEM-4523",
      "modified_at": "2019-09-19T10:00:00.000Z",
      "priority": "NOT_DEFINED",
      "service_now_ticket": {
        "result": {
          "sys_target_link": "string"
        },
        "status": "COMPLETED"
      },
      "status": "OPEN",
      "status_group": "SG_OPEN",
      "status_name": "Open",
      "title": "Memory leak investigation on API",
      "type": "STANDARD",
      "type_id": "3b010bde-09ce-4449-b745-71dd5f861963"
    },
    "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
    "relationships": {
      "assignee": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "project": {
        "data": {
          "id": "e555e290-ed65-49bd-ae18-8acbfcf18db7",
          "type": "project"
        }
      }
    },
    "type": "case"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

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"
    }
  ]
}

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

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"
    }
  ]
}

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

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

Campo

Tipo

Descripción

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

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  ## default
# 

# Path parameters
export case_id="f98a5a5b-e0ff-45d4-b2f5-afe6e74de504"
# Curl command
curl -X DELETE "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/${case_id}/insights" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "insights": [ { "ref": "/monitors/12345?q=total", "resource_id": "12345", "type": "SECURITY_SIGNAL" } ] }, "type": "case" } } EOF




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/maintenance_windowshttps://api.ap2.datadoghq.com/api/v2/maintenance_windowshttps://api.datadoghq.eu/api/v2/maintenance_windowshttps://api.ddog-gov.com/api/v2/maintenance_windowshttps://api.us2.ddog-gov.com/api/v2/maintenance_windowshttps://api.datadoghq.com/api/v2/maintenance_windowshttps://api.us3.datadoghq.com/api/v2/maintenance_windowshttps://api.us5.datadoghq.com/api/v2/maintenance_windows

Información general

Returns all configured maintenance windows for event management cases. Maintenance windows define time periods during which case notifications and automation rules are suppressed for cases matching a given query.

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

Respuesta

OK

Response containing a list of maintenance windows.

Expand All

Campo

Tipo

Descripción

data [required]

[object]

List of maintenance windows.

attributes [required]

object

Attributes of a maintenance window, including its schedule and the query that determines which cases are affected.

created_by

string

The UUID of the user who created this maintenance window. Read-only.

end_at [required]

date-time

The ISO 8601 timestamp when the maintenance window ends and normal notification behavior resumes.

name [required]

string

A human-readable name for the maintenance window (for example, Database migration - Dec 15).

query [required]

string

A case search query that determines which cases are affected during the maintenance window. Uses the same syntax as the Case Management search bar.

start_at [required]

date-time

The ISO 8601 timestamp when the maintenance window begins and notifications start being suppressed.

updated_by

string

The UUID of the user who last modified this maintenance window. Read-only.

id [required]

string

The maintenance window's identifier.

type [required]

enum

JSON:API resource type for maintenance windows. Allowed enum values: maintenance_window

default: maintenance_window

{
  "data": [
    {
      "attributes": {
        "created_by": "string",
        "end_at": "2026-06-01T06:00:00Z",
        "name": "Weekly maintenance",
        "query": "project:SEC",
        "start_at": "2026-06-01T00:00:00Z",
        "updated_by": "string"
      },
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "type": "maintenance_window"
    }
  ]
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  # 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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/maintenance_windows" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

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

POST https://api.ap1.datadoghq.com/api/v2/maintenance_windowshttps://api.ap2.datadoghq.com/api/v2/maintenance_windowshttps://api.datadoghq.eu/api/v2/maintenance_windowshttps://api.ddog-gov.com/api/v2/maintenance_windowshttps://api.us2.ddog-gov.com/api/v2/maintenance_windowshttps://api.datadoghq.com/api/v2/maintenance_windowshttps://api.us3.datadoghq.com/api/v2/maintenance_windowshttps://api.us5.datadoghq.com/api/v2/maintenance_windows

Información general

Creates a maintenance window for event management cases with a name, case filter query, and time range (start and end).

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

Solicitud

Body Data (required)

Maintenance window payload.

Expand All

Campo

Tipo

Descripción

data [required]

object

Data object for creating a maintenance window.

attributes [required]

object

Attributes required to create a maintenance window.

end_at [required]

date-time

The end time of the maintenance window.

name [required]

string

The name of the maintenance window.

query [required]

string

The query to filter event management cases for this maintenance window.

start_at [required]

date-time

The start time of the maintenance window.

type [required]

enum

JSON:API resource type for maintenance windows. Allowed enum values: maintenance_window

default: maintenance_window

{
  "data": {
    "attributes": {
      "end_at": "2026-06-01T06:00:00Z",
      "name": "Weekly maintenance",
      "query": "project:SEC",
      "start_at": "2026-06-01T00:00:00Z"
    },
    "type": "maintenance_window"
  }
}

Respuesta

Created

Response containing a single maintenance window.

Expand All

Campo

Tipo

Descripción

data [required]

object

A maintenance window that defines a scheduled time period during which case-related notifications and automation rules are suppressed. Each maintenance window applies to cases matching a specified query.

attributes [required]

object

Attributes of a maintenance window, including its schedule and the query that determines which cases are affected.

created_by

string

The UUID of the user who created this maintenance window. Read-only.

end_at [required]

date-time

The ISO 8601 timestamp when the maintenance window ends and normal notification behavior resumes.

name [required]

string

A human-readable name for the maintenance window (for example, Database migration - Dec 15).

query [required]

string

A case search query that determines which cases are affected during the maintenance window. Uses the same syntax as the Case Management search bar.

start_at [required]

date-time

The ISO 8601 timestamp when the maintenance window begins and notifications start being suppressed.

updated_by

string

The UUID of the user who last modified this maintenance window. Read-only.

id [required]

string

The maintenance window's identifier.

type [required]

enum

JSON:API resource type for maintenance windows. Allowed enum values: maintenance_window

default: maintenance_window

{
  "data": {
    "attributes": {
      "created_by": "string",
      "end_at": "2026-06-01T06:00:00Z",
      "name": "Weekly maintenance",
      "query": "project:SEC",
      "start_at": "2026-06-01T00:00:00Z",
      "updated_by": "string"
    },
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "type": "maintenance_window"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  ## default
# 

# Curl command
curl -X POST "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/maintenance_windows" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "end_at": "2026-06-01T06:00:00Z", "name": "Weekly maintenance", "query": "project:SEC", "start_at": "2026-06-01T00:00:00Z" }, "type": "maintenance_window" } } EOF

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

PUT https://api.ap1.datadoghq.com/api/v2/maintenance_windows/{maintenance_window_id}https://api.ap2.datadoghq.com/api/v2/maintenance_windows/{maintenance_window_id}https://api.datadoghq.eu/api/v2/maintenance_windows/{maintenance_window_id}https://api.ddog-gov.com/api/v2/maintenance_windows/{maintenance_window_id}https://api.us2.ddog-gov.com/api/v2/maintenance_windows/{maintenance_window_id}https://api.datadoghq.com/api/v2/maintenance_windows/{maintenance_window_id}https://api.us3.datadoghq.com/api/v2/maintenance_windows/{maintenance_window_id}https://api.us5.datadoghq.com/api/v2/maintenance_windows/{maintenance_window_id}

Información general

Updates the name, query, start time, or end time of an existing maintenance window.

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

maintenance_window_id [required]

string

The UUID of the maintenance window.

Solicitud

Body Data (required)

Maintenance window payload.

Expand All

Campo

Tipo

Descripción

data [required]

object

Data object for updating a maintenance window.

attributes

object

Attributes that can be updated on a maintenance window. All fields are optional; only provided fields are changed.

end_at

date-time

The end time of the maintenance window.

name

string

The name of the maintenance window.

query

string

The query to filter event management cases for this maintenance window.

start_at

date-time

The start time of the maintenance window.

type [required]

enum

JSON:API resource type for maintenance windows. Allowed enum values: maintenance_window

default: maintenance_window

{
  "data": {
    "attributes": {
      "end_at": "2019-09-19T10:00:00.000Z",
      "name": "string",
      "query": "string",
      "start_at": "2019-09-19T10:00:00.000Z"
    },
    "type": "maintenance_window"
  }
}

Respuesta

OK

Response containing a single maintenance window.

Expand All

Campo

Tipo

Descripción

data [required]

object

A maintenance window that defines a scheduled time period during which case-related notifications and automation rules are suppressed. Each maintenance window applies to cases matching a specified query.

attributes [required]

object

Attributes of a maintenance window, including its schedule and the query that determines which cases are affected.

created_by

string

The UUID of the user who created this maintenance window. Read-only.

end_at [required]

date-time

The ISO 8601 timestamp when the maintenance window ends and normal notification behavior resumes.

name [required]

string

A human-readable name for the maintenance window (for example, Database migration - Dec 15).

query [required]

string

A case search query that determines which cases are affected during the maintenance window. Uses the same syntax as the Case Management search bar.

start_at [required]

date-time

The ISO 8601 timestamp when the maintenance window begins and notifications start being suppressed.

updated_by

string

The UUID of the user who last modified this maintenance window. Read-only.

id [required]

string

The maintenance window's identifier.

type [required]

enum

JSON:API resource type for maintenance windows. Allowed enum values: maintenance_window

default: maintenance_window

{
  "data": {
    "attributes": {
      "created_by": "string",
      "end_at": "2026-06-01T06:00:00Z",
      "name": "Weekly maintenance",
      "query": "project:SEC",
      "start_at": "2026-06-01T00:00:00Z",
      "updated_by": "string"
    },
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "type": "maintenance_window"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  ## default
# 

# Path parameters
export maintenance_window_id="a1b2c3d4-e5f6-7890-abcd-ef1234567890"
# Curl command
curl -X PUT "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/maintenance_windows/${maintenance_window_id}" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "end_at": "2026-06-01T06:00:00Z", "name": "Weekly maintenance", "query": "project:SEC", "start_at": "2026-06-01T00:00:00Z" }, "type": "maintenance_window" } } EOF

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

DELETE https://api.ap1.datadoghq.com/api/v2/maintenance_windows/{maintenance_window_id}https://api.ap2.datadoghq.com/api/v2/maintenance_windows/{maintenance_window_id}https://api.datadoghq.eu/api/v2/maintenance_windows/{maintenance_window_id}https://api.ddog-gov.com/api/v2/maintenance_windows/{maintenance_window_id}https://api.us2.ddog-gov.com/api/v2/maintenance_windows/{maintenance_window_id}https://api.datadoghq.com/api/v2/maintenance_windows/{maintenance_window_id}https://api.us3.datadoghq.com/api/v2/maintenance_windows/{maintenance_window_id}https://api.us5.datadoghq.com/api/v2/maintenance_windows/{maintenance_window_id}

Información general

Permanently deletes a maintenance window.

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

maintenance_window_id [required]

string

The UUID of the maintenance window.

Respuesta

No Content

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  # Path parameters
export maintenance_window_id="a1b2c3d4-e5f6-7890-abcd-ef1234567890"
# Curl command
curl -X DELETE "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/maintenance_windows/${maintenance_window_id}" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

GET https://api.ap1.datadoghq.com/api/v2/cases/projects/{project_id}/notification_ruleshttps://api.ap2.datadoghq.com/api/v2/cases/projects/{project_id}/notification_ruleshttps://api.datadoghq.eu/api/v2/cases/projects/{project_id}/notification_ruleshttps://api.ddog-gov.com/api/v2/cases/projects/{project_id}/notification_ruleshttps://api.us2.ddog-gov.com/api/v2/cases/projects/{project_id}/notification_ruleshttps://api.datadoghq.com/api/v2/cases/projects/{project_id}/notification_ruleshttps://api.us3.datadoghq.com/api/v2/cases/projects/{project_id}/notification_ruleshttps://api.us5.datadoghq.com/api/v2/cases/projects/{project_id}/notification_rules

Información general

Get all notification rules for a project.

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

project_id [required]

string

Project UUID

Respuesta

OK

Response with notification rules

Expand All

Campo

Tipo

Descripción

data

[object]

Notification rules data

attributes [required]

object

Notification rule attributes

is_enabled

boolean

Whether the notification rule is enabled

query

string

Query to filter cases for this notification rule

recipients

[object]

List of notification recipients

data

object

Recipient data

channel

string

Slack channel name

channel_id

string

Slack channel ID

channel_name

string

Microsoft Teams channel name

connector_name

string

Microsoft Teams connector name

email

string

Email address

name

string

HTTP webhook name

service_name

string

PagerDuty service name

team_id

string

Microsoft Teams team ID

team_name

string

Microsoft Teams team name

tenant_id

string

Microsoft Teams tenant ID

tenant_name

string

Microsoft Teams tenant name

workspace

string

Slack workspace name

workspace_id

string

Slack workspace ID

type

string

Type of recipient (SLACK_CHANNEL, EMAIL, HTTP, PAGERDUTY_SERVICE, MS_TEAMS_CHANNEL)

triggers

[object]

List of triggers for this notification rule

data

object

Trigger data

change_type

string

Change type (added, removed, changed)

field

string

Field name for attribute value changed trigger

from_status

string

Status ID to transition from

from_status_name

string

Status name to transition from

to_status

string

Status ID to transition to

to_status_name

string

Status name to transition to

type

string

Type of trigger (CASE_CREATED, STATUS_TRANSITIONED, ATTRIBUTE_VALUE_CHANGED, EVENT_CORRELATION_SIGNAL_CORRELATED)

id [required]

string

The notification rule's identifier

type [required]

enum

Notification rule resource type Allowed enum values: notification_rule

default: notification_rule

{
  "data": [
    {
      "attributes": {
        "is_enabled": false,
        "query": "string",
        "recipients": [
          {
            "data": {
              "channel": "string",
              "channel_id": "string",
              "channel_name": "string",
              "connector_name": "string",
              "email": "string",
              "name": "string",
              "service_name": "string",
              "team_id": "string",
              "team_name": "string",
              "tenant_id": "string",
              "tenant_name": "string",
              "workspace": "string",
              "workspace_id": "string"
            },
            "type": "EMAIL"
          }
        ],
        "triggers": [
          {
            "data": {
              "change_type": "string",
              "field": "string",
              "from_status": "string",
              "from_status_name": "string",
              "to_status": "string",
              "to_status_name": "string"
            },
            "type": "CASE_CREATED"
          }
        ]
      },
      "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
      "type": "notification_rule"
    }
  ]
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  # Path parameters
export project_id="e555e290-ed65-49bd-ae18-8acbfcf18db7"
# 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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/projects/${project_id}/notification_rules" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
Get notification rules returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = CaseManagementApi(api_client)
    response = api_instance.get_project_notification_rules(
        project_id="project_id",
    )

    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Get notification rules returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new
p api_instance.get_project_notification_rules("project_id")

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Get notification rules 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"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCaseManagementApi(apiClient)
	resp, r, err := api.GetProjectNotificationRules(ctx, "project_id")

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.GetProjectNotificationRules`:\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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Get notification rules returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.CaseNotificationRulesResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

    try {
      CaseNotificationRulesResponse result =
          apiInstance.getProjectNotificationRules("e555e290-ed65-49bd-ae18-8acbfcf18db7");
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseManagementApi#getProjectNotificationRules");
      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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// Get notification rules returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api
        .get_project_notification_rules("project_id".to_string())
        .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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Get notification rules returns "OK" response
 */

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

const configuration = client.createConfiguration();
const apiInstance = new v2.CaseManagementApi(configuration);

const params: v2.CaseManagementApiGetProjectNotificationRulesRequest = {
  projectId: "project_id",
};

apiInstance
  .getProjectNotificationRules(params)
  .then((data: v2.CaseNotificationRulesResponse) => {
    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"

POST https://api.ap1.datadoghq.com/api/v2/cases/projects/{project_id}/notification_ruleshttps://api.ap2.datadoghq.com/api/v2/cases/projects/{project_id}/notification_ruleshttps://api.datadoghq.eu/api/v2/cases/projects/{project_id}/notification_ruleshttps://api.ddog-gov.com/api/v2/cases/projects/{project_id}/notification_ruleshttps://api.us2.ddog-gov.com/api/v2/cases/projects/{project_id}/notification_ruleshttps://api.datadoghq.com/api/v2/cases/projects/{project_id}/notification_ruleshttps://api.us3.datadoghq.com/api/v2/cases/projects/{project_id}/notification_ruleshttps://api.us5.datadoghq.com/api/v2/cases/projects/{project_id}/notification_rules

Información general

Create a notification rule for a project.

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

project_id [required]

string

Project UUID

Solicitud

Body Data (required)

Notification rule payload

Expand All

Campo

Tipo

Descripción

data [required]

object

Notification rule create

attributes [required]

object

Notification rule creation attributes

is_enabled

boolean

Whether the notification rule is enabled

default: true

query

string

Query to filter cases for this notification rule

recipients [required]

[object]

List of notification recipients

data

object

Recipient data

channel

string

Slack channel name

channel_id

string

Slack channel ID

channel_name

string

Microsoft Teams channel name

connector_name

string

Microsoft Teams connector name

email

string

Email address

name

string

HTTP webhook name

service_name

string

PagerDuty service name

team_id

string

Microsoft Teams team ID

team_name

string

Microsoft Teams team name

tenant_id

string

Microsoft Teams tenant ID

tenant_name

string

Microsoft Teams tenant name

workspace

string

Slack workspace name

workspace_id

string

Slack workspace ID

type

string

Type of recipient (SLACK_CHANNEL, EMAIL, HTTP, PAGERDUTY_SERVICE, MS_TEAMS_CHANNEL)

triggers [required]

[object]

List of triggers for this notification rule

data

object

Trigger data

change_type

string

Change type (added, removed, changed)

field

string

Field name for attribute value changed trigger

from_status

string

Status ID to transition from

from_status_name

string

Status name to transition from

to_status

string

Status ID to transition to

to_status_name

string

Status name to transition to

type

string

Type of trigger (CASE_CREATED, STATUS_TRANSITIONED, ATTRIBUTE_VALUE_CHANGED, EVENT_CORRELATION_SIGNAL_CORRELATED)

type [required]

enum

Notification rule resource type Allowed enum values: notification_rule

default: notification_rule

{
  "data": {
    "attributes": {
      "is_enabled": false,
      "query": "string",
      "recipients": [
        {
          "data": {
            "channel": "string",
            "channel_id": "string",
            "channel_name": "string",
            "connector_name": "string",
            "email": "string",
            "name": "string",
            "service_name": "string",
            "team_id": "string",
            "team_name": "string",
            "tenant_id": "string",
            "tenant_name": "string",
            "workspace": "string",
            "workspace_id": "string"
          },
          "type": "EMAIL"
        }
      ],
      "triggers": [
        {
          "data": {
            "change_type": "string",
            "field": "string",
            "from_status": "string",
            "from_status_name": "string",
            "to_status": "string",
            "to_status_name": "string"
          },
          "type": "CASE_CREATED"
        }
      ]
    },
    "type": "notification_rule"
  }
}

Respuesta

CREATED

Notification rule response

Expand All

Campo

Tipo

Descripción

data

object

A notification rule for case management

attributes [required]

object

Notification rule attributes

is_enabled

boolean

Whether the notification rule is enabled

query

string

Query to filter cases for this notification rule

recipients

[object]

List of notification recipients

data

object

Recipient data

channel

string

Slack channel name

channel_id

string

Slack channel ID

channel_name

string

Microsoft Teams channel name

connector_name

string

Microsoft Teams connector name

email

string

Email address

name

string

HTTP webhook name

service_name

string

PagerDuty service name

team_id

string

Microsoft Teams team ID

team_name

string

Microsoft Teams team name

tenant_id

string

Microsoft Teams tenant ID

tenant_name

string

Microsoft Teams tenant name

workspace

string

Slack workspace name

workspace_id

string

Slack workspace ID

type

string

Type of recipient (SLACK_CHANNEL, EMAIL, HTTP, PAGERDUTY_SERVICE, MS_TEAMS_CHANNEL)

triggers

[object]

List of triggers for this notification rule

data

object

Trigger data

change_type

string

Change type (added, removed, changed)

field

string

Field name for attribute value changed trigger

from_status

string

Status ID to transition from

from_status_name

string

Status name to transition from

to_status

string

Status ID to transition to

to_status_name

string

Status name to transition to

type

string

Type of trigger (CASE_CREATED, STATUS_TRANSITIONED, ATTRIBUTE_VALUE_CHANGED, EVENT_CORRELATION_SIGNAL_CORRELATED)

id [required]

string

The notification rule's identifier

type [required]

enum

Notification rule resource type Allowed enum values: notification_rule

default: notification_rule

{
  "data": {
    "attributes": {
      "is_enabled": false,
      "query": "string",
      "recipients": [
        {
          "data": {
            "channel": "string",
            "channel_id": "string",
            "channel_name": "string",
            "connector_name": "string",
            "email": "string",
            "name": "string",
            "service_name": "string",
            "team_id": "string",
            "team_name": "string",
            "tenant_id": "string",
            "tenant_name": "string",
            "workspace": "string",
            "workspace_id": "string"
          },
          "type": "EMAIL"
        }
      ],
      "triggers": [
        {
          "data": {
            "change_type": "string",
            "field": "string",
            "from_status": "string",
            "from_status_name": "string",
            "to_status": "string",
            "to_status_name": "string"
          },
          "type": "CASE_CREATED"
        }
      ]
    },
    "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
    "type": "notification_rule"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  ## default
# 

# Path parameters
export project_id="e555e290-ed65-49bd-ae18-8acbfcf18db7"
# Curl command
curl -X POST "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/projects/${project_id}/notification_rules" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "recipients": [ { "type": "EMAIL" } ], "triggers": [ { "type": "CASE_CREATED" } ] }, "type": "notification_rule" } } EOF
"""
Create a notification rule returns "CREATED" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi
from datadog_api_client.v2.model.case_notification_rule_create import CaseNotificationRuleCreate
from datadog_api_client.v2.model.case_notification_rule_create_attributes import CaseNotificationRuleCreateAttributes
from datadog_api_client.v2.model.case_notification_rule_create_request import CaseNotificationRuleCreateRequest
from datadog_api_client.v2.model.case_notification_rule_recipient import CaseNotificationRuleRecipient
from datadog_api_client.v2.model.case_notification_rule_recipient_data import CaseNotificationRuleRecipientData
from datadog_api_client.v2.model.case_notification_rule_resource_type import CaseNotificationRuleResourceType
from datadog_api_client.v2.model.case_notification_rule_trigger import CaseNotificationRuleTrigger
from datadog_api_client.v2.model.case_notification_rule_trigger_data import CaseNotificationRuleTriggerData

body = CaseNotificationRuleCreateRequest(
    data=CaseNotificationRuleCreate(
        attributes=CaseNotificationRuleCreateAttributes(
            is_enabled=True,
            recipients=[
                CaseNotificationRuleRecipient(
                    data=CaseNotificationRuleRecipientData(),
                    type="EMAIL",
                ),
            ],
            triggers=[
                CaseNotificationRuleTrigger(
                    data=CaseNotificationRuleTriggerData(),
                    type="CASE_CREATED",
                ),
            ],
        ),
        type=CaseNotificationRuleResourceType.NOTIFICATION_RULE,
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = CaseManagementApi(api_client)
    response = api_instance.create_project_notification_rule(project_id="project_id", body=body)

    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Create a notification rule returns "CREATED" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

body = DatadogAPIClient::V2::CaseNotificationRuleCreateRequest.new({
  data: DatadogAPIClient::V2::CaseNotificationRuleCreate.new({
    attributes: DatadogAPIClient::V2::CaseNotificationRuleCreateAttributes.new({
      is_enabled: true,
      recipients: [
        DatadogAPIClient::V2::CaseNotificationRuleRecipient.new({
          data: DatadogAPIClient::V2::CaseNotificationRuleRecipientData.new({}),
          type: "EMAIL",
        }),
      ],
      triggers: [
        DatadogAPIClient::V2::CaseNotificationRuleTrigger.new({
          data: DatadogAPIClient::V2::CaseNotificationRuleTriggerData.new({}),
          type: "CASE_CREATED",
        }),
      ],
    }),
    type: DatadogAPIClient::V2::CaseNotificationRuleResourceType::NOTIFICATION_RULE,
  }),
})
p api_instance.create_project_notification_rule("project_id", body)

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Create a notification rule returns "CREATED" 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"
)

func main() {
	body := datadogV2.CaseNotificationRuleCreateRequest{
		Data: datadogV2.CaseNotificationRuleCreate{
			Attributes: datadogV2.CaseNotificationRuleCreateAttributes{
				IsEnabled: datadog.PtrBool(true),
				Recipients: []datadogV2.CaseNotificationRuleRecipient{
					{
						Data: &datadogV2.CaseNotificationRuleRecipientData{},
						Type: datadog.PtrString("EMAIL"),
					},
				},
				Triggers: []datadogV2.CaseNotificationRuleTrigger{
					{
						Data: &datadogV2.CaseNotificationRuleTriggerData{},
						Type: datadog.PtrString("CASE_CREATED"),
					},
				},
			},
			Type: datadogV2.CASENOTIFICATIONRULERESOURCETYPE_NOTIFICATION_RULE,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCaseManagementApi(apiClient)
	resp, r, err := api.CreateProjectNotificationRule(ctx, "project_id", body)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.CreateProjectNotificationRule`:\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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Create a notification rule returns "CREATED" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.CaseNotificationRuleCreate;
import com.datadog.api.client.v2.model.CaseNotificationRuleCreateAttributes;
import com.datadog.api.client.v2.model.CaseNotificationRuleCreateRequest;
import com.datadog.api.client.v2.model.CaseNotificationRuleRecipient;
import com.datadog.api.client.v2.model.CaseNotificationRuleRecipientData;
import com.datadog.api.client.v2.model.CaseNotificationRuleResourceType;
import com.datadog.api.client.v2.model.CaseNotificationRuleResponse;
import com.datadog.api.client.v2.model.CaseNotificationRuleTrigger;
import com.datadog.api.client.v2.model.CaseNotificationRuleTriggerData;
import java.util.Collections;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

    CaseNotificationRuleCreateRequest body =
        new CaseNotificationRuleCreateRequest()
            .data(
                new CaseNotificationRuleCreate()
                    .attributes(
                        new CaseNotificationRuleCreateAttributes()
                            .isEnabled(true)
                            .recipients(
                                Collections.singletonList(
                                    new CaseNotificationRuleRecipient()
                                        .data(new CaseNotificationRuleRecipientData())
                                        .type("EMAIL")))
                            .triggers(
                                Collections.singletonList(
                                    new CaseNotificationRuleTrigger()
                                        .data(new CaseNotificationRuleTriggerData())
                                        .type("CASE_CREATED"))))
                    .type(CaseNotificationRuleResourceType.NOTIFICATION_RULE));

    try {
      CaseNotificationRuleResponse result =
          apiInstance.createProjectNotificationRule("e555e290-ed65-49bd-ae18-8acbfcf18db7", body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseManagementApi#createProjectNotificationRule");
      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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// Create a notification rule returns "CREATED" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
use datadog_api_client::datadogV2::model::CaseNotificationRuleCreate;
use datadog_api_client::datadogV2::model::CaseNotificationRuleCreateAttributes;
use datadog_api_client::datadogV2::model::CaseNotificationRuleCreateRequest;
use datadog_api_client::datadogV2::model::CaseNotificationRuleRecipient;
use datadog_api_client::datadogV2::model::CaseNotificationRuleRecipientData;
use datadog_api_client::datadogV2::model::CaseNotificationRuleResourceType;
use datadog_api_client::datadogV2::model::CaseNotificationRuleTrigger;
use datadog_api_client::datadogV2::model::CaseNotificationRuleTriggerData;

#[tokio::main]
async fn main() {
    let body = CaseNotificationRuleCreateRequest::new(CaseNotificationRuleCreate::new(
        CaseNotificationRuleCreateAttributes::new(
            vec![CaseNotificationRuleRecipient::new()
                .data(CaseNotificationRuleRecipientData::new())
                .type_("EMAIL".to_string())],
            vec![CaseNotificationRuleTrigger::new()
                .data(CaseNotificationRuleTriggerData::new())
                .type_("CASE_CREATED".to_string())],
        )
        .is_enabled(true),
        CaseNotificationRuleResourceType::NOTIFICATION_RULE,
    ));
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api
        .create_project_notification_rule("project_id".to_string(), body)
        .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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Create a notification rule returns "CREATED" response
 */

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

const configuration = client.createConfiguration();
const apiInstance = new v2.CaseManagementApi(configuration);

const params: v2.CaseManagementApiCreateProjectNotificationRuleRequest = {
  body: {
    data: {
      attributes: {
        isEnabled: true,
        recipients: [
          {
            data: {},
            type: "EMAIL",
          },
        ],
        triggers: [
          {
            data: {},
            type: "CASE_CREATED",
          },
        ],
      },
      type: "notification_rule",
    },
  },
  projectId: "project_id",
};

apiInstance
  .createProjectNotificationRule(params)
  .then((data: v2.CaseNotificationRuleResponse) => {
    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"

PUT https://api.ap1.datadoghq.com/api/v2/cases/projects/{project_id}/notification_rules/{notification_rule_id}https://api.ap2.datadoghq.com/api/v2/cases/projects/{project_id}/notification_rules/{notification_rule_id}https://api.datadoghq.eu/api/v2/cases/projects/{project_id}/notification_rules/{notification_rule_id}https://api.ddog-gov.com/api/v2/cases/projects/{project_id}/notification_rules/{notification_rule_id}https://api.us2.ddog-gov.com/api/v2/cases/projects/{project_id}/notification_rules/{notification_rule_id}https://api.datadoghq.com/api/v2/cases/projects/{project_id}/notification_rules/{notification_rule_id}https://api.us3.datadoghq.com/api/v2/cases/projects/{project_id}/notification_rules/{notification_rule_id}https://api.us5.datadoghq.com/api/v2/cases/projects/{project_id}/notification_rules/{notification_rule_id}

Información general

Update a notification rule.

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

project_id [required]

string

Project UUID

notification_rule_id [required]

string

Notification Rule UUID

Solicitud

Body Data (required)

Notification rule payload

Expand All

Campo

Tipo

Descripción

data [required]

object

Notification rule update

attributes

object

Notification rule attributes

is_enabled

boolean

Whether the notification rule is enabled

query

string

Query to filter cases for this notification rule

recipients

[object]

List of notification recipients

data

object

Recipient data

channel

string

Slack channel name

channel_id

string

Slack channel ID

channel_name

string

Microsoft Teams channel name

connector_name

string

Microsoft Teams connector name

email

string

Email address

name

string

HTTP webhook name

service_name

string

PagerDuty service name

team_id

string

Microsoft Teams team ID

team_name

string

Microsoft Teams team name

tenant_id

string

Microsoft Teams tenant ID

tenant_name

string

Microsoft Teams tenant name

workspace

string

Slack workspace name

workspace_id

string

Slack workspace ID

type

string

Type of recipient (SLACK_CHANNEL, EMAIL, HTTP, PAGERDUTY_SERVICE, MS_TEAMS_CHANNEL)

triggers

[object]

List of triggers for this notification rule

data

object

Trigger data

change_type

string

Change type (added, removed, changed)

field

string

Field name for attribute value changed trigger

from_status

string

Status ID to transition from

from_status_name

string

Status name to transition from

to_status

string

Status ID to transition to

to_status_name

string

Status name to transition to

type

string

Type of trigger (CASE_CREATED, STATUS_TRANSITIONED, ATTRIBUTE_VALUE_CHANGED, EVENT_CORRELATION_SIGNAL_CORRELATED)

type [required]

enum

Notification rule resource type Allowed enum values: notification_rule

default: notification_rule

{
  "data": {
    "attributes": {
      "is_enabled": false,
      "query": "string",
      "recipients": [
        {
          "data": {
            "channel": "string",
            "channel_id": "string",
            "channel_name": "string",
            "connector_name": "string",
            "email": "string",
            "name": "string",
            "service_name": "string",
            "team_id": "string",
            "team_name": "string",
            "tenant_id": "string",
            "tenant_name": "string",
            "workspace": "string",
            "workspace_id": "string"
          },
          "type": "EMAIL"
        }
      ],
      "triggers": [
        {
          "data": {
            "change_type": "string",
            "field": "string",
            "from_status": "string",
            "from_status_name": "string",
            "to_status": "string",
            "to_status_name": "string"
          },
          "type": "CASE_CREATED"
        }
      ]
    },
    "type": "notification_rule"
  }
}

Respuesta

No Content

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  ## default
# 

# Path parameters
export project_id="e555e290-ed65-49bd-ae18-8acbfcf18db7"
export notification_rule_id="e555e290-ed65-49bd-ae18-8acbfcf18db7"
# Curl command
curl -X PUT "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/projects/${project_id}/notification_rules/${notification_rule_id}" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "recipients": [ { "type": "EMAIL" } ], "triggers": [ { "type": "CASE_CREATED" } ] }, "type": "notification_rule" } } EOF
"""
Update a notification rule returns "No Content" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi
from datadog_api_client.v2.model.case_notification_rule_attributes import CaseNotificationRuleAttributes
from datadog_api_client.v2.model.case_notification_rule_recipient import CaseNotificationRuleRecipient
from datadog_api_client.v2.model.case_notification_rule_recipient_data import CaseNotificationRuleRecipientData
from datadog_api_client.v2.model.case_notification_rule_resource_type import CaseNotificationRuleResourceType
from datadog_api_client.v2.model.case_notification_rule_trigger import CaseNotificationRuleTrigger
from datadog_api_client.v2.model.case_notification_rule_trigger_data import CaseNotificationRuleTriggerData
from datadog_api_client.v2.model.case_notification_rule_update import CaseNotificationRuleUpdate
from datadog_api_client.v2.model.case_notification_rule_update_request import CaseNotificationRuleUpdateRequest

body = CaseNotificationRuleUpdateRequest(
    data=CaseNotificationRuleUpdate(
        attributes=CaseNotificationRuleAttributes(
            recipients=[
                CaseNotificationRuleRecipient(
                    data=CaseNotificationRuleRecipientData(),
                    type="EMAIL",
                ),
            ],
            triggers=[
                CaseNotificationRuleTrigger(
                    data=CaseNotificationRuleTriggerData(),
                    type="CASE_CREATED",
                ),
            ],
        ),
        type=CaseNotificationRuleResourceType.NOTIFICATION_RULE,
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = CaseManagementApi(api_client)
    api_instance.update_project_notification_rule(
        project_id="project_id", notification_rule_id="notification_rule_id", body=body
    )

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Update a notification rule returns "No Content" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

body = DatadogAPIClient::V2::CaseNotificationRuleUpdateRequest.new({
  data: DatadogAPIClient::V2::CaseNotificationRuleUpdate.new({
    attributes: DatadogAPIClient::V2::CaseNotificationRuleAttributes.new({
      recipients: [
        DatadogAPIClient::V2::CaseNotificationRuleRecipient.new({
          data: DatadogAPIClient::V2::CaseNotificationRuleRecipientData.new({}),
          type: "EMAIL",
        }),
      ],
      triggers: [
        DatadogAPIClient::V2::CaseNotificationRuleTrigger.new({
          data: DatadogAPIClient::V2::CaseNotificationRuleTriggerData.new({}),
          type: "CASE_CREATED",
        }),
      ],
    }),
    type: DatadogAPIClient::V2::CaseNotificationRuleResourceType::NOTIFICATION_RULE,
  }),
})
api_instance.update_project_notification_rule("project_id", "notification_rule_id", body)

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Update a notification rule returns "No Content" response

package main

import (
	"context"
	"fmt"
	"os"

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

func main() {
	body := datadogV2.CaseNotificationRuleUpdateRequest{
		Data: datadogV2.CaseNotificationRuleUpdate{
			Attributes: &datadogV2.CaseNotificationRuleAttributes{
				Recipients: []datadogV2.CaseNotificationRuleRecipient{
					{
						Data: &datadogV2.CaseNotificationRuleRecipientData{},
						Type: datadog.PtrString("EMAIL"),
					},
				},
				Triggers: []datadogV2.CaseNotificationRuleTrigger{
					{
						Data: &datadogV2.CaseNotificationRuleTriggerData{},
						Type: datadog.PtrString("CASE_CREATED"),
					},
				},
			},
			Type: datadogV2.CASENOTIFICATIONRULERESOURCETYPE_NOTIFICATION_RULE,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCaseManagementApi(apiClient)
	r, err := api.UpdateProjectNotificationRule(ctx, "project_id", "notification_rule_id", body)

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

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Update a notification rule returns "No Content" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.CaseNotificationRuleAttributes;
import com.datadog.api.client.v2.model.CaseNotificationRuleRecipient;
import com.datadog.api.client.v2.model.CaseNotificationRuleRecipientData;
import com.datadog.api.client.v2.model.CaseNotificationRuleResourceType;
import com.datadog.api.client.v2.model.CaseNotificationRuleTrigger;
import com.datadog.api.client.v2.model.CaseNotificationRuleTriggerData;
import com.datadog.api.client.v2.model.CaseNotificationRuleUpdate;
import com.datadog.api.client.v2.model.CaseNotificationRuleUpdateRequest;
import java.util.Collections;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

    CaseNotificationRuleUpdateRequest body =
        new CaseNotificationRuleUpdateRequest()
            .data(
                new CaseNotificationRuleUpdate()
                    .attributes(
                        new CaseNotificationRuleAttributes()
                            .recipients(
                                Collections.singletonList(
                                    new CaseNotificationRuleRecipient()
                                        .data(new CaseNotificationRuleRecipientData())
                                        .type("EMAIL")))
                            .triggers(
                                Collections.singletonList(
                                    new CaseNotificationRuleTrigger()
                                        .data(new CaseNotificationRuleTriggerData())
                                        .type("CASE_CREATED"))))
                    .type(CaseNotificationRuleResourceType.NOTIFICATION_RULE));

    try {
      apiInstance.updateProjectNotificationRule(
          "e555e290-ed65-49bd-ae18-8acbfcf18db7", "e555e290-ed65-49bd-ae18-8acbfcf18db7", body);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseManagementApi#updateProjectNotificationRule");
      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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// Update a notification rule returns "No Content" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
use datadog_api_client::datadogV2::model::CaseNotificationRuleAttributes;
use datadog_api_client::datadogV2::model::CaseNotificationRuleRecipient;
use datadog_api_client::datadogV2::model::CaseNotificationRuleRecipientData;
use datadog_api_client::datadogV2::model::CaseNotificationRuleResourceType;
use datadog_api_client::datadogV2::model::CaseNotificationRuleTrigger;
use datadog_api_client::datadogV2::model::CaseNotificationRuleTriggerData;
use datadog_api_client::datadogV2::model::CaseNotificationRuleUpdate;
use datadog_api_client::datadogV2::model::CaseNotificationRuleUpdateRequest;

#[tokio::main]
async fn main() {
    let body = CaseNotificationRuleUpdateRequest::new(
        CaseNotificationRuleUpdate::new(CaseNotificationRuleResourceType::NOTIFICATION_RULE)
            .attributes(
                CaseNotificationRuleAttributes::new()
                    .recipients(vec![CaseNotificationRuleRecipient::new()
                        .data(CaseNotificationRuleRecipientData::new())
                        .type_("EMAIL".to_string())])
                    .triggers(vec![CaseNotificationRuleTrigger::new()
                        .data(CaseNotificationRuleTriggerData::new())
                        .type_("CASE_CREATED".to_string())]),
            ),
    );
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api
        .update_project_notification_rule(
            "project_id".to_string(),
            "notification_rule_id".to_string(),
            body,
        )
        .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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Update a notification rule returns "No Content" response
 */

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

const configuration = client.createConfiguration();
const apiInstance = new v2.CaseManagementApi(configuration);

const params: v2.CaseManagementApiUpdateProjectNotificationRuleRequest = {
  body: {
    data: {
      attributes: {
        recipients: [
          {
            data: {},
            type: "EMAIL",
          },
        ],
        triggers: [
          {
            data: {},
            type: "CASE_CREATED",
          },
        ],
      },
      type: "notification_rule",
    },
  },
  projectId: "project_id",
  notificationRuleId: "notification_rule_id",
};

apiInstance
  .updateProjectNotificationRule(params)
  .then((data: any) => {
    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"

DELETE https://api.ap1.datadoghq.com/api/v2/cases/projects/{project_id}/notification_rules/{notification_rule_id}https://api.ap2.datadoghq.com/api/v2/cases/projects/{project_id}/notification_rules/{notification_rule_id}https://api.datadoghq.eu/api/v2/cases/projects/{project_id}/notification_rules/{notification_rule_id}https://api.ddog-gov.com/api/v2/cases/projects/{project_id}/notification_rules/{notification_rule_id}https://api.us2.ddog-gov.com/api/v2/cases/projects/{project_id}/notification_rules/{notification_rule_id}https://api.datadoghq.com/api/v2/cases/projects/{project_id}/notification_rules/{notification_rule_id}https://api.us3.datadoghq.com/api/v2/cases/projects/{project_id}/notification_rules/{notification_rule_id}https://api.us5.datadoghq.com/api/v2/cases/projects/{project_id}/notification_rules/{notification_rule_id}

Información general

Delete a notification rule using the notification rule’s id.

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

project_id [required]

string

Project UUID

notification_rule_id [required]

string

Notification Rule UUID

Respuesta

No Content

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

API error response

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  # Path parameters
export project_id="e555e290-ed65-49bd-ae18-8acbfcf18db7"
export notification_rule_id="e555e290-ed65-49bd-ae18-8acbfcf18db7"
# Curl command
curl -X DELETE "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/projects/${project_id}/notification_rules/${notification_rule_id}" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
Delete a notification rule returns "No Content" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = CaseManagementApi(api_client)
    api_instance.delete_project_notification_rule(
        project_id="project_id",
        notification_rule_id="notification_rule_id",
    )

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Delete a notification rule returns "No Content" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new
api_instance.delete_project_notification_rule("project_id", "notification_rule_id")

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Delete a notification rule returns "No Content" response

package main

import (
	"context"
	"fmt"
	"os"

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

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCaseManagementApi(apiClient)
	r, err := api.DeleteProjectNotificationRule(ctx, "project_id", "notification_rule_id")

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

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Delete a notification rule returns "No Content" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

    try {
      apiInstance.deleteProjectNotificationRule(
          "e555e290-ed65-49bd-ae18-8acbfcf18db7", "e555e290-ed65-49bd-ae18-8acbfcf18db7");
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseManagementApi#deleteProjectNotificationRule");
      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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// Delete a notification rule returns "No Content" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api
        .delete_project_notification_rule(
            "project_id".to_string(),
            "notification_rule_id".to_string(),
        )
        .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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Delete a notification rule returns "No Content" response
 */

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

const configuration = client.createConfiguration();
const apiInstance = new v2.CaseManagementApi(configuration);

const params: v2.CaseManagementApiDeleteProjectNotificationRuleRequest = {
  projectId: "project_id",
  notificationRuleId: "notification_rule_id",
};

apiInstance
  .deleteProjectNotificationRule(params)
  .then((data: any) => {
    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"

POST https://api.ap1.datadoghq.com/api/v2/cases/projectshttps://api.ap2.datadoghq.com/api/v2/cases/projectshttps://api.datadoghq.eu/api/v2/cases/projectshttps://api.ddog-gov.com/api/v2/cases/projectshttps://api.us2.ddog-gov.com/api/v2/cases/projectshttps://api.datadoghq.com/api/v2/cases/projectshttps://api.us3.datadoghq.com/api/v2/cases/projectshttps://api.us5.datadoghq.com/api/v2/cases/projects

Información general

Create a project.

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

Solicitud

Body Data (required)

Project payload.

Expand All

Campo

Tipo

Descripción

data [required]

object

Project create.

attributes [required]

object

Project creation attributes.

enabled_custom_case_types

[string]

List of enabled custom case type IDs.

key [required]

string

Project's key. Cannot be "CASE".

name [required]

string

Project name.

team_uuid

string

Team UUID to associate with the project.

type [required]

enum

Project resource type. Allowed enum values: project

default: project

{
  "data": {
    "attributes": {
      "enabled_custom_case_types": [],
      "key": "SEC",
      "name": "Security Investigation",
      "team_uuid": "string"
    },
    "type": "project"
  }
}

Respuesta

CREATED

Project response.

Expand All

Campo

Tipo

Descripción

data

object

A Project.

attributes [required]

object

Project attributes.

columns_config

object

Project columns configuration.

columns

[object]

List of column configurations for the project board view.

sort

object

Sort configuration for a project board column.

ascending

boolean

Whether to sort in ascending order.

priority

int64

The sort priority order for this column.

sort_field

string

The field used to sort items in this column.

type

string

The type of column.

enabled_custom_case_types

[string]

List of enabled custom case type IDs.

key

string

The project's key.

name

string

Project's name.

restricted

boolean

Whether the project is restricted.

settings

object

Project settings.

auto_close_inactive_cases

object

Auto-close inactive cases settings.

enabled

boolean

Whether auto-close is enabled.

max_inactive_time_in_secs

int64

Maximum inactive time in seconds before auto-closing.

auto_transition_assigned_cases

object

Auto-transition assigned cases settings.

auto_transition_assigned_cases_on_self_assigned

boolean

Whether to auto-transition cases when self-assigned.

integration_incident

object

Incident integration settings.

auto_escalation_query

string

Query for auto-escalation.

default_incident_commander

string

Default incident commander.

enabled

boolean

Whether incident integration is enabled.

field_mappings

[object]

List of mappings between incident fields and case fields.

case_field

string

The case field to map the incident field value to.

incident_user_defined_field_id

string

The identifier of the incident user-defined field to map from.

incident_type

string

Incident type.

severity_config

object

Severity configuration for mapping incident priorities to case priorities.

priority_mapping

object

Mapping of incident severity values to case priority values.

<any-key>

string

integration_jira

object

Jira integration settings.

auto_creation

object

Auto-creation settings for Jira issues from cases.

enabled

boolean

Whether automatic Jira issue creation is enabled.

enabled

boolean

Whether Jira integration is enabled.

metadata

object

Metadata for connecting a case management project to a Jira project.

account_id

string

The Jira account identifier.

issue_type_id

string

The Jira issue type identifier to use when creating issues.

project_id

string

The Jira project identifier to associate with this case project.

sync

object

Synchronization configuration for Jira integration.

enabled

boolean

Whether Jira field synchronization is enabled.

properties

object

Field synchronization properties for Jira integration.

assignee

object

Sync property configuration.

sync_type

string

The direction and type of synchronization for this property.

comments

object

Sync property configuration.

sync_type

string

The direction and type of synchronization for this property.

custom_fields

object

Map of custom field identifiers to their sync configurations.

<any-key>

object

Synchronization configuration for a Jira custom field.

sync_type

string

The type of synchronization to apply for this custom field.

value

object <oneOf>

Represents any valid JSON value.

Option 1

string

A scalar string value.

Option 2

double

A scalar numeric value.

Option 3

object

An arbitrary object value with additional properties.

Option 4

[ <oneOf>]

An array of arbitrary values.

Option 1

string

A scalar string value.

Option 2

double

A scalar numeric value.

Option 3

object

An arbitrary object value with additional properties.

Option 4

boolean

A scalar boolean value.

Option 5

boolean

A scalar boolean value.

description

object

Sync property configuration.

sync_type

string

The direction and type of synchronization for this property.

due_date

object

Due date synchronization configuration for Jira integration.

jira_field_id

string

The Jira field identifier used to store the due date.

sync_type

string

The type of synchronization to apply for the due date field.

priority

object

Sync property with mapping configuration.

mapping

object

Map of source values to destination values for synchronization.

<any-key>

string

name_mapping

object

Map of source names to display names used during synchronization.

<any-key>

string

sync_type

string

The direction and type of synchronization for this property.

status

object

Sync property with mapping configuration.

mapping

object

Map of source values to destination values for synchronization.

<any-key>

string

name_mapping

object

Map of source names to display names used during synchronization.

<any-key>

string

sync_type

string

The direction and type of synchronization for this property.

title

object

Sync property configuration.

sync_type

string

The direction and type of synchronization for this property.

integration_monitor

object

Monitor integration settings.

auto_resolve_enabled

boolean

Whether auto-resolve is enabled.

case_type_id

string

Case type ID for monitor integration.

enabled

boolean

Whether monitor integration is enabled.

handle

string

Monitor handle.

integration_on_call

object

On-Call integration settings.

auto_assign_on_call

boolean

Whether to auto-assign on-call.

enabled

boolean

Whether On-Call integration is enabled.

escalation_queries

[object]

List of escalation queries for routing cases to on-call responders.

enabled

boolean

Whether this escalation query is enabled.

id

string

Unique identifier of the escalation query.

query

string

The query used to match cases for escalation.

target

object

The target recipient for an On-Call escalation query.

dynamic_team_paging

boolean

Whether to use dynamic team paging for escalation.

team_id

string

The identifier of the team to escalate to.

user_id

string

The identifier of the user to escalate to.

integration_service_now

object

ServiceNow integration settings.

assignment_group

string

Assignment group.

auto_creation

object

Auto-creation settings for ServiceNow incidents from cases.

enabled

boolean

Whether automatic ServiceNow incident creation is enabled.

enabled

boolean

Whether ServiceNow integration is enabled.

instance_name

string

ServiceNow instance name.

sync_config

object

Synchronization configuration for ServiceNow integration.

enabled

boolean

Whether ServiceNow synchronization is enabled.

properties

object

Field-level synchronization properties for ServiceNow integration.

comments

object

Sync property configuration.

sync_type

string

The direction and type of synchronization for this property.

priority

object

Priority synchronization configuration for ServiceNow integration.

impact_mapping

object

Mapping of case priority values to ServiceNow impact values.

<any-key>

string

sync_type

string

The type of synchronization to apply for priority.

urgency_mapping

object

Mapping of case priority values to ServiceNow urgency values.

<any-key>

string

status

object

Sync property with mapping configuration.

mapping

object

Map of source values to destination values for synchronization.

<any-key>

string

name_mapping

object

Map of source names to display names used during synchronization.

<any-key>

string

sync_type

string

The direction and type of synchronization for this property.

notification

object

Project notification settings.

destinations

[integer]

Notification destinations (1=email, 2=slack, 3=in-app).

enabled

boolean

Whether notifications are enabled.

notify_on_case_assignment

boolean

Whether to send a notification when a case is assigned.

notify_on_case_closed

boolean

Whether to send a notification when a case is closed.

notify_on_case_comment

boolean

Whether to send a notification when a comment is added to a case.

notify_on_case_comment_mention

boolean

Whether to send a notification when a user is mentioned in a case comment.

notify_on_case_priority_change

boolean

Whether to send a notification when a case's priority changes.

notify_on_case_status_change

boolean

Whether to send a notification when a case's status changes.

notify_on_case_unassignment

boolean

Whether to send a notification when a case is unassigned.

id [required]

string

The Project's identifier.

relationships

object

Project relationships.

member_team

object

Relationship between a team and a team link

data

[object]

Related team links

id [required]

string

The team link's identifier

type [required]

enum

Team link type Allowed enum values: team_links

default: team_links

links

object

Links attributes.

related

string

Related link.

member_user

object

Relationship to users.

data [required]

[object]

Relationships to user objects.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

type [required]

enum

Project resource type. Allowed enum values: project

default: project

{
  "data": {
    "attributes": {
      "columns_config": {
        "columns": [
          {
            "sort": {
              "ascending": false,
              "priority": "integer"
            },
            "sort_field": "string",
            "type": "string"
          }
        ]
      },
      "enabled_custom_case_types": [],
      "key": "CASEM",
      "name": "Security Investigation",
      "restricted": false,
      "settings": {
        "auto_close_inactive_cases": {
          "enabled": false,
          "max_inactive_time_in_secs": "integer"
        },
        "auto_transition_assigned_cases": {
          "auto_transition_assigned_cases_on_self_assigned": false
        },
        "integration_incident": {
          "auto_escalation_query": "string",
          "default_incident_commander": "string",
          "enabled": false,
          "field_mappings": [
            {
              "case_field": "string",
              "incident_user_defined_field_id": "string"
            }
          ],
          "incident_type": "string",
          "severity_config": {
            "priority_mapping": {
              "<any-key>": "string"
            }
          }
        },
        "integration_jira": {
          "auto_creation": {
            "enabled": false
          },
          "enabled": false,
          "metadata": {
            "account_id": "string",
            "issue_type_id": "string",
            "project_id": "string"
          },
          "sync": {
            "enabled": false,
            "properties": {
              "assignee": {
                "sync_type": "string"
              },
              "comments": {
                "sync_type": "string"
              },
              "custom_fields": {
                "<any-key>": {
                  "sync_type": "string",
                  "value": {
                    "description": "undefined",
                    "type": "undefined"
                  }
                }
              },
              "description": {
                "sync_type": "string"
              },
              "due_date": {
                "jira_field_id": "string",
                "sync_type": "string"
              },
              "priority": {
                "mapping": {
                  "<any-key>": "string"
                },
                "name_mapping": {
                  "<any-key>": "string"
                },
                "sync_type": "string"
              },
              "status": {
                "mapping": {
                  "<any-key>": "string"
                },
                "name_mapping": {
                  "<any-key>": "string"
                },
                "sync_type": "string"
              },
              "title": {
                "sync_type": "string"
              }
            }
          }
        },
        "integration_monitor": {
          "auto_resolve_enabled": false,
          "case_type_id": "string",
          "enabled": false,
          "handle": "string"
        },
        "integration_on_call": {
          "auto_assign_on_call": false,
          "enabled": false,
          "escalation_queries": [
            {
              "enabled": false,
              "id": "string",
              "query": "string",
              "target": {
                "dynamic_team_paging": false,
                "team_id": "string",
                "user_id": "string"
              }
            }
          ]
        },
        "integration_service_now": {
          "assignment_group": "string",
          "auto_creation": {
            "enabled": false
          },
          "enabled": false,
          "instance_name": "string",
          "sync_config": {
            "enabled": false,
            "properties": {
              "comments": {
                "sync_type": "string"
              },
              "priority": {
                "impact_mapping": {
                  "<any-key>": "string"
                },
                "sync_type": "string",
                "urgency_mapping": {
                  "<any-key>": "string"
                }
              },
              "status": {
                "mapping": {
                  "<any-key>": "string"
                },
                "name_mapping": {
                  "<any-key>": "string"
                },
                "sync_type": "string"
              }
            }
          }
        },
        "notification": {
          "destinations": [],
          "enabled": false,
          "notify_on_case_assignment": false,
          "notify_on_case_closed": false,
          "notify_on_case_comment": false,
          "notify_on_case_comment_mention": false,
          "notify_on_case_priority_change": false,
          "notify_on_case_status_change": false,
          "notify_on_case_unassignment": false
        }
      }
    },
    "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
    "relationships": {
      "member_team": {
        "data": [
          {
            "id": "f9bb8444-af7f-11ec-ac2c-da7ad0900001",
            "type": "team_links"
          }
        ],
        "links": {
          "related": "/api/v2/team/c75a4a8e-20c7-11ee-a3a5-da7ad0900002/links"
        }
      },
      "member_user": {
        "data": [
          {
            "id": "00000000-0000-0000-0000-000000000000",
            "type": "user"
          }
        ]
      }
    },
    "type": "project"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  ## default
# 

# Curl command
curl -X POST "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/projects" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "key": "SEC", "name": "Security Investigation" }, "type": "project" } } EOF
"""
Create a project returns "CREATED" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi
from datadog_api_client.v2.model.project_create import ProjectCreate
from datadog_api_client.v2.model.project_create_attributes import ProjectCreateAttributes
from datadog_api_client.v2.model.project_create_request import ProjectCreateRequest
from datadog_api_client.v2.model.project_resource_type import ProjectResourceType

body = ProjectCreateRequest(
    data=ProjectCreate(
        attributes=ProjectCreateAttributes(
            enabled_custom_case_types=[],
            key="SEC",
            name="Security Investigation",
        ),
        type=ProjectResourceType.PROJECT,
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = CaseManagementApi(api_client)
    response = api_instance.create_project(body=body)

    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Create a project returns "CREATED" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

body = DatadogAPIClient::V2::ProjectCreateRequest.new({
  data: DatadogAPIClient::V2::ProjectCreate.new({
    attributes: DatadogAPIClient::V2::ProjectCreateAttributes.new({
      enabled_custom_case_types: [],
      key: "SEC",
      name: "Security Investigation",
    }),
    type: DatadogAPIClient::V2::ProjectResourceType::PROJECT,
  }),
})
p api_instance.create_project(body)

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Create a project returns "CREATED" 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"
)

func main() {
	body := datadogV2.ProjectCreateRequest{
		Data: datadogV2.ProjectCreate{
			Attributes: datadogV2.ProjectCreateAttributes{
				EnabledCustomCaseTypes: []string{},
				Key:                    "SEC",
				Name:                   "Security Investigation",
			},
			Type: datadogV2.PROJECTRESOURCETYPE_PROJECT,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCaseManagementApi(apiClient)
	resp, r, err := api.CreateProject(ctx, body)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.CreateProject`:\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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Create a project returns "CREATED" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.ProjectCreate;
import com.datadog.api.client.v2.model.ProjectCreateAttributes;
import com.datadog.api.client.v2.model.ProjectCreateRequest;
import com.datadog.api.client.v2.model.ProjectResourceType;
import com.datadog.api.client.v2.model.ProjectResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

    ProjectCreateRequest body =
        new ProjectCreateRequest()
            .data(
                new ProjectCreate()
                    .attributes(
                        new ProjectCreateAttributes().key("SEC").name("Security Investigation"))
                    .type(ProjectResourceType.PROJECT));

    try {
      ProjectResponse result = apiInstance.createProject(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseManagementApi#createProject");
      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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// Create a project returns "CREATED" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
use datadog_api_client::datadogV2::model::ProjectCreate;
use datadog_api_client::datadogV2::model::ProjectCreateAttributes;
use datadog_api_client::datadogV2::model::ProjectCreateRequest;
use datadog_api_client::datadogV2::model::ProjectResourceType;

#[tokio::main]
async fn main() {
    let body = ProjectCreateRequest::new(ProjectCreate::new(
        ProjectCreateAttributes::new("SEC".to_string(), "Security Investigation".to_string())
            .enabled_custom_case_types(vec![]),
        ProjectResourceType::PROJECT,
    ));
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.create_project(body).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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Create a project returns "CREATED" response
 */

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

const configuration = client.createConfiguration();
const apiInstance = new v2.CaseManagementApi(configuration);

const params: v2.CaseManagementApiCreateProjectRequest = {
  body: {
    data: {
      attributes: {
        enabledCustomCaseTypes: [],
        key: "SEC",
        name: "Security Investigation",
      },
      type: "project",
    },
  },
};

apiInstance
  .createProject(params)
  .then((data: v2.ProjectResponse) => {
    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"

GET https://api.ap1.datadoghq.com/api/v2/cases/projectshttps://api.ap2.datadoghq.com/api/v2/cases/projectshttps://api.datadoghq.eu/api/v2/cases/projectshttps://api.ddog-gov.com/api/v2/cases/projectshttps://api.us2.ddog-gov.com/api/v2/cases/projectshttps://api.datadoghq.com/api/v2/cases/projectshttps://api.us3.datadoghq.com/api/v2/cases/projectshttps://api.us5.datadoghq.com/api/v2/cases/projects

Información general

Get all projects.

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

Respuesta

OK

Response with projects.

Expand All

Campo

Tipo

Descripción

data

[object]

Projects response data.

attributes [required]

object

Project attributes.

columns_config

object

Project columns configuration.

columns

[object]

List of column configurations for the project board view.

sort

object

Sort configuration for a project board column.

ascending

boolean

Whether to sort in ascending order.

priority

int64

The sort priority order for this column.

sort_field

string

The field used to sort items in this column.

type

string

The type of column.

enabled_custom_case_types

[string]

List of enabled custom case type IDs.

key

string

The project's key.

name

string

Project's name.

restricted

boolean

Whether the project is restricted.

settings

object

Project settings.

auto_close_inactive_cases

object

Auto-close inactive cases settings.

enabled

boolean

Whether auto-close is enabled.

max_inactive_time_in_secs

int64

Maximum inactive time in seconds before auto-closing.

auto_transition_assigned_cases

object

Auto-transition assigned cases settings.

auto_transition_assigned_cases_on_self_assigned

boolean

Whether to auto-transition cases when self-assigned.

integration_incident

object

Incident integration settings.

auto_escalation_query

string

Query for auto-escalation.

default_incident_commander

string

Default incident commander.

enabled

boolean

Whether incident integration is enabled.

field_mappings

[object]

List of mappings between incident fields and case fields.

case_field

string

The case field to map the incident field value to.

incident_user_defined_field_id

string

The identifier of the incident user-defined field to map from.

incident_type

string

Incident type.

severity_config

object

Severity configuration for mapping incident priorities to case priorities.

priority_mapping

object

Mapping of incident severity values to case priority values.

<any-key>

string

integration_jira

object

Jira integration settings.

auto_creation

object

Auto-creation settings for Jira issues from cases.

enabled

boolean

Whether automatic Jira issue creation is enabled.

enabled

boolean

Whether Jira integration is enabled.

metadata

object

Metadata for connecting a case management project to a Jira project.

account_id

string

The Jira account identifier.

issue_type_id

string

The Jira issue type identifier to use when creating issues.

project_id

string

The Jira project identifier to associate with this case project.

sync

object

Synchronization configuration for Jira integration.

enabled

boolean

Whether Jira field synchronization is enabled.

properties

object

Field synchronization properties for Jira integration.

assignee

object

Sync property configuration.

sync_type

string

The direction and type of synchronization for this property.

comments

object

Sync property configuration.

sync_type

string

The direction and type of synchronization for this property.

custom_fields

object

Map of custom field identifiers to their sync configurations.

<any-key>

object

Synchronization configuration for a Jira custom field.

sync_type

string

The type of synchronization to apply for this custom field.

value

object <oneOf>

Represents any valid JSON value.

Option 1

string

A scalar string value.

Option 2

double

A scalar numeric value.

Option 3

object

An arbitrary object value with additional properties.

Option 4

[ <oneOf>]

An array of arbitrary values.

Option 1

string

A scalar string value.

Option 2

double

A scalar numeric value.

Option 3

object

An arbitrary object value with additional properties.

Option 4

boolean

A scalar boolean value.

Option 5

boolean

A scalar boolean value.

description

object

Sync property configuration.

sync_type

string

The direction and type of synchronization for this property.

due_date

object

Due date synchronization configuration for Jira integration.

jira_field_id

string

The Jira field identifier used to store the due date.

sync_type

string

The type of synchronization to apply for the due date field.

priority

object

Sync property with mapping configuration.

mapping

object

Map of source values to destination values for synchronization.

<any-key>

string

name_mapping

object

Map of source names to display names used during synchronization.

<any-key>

string

sync_type

string

The direction and type of synchronization for this property.

status

object

Sync property with mapping configuration.

mapping

object

Map of source values to destination values for synchronization.

<any-key>

string

name_mapping

object

Map of source names to display names used during synchronization.

<any-key>

string

sync_type

string

The direction and type of synchronization for this property.

title

object

Sync property configuration.

sync_type

string

The direction and type of synchronization for this property.

integration_monitor

object

Monitor integration settings.

auto_resolve_enabled

boolean

Whether auto-resolve is enabled.

case_type_id

string

Case type ID for monitor integration.

enabled

boolean

Whether monitor integration is enabled.

handle

string

Monitor handle.

integration_on_call

object

On-Call integration settings.

auto_assign_on_call

boolean

Whether to auto-assign on-call.

enabled

boolean

Whether On-Call integration is enabled.

escalation_queries

[object]

List of escalation queries for routing cases to on-call responders.

enabled

boolean

Whether this escalation query is enabled.

id

string

Unique identifier of the escalation query.

query

string

The query used to match cases for escalation.

target

object

The target recipient for an On-Call escalation query.

dynamic_team_paging

boolean

Whether to use dynamic team paging for escalation.

team_id

string

The identifier of the team to escalate to.

user_id

string

The identifier of the user to escalate to.

integration_service_now

object

ServiceNow integration settings.

assignment_group

string

Assignment group.

auto_creation

object

Auto-creation settings for ServiceNow incidents from cases.

enabled

boolean

Whether automatic ServiceNow incident creation is enabled.

enabled

boolean

Whether ServiceNow integration is enabled.

instance_name

string

ServiceNow instance name.

sync_config

object

Synchronization configuration for ServiceNow integration.

enabled

boolean

Whether ServiceNow synchronization is enabled.

properties

object

Field-level synchronization properties for ServiceNow integration.

comments

object

Sync property configuration.

sync_type

string

The direction and type of synchronization for this property.

priority

object

Priority synchronization configuration for ServiceNow integration.

impact_mapping

object

Mapping of case priority values to ServiceNow impact values.

<any-key>

string

sync_type

string

The type of synchronization to apply for priority.

urgency_mapping

object

Mapping of case priority values to ServiceNow urgency values.

<any-key>

string

status

object

Sync property with mapping configuration.

mapping

object

Map of source values to destination values for synchronization.

<any-key>

string

name_mapping

object

Map of source names to display names used during synchronization.

<any-key>

string

sync_type

string

The direction and type of synchronization for this property.

notification

object

Project notification settings.

destinations

[integer]

Notification destinations (1=email, 2=slack, 3=in-app).

enabled

boolean

Whether notifications are enabled.

notify_on_case_assignment

boolean

Whether to send a notification when a case is assigned.

notify_on_case_closed

boolean

Whether to send a notification when a case is closed.

notify_on_case_comment

boolean

Whether to send a notification when a comment is added to a case.

notify_on_case_comment_mention

boolean

Whether to send a notification when a user is mentioned in a case comment.

notify_on_case_priority_change

boolean

Whether to send a notification when a case's priority changes.

notify_on_case_status_change

boolean

Whether to send a notification when a case's status changes.

notify_on_case_unassignment

boolean

Whether to send a notification when a case is unassigned.

id [required]

string

The Project's identifier.

relationships

object

Project relationships.

member_team

object

Relationship between a team and a team link

data

[object]

Related team links

id [required]

string

The team link's identifier

type [required]

enum

Team link type Allowed enum values: team_links

default: team_links

links

object

Links attributes.

related

string

Related link.

member_user

object

Relationship to users.

data [required]

[object]

Relationships to user objects.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

type [required]

enum

Project resource type. Allowed enum values: project

default: project

{
  "data": [
    {
      "attributes": {
        "columns_config": {
          "columns": [
            {
              "sort": {
                "ascending": false,
                "priority": "integer"
              },
              "sort_field": "string",
              "type": "string"
            }
          ]
        },
        "enabled_custom_case_types": [],
        "key": "CASEM",
        "name": "Security Investigation",
        "restricted": false,
        "settings": {
          "auto_close_inactive_cases": {
            "enabled": false,
            "max_inactive_time_in_secs": "integer"
          },
          "auto_transition_assigned_cases": {
            "auto_transition_assigned_cases_on_self_assigned": false
          },
          "integration_incident": {
            "auto_escalation_query": "string",
            "default_incident_commander": "string",
            "enabled": false,
            "field_mappings": [
              {
                "case_field": "string",
                "incident_user_defined_field_id": "string"
              }
            ],
            "incident_type": "string",
            "severity_config": {
              "priority_mapping": {
                "<any-key>": "string"
              }
            }
          },
          "integration_jira": {
            "auto_creation": {
              "enabled": false
            },
            "enabled": false,
            "metadata": {
              "account_id": "string",
              "issue_type_id": "string",
              "project_id": "string"
            },
            "sync": {
              "enabled": false,
              "properties": {
                "assignee": {
                  "sync_type": "string"
                },
                "comments": {
                  "sync_type": "string"
                },
                "custom_fields": {
                  "<any-key>": {
                    "sync_type": "string",
                    "value": {
                      "description": "undefined",
                      "type": "undefined"
                    }
                  }
                },
                "description": {
                  "sync_type": "string"
                },
                "due_date": {
                  "jira_field_id": "string",
                  "sync_type": "string"
                },
                "priority": {
                  "mapping": {
                    "<any-key>": "string"
                  },
                  "name_mapping": {
                    "<any-key>": "string"
                  },
                  "sync_type": "string"
                },
                "status": {
                  "mapping": {
                    "<any-key>": "string"
                  },
                  "name_mapping": {
                    "<any-key>": "string"
                  },
                  "sync_type": "string"
                },
                "title": {
                  "sync_type": "string"
                }
              }
            }
          },
          "integration_monitor": {
            "auto_resolve_enabled": false,
            "case_type_id": "string",
            "enabled": false,
            "handle": "string"
          },
          "integration_on_call": {
            "auto_assign_on_call": false,
            "enabled": false,
            "escalation_queries": [
              {
                "enabled": false,
                "id": "string",
                "query": "string",
                "target": {
                  "dynamic_team_paging": false,
                  "team_id": "string",
                  "user_id": "string"
                }
              }
            ]
          },
          "integration_service_now": {
            "assignment_group": "string",
            "auto_creation": {
              "enabled": false
            },
            "enabled": false,
            "instance_name": "string",
            "sync_config": {
              "enabled": false,
              "properties": {
                "comments": {
                  "sync_type": "string"
                },
                "priority": {
                  "impact_mapping": {
                    "<any-key>": "string"
                  },
                  "sync_type": "string",
                  "urgency_mapping": {
                    "<any-key>": "string"
                  }
                },
                "status": {
                  "mapping": {
                    "<any-key>": "string"
                  },
                  "name_mapping": {
                    "<any-key>": "string"
                  },
                  "sync_type": "string"
                }
              }
            }
          },
          "notification": {
            "destinations": [],
            "enabled": false,
            "notify_on_case_assignment": false,
            "notify_on_case_closed": false,
            "notify_on_case_comment": false,
            "notify_on_case_comment_mention": false,
            "notify_on_case_priority_change": false,
            "notify_on_case_status_change": false,
            "notify_on_case_unassignment": false
          }
        }
      },
      "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
      "relationships": {
        "member_team": {
          "data": [
            {
              "id": "f9bb8444-af7f-11ec-ac2c-da7ad0900001",
              "type": "team_links"
            }
          ],
          "links": {
            "related": "/api/v2/team/c75a4a8e-20c7-11ee-a3a5-da7ad0900002/links"
          }
        },
        "member_user": {
          "data": [
            {
              "id": "00000000-0000-0000-0000-000000000000",
              "type": "user"
            }
          ]
        }
      },
      "type": "project"
    }
  ]
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  # 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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/projects" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
Get all projects returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = CaseManagementApi(api_client)
    response = api_instance.get_projects()

    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Get all projects returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new
p api_instance.get_projects()

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Get all projects 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"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCaseManagementApi(apiClient)
	resp, r, err := api.GetProjects(ctx)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.GetProjects`:\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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Get all projects returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.ProjectsResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

    try {
      ProjectsResponse result = apiInstance.getProjects();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseManagementApi#getProjects");
      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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// Get all projects returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.get_projects().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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Get all projects returns "OK" response
 */

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

const configuration = client.createConfiguration();
const apiInstance = new v2.CaseManagementApi(configuration);

apiInstance
  .getProjects()
  .then((data: v2.ProjectsResponse) => {
    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"

GET https://api.ap1.datadoghq.com/api/v2/cases/projects/{project_id}https://api.ap2.datadoghq.com/api/v2/cases/projects/{project_id}https://api.datadoghq.eu/api/v2/cases/projects/{project_id}https://api.ddog-gov.com/api/v2/cases/projects/{project_id}https://api.us2.ddog-gov.com/api/v2/cases/projects/{project_id}https://api.datadoghq.com/api/v2/cases/projects/{project_id}https://api.us3.datadoghq.com/api/v2/cases/projects/{project_id}https://api.us5.datadoghq.com/api/v2/cases/projects/{project_id}

Información general

Get the details of a project by project_id.

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

project_id [required]

string

Project UUID.

Respuesta

OK

Project response.

Expand All

Campo

Tipo

Descripción

data

object

A Project.

attributes [required]

object

Project attributes.

columns_config

object

Project columns configuration.

columns

[object]

List of column configurations for the project board view.

sort

object

Sort configuration for a project board column.

ascending

boolean

Whether to sort in ascending order.

priority

int64

The sort priority order for this column.

sort_field

string

The field used to sort items in this column.

type

string

The type of column.

enabled_custom_case_types

[string]

List of enabled custom case type IDs.

key

string

The project's key.

name

string

Project's name.

restricted

boolean

Whether the project is restricted.

settings

object

Project settings.

auto_close_inactive_cases

object

Auto-close inactive cases settings.

enabled

boolean

Whether auto-close is enabled.

max_inactive_time_in_secs

int64

Maximum inactive time in seconds before auto-closing.

auto_transition_assigned_cases

object

Auto-transition assigned cases settings.

auto_transition_assigned_cases_on_self_assigned

boolean

Whether to auto-transition cases when self-assigned.

integration_incident

object

Incident integration settings.

auto_escalation_query

string

Query for auto-escalation.

default_incident_commander

string

Default incident commander.

enabled

boolean

Whether incident integration is enabled.

field_mappings

[object]

List of mappings between incident fields and case fields.

case_field

string

The case field to map the incident field value to.

incident_user_defined_field_id

string

The identifier of the incident user-defined field to map from.

incident_type

string

Incident type.

severity_config

object

Severity configuration for mapping incident priorities to case priorities.

priority_mapping

object

Mapping of incident severity values to case priority values.

<any-key>

string

integration_jira

object

Jira integration settings.

auto_creation

object

Auto-creation settings for Jira issues from cases.

enabled

boolean

Whether automatic Jira issue creation is enabled.

enabled

boolean

Whether Jira integration is enabled.

metadata

object

Metadata for connecting a case management project to a Jira project.

account_id

string

The Jira account identifier.

issue_type_id

string

The Jira issue type identifier to use when creating issues.

project_id

string

The Jira project identifier to associate with this case project.

sync

object

Synchronization configuration for Jira integration.

enabled

boolean

Whether Jira field synchronization is enabled.

properties

object

Field synchronization properties for Jira integration.

assignee

object

Sync property configuration.

sync_type

string

The direction and type of synchronization for this property.

comments

object

Sync property configuration.

sync_type

string

The direction and type of synchronization for this property.

custom_fields

object

Map of custom field identifiers to their sync configurations.

<any-key>

object

Synchronization configuration for a Jira custom field.

sync_type

string

The type of synchronization to apply for this custom field.

value

object <oneOf>

Represents any valid JSON value.

Option 1

string

A scalar string value.

Option 2

double

A scalar numeric value.

Option 3

object

An arbitrary object value with additional properties.

Option 4

[ <oneOf>]

An array of arbitrary values.

Option 1

string

A scalar string value.

Option 2

double

A scalar numeric value.

Option 3

object

An arbitrary object value with additional properties.

Option 4

boolean

A scalar boolean value.

Option 5

boolean

A scalar boolean value.

description

object

Sync property configuration.

sync_type

string

The direction and type of synchronization for this property.

due_date

object

Due date synchronization configuration for Jira integration.

jira_field_id

string

The Jira field identifier used to store the due date.

sync_type

string

The type of synchronization to apply for the due date field.

priority

object

Sync property with mapping configuration.

mapping

object

Map of source values to destination values for synchronization.

<any-key>

string

name_mapping

object

Map of source names to display names used during synchronization.

<any-key>

string

sync_type

string

The direction and type of synchronization for this property.

status

object

Sync property with mapping configuration.

mapping

object

Map of source values to destination values for synchronization.

<any-key>

string

name_mapping

object

Map of source names to display names used during synchronization.

<any-key>

string

sync_type

string

The direction and type of synchronization for this property.

title

object

Sync property configuration.

sync_type

string

The direction and type of synchronization for this property.

integration_monitor

object

Monitor integration settings.

auto_resolve_enabled

boolean

Whether auto-resolve is enabled.

case_type_id

string

Case type ID for monitor integration.

enabled

boolean

Whether monitor integration is enabled.

handle

string

Monitor handle.

integration_on_call

object

On-Call integration settings.

auto_assign_on_call

boolean

Whether to auto-assign on-call.

enabled

boolean

Whether On-Call integration is enabled.

escalation_queries

[object]

List of escalation queries for routing cases to on-call responders.

enabled

boolean

Whether this escalation query is enabled.

id

string

Unique identifier of the escalation query.

query

string

The query used to match cases for escalation.

target

object

The target recipient for an On-Call escalation query.

dynamic_team_paging

boolean

Whether to use dynamic team paging for escalation.

team_id

string

The identifier of the team to escalate to.

user_id

string

The identifier of the user to escalate to.

integration_service_now

object

ServiceNow integration settings.

assignment_group

string

Assignment group.

auto_creation

object

Auto-creation settings for ServiceNow incidents from cases.

enabled

boolean

Whether automatic ServiceNow incident creation is enabled.

enabled

boolean

Whether ServiceNow integration is enabled.

instance_name

string

ServiceNow instance name.

sync_config

object

Synchronization configuration for ServiceNow integration.

enabled

boolean

Whether ServiceNow synchronization is enabled.

properties

object

Field-level synchronization properties for ServiceNow integration.

comments

object

Sync property configuration.

sync_type

string

The direction and type of synchronization for this property.

priority

object

Priority synchronization configuration for ServiceNow integration.

impact_mapping

object

Mapping of case priority values to ServiceNow impact values.

<any-key>

string

sync_type

string

The type of synchronization to apply for priority.

urgency_mapping

object

Mapping of case priority values to ServiceNow urgency values.

<any-key>

string

status

object

Sync property with mapping configuration.

mapping

object

Map of source values to destination values for synchronization.

<any-key>

string

name_mapping

object

Map of source names to display names used during synchronization.

<any-key>

string

sync_type

string

The direction and type of synchronization for this property.

notification

object

Project notification settings.

destinations

[integer]

Notification destinations (1=email, 2=slack, 3=in-app).

enabled

boolean

Whether notifications are enabled.

notify_on_case_assignment

boolean

Whether to send a notification when a case is assigned.

notify_on_case_closed

boolean

Whether to send a notification when a case is closed.

notify_on_case_comment

boolean

Whether to send a notification when a comment is added to a case.

notify_on_case_comment_mention

boolean

Whether to send a notification when a user is mentioned in a case comment.

notify_on_case_priority_change

boolean

Whether to send a notification when a case's priority changes.

notify_on_case_status_change

boolean

Whether to send a notification when a case's status changes.

notify_on_case_unassignment

boolean

Whether to send a notification when a case is unassigned.

id [required]

string

The Project's identifier.

relationships

object

Project relationships.

member_team

object

Relationship between a team and a team link

data

[object]

Related team links

id [required]

string

The team link's identifier

type [required]

enum

Team link type Allowed enum values: team_links

default: team_links

links

object

Links attributes.

related

string

Related link.

member_user

object

Relationship to users.

data [required]

[object]

Relationships to user objects.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

type [required]

enum

Project resource type. Allowed enum values: project

default: project

{
  "data": {
    "attributes": {
      "columns_config": {
        "columns": [
          {
            "sort": {
              "ascending": false,
              "priority": "integer"
            },
            "sort_field": "string",
            "type": "string"
          }
        ]
      },
      "enabled_custom_case_types": [],
      "key": "CASEM",
      "name": "Security Investigation",
      "restricted": false,
      "settings": {
        "auto_close_inactive_cases": {
          "enabled": false,
          "max_inactive_time_in_secs": "integer"
        },
        "auto_transition_assigned_cases": {
          "auto_transition_assigned_cases_on_self_assigned": false
        },
        "integration_incident": {
          "auto_escalation_query": "string",
          "default_incident_commander": "string",
          "enabled": false,
          "field_mappings": [
            {
              "case_field": "string",
              "incident_user_defined_field_id": "string"
            }
          ],
          "incident_type": "string",
          "severity_config": {
            "priority_mapping": {
              "<any-key>": "string"
            }
          }
        },
        "integration_jira": {
          "auto_creation": {
            "enabled": false
          },
          "enabled": false,
          "metadata": {
            "account_id": "string",
            "issue_type_id": "string",
            "project_id": "string"
          },
          "sync": {
            "enabled": false,
            "properties": {
              "assignee": {
                "sync_type": "string"
              },
              "comments": {
                "sync_type": "string"
              },
              "custom_fields": {
                "<any-key>": {
                  "sync_type": "string",
                  "value": {
                    "description": "undefined",
                    "type": "undefined"
                  }
                }
              },
              "description": {
                "sync_type": "string"
              },
              "due_date": {
                "jira_field_id": "string",
                "sync_type": "string"
              },
              "priority": {
                "mapping": {
                  "<any-key>": "string"
                },
                "name_mapping": {
                  "<any-key>": "string"
                },
                "sync_type": "string"
              },
              "status": {
                "mapping": {
                  "<any-key>": "string"
                },
                "name_mapping": {
                  "<any-key>": "string"
                },
                "sync_type": "string"
              },
              "title": {
                "sync_type": "string"
              }
            }
          }
        },
        "integration_monitor": {
          "auto_resolve_enabled": false,
          "case_type_id": "string",
          "enabled": false,
          "handle": "string"
        },
        "integration_on_call": {
          "auto_assign_on_call": false,
          "enabled": false,
          "escalation_queries": [
            {
              "enabled": false,
              "id": "string",
              "query": "string",
              "target": {
                "dynamic_team_paging": false,
                "team_id": "string",
                "user_id": "string"
              }
            }
          ]
        },
        "integration_service_now": {
          "assignment_group": "string",
          "auto_creation": {
            "enabled": false
          },
          "enabled": false,
          "instance_name": "string",
          "sync_config": {
            "enabled": false,
            "properties": {
              "comments": {
                "sync_type": "string"
              },
              "priority": {
                "impact_mapping": {
                  "<any-key>": "string"
                },
                "sync_type": "string",
                "urgency_mapping": {
                  "<any-key>": "string"
                }
              },
              "status": {
                "mapping": {
                  "<any-key>": "string"
                },
                "name_mapping": {
                  "<any-key>": "string"
                },
                "sync_type": "string"
              }
            }
          }
        },
        "notification": {
          "destinations": [],
          "enabled": false,
          "notify_on_case_assignment": false,
          "notify_on_case_closed": false,
          "notify_on_case_comment": false,
          "notify_on_case_comment_mention": false,
          "notify_on_case_priority_change": false,
          "notify_on_case_status_change": false,
          "notify_on_case_unassignment": false
        }
      }
    },
    "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
    "relationships": {
      "member_team": {
        "data": [
          {
            "id": "f9bb8444-af7f-11ec-ac2c-da7ad0900001",
            "type": "team_links"
          }
        ],
        "links": {
          "related": "/api/v2/team/c75a4a8e-20c7-11ee-a3a5-da7ad0900002/links"
        }
      },
      "member_user": {
        "data": [
          {
            "id": "00000000-0000-0000-0000-000000000000",
            "type": "user"
          }
        ]
      }
    },
    "type": "project"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  # Path parameters
export project_id="e555e290-ed65-49bd-ae18-8acbfcf18db7"
# 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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/projects/${project_id}" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
Get the details of a project returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = CaseManagementApi(api_client)
    response = api_instance.get_project(
        project_id="project_id",
    )

    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Get the details of a project returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new
p api_instance.get_project("project_id")

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Get the details of a project 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"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCaseManagementApi(apiClient)
	resp, r, err := api.GetProject(ctx, "project_id")

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.GetProject`:\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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Get the details of a project returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.ProjectResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

    try {
      ProjectResponse result = apiInstance.getProject("e555e290-ed65-49bd-ae18-8acbfcf18db7");
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseManagementApi#getProject");
      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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// Get the details of a project returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.get_project("project_id".to_string()).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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Get the details of a project returns "OK" response
 */

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

const configuration = client.createConfiguration();
const apiInstance = new v2.CaseManagementApi(configuration);

const params: v2.CaseManagementApiGetProjectRequest = {
  projectId: "project_id",
};

apiInstance
  .getProject(params)
  .then((data: v2.ProjectResponse) => {
    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"

DELETE https://api.ap1.datadoghq.com/api/v2/cases/projects/{project_id}https://api.ap2.datadoghq.com/api/v2/cases/projects/{project_id}https://api.datadoghq.eu/api/v2/cases/projects/{project_id}https://api.ddog-gov.com/api/v2/cases/projects/{project_id}https://api.us2.ddog-gov.com/api/v2/cases/projects/{project_id}https://api.datadoghq.com/api/v2/cases/projects/{project_id}https://api.us3.datadoghq.com/api/v2/cases/projects/{project_id}https://api.us5.datadoghq.com/api/v2/cases/projects/{project_id}

Información general

Remove a project using the project’s id.

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

project_id [required]

string

Project UUID.

Respuesta

No Content

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

API error response

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  # Path parameters
export project_id="e555e290-ed65-49bd-ae18-8acbfcf18db7"
# Curl command
curl -X DELETE "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/projects/${project_id}" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
Remove a project returns "No Content" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = CaseManagementApi(api_client)
    api_instance.delete_project(
        project_id="project_id",
    )

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Remove a project returns "No Content" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new
api_instance.delete_project("project_id")

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Remove a project returns "No Content" response

package main

import (
	"context"
	"fmt"
	"os"

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

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCaseManagementApi(apiClient)
	r, err := api.DeleteProject(ctx, "project_id")

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

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Remove a project returns "No Content" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

    try {
      apiInstance.deleteProject("e555e290-ed65-49bd-ae18-8acbfcf18db7");
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseManagementApi#deleteProject");
      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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// Remove a project returns "No Content" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.delete_project("project_id".to_string()).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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Remove a project returns "No Content" response
 */

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

const configuration = client.createConfiguration();
const apiInstance = new v2.CaseManagementApi(configuration);

const params: v2.CaseManagementApiDeleteProjectRequest = {
  projectId: "project_id",
};

apiInstance
  .deleteProject(params)
  .then((data: any) => {
    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"

PATCH https://api.ap1.datadoghq.com/api/v2/cases/projects/{project_id}https://api.ap2.datadoghq.com/api/v2/cases/projects/{project_id}https://api.datadoghq.eu/api/v2/cases/projects/{project_id}https://api.ddog-gov.com/api/v2/cases/projects/{project_id}https://api.us2.ddog-gov.com/api/v2/cases/projects/{project_id}https://api.datadoghq.com/api/v2/cases/projects/{project_id}https://api.us3.datadoghq.com/api/v2/cases/projects/{project_id}https://api.us5.datadoghq.com/api/v2/cases/projects/{project_id}

Información general

Update a project.

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

project_id [required]

string

Project UUID.

Solicitud

Body Data (required)

Project payload.

Expand All

Campo

Tipo

Descripción

data [required]

object

Project update.

attributes

object

Project update attributes.

columns_config

object

Project columns configuration.

columns

[object]

List of column configurations for the project board view.

sort

object

Sort configuration for a project board column.

ascending

boolean

Whether to sort in ascending order.

priority

int64

The sort priority order for this column.

sort_field

string

The field used to sort items in this column.

type

string

The type of column.

enabled_custom_case_types

[string]

List of enabled custom case type IDs.

name

string

Project name.

settings

object

Project settings.

auto_close_inactive_cases

object

Auto-close inactive cases settings.

enabled

boolean

Whether auto-close is enabled.

max_inactive_time_in_secs

int64

Maximum inactive time in seconds before auto-closing.

auto_transition_assigned_cases

object

Auto-transition assigned cases settings.

auto_transition_assigned_cases_on_self_assigned

boolean

Whether to auto-transition cases when self-assigned.

integration_incident

object

Incident integration settings.

auto_escalation_query

string

Query for auto-escalation.

default_incident_commander

string

Default incident commander.

enabled

boolean

Whether incident integration is enabled.

field_mappings

[object]

List of mappings between incident fields and case fields.

case_field

string

The case field to map the incident field value to.

incident_user_defined_field_id

string

The identifier of the incident user-defined field to map from.

incident_type

string

Incident type.

severity_config

object

Severity configuration for mapping incident priorities to case priorities.

priority_mapping

object

Mapping of incident severity values to case priority values.

<any-key>

string

integration_jira

object

Jira integration settings.

auto_creation

object

Auto-creation settings for Jira issues from cases.

enabled

boolean

Whether automatic Jira issue creation is enabled.

enabled

boolean

Whether Jira integration is enabled.

metadata

object

Metadata for connecting a case management project to a Jira project.

account_id

string

The Jira account identifier.

issue_type_id

string

The Jira issue type identifier to use when creating issues.

project_id

string

The Jira project identifier to associate with this case project.

sync

object

Synchronization configuration for Jira integration.

enabled

boolean

Whether Jira field synchronization is enabled.

properties

object

Field synchronization properties for Jira integration.

assignee

object

Sync property configuration.

sync_type

string

The direction and type of synchronization for this property.

comments

object

Sync property configuration.

sync_type

string

The direction and type of synchronization for this property.

custom_fields

object

Map of custom field identifiers to their sync configurations.

<any-key>

object

Synchronization configuration for a Jira custom field.

sync_type

string

The type of synchronization to apply for this custom field.

value

object <oneOf>

Represents any valid JSON value.

Option 1

string

A scalar string value.

Option 2

double

A scalar numeric value.

Option 3

object

An arbitrary object value with additional properties.

Option 4

[ <oneOf>]

An array of arbitrary values.

Option 1

string

A scalar string value.

Option 2

double

A scalar numeric value.

Option 3

object

An arbitrary object value with additional properties.

Option 4

boolean

A scalar boolean value.

Option 5

boolean

A scalar boolean value.

description

object

Sync property configuration.

sync_type

string

The direction and type of synchronization for this property.

due_date

object

Due date synchronization configuration for Jira integration.

jira_field_id

string

The Jira field identifier used to store the due date.

sync_type

string

The type of synchronization to apply for the due date field.

priority

object

Sync property with mapping configuration.

mapping

object

Map of source values to destination values for synchronization.

<any-key>

string

name_mapping

object

Map of source names to display names used during synchronization.

<any-key>

string

sync_type

string

The direction and type of synchronization for this property.

status

object

Sync property with mapping configuration.

mapping

object

Map of source values to destination values for synchronization.

<any-key>

string

name_mapping

object

Map of source names to display names used during synchronization.

<any-key>

string

sync_type

string

The direction and type of synchronization for this property.

title

object

Sync property configuration.

sync_type

string

The direction and type of synchronization for this property.

integration_monitor

object

Monitor integration settings.

auto_resolve_enabled

boolean

Whether auto-resolve is enabled.

case_type_id

string

Case type ID for monitor integration.

enabled

boolean

Whether monitor integration is enabled.

handle

string

Monitor handle.

integration_on_call

object

On-Call integration settings.

auto_assign_on_call

boolean

Whether to auto-assign on-call.

enabled

boolean

Whether On-Call integration is enabled.

escalation_queries

[object]

List of escalation queries for routing cases to on-call responders.

enabled

boolean

Whether this escalation query is enabled.

id

string

Unique identifier of the escalation query.

query

string

The query used to match cases for escalation.

target

object

The target recipient for an On-Call escalation query.

dynamic_team_paging

boolean

Whether to use dynamic team paging for escalation.

team_id

string

The identifier of the team to escalate to.

user_id

string

The identifier of the user to escalate to.

integration_service_now

object

ServiceNow integration settings.

assignment_group

string

Assignment group.

auto_creation

object

Auto-creation settings for ServiceNow incidents from cases.

enabled

boolean

Whether automatic ServiceNow incident creation is enabled.

enabled

boolean

Whether ServiceNow integration is enabled.

instance_name

string

ServiceNow instance name.

sync_config

object

Synchronization configuration for ServiceNow integration.

enabled

boolean

Whether ServiceNow synchronization is enabled.

properties

object

Field-level synchronization properties for ServiceNow integration.

comments

object

Sync property configuration.

sync_type

string

The direction and type of synchronization for this property.

priority

object

Priority synchronization configuration for ServiceNow integration.

impact_mapping

object

Mapping of case priority values to ServiceNow impact values.

<any-key>

string

sync_type

string

The type of synchronization to apply for priority.

urgency_mapping

object

Mapping of case priority values to ServiceNow urgency values.

<any-key>

string

status

object

Sync property with mapping configuration.

mapping

object

Map of source values to destination values for synchronization.

<any-key>

string

name_mapping

object

Map of source names to display names used during synchronization.

<any-key>

string

sync_type

string

The direction and type of synchronization for this property.

notification

object

Project notification settings.

destinations

[integer]

Notification destinations (1=email, 2=slack, 3=in-app).

enabled

boolean

Whether notifications are enabled.

notify_on_case_assignment

boolean

Whether to send a notification when a case is assigned.

notify_on_case_closed

boolean

Whether to send a notification when a case is closed.

notify_on_case_comment

boolean

Whether to send a notification when a comment is added to a case.

notify_on_case_comment_mention

boolean

Whether to send a notification when a user is mentioned in a case comment.

notify_on_case_priority_change

boolean

Whether to send a notification when a case's priority changes.

notify_on_case_status_change

boolean

Whether to send a notification when a case's status changes.

notify_on_case_unassignment

boolean

Whether to send a notification when a case is unassigned.

team_uuid

string

Team UUID to associate with the project.

type [required]

enum

Project resource type. Allowed enum values: project

default: project

{
  "data": {
    "type": "project",
    "attributes": {
      "name": "Updated Project Name Example-Case-Management"
    }
  }
}

Respuesta

OK

Project response.

Expand All

Campo

Tipo

Descripción

data

object

A Project.

attributes [required]

object

Project attributes.

columns_config

object

Project columns configuration.

columns

[object]

List of column configurations for the project board view.

sort

object

Sort configuration for a project board column.

ascending

boolean

Whether to sort in ascending order.

priority

int64

The sort priority order for this column.

sort_field

string

The field used to sort items in this column.

type

string

The type of column.

enabled_custom_case_types

[string]

List of enabled custom case type IDs.

key

string

The project's key.

name

string

Project's name.

restricted

boolean

Whether the project is restricted.

settings

object

Project settings.

auto_close_inactive_cases

object

Auto-close inactive cases settings.

enabled

boolean

Whether auto-close is enabled.

max_inactive_time_in_secs

int64

Maximum inactive time in seconds before auto-closing.

auto_transition_assigned_cases

object

Auto-transition assigned cases settings.

auto_transition_assigned_cases_on_self_assigned

boolean

Whether to auto-transition cases when self-assigned.

integration_incident

object

Incident integration settings.

auto_escalation_query

string

Query for auto-escalation.

default_incident_commander

string

Default incident commander.

enabled

boolean

Whether incident integration is enabled.

field_mappings

[object]

List of mappings between incident fields and case fields.

case_field

string

The case field to map the incident field value to.

incident_user_defined_field_id

string

The identifier of the incident user-defined field to map from.

incident_type

string

Incident type.

severity_config

object

Severity configuration for mapping incident priorities to case priorities.

priority_mapping

object

Mapping of incident severity values to case priority values.

<any-key>

string

integration_jira

object

Jira integration settings.

auto_creation

object

Auto-creation settings for Jira issues from cases.

enabled

boolean

Whether automatic Jira issue creation is enabled.

enabled

boolean

Whether Jira integration is enabled.

metadata

object

Metadata for connecting a case management project to a Jira project.

account_id

string

The Jira account identifier.

issue_type_id

string

The Jira issue type identifier to use when creating issues.

project_id

string

The Jira project identifier to associate with this case project.

sync

object

Synchronization configuration for Jira integration.

enabled

boolean

Whether Jira field synchronization is enabled.

properties

object

Field synchronization properties for Jira integration.

assignee

object

Sync property configuration.

sync_type

string

The direction and type of synchronization for this property.

comments

object

Sync property configuration.

sync_type

string

The direction and type of synchronization for this property.

custom_fields

object

Map of custom field identifiers to their sync configurations.

<any-key>

object

Synchronization configuration for a Jira custom field.

sync_type

string

The type of synchronization to apply for this custom field.

value

object <oneOf>

Represents any valid JSON value.

Option 1

string

A scalar string value.

Option 2

double

A scalar numeric value.

Option 3

object

An arbitrary object value with additional properties.

Option 4

[ <oneOf>]

An array of arbitrary values.

Option 1

string

A scalar string value.

Option 2

double

A scalar numeric value.

Option 3

object

An arbitrary object value with additional properties.

Option 4

boolean

A scalar boolean value.

Option 5

boolean

A scalar boolean value.

description

object

Sync property configuration.

sync_type

string

The direction and type of synchronization for this property.

due_date

object

Due date synchronization configuration for Jira integration.

jira_field_id

string

The Jira field identifier used to store the due date.

sync_type

string

The type of synchronization to apply for the due date field.

priority

object

Sync property with mapping configuration.

mapping

object

Map of source values to destination values for synchronization.

<any-key>

string

name_mapping

object

Map of source names to display names used during synchronization.

<any-key>

string

sync_type

string

The direction and type of synchronization for this property.

status

object

Sync property with mapping configuration.

mapping

object

Map of source values to destination values for synchronization.

<any-key>

string

name_mapping

object

Map of source names to display names used during synchronization.

<any-key>

string

sync_type

string

The direction and type of synchronization for this property.

title

object

Sync property configuration.

sync_type

string

The direction and type of synchronization for this property.

integration_monitor

object

Monitor integration settings.

auto_resolve_enabled

boolean

Whether auto-resolve is enabled.

case_type_id

string

Case type ID for monitor integration.

enabled

boolean

Whether monitor integration is enabled.

handle

string

Monitor handle.

integration_on_call

object

On-Call integration settings.

auto_assign_on_call

boolean

Whether to auto-assign on-call.

enabled

boolean

Whether On-Call integration is enabled.

escalation_queries

[object]

List of escalation queries for routing cases to on-call responders.

enabled

boolean

Whether this escalation query is enabled.

id

string

Unique identifier of the escalation query.

query

string

The query used to match cases for escalation.

target

object

The target recipient for an On-Call escalation query.

dynamic_team_paging

boolean

Whether to use dynamic team paging for escalation.

team_id

string

The identifier of the team to escalate to.

user_id

string

The identifier of the user to escalate to.

integration_service_now

object

ServiceNow integration settings.

assignment_group

string

Assignment group.

auto_creation

object

Auto-creation settings for ServiceNow incidents from cases.

enabled

boolean

Whether automatic ServiceNow incident creation is enabled.

enabled

boolean

Whether ServiceNow integration is enabled.

instance_name

string

ServiceNow instance name.

sync_config

object

Synchronization configuration for ServiceNow integration.

enabled

boolean

Whether ServiceNow synchronization is enabled.

properties

object

Field-level synchronization properties for ServiceNow integration.

comments

object

Sync property configuration.

sync_type

string

The direction and type of synchronization for this property.

priority

object

Priority synchronization configuration for ServiceNow integration.

impact_mapping

object

Mapping of case priority values to ServiceNow impact values.

<any-key>

string

sync_type

string

The type of synchronization to apply for priority.

urgency_mapping

object

Mapping of case priority values to ServiceNow urgency values.

<any-key>

string

status

object

Sync property with mapping configuration.

mapping

object

Map of source values to destination values for synchronization.

<any-key>

string

name_mapping

object

Map of source names to display names used during synchronization.

<any-key>

string

sync_type

string

The direction and type of synchronization for this property.

notification

object

Project notification settings.

destinations

[integer]

Notification destinations (1=email, 2=slack, 3=in-app).

enabled

boolean

Whether notifications are enabled.

notify_on_case_assignment

boolean

Whether to send a notification when a case is assigned.

notify_on_case_closed

boolean

Whether to send a notification when a case is closed.

notify_on_case_comment

boolean

Whether to send a notification when a comment is added to a case.

notify_on_case_comment_mention

boolean

Whether to send a notification when a user is mentioned in a case comment.

notify_on_case_priority_change

boolean

Whether to send a notification when a case's priority changes.

notify_on_case_status_change

boolean

Whether to send a notification when a case's status changes.

notify_on_case_unassignment

boolean

Whether to send a notification when a case is unassigned.

id [required]

string

The Project's identifier.

relationships

object

Project relationships.

member_team

object

Relationship between a team and a team link

data

[object]

Related team links

id [required]

string

The team link's identifier

type [required]

enum

Team link type Allowed enum values: team_links

default: team_links

links

object

Links attributes.

related

string

Related link.

member_user

object

Relationship to users.

data [required]

[object]

Relationships to user objects.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

type [required]

enum

Project resource type. Allowed enum values: project

default: project

{
  "data": {
    "attributes": {
      "columns_config": {
        "columns": [
          {
            "sort": {
              "ascending": false,
              "priority": "integer"
            },
            "sort_field": "string",
            "type": "string"
          }
        ]
      },
      "enabled_custom_case_types": [],
      "key": "CASEM",
      "name": "Security Investigation",
      "restricted": false,
      "settings": {
        "auto_close_inactive_cases": {
          "enabled": false,
          "max_inactive_time_in_secs": "integer"
        },
        "auto_transition_assigned_cases": {
          "auto_transition_assigned_cases_on_self_assigned": false
        },
        "integration_incident": {
          "auto_escalation_query": "string",
          "default_incident_commander": "string",
          "enabled": false,
          "field_mappings": [
            {
              "case_field": "string",
              "incident_user_defined_field_id": "string"
            }
          ],
          "incident_type": "string",
          "severity_config": {
            "priority_mapping": {
              "<any-key>": "string"
            }
          }
        },
        "integration_jira": {
          "auto_creation": {
            "enabled": false
          },
          "enabled": false,
          "metadata": {
            "account_id": "string",
            "issue_type_id": "string",
            "project_id": "string"
          },
          "sync": {
            "enabled": false,
            "properties": {
              "assignee": {
                "sync_type": "string"
              },
              "comments": {
                "sync_type": "string"
              },
              "custom_fields": {
                "<any-key>": {
                  "sync_type": "string",
                  "value": {
                    "description": "undefined",
                    "type": "undefined"
                  }
                }
              },
              "description": {
                "sync_type": "string"
              },
              "due_date": {
                "jira_field_id": "string",
                "sync_type": "string"
              },
              "priority": {
                "mapping": {
                  "<any-key>": "string"
                },
                "name_mapping": {
                  "<any-key>": "string"
                },
                "sync_type": "string"
              },
              "status": {
                "mapping": {
                  "<any-key>": "string"
                },
                "name_mapping": {
                  "<any-key>": "string"
                },
                "sync_type": "string"
              },
              "title": {
                "sync_type": "string"
              }
            }
          }
        },
        "integration_monitor": {
          "auto_resolve_enabled": false,
          "case_type_id": "string",
          "enabled": false,
          "handle": "string"
        },
        "integration_on_call": {
          "auto_assign_on_call": false,
          "enabled": false,
          "escalation_queries": [
            {
              "enabled": false,
              "id": "string",
              "query": "string",
              "target": {
                "dynamic_team_paging": false,
                "team_id": "string",
                "user_id": "string"
              }
            }
          ]
        },
        "integration_service_now": {
          "assignment_group": "string",
          "auto_creation": {
            "enabled": false
          },
          "enabled": false,
          "instance_name": "string",
          "sync_config": {
            "enabled": false,
            "properties": {
              "comments": {
                "sync_type": "string"
              },
              "priority": {
                "impact_mapping": {
                  "<any-key>": "string"
                },
                "sync_type": "string",
                "urgency_mapping": {
                  "<any-key>": "string"
                }
              },
              "status": {
                "mapping": {
                  "<any-key>": "string"
                },
                "name_mapping": {
                  "<any-key>": "string"
                },
                "sync_type": "string"
              }
            }
          }
        },
        "notification": {
          "destinations": [],
          "enabled": false,
          "notify_on_case_assignment": false,
          "notify_on_case_closed": false,
          "notify_on_case_comment": false,
          "notify_on_case_comment_mention": false,
          "notify_on_case_priority_change": false,
          "notify_on_case_status_change": false,
          "notify_on_case_unassignment": false
        }
      }
    },
    "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
    "relationships": {
      "member_team": {
        "data": [
          {
            "id": "f9bb8444-af7f-11ec-ac2c-da7ad0900001",
            "type": "team_links"
          }
        ],
        "links": {
          "related": "/api/v2/team/c75a4a8e-20c7-11ee-a3a5-da7ad0900002/links"
        }
      },
      "member_user": {
        "data": [
          {
            "id": "00000000-0000-0000-0000-000000000000",
            "type": "user"
          }
        ]
      }
    },
    "type": "project"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                          ## default
# 

# Path parameters
export project_id="e555e290-ed65-49bd-ae18-8acbfcf18db7"
# Curl command
curl -X PATCH "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/projects/${project_id}" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "type": "project" } } EOF
// Update a project 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"
)

func main() {
	body := datadogV2.ProjectUpdateRequest{
		Data: datadogV2.ProjectUpdate{
			Type: datadogV2.PROJECTRESOURCETYPE_PROJECT,
			Attributes: &datadogV2.ProjectUpdateAttributes{
				Name: datadog.PtrString("Updated Project Name Example-Case-Management"),
			},
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCaseManagementApi(apiClient)
	resp, r, err := api.UpdateProject(ctx, "d4bbe1af-f36e-42f1-87c1-493ca35c320e", body)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.UpdateProject`:\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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Update a project returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.ProjectResourceType;
import com.datadog.api.client.v2.model.ProjectResponse;
import com.datadog.api.client.v2.model.ProjectUpdate;
import com.datadog.api.client.v2.model.ProjectUpdateAttributes;
import com.datadog.api.client.v2.model.ProjectUpdateRequest;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

    ProjectUpdateRequest body =
        new ProjectUpdateRequest()
            .data(
                new ProjectUpdate()
                    .type(ProjectResourceType.PROJECT)
                    .attributes(
                        new ProjectUpdateAttributes()
                            .name("Updated Project Name Example-Case-Management")));

    try {
      ProjectResponse result =
          apiInstance.updateProject("d4bbe1af-f36e-42f1-87c1-493ca35c320e", body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseManagementApi#updateProject");
      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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
"""
Update a project returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi
from datadog_api_client.v2.model.project_resource_type import ProjectResourceType
from datadog_api_client.v2.model.project_update import ProjectUpdate
from datadog_api_client.v2.model.project_update_attributes import ProjectUpdateAttributes
from datadog_api_client.v2.model.project_update_request import ProjectUpdateRequest

body = ProjectUpdateRequest(
    data=ProjectUpdate(
        type=ProjectResourceType.PROJECT,
        attributes=ProjectUpdateAttributes(
            name="Updated Project Name Example-Case-Management",
        ),
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = CaseManagementApi(api_client)
    response = api_instance.update_project(project_id="d4bbe1af-f36e-42f1-87c1-493ca35c320e", body=body)

    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Update a project returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

body = DatadogAPIClient::V2::ProjectUpdateRequest.new({
  data: DatadogAPIClient::V2::ProjectUpdate.new({
    type: DatadogAPIClient::V2::ProjectResourceType::PROJECT,
    attributes: DatadogAPIClient::V2::ProjectUpdateAttributes.new({
      name: "Updated Project Name Example-Case-Management",
    }),
  }),
})
p api_instance.update_project("d4bbe1af-f36e-42f1-87c1-493ca35c320e", body)

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Update a project returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
use datadog_api_client::datadogV2::model::ProjectResourceType;
use datadog_api_client::datadogV2::model::ProjectUpdate;
use datadog_api_client::datadogV2::model::ProjectUpdateAttributes;
use datadog_api_client::datadogV2::model::ProjectUpdateRequest;

#[tokio::main]
async fn main() {
    let body = ProjectUpdateRequest::new(
        ProjectUpdate::new(ProjectResourceType::PROJECT).attributes(
            ProjectUpdateAttributes::new()
                .name("Updated Project Name Example-Case-Management".to_string()),
        ),
    );
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api
        .update_project("d4bbe1af-f36e-42f1-87c1-493ca35c320e".to_string(), body)
        .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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Update a project returns "OK" response
 */

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

const configuration = client.createConfiguration();
const apiInstance = new v2.CaseManagementApi(configuration);

const params: v2.CaseManagementApiUpdateProjectRequest = {
  body: {
    data: {
      type: "project",
      attributes: {
        name: "Updated Project Name Example-Case-Management",
      },
    },
  },
  projectId: "d4bbe1af-f36e-42f1-87c1-493ca35c320e",
};

apiInstance
  .updateProject(params)
  .then((data: v2.ProjectResponse) => {
    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"

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

PATCH https://api.ap1.datadoghq.com/api/v2/cases/{case_id}/relationships/projecthttps://api.ap2.datadoghq.com/api/v2/cases/{case_id}/relationships/projecthttps://api.datadoghq.eu/api/v2/cases/{case_id}/relationships/projecthttps://api.ddog-gov.com/api/v2/cases/{case_id}/relationships/projecthttps://api.us2.ddog-gov.com/api/v2/cases/{case_id}/relationships/projecthttps://api.datadoghq.com/api/v2/cases/{case_id}/relationships/projecthttps://api.us3.datadoghq.com/api/v2/cases/{case_id}/relationships/projecthttps://api.us5.datadoghq.com/api/v2/cases/{case_id}/relationships/project

Información general

Update the project associated with a case

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

case_id [required]

string

Case’s UUID or key

Solicitud

Body Data (required)

Project update request

Expand All

Campo

Tipo

Descripción

data [required]

object

Relationship to project object.

id [required]

string

A unique identifier that represents the project.

type [required]

enum

Project resource type. Allowed enum values: project

default: project

{
  "data": {
    "id": "e555e290-ed65-49bd-ae18-8acbfcf18db7",
    "type": "project"
  }
}

Respuesta

OK

Case response

Expand All

Campo

Tipo

Descripción

data

object

A case

attributes [required]

object

Case resource attributes

archived_at

date-time

Timestamp of when the case was archived

attributes

object

Key-value pairs of case attributes. Each key maps to an array of string values, used for flexible metadata such as labels or tags.

<any-key>

[string]

closed_at

date-time

Timestamp of when the case was closed

created_at

date-time

Timestamp of when the case was created

custom_attributes

object

Case custom attributes

<any-key>

object

A typed value for a custom attribute on a specific case.

is_multi [required]

boolean

If true, value must be an array

type [required]

enum

The data type of the custom attribute, which determines the allowed values and UI input control. Allowed enum values: URL,TEXT,NUMBER,SELECT

value [required]

 <oneOf>

The value of a custom attribute. The accepted format depends on the attribute's type and whether it accepts multiple values.

Option 1

string

A string value for a TEXT, URL, or SELECT-type custom attribute.

Option 2

[string]

An array of string values for a multi-value TEXT, URL, or SELECT-type custom attribute.

Option 3

double

A numeric value for a NUMBER-type custom attribute.

Option 4

[number]

An array of numeric values for a multi-value NUMBER-type custom attribute.

description

string

Description

jira_issue

object

Jira issue attached to case

result

object

Jira issue information

issue_id

string

Jira issue ID

issue_key

string

Jira issue key

issue_url

string

Jira issue URL

project_key

string

Jira project key

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

key

string

Key

modified_at

date-time

Timestamp of when the case was last modified

priority

enum

Case priority Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5

default: NOT_DEFINED

service_now_ticket

object

ServiceNow ticket attached to case

result

object

ServiceNow ticket information

sys_target_link

string

Link to the Incident created on ServiceNow

status

enum

Case status Allowed enum values: IN_PROGRESS,COMPLETED,FAILED

default: IN_PROGRESS

status

enum

DEPRECATED: Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use status_name instead. Allowed enum values: OPEN,IN_PROGRESS,CLOSED

status_group

enum

Status group of the case. Allowed enum values: SG_OPEN,SG_IN_PROGRESS,SG_CLOSED

status_name

string

Status of the case. Must be one of the existing statuses for the case's type.

title

string

Title

type

enum

DEPRECATED: Case type Allowed enum values: STANDARD

type_id

string

Case type UUID

id [required]

string

Case's identifier

relationships

object

Resources related to a case

assignee

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

project

object

Relationship to project.

data [required]

object

Relationship to project object.

id [required]

string

A unique identifier that represents the project.

type [required]

enum

Project resource type. Allowed enum values: project

default: project

type [required]

enum

JSON:API resource type for cases. Allowed enum values: case

default: case

{
  "data": {
    "attributes": {
      "archived_at": "2019-09-19T10:00:00.000Z",
      "attributes": {
        "<any-key>": []
      },
      "closed_at": "2019-09-19T10:00:00.000Z",
      "created_at": "2019-09-19T10:00:00.000Z",
      "custom_attributes": {
        "<any-key>": {
          "is_multi": false,
          "type": "NUMBER",
          "value": {
            "description": "",
            "type": ""
          }
        }
      },
      "description": "string",
      "jira_issue": {
        "result": {
          "issue_id": "string",
          "issue_key": "string",
          "issue_url": "string",
          "project_key": "string"
        },
        "status": "COMPLETED"
      },
      "key": "CASEM-4523",
      "modified_at": "2019-09-19T10:00:00.000Z",
      "priority": "NOT_DEFINED",
      "service_now_ticket": {
        "result": {
          "sys_target_link": "string"
        },
        "status": "COMPLETED"
      },
      "status": "OPEN",
      "status_group": "SG_OPEN",
      "status_name": "Open",
      "title": "Memory leak investigation on API",
      "type": "STANDARD",
      "type_id": "3b010bde-09ce-4449-b745-71dd5f861963"
    },
    "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
    "relationships": {
      "assignee": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "project": {
        "data": {
          "id": "e555e290-ed65-49bd-ae18-8acbfcf18db7",
          "type": "project"
        }
      }
    },
    "type": "case"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

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"
    }
  ]
}

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

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"
    }
  ]
}

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

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

Campo

Tipo

Descripción

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

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  ## default
# 

# Path parameters
export case_id="f98a5a5b-e0ff-45d4-b2f5-afe6e74de504"
# Curl command
curl -X PATCH "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/${case_id}/relationships/project" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "id": "e555e290-ed65-49bd-ae18-8acbfcf18db7", "type": "project" } } EOF
"""
Update case project returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi
from datadog_api_client.v2.model.project_relationship import ProjectRelationship
from datadog_api_client.v2.model.project_relationship_data import ProjectRelationshipData
from datadog_api_client.v2.model.project_resource_type import ProjectResourceType

body = ProjectRelationship(
    data=ProjectRelationshipData(
        id="e555e290-ed65-49bd-ae18-8acbfcf18db7",
        type=ProjectResourceType.PROJECT,
    ),
)

configuration = Configuration()
configuration.unstable_operations["move_case_to_project"] = True
with ApiClient(configuration) as api_client:
    api_instance = CaseManagementApi(api_client)
    response = api_instance.move_case_to_project(case_id="case_id", body=body)

    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Update case project returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.move_case_to_project".to_sym] = true
end
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

body = DatadogAPIClient::V2::ProjectRelationship.new({
  data: DatadogAPIClient::V2::ProjectRelationshipData.new({
    id: "e555e290-ed65-49bd-ae18-8acbfcf18db7",
    type: DatadogAPIClient::V2::ProjectResourceType::PROJECT,
  }),
})
p api_instance.move_case_to_project("case_id", body)

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Update case project 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"
)

func main() {
	body := datadogV2.ProjectRelationship{
		Data: datadogV2.ProjectRelationshipData{
			Id:   "e555e290-ed65-49bd-ae18-8acbfcf18db7",
			Type: datadogV2.PROJECTRESOURCETYPE_PROJECT,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.MoveCaseToProject", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCaseManagementApi(apiClient)
	resp, r, err := api.MoveCaseToProject(ctx, "case_id", body)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.MoveCaseToProject`:\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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Update case project returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.CaseResponse;
import com.datadog.api.client.v2.model.ProjectRelationship;
import com.datadog.api.client.v2.model.ProjectRelationshipData;
import com.datadog.api.client.v2.model.ProjectResourceType;

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

    ProjectRelationship body =
        new ProjectRelationship()
            .data(
                new ProjectRelationshipData()
                    .id("e555e290-ed65-49bd-ae18-8acbfcf18db7")
                    .type(ProjectResourceType.PROJECT));

    try {
      CaseResponse result =
          apiInstance.moveCaseToProject("f98a5a5b-e0ff-45d4-b2f5-afe6e74de504", body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseManagementApi#moveCaseToProject");
      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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// Update case project returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
use datadog_api_client::datadogV2::model::ProjectRelationship;
use datadog_api_client::datadogV2::model::ProjectRelationshipData;
use datadog_api_client::datadogV2::model::ProjectResourceType;

#[tokio::main]
async fn main() {
    let body = ProjectRelationship::new(ProjectRelationshipData::new(
        "e555e290-ed65-49bd-ae18-8acbfcf18db7".to_string(),
        ProjectResourceType::PROJECT,
    ));
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.MoveCaseToProject", true);
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.move_case_to_project("case_id".to_string(), body).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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Update case project returns "OK" response
 */

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

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

const params: v2.CaseManagementApiMoveCaseToProjectRequest = {
  body: {
    data: {
      id: "e555e290-ed65-49bd-ae18-8acbfcf18db7",
      type: "project",
    },
  },
  caseId: "case_id",
};

apiInstance
  .moveCaseToProject(params)
  .then((data: v2.CaseResponse) => {
    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"


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

POST https://api.ap1.datadoghq.com/api/v2/cases/{case_id}/relationships/jira_issueshttps://api.ap2.datadoghq.com/api/v2/cases/{case_id}/relationships/jira_issueshttps://api.datadoghq.eu/api/v2/cases/{case_id}/relationships/jira_issueshttps://api.ddog-gov.com/api/v2/cases/{case_id}/relationships/jira_issueshttps://api.us2.ddog-gov.com/api/v2/cases/{case_id}/relationships/jira_issueshttps://api.datadoghq.com/api/v2/cases/{case_id}/relationships/jira_issueshttps://api.us3.datadoghq.com/api/v2/cases/{case_id}/relationships/jira_issueshttps://api.us5.datadoghq.com/api/v2/cases/{case_id}/relationships/jira_issues

Información general

Create a new Jira issue and link it to a case

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

case_id [required]

string

Case’s UUID or key

Solicitud

Body Data (required)

Jira issue creation request

Expand All

Campo

Tipo

Descripción

data [required]

object

Jira issue creation data

attributes [required]

object

Jira issue creation attributes

fields

object

Additional Jira fields

issue_type_id [required]

string

Jira issue type ID

jira_account_id [required]

string

Jira account ID

project_id [required]

string

Jira project ID

type [required]

enum

Jira issue resource type Allowed enum values: issues

{
  "data": {
    "attributes": {
      "fields": {},
      "issue_type_id": "10001",
      "jira_account_id": "1234",
      "project_id": "5678"
    },
    "type": "issues"
  }
}

Respuesta

Accepted

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

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"
    }
  ]
}

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

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"
    }
  ]
}

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

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

Campo

Tipo

Descripción

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

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  ## default
# 

# Path parameters
export case_id="f98a5a5b-e0ff-45d4-b2f5-afe6e74de504"
# Curl command
curl -X POST "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/${case_id}/relationships/jira_issues" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "fields": {}, "issue_type_id": "10001", "jira_account_id": "1234", "project_id": "5678" }, "type": "issues" } } EOF
"""
Create Jira issue for case returns "Accepted" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi
from datadog_api_client.v2.model.jira_issue_create_attributes import JiraIssueCreateAttributes
from datadog_api_client.v2.model.jira_issue_create_data import JiraIssueCreateData
from datadog_api_client.v2.model.jira_issue_create_request import JiraIssueCreateRequest
from datadog_api_client.v2.model.jira_issue_resource_type import JiraIssueResourceType

body = JiraIssueCreateRequest(
    data=JiraIssueCreateData(
        attributes=JiraIssueCreateAttributes(
            fields=dict(),
            issue_type_id="10001",
            jira_account_id="1234",
            project_id="5678",
        ),
        type=JiraIssueResourceType.ISSUES,
    ),
)

configuration = Configuration()
configuration.unstable_operations["create_case_jira_issue"] = True
with ApiClient(configuration) as api_client:
    api_instance = CaseManagementApi(api_client)
    api_instance.create_case_jira_issue(case_id="case_id", body=body)

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Create Jira issue for case returns "Accepted" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.create_case_jira_issue".to_sym] = true
end
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

body = DatadogAPIClient::V2::JiraIssueCreateRequest.new({
  data: DatadogAPIClient::V2::JiraIssueCreateData.new({
    attributes: DatadogAPIClient::V2::JiraIssueCreateAttributes.new({
      fields: {},
      issue_type_id: "10001",
      jira_account_id: "1234",
      project_id: "5678",
    }),
    type: DatadogAPIClient::V2::JiraIssueResourceType::ISSUES,
  }),
})
p api_instance.create_case_jira_issue("case_id", body)

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Create Jira issue for case returns "Accepted" response

package main

import (
	"context"
	"fmt"
	"os"

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

func main() {
	body := datadogV2.JiraIssueCreateRequest{
		Data: datadogV2.JiraIssueCreateData{
			Attributes: datadogV2.JiraIssueCreateAttributes{
				Fields:        map[string]interface{}{},
				IssueTypeId:   "10001",
				JiraAccountId: "1234",
				ProjectId:     "5678",
			},
			Type: datadogV2.JIRAISSUERESOURCETYPE_ISSUES,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.CreateCaseJiraIssue", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCaseManagementApi(apiClient)
	r, err := api.CreateCaseJiraIssue(ctx, "case_id", body)

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

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Create Jira issue for case returns "Accepted" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.JiraIssueCreateAttributes;
import com.datadog.api.client.v2.model.JiraIssueCreateData;
import com.datadog.api.client.v2.model.JiraIssueCreateRequest;
import com.datadog.api.client.v2.model.JiraIssueResourceType;
import java.util.Map;

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

    JiraIssueCreateRequest body =
        new JiraIssueCreateRequest()
            .data(
                new JiraIssueCreateData()
                    .attributes(
                        new JiraIssueCreateAttributes()
                            .fields(Map.ofEntries())
                            .issueTypeId("10001")
                            .jiraAccountId("1234")
                            .projectId("5678"))
                    .type(JiraIssueResourceType.ISSUES));

    try {
      apiInstance.createCaseJiraIssue("f98a5a5b-e0ff-45d4-b2f5-afe6e74de504", body);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseManagementApi#createCaseJiraIssue");
      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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// Create Jira issue for case returns "Accepted" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
use datadog_api_client::datadogV2::model::JiraIssueCreateAttributes;
use datadog_api_client::datadogV2::model::JiraIssueCreateData;
use datadog_api_client::datadogV2::model::JiraIssueCreateRequest;
use datadog_api_client::datadogV2::model::JiraIssueResourceType;
use std::collections::BTreeMap;

#[tokio::main]
async fn main() {
    let body = JiraIssueCreateRequest::new(JiraIssueCreateData::new(
        JiraIssueCreateAttributes::new("10001".to_string(), "1234".to_string(), "5678".to_string())
            .fields(BTreeMap::from([])),
        JiraIssueResourceType::ISSUES,
    ));
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.CreateCaseJiraIssue", true);
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api
        .create_case_jira_issue("case_id".to_string(), body)
        .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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Create Jira issue for case returns "Accepted" response
 */

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

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

const params: v2.CaseManagementApiCreateCaseJiraIssueRequest = {
  body: {
    data: {
      attributes: {
        fields: {},
        issueTypeId: "10001",
        jiraAccountId: "1234",
        projectId: "5678",
      },
      type: "issues",
    },
  },
  caseId: "case_id",
};

apiInstance
  .createCaseJiraIssue(params)
  .then((data: any) => {
    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"



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

POST https://api.ap1.datadoghq.com/api/v2/cases/{case_id}/relationships/servicenow_ticketshttps://api.ap2.datadoghq.com/api/v2/cases/{case_id}/relationships/servicenow_ticketshttps://api.datadoghq.eu/api/v2/cases/{case_id}/relationships/servicenow_ticketshttps://api.ddog-gov.com/api/v2/cases/{case_id}/relationships/servicenow_ticketshttps://api.us2.ddog-gov.com/api/v2/cases/{case_id}/relationships/servicenow_ticketshttps://api.datadoghq.com/api/v2/cases/{case_id}/relationships/servicenow_ticketshttps://api.us3.datadoghq.com/api/v2/cases/{case_id}/relationships/servicenow_ticketshttps://api.us5.datadoghq.com/api/v2/cases/{case_id}/relationships/servicenow_tickets

Información general

Create a new ServiceNow incident ticket and link it to a case

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

case_id [required]

string

Case’s UUID or key

Solicitud

Body Data (required)

ServiceNow ticket creation request

Expand All

Campo

Tipo

Descripción

data [required]

object

ServiceNow ticket creation data

attributes [required]

object

ServiceNow ticket creation attributes

assignment_group

string

ServiceNow assignment group

instance_name [required]

string

ServiceNow instance name

type [required]

enum

ServiceNow ticket resource type Allowed enum values: tickets

{
  "data": {
    "attributes": {
      "assignment_group": "IT Support",
      "instance_name": "my-instance"
    },
    "type": "tickets"
  }
}

Respuesta

Accepted

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

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"
    }
  ]
}

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

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"
    }
  ]
}

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

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

Campo

Tipo

Descripción

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

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  ## default
# 

# Path parameters
export case_id="f98a5a5b-e0ff-45d4-b2f5-afe6e74de504"
# Curl command
curl -X POST "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/${case_id}/relationships/servicenow_tickets" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "assignment_group": "IT Support", "instance_name": "my-instance" }, "type": "tickets" } } EOF
"""
Create ServiceNow ticket for case returns "Accepted" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi
from datadog_api_client.v2.model.service_now_ticket_create_attributes import ServiceNowTicketCreateAttributes
from datadog_api_client.v2.model.service_now_ticket_create_data import ServiceNowTicketCreateData
from datadog_api_client.v2.model.service_now_ticket_create_request import ServiceNowTicketCreateRequest
from datadog_api_client.v2.model.service_now_ticket_resource_type import ServiceNowTicketResourceType

body = ServiceNowTicketCreateRequest(
    data=ServiceNowTicketCreateData(
        attributes=ServiceNowTicketCreateAttributes(
            assignment_group="IT Support",
            instance_name="my-instance",
        ),
        type=ServiceNowTicketResourceType.TICKETS,
    ),
)

configuration = Configuration()
configuration.unstable_operations["create_case_service_now_ticket"] = True
with ApiClient(configuration) as api_client:
    api_instance = CaseManagementApi(api_client)
    api_instance.create_case_service_now_ticket(case_id="case_id", body=body)

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Create ServiceNow ticket for case returns "Accepted" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.create_case_service_now_ticket".to_sym] = true
end
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

body = DatadogAPIClient::V2::ServiceNowTicketCreateRequest.new({
  data: DatadogAPIClient::V2::ServiceNowTicketCreateData.new({
    attributes: DatadogAPIClient::V2::ServiceNowTicketCreateAttributes.new({
      assignment_group: "IT Support",
      instance_name: "my-instance",
    }),
    type: DatadogAPIClient::V2::ServiceNowTicketResourceType::TICKETS,
  }),
})
p api_instance.create_case_service_now_ticket("case_id", body)

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Create ServiceNow ticket for case returns "Accepted" response

package main

import (
	"context"
	"fmt"
	"os"

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

func main() {
	body := datadogV2.ServiceNowTicketCreateRequest{
		Data: datadogV2.ServiceNowTicketCreateData{
			Attributes: datadogV2.ServiceNowTicketCreateAttributes{
				AssignmentGroup: datadog.PtrString("IT Support"),
				InstanceName:    "my-instance",
			},
			Type: datadogV2.SERVICENOWTICKETRESOURCETYPE_TICKETS,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.CreateCaseServiceNowTicket", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCaseManagementApi(apiClient)
	r, err := api.CreateCaseServiceNowTicket(ctx, "case_id", body)

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

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Create ServiceNow ticket for case returns "Accepted" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.ServiceNowTicketCreateAttributes;
import com.datadog.api.client.v2.model.ServiceNowTicketCreateData;
import com.datadog.api.client.v2.model.ServiceNowTicketCreateRequest;
import com.datadog.api.client.v2.model.ServiceNowTicketResourceType;

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

    ServiceNowTicketCreateRequest body =
        new ServiceNowTicketCreateRequest()
            .data(
                new ServiceNowTicketCreateData()
                    .attributes(
                        new ServiceNowTicketCreateAttributes()
                            .assignmentGroup("IT Support")
                            .instanceName("my-instance"))
                    .type(ServiceNowTicketResourceType.TICKETS));

    try {
      apiInstance.createCaseServiceNowTicket("f98a5a5b-e0ff-45d4-b2f5-afe6e74de504", body);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseManagementApi#createCaseServiceNowTicket");
      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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// Create ServiceNow ticket for case returns "Accepted" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
use datadog_api_client::datadogV2::model::ServiceNowTicketCreateAttributes;
use datadog_api_client::datadogV2::model::ServiceNowTicketCreateData;
use datadog_api_client::datadogV2::model::ServiceNowTicketCreateRequest;
use datadog_api_client::datadogV2::model::ServiceNowTicketResourceType;

#[tokio::main]
async fn main() {
    let body = ServiceNowTicketCreateRequest::new(ServiceNowTicketCreateData::new(
        ServiceNowTicketCreateAttributes::new("my-instance".to_string())
            .assignment_group("IT Support".to_string()),
        ServiceNowTicketResourceType::TICKETS,
    ));
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.CreateCaseServiceNowTicket", true);
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api
        .create_case_service_now_ticket("case_id".to_string(), body)
        .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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Create ServiceNow ticket for case returns "Accepted" response
 */

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

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

const params: v2.CaseManagementApiCreateCaseServiceNowTicketRequest = {
  body: {
    data: {
      attributes: {
        assignmentGroup: "IT Support",
        instanceName: "my-instance",
      },
      type: "tickets",
    },
  },
  caseId: "case_id",
};

apiInstance
  .createCaseServiceNowTicket(params)
  .then((data: any) => {
    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"

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

POST https://api.ap1.datadoghq.com/api/v2/cases/{case_id}/relationships/notebookhttps://api.ap2.datadoghq.com/api/v2/cases/{case_id}/relationships/notebookhttps://api.datadoghq.eu/api/v2/cases/{case_id}/relationships/notebookhttps://api.ddog-gov.com/api/v2/cases/{case_id}/relationships/notebookhttps://api.us2.ddog-gov.com/api/v2/cases/{case_id}/relationships/notebookhttps://api.datadoghq.com/api/v2/cases/{case_id}/relationships/notebookhttps://api.us3.datadoghq.com/api/v2/cases/{case_id}/relationships/notebookhttps://api.us5.datadoghq.com/api/v2/cases/{case_id}/relationships/notebook

Información general

Create a new investigation notebook and link it to a case

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

case_id [required]

string

Case’s UUID or key

Solicitud

Body Data (required)

Notebook creation request

Expand All

Campo

Tipo

Descripción

data [required]

object

Notebook creation data

type [required]

enum

Notebook resource type Allowed enum values: notebook

{
  "data": {
    "type": "notebook"
  }
}

Respuesta

No Content

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

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"
    }
  ]
}

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

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"
    }
  ]
}

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

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

Campo

Tipo

Descripción

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

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  ## default
# 

# Path parameters
export case_id="f98a5a5b-e0ff-45d4-b2f5-afe6e74de504"
# Curl command
curl -X POST "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/${case_id}/relationships/notebook" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "type": "notebook" } } EOF
"""
Create investigation notebook for case returns "No Content" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi
from datadog_api_client.v2.model.notebook_create_data import NotebookCreateData
from datadog_api_client.v2.model.notebook_create_request import NotebookCreateRequest
from datadog_api_client.v2.model.notebook_resource_type import NotebookResourceType

body = NotebookCreateRequest(
    data=NotebookCreateData(
        type=NotebookResourceType.NOTEBOOK,
    ),
)

configuration = Configuration()
configuration.unstable_operations["create_case_notebook"] = True
with ApiClient(configuration) as api_client:
    api_instance = CaseManagementApi(api_client)
    api_instance.create_case_notebook(case_id="case_id", body=body)

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Create investigation notebook for case returns "No Content" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.create_case_notebook".to_sym] = true
end
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

body = DatadogAPIClient::V2::NotebookCreateRequest.new({
  data: DatadogAPIClient::V2::NotebookCreateData.new({
    type: DatadogAPIClient::V2::NotebookResourceType::NOTEBOOK,
  }),
})
api_instance.create_case_notebook("case_id", body)

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Create investigation notebook for case returns "No Content" response

package main

import (
	"context"
	"fmt"
	"os"

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

func main() {
	body := datadogV2.NotebookCreateRequest{
		Data: datadogV2.NotebookCreateData{
			Type: datadogV2.NOTEBOOKRESOURCETYPE_NOTEBOOK,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.CreateCaseNotebook", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCaseManagementApi(apiClient)
	r, err := api.CreateCaseNotebook(ctx, "case_id", body)

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

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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Create investigation notebook for case returns "No Content" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.NotebookCreateData;
import com.datadog.api.client.v2.model.NotebookCreateRequest;
import com.datadog.api.client.v2.model.NotebookResourceType;

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

    NotebookCreateRequest body =
        new NotebookCreateRequest()
            .data(new NotebookCreateData().type(NotebookResourceType.NOTEBOOK));

    try {
      apiInstance.createCaseNotebook("f98a5a5b-e0ff-45d4-b2f5-afe6e74de504", body);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseManagementApi#createCaseNotebook");
      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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// Create investigation notebook for case returns "No Content" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
use datadog_api_client::datadogV2::model::NotebookCreateData;
use datadog_api_client::datadogV2::model::NotebookCreateRequest;
use datadog_api_client::datadogV2::model::NotebookResourceType;

#[tokio::main]
async fn main() {
    let body = NotebookCreateRequest::new(NotebookCreateData::new(NotebookResourceType::NOTEBOOK));
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.CreateCaseNotebook", true);
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.create_case_notebook("case_id".to_string(), body).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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Create investigation notebook for case returns "No Content" response
 */

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

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

const params: v2.CaseManagementApiCreateCaseNotebookRequest = {
  body: {
    data: {
      type: "notebook",
    },
  },
  caseId: "case_id",
};

apiInstance
  .createCaseNotebook(params)
  .then((data: any) => {
    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.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"

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/cases/{case_id}/timelineshttps://api.ap2.datadoghq.com/api/v2/cases/{case_id}/timelineshttps://api.datadoghq.eu/api/v2/cases/{case_id}/timelineshttps://api.ddog-gov.com/api/v2/cases/{case_id}/timelineshttps://api.us2.ddog-gov.com/api/v2/cases/{case_id}/timelineshttps://api.datadoghq.com/api/v2/cases/{case_id}/timelineshttps://api.us3.datadoghq.com/api/v2/cases/{case_id}/timelineshttps://api.us5.datadoghq.com/api/v2/cases/{case_id}/timelines

Información general

Returns the timeline of events for a case, including comments, status changes, and other activity. Supports pagination and sort order.

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

case_id [required]

string

Case’s UUID or key

Cadenas de consulta

Nombre

Tipo

Descripción

page[size]

integer

Number of timeline cells to return per page.

page[number]

integer

Zero-based page number for pagination.

sort[ascending]

boolean

If true, returns timeline cells in chronological order (oldest first). Defaults to false (newest first).

Respuesta

OK

Response containing the chronological list of timeline cells for a case.

Expand All

Campo

Tipo

Descripción

data

[object]

The TimelineResponse data.

attributes [required]

object

Attributes of a timeline cell, representing a single event in a case's chronological activity log (for example, a comment, status change, or assignment update).

author

 <oneOf>

The author of the timeline cell. Currently only user authors are supported.

Option 1

object

A user who authored a timeline cell.

content

object

Profile information for the user who authored the timeline cell.

email

string

The email address of the user.

handle

string

The Datadog handle of the user.

id

string

The UUID of the user.

name

string

The display name of the user.

type

enum

The type of timeline cell author. Currently only USER is supported. Allowed enum values: USER

cell_content

 <oneOf>

The content payload of a timeline cell, varying by cell type.

Option 1

object

The content of a comment timeline cell.

message

string

The text content of the comment. Supports Markdown formatting.

created_at

date-time

Timestamp of when the cell was created

deleted_at

date-time

Timestamp of when the cell was deleted

modified_at

date-time

Timestamp of when the cell was last modified

type

enum

The type of content in the timeline cell. Currently only COMMENT is supported in this endpoint. Allowed enum values: COMMENT

id [required]

string

Timeline cell's identifier

type [required]

enum

JSON:API resource type for timeline cells. Allowed enum values: timeline_cell

default: timeline_cell

{
  "data": [
    {
      "attributes": {
        "author": {
          "content": {
            "email": "string",
            "handle": "string",
            "id": "string",
            "name": "string"
          },
          "type": "USER"
        },
        "cell_content": {
          "message": "string"
        },
        "created_at": "2019-09-19T10:00:00.000Z",
        "deleted_at": "2019-09-19T10:00:00.000Z",
        "modified_at": "2019-09-19T10:00:00.000Z",
        "type": "COMMENT"
      },
      "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
      "type": "timeline_cell"
    }
  ]
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  # Path parameters
export case_id="f98a5a5b-e0ff-45d4-b2f5-afe6e74de504"
# 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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/${case_id}/timelines" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

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/cases/viewshttps://api.ap2.datadoghq.com/api/v2/cases/viewshttps://api.datadoghq.eu/api/v2/cases/viewshttps://api.ddog-gov.com/api/v2/cases/viewshttps://api.us2.ddog-gov.com/api/v2/cases/viewshttps://api.datadoghq.com/api/v2/cases/viewshttps://api.us3.datadoghq.com/api/v2/cases/viewshttps://api.us5.datadoghq.com/api/v2/cases/views

Información general

Returns all saved case views for a given project. Views are saved search queries that allow quick access to filtered lists of cases.

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

Argumentos

Cadenas de consulta

Nombre

Tipo

Descripción

project_id [required]

string

Filter views by project identifier.

Respuesta

OK

Response containing a list of case views.

Expand All

Campo

Tipo

Descripción

data [required]

[object]

A list of case views.

attributes [required]

object

Attributes of a case view, including the filter query and optional notification rule.

created_at [required]

date-time

Timestamp when the view was created.

modified_at

date-time

Timestamp when the view was last modified.

name [required]

string

A human-readable name for the view, displayed in the Case Management UI.

np_rule_id

string

The identifier of a notification rule linked to this view. When set, users subscribed to the view receive alerts for matching cases.

query [required]

string

The search query that determines which cases appear in this view. Uses the same syntax as the Case Management search bar (for example, status:open priority:P1).

id [required]

string

The view's identifier.

relationships

object

Related resources for the case view, including the creator, last modifier, and associated project.

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

project

object

Relationship to project.

data [required]

object

Relationship to project object.

id [required]

string

A unique identifier that represents the project.

type [required]

enum

Project resource type. Allowed enum values: project

default: project

type [required]

enum

JSON:API resource type for case views. Allowed enum values: view

default: view

{
  "data": [
    {
      "attributes": {
        "created_at": "2024-01-01T00:00:00.000Z",
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "Open bugs",
        "np_rule_id": "string",
        "query": "status:open type:bug"
      },
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "relationships": {
        "created_by": {
          "data": {
            "id": "00000000-0000-0000-0000-000000000000",
            "type": "user"
          }
        },
        "modified_by": {
          "data": {
            "id": "00000000-0000-0000-0000-000000000000",
            "type": "user"
          }
        },
        "project": {
          "data": {
            "id": "e555e290-ed65-49bd-ae18-8acbfcf18db7",
            "type": "project"
          }
        }
      },
      "type": "view"
    }
  ]
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  # Required query arguments
export project_id="e555e290-ed65-49bd-ae18-8acbfcf18db7"
# 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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/views?project_id=${project_id}" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

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

POST https://api.ap1.datadoghq.com/api/v2/cases/viewshttps://api.ap2.datadoghq.com/api/v2/cases/viewshttps://api.datadoghq.eu/api/v2/cases/viewshttps://api.ddog-gov.com/api/v2/cases/viewshttps://api.us2.ddog-gov.com/api/v2/cases/viewshttps://api.datadoghq.com/api/v2/cases/viewshttps://api.us3.datadoghq.com/api/v2/cases/viewshttps://api.us5.datadoghq.com/api/v2/cases/views

Información general

Creates a new saved case view with a name, filter query, and associated project. Optionally, a notification rule can be linked to the view.

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

Solicitud

Body Data (required)

Case view payload.

Expand All

Campo

Tipo

Descripción

data [required]

object

Data object for creating a case view.

attributes [required]

object

Attributes required to create a case view.

name [required]

string

The name of the view.

np_rule_id

string

The identifier of a notification rule linked to this view. When set, users subscribed to the view receive alerts for matching cases.

project_id [required]

string

The UUID of the project this view belongs to. Views are scoped to a single project.

query [required]

string

The query used to filter cases in this view.

type [required]

enum

JSON:API resource type for case views. Allowed enum values: view

default: view

{
  "data": {
    "attributes": {
      "name": "Open bugs",
      "np_rule_id": "string",
      "project_id": "e555e290-ed65-49bd-ae18-8acbfcf18db7",
      "query": "status:open type:bug"
    },
    "type": "view"
  }
}

Respuesta

Created

Response containing a single case view.

Expand All

Campo

Tipo

Descripción

data [required]

object

A saved case view that provides a filtered, reusable list of cases matching a specific query. Views act as persistent dashboards for monitoring case subsets.

attributes [required]

object

Attributes of a case view, including the filter query and optional notification rule.

created_at [required]

date-time

Timestamp when the view was created.

modified_at

date-time

Timestamp when the view was last modified.

name [required]

string

A human-readable name for the view, displayed in the Case Management UI.

np_rule_id

string

The identifier of a notification rule linked to this view. When set, users subscribed to the view receive alerts for matching cases.

query [required]

string

The search query that determines which cases appear in this view. Uses the same syntax as the Case Management search bar (for example, status:open priority:P1).

id [required]

string

The view's identifier.

relationships

object

Related resources for the case view, including the creator, last modifier, and associated project.

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

project

object

Relationship to project.

data [required]

object

Relationship to project object.

id [required]

string

A unique identifier that represents the project.

type [required]

enum

Project resource type. Allowed enum values: project

default: project

type [required]

enum

JSON:API resource type for case views. Allowed enum values: view

default: view

{
  "data": {
    "attributes": {
      "created_at": "2024-01-01T00:00:00.000Z",
      "modified_at": "2019-09-19T10:00:00.000Z",
      "name": "Open bugs",
      "np_rule_id": "string",
      "query": "status:open type:bug"
    },
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "relationships": {
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "project": {
        "data": {
          "id": "e555e290-ed65-49bd-ae18-8acbfcf18db7",
          "type": "project"
        }
      }
    },
    "type": "view"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  ## default
# 

# Curl command
curl -X POST "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/views" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "name": "Open bugs", "project_id": "e555e290-ed65-49bd-ae18-8acbfcf18db7", "query": "status:open type:bug" }, "type": "view" } } EOF

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/cases/views/{view_id}https://api.ap2.datadoghq.com/api/v2/cases/views/{view_id}https://api.datadoghq.eu/api/v2/cases/views/{view_id}https://api.ddog-gov.com/api/v2/cases/views/{view_id}https://api.us2.ddog-gov.com/api/v2/cases/views/{view_id}https://api.datadoghq.com/api/v2/cases/views/{view_id}https://api.us3.datadoghq.com/api/v2/cases/views/{view_id}https://api.us5.datadoghq.com/api/v2/cases/views/{view_id}

Información general

Returns a single saved case view identified by its UUID, including its query, associated project, and timestamps.

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

view_id [required]

string

The UUID of the case view.

Respuesta

OK

Response containing a single case view.

Expand All

Campo

Tipo

Descripción

data [required]

object

A saved case view that provides a filtered, reusable list of cases matching a specific query. Views act as persistent dashboards for monitoring case subsets.

attributes [required]

object

Attributes of a case view, including the filter query and optional notification rule.

created_at [required]

date-time

Timestamp when the view was created.

modified_at

date-time

Timestamp when the view was last modified.

name [required]

string

A human-readable name for the view, displayed in the Case Management UI.

np_rule_id

string

The identifier of a notification rule linked to this view. When set, users subscribed to the view receive alerts for matching cases.

query [required]

string

The search query that determines which cases appear in this view. Uses the same syntax as the Case Management search bar (for example, status:open priority:P1).

id [required]

string

The view's identifier.

relationships

object

Related resources for the case view, including the creator, last modifier, and associated project.

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

project

object

Relationship to project.

data [required]

object

Relationship to project object.

id [required]

string

A unique identifier that represents the project.

type [required]

enum

Project resource type. Allowed enum values: project

default: project

type [required]

enum

JSON:API resource type for case views. Allowed enum values: view

default: view

{
  "data": {
    "attributes": {
      "created_at": "2024-01-01T00:00:00.000Z",
      "modified_at": "2019-09-19T10:00:00.000Z",
      "name": "Open bugs",
      "np_rule_id": "string",
      "query": "status:open type:bug"
    },
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "relationships": {
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "project": {
        "data": {
          "id": "e555e290-ed65-49bd-ae18-8acbfcf18db7",
          "type": "project"
        }
      }
    },
    "type": "view"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  # Path parameters
export view_id="a1b2c3d4-e5f6-7890-abcd-ef1234567890"
# 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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/views/${view_id}" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

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

PUT https://api.ap1.datadoghq.com/api/v2/cases/views/{view_id}https://api.ap2.datadoghq.com/api/v2/cases/views/{view_id}https://api.datadoghq.eu/api/v2/cases/views/{view_id}https://api.ddog-gov.com/api/v2/cases/views/{view_id}https://api.us2.ddog-gov.com/api/v2/cases/views/{view_id}https://api.datadoghq.com/api/v2/cases/views/{view_id}https://api.us3.datadoghq.com/api/v2/cases/views/{view_id}https://api.us5.datadoghq.com/api/v2/cases/views/{view_id}

Información general

Updates the name, query, or notification rule of an existing case view.

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

view_id [required]

string

The UUID of the case view.

Solicitud

Body Data (required)

Case view payload.

Expand All

Campo

Tipo

Descripción

data [required]

object

Data object for updating a case view.

attributes

object

Attributes that can be updated on a case view. All fields are optional; only provided fields are changed.

name

string

The name of the view.

np_rule_id

string

The identifier of a notification rule linked to this view. When set, users subscribed to the view receive alerts for matching cases.

query

string

The query used to filter cases in this view.

type [required]

enum

JSON:API resource type for case views. Allowed enum values: view

default: view

{
  "data": {
    "attributes": {
      "name": "string",
      "np_rule_id": "string",
      "query": "string"
    },
    "type": "view"
  }
}

Respuesta

OK

Response containing a single case view.

Expand All

Campo

Tipo

Descripción

data [required]

object

A saved case view that provides a filtered, reusable list of cases matching a specific query. Views act as persistent dashboards for monitoring case subsets.

attributes [required]

object

Attributes of a case view, including the filter query and optional notification rule.

created_at [required]

date-time

Timestamp when the view was created.

modified_at

date-time

Timestamp when the view was last modified.

name [required]

string

A human-readable name for the view, displayed in the Case Management UI.

np_rule_id

string

The identifier of a notification rule linked to this view. When set, users subscribed to the view receive alerts for matching cases.

query [required]

string

The search query that determines which cases appear in this view. Uses the same syntax as the Case Management search bar (for example, status:open priority:P1).

id [required]

string

The view's identifier.

relationships

object

Related resources for the case view, including the creator, last modifier, and associated project.

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

project

object

Relationship to project.

data [required]

object

Relationship to project object.

id [required]

string

A unique identifier that represents the project.

type [required]

enum

Project resource type. Allowed enum values: project

default: project

type [required]

enum

JSON:API resource type for case views. Allowed enum values: view

default: view

{
  "data": {
    "attributes": {
      "created_at": "2024-01-01T00:00:00.000Z",
      "modified_at": "2019-09-19T10:00:00.000Z",
      "name": "Open bugs",
      "np_rule_id": "string",
      "query": "status:open type:bug"
    },
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "relationships": {
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "project": {
        "data": {
          "id": "e555e290-ed65-49bd-ae18-8acbfcf18db7",
          "type": "project"
        }
      }
    },
    "type": "view"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  ## default
# 

# Path parameters
export view_id="a1b2c3d4-e5f6-7890-abcd-ef1234567890"
# Curl command
curl -X PUT "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/views/${view_id}" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "name": "Updated view name" }, "type": "view" } } EOF

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

DELETE https://api.ap1.datadoghq.com/api/v2/cases/views/{view_id}https://api.ap2.datadoghq.com/api/v2/cases/views/{view_id}https://api.datadoghq.eu/api/v2/cases/views/{view_id}https://api.ddog-gov.com/api/v2/cases/views/{view_id}https://api.us2.ddog-gov.com/api/v2/cases/views/{view_id}https://api.datadoghq.com/api/v2/cases/views/{view_id}https://api.us3.datadoghq.com/api/v2/cases/views/{view_id}https://api.us5.datadoghq.com/api/v2/cases/views/{view_id}

Información general

Permanently deletes a saved case view.

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

view_id [required]

string

The UUID of the case view.

Respuesta

No Content

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  # Path parameters
export view_id="a1b2c3d4-e5f6-7890-abcd-ef1234567890"
# Curl command
curl -X DELETE "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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/views/${view_id}" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

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/cases/{case_id}/watchershttps://api.ap2.datadoghq.com/api/v2/cases/{case_id}/watchershttps://api.datadoghq.eu/api/v2/cases/{case_id}/watchershttps://api.ddog-gov.com/api/v2/cases/{case_id}/watchershttps://api.us2.ddog-gov.com/api/v2/cases/{case_id}/watchershttps://api.datadoghq.com/api/v2/cases/{case_id}/watchershttps://api.us3.datadoghq.com/api/v2/cases/{case_id}/watchershttps://api.us5.datadoghq.com/api/v2/cases/{case_id}/watchers

Información general

Returns the list of users who are watching a case. Watchers receive notifications about updates to the case.

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

case_id [required]

string

Case’s UUID or key

Respuesta

OK

Response containing the list of users watching a case.

Expand All

Campo

Tipo

Descripción

data [required]

[object]

List of case watchers.

id [required]

string

The primary identifier of the case watcher.

relationships [required]

object

Relationships for a case watcher, linking to the underlying user resource.

user [required]

object

The user relationship for a case watcher.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

User resource type. Allowed enum values: user

default: user

type [required]

enum

JSON:API resource type for case watchers. Allowed enum values: watcher

default: watcher

{
  "data": [
    {
      "id": "8146583c-0b5f-11ec-abf8-da7ad0900001",
      "relationships": {
        "user": {
          "data": {
            "id": "00000000-0000-0000-0000-000000000000",
            "type": "user"
          }
        }
      },
      "type": "watcher"
    }
  ]
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  # Path parameters
export case_id="f98a5a5b-e0ff-45d4-b2f5-afe6e74de504"
# 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.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/${case_id}/watchers" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

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

POST https://api.ap1.datadoghq.com/api/v2/cases/{case_id}/watchers/{user_uuid}https://api.ap2.datadoghq.com/api/v2/cases/{case_id}/watchers/{user_uuid}https://api.datadoghq.eu/api/v2/cases/{case_id}/watchers/{user_uuid}https://api.ddog-gov.com/api/v2/cases/{case_id}/watchers/{user_uuid}https://api.us2.ddog-gov.com/api/v2/cases/{case_id}/watchers/{user_uuid}https://api.datadoghq.com/api/v2/cases/{case_id}/watchers/{user_uuid}https://api.us3.datadoghq.com/api/v2/cases/{case_id}/watchers/{user_uuid}https://api.us5.datadoghq.com/api/v2/cases/{case_id}/watchers/{user_uuid}

Información general

Adds a user (identified by their UUID) as a watcher of a case. The user receives notifications about subsequent updates to the case.

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

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

case_id [required]

string

Case’s UUID or key

user_uuid [required]

string

The UUID of the user to add or remove as a watcher.

Respuesta

Created

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error respon