For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/ko/api/latest/service-definition/create-or-update-service-definition.md. A documentation index is available at /llms.txt.
Language
Datadog site

서비스 정의 생성 또는 업데이트

POSThttps://api.datadoghq.com/api/v2/services/definitionshttps://api.us3.datadoghq.com/api/v2/services/definitionshttps://api.us5.datadoghq.com/api/v2/services/definitionshttps://api.datadoghq.eu/api/v2/services/definitionshttps://api.ap1.datadoghq.com/api/v2/services/definitionshttps://api.ap2.datadoghq.com/api/v2/services/definitionshttps://api.uk1.datadoghq.com/api/v2/services/definitionshttps://api.ddog-gov.com/api/v2/services/definitionshttps://api.us2.ddog-gov.com/api/v2/services/definitions

개요

Datadog Service Catalog에서 서비스 정의를 생성하거나 업데이트합니다.

This endpoint requires the apm_service_catalog_write permission.

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

요청

Body Data (required)

서비스 정의 YAML/JSON.

항목
유형
설명
Option 1
object

서비스 정의 만들기 요청입니다.

Option 2
object

Service definition v2.1 for providing service metadata and integrations.

Option 3
object

Service definition V2 for providing service metadata and integrations.

Option 4
string

Service Definition in raw JSON/YAML representation.

응답

CREATED

Create service definitions response.

항목
유형
설명
data
[object]

Create service definitions response payload.

코드 예시

