Create an incident ServiceNow record
https://api.datadoghq.com/api/v2/incidents/{incident_id}/servicenow-recordshttps://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/servicenow-recordshttps://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/servicenow-recordshttps://api.datadoghq.eu/api/v2/incidents/{incident_id}/servicenow-recordshttps://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/servicenow-recordshttps://api.ap2.datadoghq.com/api/v2/incidents/{incident_id}/servicenow-recordshttps://api.uk1.datadoghq.com/api/v2/incidents/{incident_id}/servicenow-recordshttps://api.ddog-gov.com/api/v2/incidents/{incident_id}/servicenow-recordshttps://api.us2.ddog-gov.com/api/v2/incidents/{incident_id}/servicenow-recordsOverview
Create a ServiceNow record for an incident.
OAuth apps require the incident_write authorization scope to access this endpoint.
Arguments
Path Parameters
incident_id [required]The UUID of the incident.
Request
Body Data (required)
ServiceNow record payload.
data [required]ServiceNow record data in a create request.
attributes [required]Attributes for creating a ServiceNow record for an incident.
assignment_group [required]The ServiceNow assignment group.
configuration_item_mapping [required]The ServiceNow configuration item mapping.
instance_name [required]The ServiceNow instance name.
record_idAn existing ServiceNow record ID (Sys ID) to link instead of creating a new record.
type [required]ServiceNow record prompt resource type.
incident_servicenow_record_prompt{
"data": {
"attributes": {
"assignment_group": "IT Support",
"configuration_item_mapping": "my-service",
"instance_name": "my-instance"
},
"type": "incident_servicenow_record_prompt"
}
}Response
Created
Response with an incident integration metadata.
data [required]Incident integration metadata from a response.
attributesIncident integration metadata's attributes for a create request.
createdTimestamp when the incident todo was created.
incident_idUUID of the incident this integration metadata is connected to.
integration_type [required]A number indicating the type of integration this metadata is for. 1 indicates Slack; 7 indicates Microsoft Teams; 8 indicates Jira.
metadata [required]Incident integration metadata's metadata attribute.
Object 1Incident integration metadata for the Slack integration.
channels [required]Array of Slack channels in this integration metadata.
channel_id [required]Slack channel ID.
channel_name [required]Name of the Slack channel.
redirect_url [required]URL redirecting to the Slack channel.
team_idSlack team ID.
Object 2Incident integration metadata for the Jira integration.
issues [required]Array of Jira issues in this integration metadata.
account [required]URL of issue's Jira account.
issue_keyJira issue's issue key.
issuetype_idJira issue's issue type.
project_key [required]Jira issue's project keys.
redirect_urlURL redirecting to the Jira issue.
Object 3Incident integration metadata for the Microsoft Teams integration.
teams [required]Array of Microsoft Teams in this integration metadata.
ms_channel_id [required]Microsoft Teams channel ID.
ms_channel_name [required]Microsoft Teams channel name.
ms_tenant_id [required]Microsoft Teams tenant ID.
redirect_url [required]URL redirecting to the Microsoft Teams channel.
modifiedTimestamp when the incident todo was last modified.
statusA number indicating the status of this integration metadata. 0 indicates unknown; 1 indicates pending; 2 indicates complete; 3 indicates manually created; 4 indicates manually updated; 5 indicates failed.
id [required]The incident integration metadata's ID.
relationshipsThe incident's integration relationships from a response.
created_by_userRelationship to user.
data [required]Relationship to user object.
id [required]A unique identifier that represents the user.
type [required]Users resource type.
usersuserslast_modified_by_userRelationship to user.
data [required]Relationship to user object.
id [required]A unique identifier that represents the user.
type [required]Users resource type.
usersuserstype [required]Integration metadata resource type.
incident_integrationsincident_integrationsincludedIncluded related resources that the user requested.
<type=users>User object returned by the API.
attributesAttributes of user object returned by the API.
created_atThe ISO 8601 timestamp of when the user account was created.
disabledWhether the user account is deactivated. Disabled users cannot log in.
emailThe email address of the user, used for login and notifications.
handleThe unique handle (username) of the user, typically matching their email prefix.
iconURL of the user's profile icon, typically a Gravatar URL derived from the email address.
last_login_timeThe ISO 8601 timestamp of the user's most recent login, or null if the user has never logged in.
mfa_enabledWhether multi-factor authentication (MFA) is enabled for the user's account.
modified_atThe ISO 8601 timestamp of when the user account was last modified.
nameThe full display name of the user as shown in the Datadog UI.
service_accountWhether this is a service account rather than a human user. Service accounts are used for programmatic API access.
statusThe current status of the user account (for example, Active, Pending, or Disabled).
titleThe job title of the user (for example, "Senior Engineer" or "Product Manager").
uuidThe globally unique identifier (UUID) of the user.
verifiedWhether the user's email address has been verified.
idID of the user.
relationshipsRelationships of the user object returned by the API.
orgRelationship to an organization.
data [required]Relationship to organization object.
id [required]ID of the organization.
type [required]Organizations resource type.
orgsorgsother_orgsRelationship to organizations.
data [required]Relationships to organization objects.
id [required]ID of the organization.
type [required]Organizations resource type.
orgsorgsother_usersRelationship to users.
data [required]Relationships to user objects.
id [required]A unique identifier that represents the user.
type [required]Users resource type.
usersusersrolesRelationship to roles.
dataAn array containing type and the unique identifier of a role.
idThe unique identifier of the role.
typeRoles type.
rolesrolestypeUsers resource type.
usersusers{
"data": {
"attributes": {
"created": "2019-09-19T10:00:00.000Z",
"incident_id": "00000000-aaaa-0000-0000-000000000000",
"integration_type": 1,
"metadata": {
"channels": [
{
"channel_id": "C0123456789",
"channel_name": "#example-channel-name",
"redirect_url": "https://slack.com/app_redirect?channel=C0123456789&team=T01234567",
"team_id": "T01234567"
}
]
},
"modified": "2019-09-19T10:00:00.000Z",
"status": "integer"
},
"id": "00000000-0000-0000-1234-000000000000",
"relationships": {
"created_by_user": {
"data": {
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
},
"last_modified_by_user": {
"data": {
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
}
},
"type": "incident_integrations"
},
"included": [
{
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"disabled": false,
"email": "string",
"handle": "string",
"icon": "string",
"last_login_time": "2019-09-19T10:00:00.000Z",
"mfa_enabled": false,
"modified_at": "2019-09-19T10:00:00.000Z",
"name": "string",
"service_account": false,
"status": "string",
"title": "string",
"uuid": "string",
"verified": false
},
"id": "string",
"relationships": {
"org": {
"data": {
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
},
"other_orgs": {
"data": [
{
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
]
},
"other_users": {
"data": [
{
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
]
},
"roles": {
"data": [
{
"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
"type": "roles"
}
]
}
},
"type": "users"
}
]
}Bad Request
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Unauthorized
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Forbidden
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Not Found
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Too many requests
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Code Example
# Path parameters
export incident_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/incidents/${incident_id}/servicenow-records" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"assignment_group": "IT Support",
"configuration_item_mapping": "my-service",
"instance_name": "my-instance"
},
"type": "incident_servicenow_record_prompt"
}
}
EOF# Path parameters
export incident_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/incidents/${incident_id}/servicenow-records" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"assignment_group": "IT Support",
"configuration_item_mapping": "my-service",
"instance_name": "my-instance"
},
"type": "incident_servicenow_record_prompt"
}
}
EOF# Path parameters
export incident_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/incidents/${incident_id}/servicenow-records" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"assignment_group": "IT Support",
"configuration_item_mapping": "my-service",
"instance_name": "my-instance"
},
"type": "incident_servicenow_record_prompt"
}
}
EOF# Path parameters
export incident_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/incidents/${incident_id}/servicenow-records" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"assignment_group": "IT Support",
"configuration_item_mapping": "my-service",
"instance_name": "my-instance"
},
"type": "incident_servicenow_record_prompt"
}
}
EOF# Path parameters
export incident_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/incidents/${incident_id}/servicenow-records" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"assignment_group": "IT Support",
"configuration_item_mapping": "my-service",
"instance_name": "my-instance"
},
"type": "incident_servicenow_record_prompt"
}
}
EOF# Path parameters
export incident_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/incidents/${incident_id}/servicenow-records" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"assignment_group": "IT Support",
"configuration_item_mapping": "my-service",
"instance_name": "my-instance"
},
"type": "incident_servicenow_record_prompt"
}
}
EOF# Path parameters
export incident_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/incidents/${incident_id}/servicenow-records" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"assignment_group": "IT Support",
"configuration_item_mapping": "my-service",
"instance_name": "my-instance"
},
"type": "incident_servicenow_record_prompt"
}
}
EOF# Path parameters
export incident_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/incidents/${incident_id}/servicenow-records" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"assignment_group": "IT Support",
"configuration_item_mapping": "my-service",
"instance_name": "my-instance"
},
"type": "incident_servicenow_record_prompt"
}
}
EOF# Path parameters
export incident_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/incidents/${incident_id}/servicenow-records" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"assignment_group": "IT Support",
"configuration_item_mapping": "my-service",
"instance_name": "my-instance"
},
"type": "incident_servicenow_record_prompt"
}
}
EOF