Create a project

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

Overview

Create a project.

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

Request

Body Data (required)

Project payload.

Expand All

Field

Type

Description

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"
  }
}

Response

CREATED

Project response.

Expand All

Field

Type

Description

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

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Code Example

                  ## 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"