Create or update service definition using schema v2 returns "CREATED" response
# 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/services/definitions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "contacts": [
    {
      "contact": "contact@datadoghq.com",
      "name": "Team Email",
      "type": "email"
    }
  ],
  "dd-service": "service-exampleservicedefinition",
  "dd-team": "my-team",
  "docs": [
    {
      "name": "Architecture",
      "provider": "google drive",
      "url": "https://gdrive/mydoc"
    }
  ],
  "extensions": {
    "myorgextension": "extensionvalue"
  },
  "integrations": {
    "opsgenie": {
      "region": "US",
      "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
    },
    "pagerduty": "https://my-org.pagerduty.com/service-directory/PMyService"
  },
  "links": [
    {
      "name": "Runbook",
      "type": "runbook",
      "url": "https://my-runbook"
    }
  ],
  "repos": [
    {
      "name": "Source Code",
      "provider": "GitHub",
      "url": "https://github.com/DataDog/schema"
    }
  ],
  "schema-version": "v2",
  "tags": [
    "my:tag",
    "service:tag"
  ],
  "team": "my-team"
}
EOF
# 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/services/definitions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "contacts": [
    {
      "contact": "contact@datadoghq.com",
      "name": "Team Email",
      "type": "email"
    }
  ],
  "dd-service": "service-exampleservicedefinition",
  "dd-team": "my-team",
  "docs": [
    {
      "name": "Architecture",
      "provider": "google drive",
      "url": "https://gdrive/mydoc"
    }
  ],
  "extensions": {
    "myorgextension": "extensionvalue"
  },
  "integrations": {
    "opsgenie": {
      "region": "US",
      "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
    },
    "pagerduty": "https://my-org.pagerduty.com/service-directory/PMyService"
  },
  "links": [
    {
      "name": "Runbook",
      "type": "runbook",
      "url": "https://my-runbook"
    }
  ],
  "repos": [
    {
      "name": "Source Code",
      "provider": "GitHub",
      "url": "https://github.com/DataDog/schema"
    }
  ],
  "schema-version": "v2",
  "tags": [
    "my:tag",
    "service:tag"
  ],
  "team": "my-team"
}
EOF
# 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/services/definitions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "contacts": [
    {
      "contact": "contact@datadoghq.com",
      "name": "Team Email",
      "type": "email"
    }
  ],
  "dd-service": "service-exampleservicedefinition",
  "dd-team": "my-team",
  "docs": [
    {
      "name": "Architecture",
      "provider": "google drive",
      "url": "https://gdrive/mydoc"
    }
  ],
  "extensions": {
    "myorgextension": "extensionvalue"
  },
  "integrations": {
    "opsgenie": {
      "region": "US",
      "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
    },
    "pagerduty": "https://my-org.pagerduty.com/service-directory/PMyService"
  },
  "links": [
    {
      "name": "Runbook",
      "type": "runbook",
      "url": "https://my-runbook"
    }
  ],
  "repos": [
    {
      "name": "Source Code",
      "provider": "GitHub",
      "url": "https://github.com/DataDog/schema"
    }
  ],
  "schema-version": "v2",
  "tags": [
    "my:tag",
    "service:tag"
  ],
  "team": "my-team"
}
EOF
# 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/services/definitions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "contacts": [
    {
      "contact": "contact@datadoghq.com",
      "name": "Team Email",
      "type": "email"
    }
  ],
  "dd-service": "service-exampleservicedefinition",
  "dd-team": "my-team",
  "docs": [
    {
      "name": "Architecture",
      "provider": "google drive",
      "url": "https://gdrive/mydoc"
    }
  ],
  "extensions": {
    "myorgextension": "extensionvalue"
  },
  "integrations": {
    "opsgenie": {
      "region": "US",
      "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
    },
    "pagerduty": "https://my-org.pagerduty.com/service-directory/PMyService"
  },
  "links": [
    {
      "name": "Runbook",
      "type": "runbook",
      "url": "https://my-runbook"
    }
  ],
  "repos": [
    {
      "name": "Source Code",
      "provider": "GitHub",
      "url": "https://github.com/DataDog/schema"
    }
  ],
  "schema-version": "v2",
  "tags": [
    "my:tag",
    "service:tag"
  ],
  "team": "my-team"
}
EOF
# 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/services/definitions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "contacts": [
    {
      "contact": "contact@datadoghq.com",
      "name": "Team Email",
      "type": "email"
    }
  ],
  "dd-service": "service-exampleservicedefinition",
  "dd-team": "my-team",
  "docs": [
    {
      "name": "Architecture",
      "provider": "google drive",
      "url": "https://gdrive/mydoc"
    }
  ],
  "extensions": {
    "myorgextension": "extensionvalue"
  },
  "integrations": {
    "opsgenie": {
      "region": "US",
      "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
    },
    "pagerduty": "https://my-org.pagerduty.com/service-directory/PMyService"
  },
  "links": [
    {
      "name": "Runbook",
      "type": "runbook",
      "url": "https://my-runbook"
    }
  ],
  "repos": [
    {
      "name": "Source Code",
      "provider": "GitHub",
      "url": "https://github.com/DataDog/schema"
    }
  ],
  "schema-version": "v2",
  "tags": [
    "my:tag",
    "service:tag"
  ],
  "team": "my-team"
}
EOF
# 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/services/definitions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "contacts": [
    {
      "contact": "contact@datadoghq.com",
      "name": "Team Email",
      "type": "email"
    }
  ],
  "dd-service": "service-exampleservicedefinition",
  "dd-team": "my-team",
  "docs": [
    {
      "name": "Architecture",
      "provider": "google drive",
      "url": "https://gdrive/mydoc"
    }
  ],
  "extensions": {
    "myorgextension": "extensionvalue"
  },
  "integrations": {
    "opsgenie": {
      "region": "US",
      "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
    },
    "pagerduty": "https://my-org.pagerduty.com/service-directory/PMyService"
  },
  "links": [
    {
      "name": "Runbook",
      "type": "runbook",
      "url": "https://my-runbook"
    }
  ],
  "repos": [
    {
      "name": "Source Code",
      "provider": "GitHub",
      "url": "https://github.com/DataDog/schema"
    }
  ],
  "schema-version": "v2",
  "tags": [
    "my:tag",
    "service:tag"
  ],
  "team": "my-team"
}
EOF
# 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/services/definitions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "contacts": [
    {
      "contact": "contact@datadoghq.com",
      "name": "Team Email",
      "type": "email"
    }
  ],
  "dd-service": "service-exampleservicedefinition",
  "dd-team": "my-team",
  "docs": [
    {
      "name": "Architecture",
      "provider": "google drive",
      "url": "https://gdrive/mydoc"
    }
  ],
  "extensions": {
    "myorgextension": "extensionvalue"
  },
  "integrations": {
    "opsgenie": {
      "region": "US",
      "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
    },
    "pagerduty": "https://my-org.pagerduty.com/service-directory/PMyService"
  },
  "links": [
    {
      "name": "Runbook",
      "type": "runbook",
      "url": "https://my-runbook"
    }
  ],
  "repos": [
    {
      "name": "Source Code",
      "provider": "GitHub",
      "url": "https://github.com/DataDog/schema"
    }
  ],
  "schema-version": "v2",
  "tags": [
    "my:tag",
    "service:tag"
  ],
  "team": "my-team"
}
EOF
# 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/services/definitions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "contacts": [
    {
      "contact": "contact@datadoghq.com",
      "name": "Team Email",
      "type": "email"
    }
  ],
  "dd-service": "service-exampleservicedefinition",
  "dd-team": "my-team",
  "docs": [
    {
      "name": "Architecture",
      "provider": "google drive",
      "url": "https://gdrive/mydoc"
    }
  ],
  "extensions": {
    "myorgextension": "extensionvalue"
  },
  "integrations": {
    "opsgenie": {
      "region": "US",
      "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
    },
    "pagerduty": "https://my-org.pagerduty.com/service-directory/PMyService"
  },
  "links": [
    {
      "name": "Runbook",
      "type": "runbook",
      "url": "https://my-runbook"
    }
  ],
  "repos": [
    {
      "name": "Source Code",
      "provider": "GitHub",
      "url": "https://github.com/DataDog/schema"
    }
  ],
  "schema-version": "v2",
  "tags": [
    "my:tag",
    "service:tag"
  ],
  "team": "my-team"
}
EOF
# 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/services/definitions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "contacts": [
    {
      "contact": "contact@datadoghq.com",
      "name": "Team Email",
      "type": "email"
    }
  ],
  "dd-service": "service-exampleservicedefinition",
  "dd-team": "my-team",
  "docs": [
    {
      "name": "Architecture",
      "provider": "google drive",
      "url": "https://gdrive/mydoc"
    }
  ],
  "extensions": {
    "myorgextension": "extensionvalue"
  },
  "integrations": {
    "opsgenie": {
      "region": "US",
      "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
    },
    "pagerduty": "https://my-org.pagerduty.com/service-directory/PMyService"
  },
  "links": [
    {
      "name": "Runbook",
      "type": "runbook",
      "url": "https://my-runbook"
    }
  ],
  "repos": [
    {
      "name": "Source Code",
      "provider": "GitHub",
      "url": "https://github.com/DataDog/schema"
    }
  ],
  "schema-version": "v2",
  "tags": [
    "my:tag",
    "service:tag"
  ],
  "team": "my-team"
}
EOF
Create or update service definition using schema v2-1 returns "CREATED" response
# 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/services/definitions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "contacts": [
    {
      "contact": "contact@datadoghq.com",
      "name": "Team Email",
      "type": "email"
    }
  ],
  "dd-service": "service-exampleservicedefinition",
  "extensions": {
    "myorgextension": "extensionvalue"
  },
  "integrations": {
    "opsgenie": {
      "region": "US",
      "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
    },
    "pagerduty": {
      "service-url": "https://my-org.pagerduty.com/service-directory/PMyService"
    }
  },
  "links": [
    {
      "name": "Runbook",
      "type": "runbook",
      "url": "https://my-runbook"
    },
    {
      "name": "Source Code",
      "type": "repo",
      "provider": "GitHub",
      "url": "https://github.com/DataDog/schema"
    },
    {
      "name": "Architecture",
      "type": "doc",
      "provider": "Gigoogle drivetHub",
      "url": "https://my-runbook"
    }
  ],
  "schema-version": "v2.1",
  "tags": [
    "my:tag",
    "service:tag"
  ],
  "team": "my-team"
}
EOF
# 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/services/definitions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "contacts": [
    {
      "contact": "contact@datadoghq.com",
      "name": "Team Email",
      "type": "email"
    }
  ],
  "dd-service": "service-exampleservicedefinition",
  "extensions": {
    "myorgextension": "extensionvalue"
  },
  "integrations": {
    "opsgenie": {
      "region": "US",
      "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
    },
    "pagerduty": {
      "service-url": "https://my-org.pagerduty.com/service-directory/PMyService"
    }
  },
  "links": [
    {
      "name": "Runbook",
      "type": "runbook",
      "url": "https://my-runbook"
    },
    {
      "name": "Source Code",
      "type": "repo",
      "provider": "GitHub",
      "url": "https://github.com/DataDog/schema"
    },
    {
      "name": "Architecture",
      "type": "doc",
      "provider": "Gigoogle drivetHub",
      "url": "https://my-runbook"
    }
  ],
  "schema-version": "v2.1",
  "tags": [
    "my:tag",
    "service:tag"
  ],
  "team": "my-team"
}
EOF
# 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/services/definitions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "contacts": [
    {
      "contact": "contact@datadoghq.com",
      "name": "Team Email",
      "type": "email"
    }
  ],
  "dd-service": "service-exampleservicedefinition",
  "extensions": {
    "myorgextension": "extensionvalue"
  },
  "integrations": {
    "opsgenie": {
      "region": "US",
      "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
    },
    "pagerduty": {
      "service-url": "https://my-org.pagerduty.com/service-directory/PMyService"
    }
  },
  "links": [
    {
      "name": "Runbook",
      "type": "runbook",
      "url": "https://my-runbook"
    },
    {
      "name": "Source Code",
      "type": "repo",
      "provider": "GitHub",
      "url": "https://github.com/DataDog/schema"
    },
    {
      "name": "Architecture",
      "type": "doc",
      "provider": "Gigoogle drivetHub",
      "url": "https://my-runbook"
    }
  ],
  "schema-version": "v2.1",
  "tags": [
    "my:tag",
    "service:tag"
  ],
  "team": "my-team"
}
EOF
# 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/services/definitions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "contacts": [
    {
      "contact": "contact@datadoghq.com",
      "name": "Team Email",
      "type": "email"
    }
  ],
  "dd-service": "service-exampleservicedefinition",
  "extensions": {
    "myorgextension": "extensionvalue"
  },
  "integrations": {
    "opsgenie": {
      "region": "US",
      "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
    },
    "pagerduty": {
      "service-url": "https://my-org.pagerduty.com/service-directory/PMyService"
    }
  },
  "links": [
    {
      "name": "Runbook",
      "type": "runbook",
      "url": "https://my-runbook"
    },
    {
      "name": "Source Code",
      "type": "repo",
      "provider": "GitHub",
      "url": "https://github.com/DataDog/schema"
    },
    {
      "name": "Architecture",
      "type": "doc",
      "provider": "Gigoogle drivetHub",
      "url": "https://my-runbook"
    }
  ],
  "schema-version": "v2.1",
  "tags": [
    "my:tag",
    "service:tag"
  ],
  "team": "my-team"
}
EOF
# 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/services/definitions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "contacts": [
    {
      "contact": "contact@datadoghq.com",
      "name": "Team Email",
      "type": "email"
    }
  ],
  "dd-service": "service-exampleservicedefinition",
  "extensions": {
    "myorgextension": "extensionvalue"
  },
  "integrations": {
    "opsgenie": {
      "region": "US",
      "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
    },
    "pagerduty": {
      "service-url": "https://my-org.pagerduty.com/service-directory/PMyService"
    }
  },
  "links": [
    {
      "name": "Runbook",
      "type": "runbook",
      "url": "https://my-runbook"
    },
    {
      "name": "Source Code",
      "type": "repo",
      "provider": "GitHub",
      "url": "https://github.com/DataDog/schema"
    },
    {
      "name": "Architecture",
      "type": "doc",
      "provider": "Gigoogle drivetHub",
      "url": "https://my-runbook"
    }
  ],
  "schema-version": "v2.1",
  "tags": [
    "my:tag",
    "service:tag"
  ],
  "team": "my-team"
}
EOF
# 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/services/definitions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "contacts": [
    {
      "contact": "contact@datadoghq.com",
      "name": "Team Email",
      "type": "email"
    }
  ],
  "dd-service": "service-exampleservicedefinition",
  "extensions": {
    "myorgextension": "extensionvalue"
  },
  "integrations": {
    "opsgenie": {
      "region": "US",
      "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
    },
    "pagerduty": {
      "service-url": "https://my-org.pagerduty.com/service-directory/PMyService"
    }
  },
  "links": [
    {
      "name": "Runbook",
      "type": "runbook",
      "url": "https://my-runbook"
    },
    {
      "name": "Source Code",
      "type": "repo",
      "provider": "GitHub",
      "url": "https://github.com/DataDog/schema"
    },
    {
      "name": "Architecture",
      "type": "doc",
      "provider": "Gigoogle drivetHub",
      "url": "https://my-runbook"
    }
  ],
  "schema-version": "v2.1",
  "tags": [
    "my:tag",
    "service:tag"
  ],
  "team": "my-team"
}
EOF
# 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/services/definitions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "contacts": [
    {
      "contact": "contact@datadoghq.com",
      "name": "Team Email",
      "type": "email"
    }
  ],
  "dd-service": "service-exampleservicedefinition",
  "extensions": {
    "myorgextension": "extensionvalue"
  },
  "integrations": {
    "opsgenie": {
      "region": "US",
      "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
    },
    "pagerduty": {
      "service-url": "https://my-org.pagerduty.com/service-directory/PMyService"
    }
  },
  "links": [
    {
      "name": "Runbook",
      "type": "runbook",
      "url": "https://my-runbook"
    },
    {
      "name": "Source Code",
      "type": "repo",
      "provider": "GitHub",
      "url": "https://github.com/DataDog/schema"
    },
    {
      "name": "Architecture",
      "type": "doc",
      "provider": "Gigoogle drivetHub",
      "url": "https://my-runbook"
    }
  ],
  "schema-version": "v2.1",
  "tags": [
    "my:tag",
    "service:tag"
  ],
  "team": "my-team"
}
EOF
# 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/services/definitions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "contacts": [
    {
      "contact": "contact@datadoghq.com",
      "name": "Team Email",
      "type": "email"
    }
  ],
  "dd-service": "service-exampleservicedefinition",
  "extensions": {
    "myorgextension": "extensionvalue"
  },
  "integrations": {
    "opsgenie": {
      "region": "US",
      "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
    },
    "pagerduty": {
      "service-url": "https://my-org.pagerduty.com/service-directory/PMyService"
    }
  },
  "links": [
    {
      "name": "Runbook",
      "type": "runbook",
      "url": "https://my-runbook"
    },
    {
      "name": "Source Code",
      "type": "repo",
      "provider": "GitHub",
      "url": "https://github.com/DataDog/schema"
    },
    {
      "name": "Architecture",
      "type": "doc",
      "provider": "Gigoogle drivetHub",
      "url": "https://my-runbook"
    }
  ],
  "schema-version": "v2.1",
  "tags": [
    "my:tag",
    "service:tag"
  ],
  "team": "my-team"
}
EOF
# 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/services/definitions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "contacts": [
    {
      "contact": "contact@datadoghq.com",
      "name": "Team Email",
      "type": "email"
    }
  ],
  "dd-service": "service-exampleservicedefinition",
  "extensions": {
    "myorgextension": "extensionvalue"
  },
  "integrations": {
    "opsgenie": {
      "region": "US",
      "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
    },
    "pagerduty": {
      "service-url": "https://my-org.pagerduty.com/service-directory/PMyService"
    }
  },
  "links": [
    {
      "name": "Runbook",
      "type": "runbook",
      "url": "https://my-runbook"
    },
    {
      "name": "Source Code",
      "type": "repo",
      "provider": "GitHub",
      "url": "https://github.com/DataDog/schema"
    },
    {
      "name": "Architecture",
      "type": "doc",
      "provider": "Gigoogle drivetHub",
      "url": "https://my-runbook"
    }
  ],
  "schema-version": "v2.1",
  "tags": [
    "my:tag",
    "service:tag"
  ],
  "team": "my-team"
}
EOF
Create or update service definition using schema v2-2 returns "CREATED" response
# 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/services/definitions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "contacts": [
    {
      "contact": "contact@datadoghq.com",
      "name": "Team Email",
      "type": "email"
    }
  ],
  "dd-service": "service-exampleservicedefinition",
  "extensions": {
    "myorgextension": "extensionvalue"
  },
  "integrations": {
    "opsgenie": {
      "region": "US",
      "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
    },
    "pagerduty": {
      "service-url": "https://my-org.pagerduty.com/service-directory/PMyService"
    }
  },
  "links": [
    {
      "name": "Runbook",
      "type": "runbook",
      "url": "https://my-runbook"
    },
    {
      "name": "Source Code",
      "type": "repo",
      "provider": "GitHub",
      "url": "https://github.com/DataDog/schema"
    },
    {
      "name": "Architecture",
      "type": "doc",
      "provider": "Gigoogle drivetHub",
      "url": "https://my-runbook"
    }
  ],
  "schema-version": "v2.2",
  "tags": [
    "my:tag",
    "service:tag"
  ],
  "team": "my-team"
}
EOF
# 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/services/definitions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "contacts": [
    {
      "contact": "contact@datadoghq.com",
      "name": "Team Email",
      "type": "email"
    }
  ],
  "dd-service": "service-exampleservicedefinition",
  "extensions": {
    "myorgextension": "extensionvalue"
  },
  "integrations": {
    "opsgenie": {
      "region": "US",
      "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
    },
    "pagerduty": {
      "service-url": "https://my-org.pagerduty.com/service-directory/PMyService"
    }
  },
  "links": [
    {
      "name": "Runbook",
      "type": "runbook",
      "url": "https://my-runbook"
    },
    {
      "name": "Source Code",
      "type": "repo",
      "provider": "GitHub",
      "url": "https://github.com/DataDog/schema"
    },
    {
      "name": "Architecture",
      "type": "doc",
      "provider": "Gigoogle drivetHub",
      "url": "https://my-runbook"
    }
  ],
  "schema-version": "v2.2",
  "tags": [
    "my:tag",
    "service:tag"
  ],
  "team": "my-team"
}
EOF
# 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/services/definitions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "contacts": [
    {
      "contact": "contact@datadoghq.com",
      "name": "Team Email",
      "type": "email"
    }
  ],
  "dd-service": "service-exampleservicedefinition",
  "extensions": {
    "myorgextension": "extensionvalue"
  },
  "integrations": {
    "opsgenie": {
      "region": "US",
      "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
    },
    "pagerduty": {
      "service-url": "https://my-org.pagerduty.com/service-directory/PMyService"
    }
  },
  "links": [
    {
      "name": "Runbook",
      "type": "runbook",
      "url": "https://my-runbook"
    },
    {
      "name": "Source Code",
      "type": "repo",
      "provider": "GitHub",
      "url": "https://github.com/DataDog/schema"
    },
    {
      "name": "Architecture",
      "type": "doc",
      "provider": "Gigoogle drivetHub",
      "url": "https://my-runbook"
    }
  ],
  "schema-version": "v2.2",
  "tags": [
    "my:tag",
    "service:tag"
  ],
  "team": "my-team"
}
EOF
# 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/services/definitions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "contacts": [
    {
      "contact": "contact@datadoghq.com",
      "name": "Team Email",
      "type": "email"
    }
  ],
  "dd-service": "service-exampleservicedefinition",
  "extensions": {
    "myorgextension": "extensionvalue"
  },
  "integrations": {
    "opsgenie": {
      "region": "US",
      "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
    },
    "pagerduty": {
      "service-url": "https://my-org.pagerduty.com/service-directory/PMyService"
    }
  },
  "links": [
    {
      "name": "Runbook",
      "type": "runbook",
      "url": "https://my-runbook"
    },
    {
      "name": "Source Code",
      "type": "repo",
      "provider": "GitHub",
      "url": "https://github.com/DataDog/schema"
    },
    {
      "name": "Architecture",
      "type": "doc",
      "provider": "Gigoogle drivetHub",
      "url": "https://my-runbook"
    }
  ],
  "schema-version": "v2.2",
  "tags": [
    "my:tag",
    "service:tag"
  ],
  "team": "my-team"
}
EOF
# 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/services/definitions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "contacts": [
    {
      "contact": "contact@datadoghq.com",
      "name": "Team Email",
      "type": "email"
    }
  ],
  "dd-service": "service-exampleservicedefinition",
  "extensions": {
    "myorgextension": "extensionvalue"
  },
  "integrations": {
    "opsgenie": {
      "region": "US",
      "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
    },
    "pagerduty": {
      "service-url": "https://my-org.pagerduty.com/service-directory/PMyService"
    }
  },
  "links": [
    {
      "name": "Runbook",
      "type": "runbook",
      "url": "https://my-runbook"
    },
    {
      "name": "Source Code",
      "type": "repo",
      "provider": "GitHub",
      "url": "https://github.com/DataDog/schema"
    },
    {
      "name": "Architecture",
      "type": "doc",
      "provider": "Gigoogle drivetHub",
      "url": "https://my-runbook"
    }
  ],
  "schema-version": "v2.2",
  "tags": [
    "my:tag",
    "service:tag"
  ],
  "team": "my-team"
}
EOF
# 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/services/definitions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "contacts": [
    {
      "contact": "contact@datadoghq.com",
      "name": "Team Email",
      "type": "email"
    }
  ],
  "dd-service": "service-exampleservicedefinition",
  "extensions": {
    "myorgextension": "extensionvalue"
  },
  "integrations": {
    "opsgenie": {
      "region": "US",
      "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
    },
    "pagerduty": {
      "service-url": "https://my-org.pagerduty.com/service-directory/PMyService"
    }
  },
  "links": [
    {
      "name": "Runbook",
      "type": "runbook",
      "url": "https://my-runbook"
    },
    {
      "name": "Source Code",
      "type": "repo",
      "provider": "GitHub",
      "url": "https://github.com/DataDog/schema"
    },
    {
      "name": "Architecture",
      "type": "doc",
      "provider": "Gigoogle drivetHub",
      "url": "https://my-runbook"
    }
  ],
  "schema-version": "v2.2",
  "tags": [
    "my:tag",
    "service:tag"
  ],
  "team": "my-team"
}
EOF
# 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/services/definitions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "contacts": [
    {
      "contact": "contact@datadoghq.com",
      "name": "Team Email",
      "type": "email"
    }
  ],
  "dd-service": "service-exampleservicedefinition",
  "extensions": {
    "myorgextension": "extensionvalue"
  },
  "integrations": {
    "opsgenie": {
      "region": "US",
      "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
    },
    "pagerduty": {
      "service-url": "https://my-org.pagerduty.com/service-directory/PMyService"
    }
  },
  "links": [
    {
      "name": "Runbook",
      "type": "runbook",
      "url": "https://my-runbook"
    },
    {
      "name": "Source Code",
      "type": "repo",
      "provider": "GitHub",
      "url": "https://github.com/DataDog/schema"
    },
    {
      "name": "Architecture",
      "type": "doc",
      "provider": "Gigoogle drivetHub",
      "url": "https://my-runbook"
    }
  ],
  "schema-version": "v2.2",
  "tags": [
    "my:tag",
    "service:tag"
  ],
  "team": "my-team"
}
EOF
# 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/services/definitions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "contacts": [
    {
      "contact": "contact@datadoghq.com",
      "name": "Team Email",
      "type": "email"
    }
  ],
  "dd-service": "service-exampleservicedefinition",
  "extensions": {
    "myorgextension": "extensionvalue"
  },
  "integrations": {
    "opsgenie": {
      "region": "US",
      "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
    },
    "pagerduty": {
      "service-url": "https://my-org.pagerduty.com/service-directory/PMyService"
    }
  },
  "links": [
    {
      "name": "Runbook",
      "type": "runbook",
      "url": "https://my-runbook"
    },
    {
      "name": "Source Code",
      "type": "repo",
      "provider": "GitHub",
      "url": "https://github.com/DataDog/schema"
    },
    {
      "name": "Architecture",
      "type": "doc",
      "provider": "Gigoogle drivetHub",
      "url": "https://my-runbook"
    }
  ],
  "schema-version": "v2.2",
  "tags": [
    "my:tag",
    "service:tag"
  ],
  "team": "my-team"
}
EOF
# 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/services/definitions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "contacts": [
    {
      "contact": "contact@datadoghq.com",
      "name": "Team Email",
      "type": "email"
    }
  ],
  "dd-service": "service-exampleservicedefinition",
  "extensions": {
    "myorgextension": "extensionvalue"
  },
  "integrations": {
    "opsgenie": {
      "region": "US",
      "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
    },
    "pagerduty": {
      "service-url": "https://my-org.pagerduty.com/service-directory/PMyService"
    }
  },
  "links": [
    {
      "name": "Runbook",
      "type": "runbook",
      "url": "https://my-runbook"
    },
    {
      "name": "Source Code",
      "type": "repo",
      "provider": "GitHub",
      "url": "https://github.com/DataDog/schema"
    },
    {
      "name": "Architecture",
      "type": "doc",
      "provider": "Gigoogle drivetHub",
      "url": "https://my-runbook"
    }
  ],
  "schema-version": "v2.2",
  "tags": [
    "my:tag",
    "service:tag"
  ],
  "team": "my-team"
}
EOF