API Management

Configure your API endpoints through the Datadog API.

Note: This endpoint is deprecated.

POST https://api.ap1.datadoghq.com/api/v2/apicatalog/openapihttps://api.datadoghq.eu/api/v2/apicatalog/openapihttps://api.ddog-gov.com/api/v2/apicatalog/openapihttps://api.datadoghq.com/api/v2/apicatalog/openapihttps://api.us3.datadoghq.com/api/v2/apicatalog/openapihttps://api.us5.datadoghq.com/api/v2/apicatalog/openapi

Overview

Create a new API from the OpenAPI specification given. See the API Catalog documentation for additional information about the possible metadata. It returns the created API ID. This endpoint requires the apm_api_catalog_write permission.

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

Request

Body Data (required)

Expand All

Field

Type

Description

openapi_spec_file

binary

Binary OpenAPI spec file

{
  "openapi_spec_file": "string"
}

Response

API created successfully

Response for CreateOpenAPI operation.

Expand All

Field

Type

Description

data

object

Data envelope for CreateOpenAPIResponse.

attributes

object

Attributes for CreateOpenAPI.

failed_endpoints

[object]

List of endpoints which couldn't be parsed.

method

string

The endpoint method.

path

string

The endpoint path.

id

uuid

API identifier.

{
  "data": {
    "attributes": {
      "failed_endpoints": [
        {
          "method": "string",
          "path": "string"
        }
      ]
    },
    "id": "90646597-5fdb-4a17-a240-647003f8c028"
  }
}

Bad request

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

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

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

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

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

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

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

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

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

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

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

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

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

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

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

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

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Code Example

"""
Create a new API returns "API created successfully" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.api_management_api import APIManagementApi

configuration = Configuration()
configuration.unstable_operations["create_open_api"] = True
with ApiClient(configuration) as api_client:
    api_instance = APIManagementApi(api_client)
    response = api_instance.create_open_api(
        openapi_spec_file=open("openapi-spec.yaml", "rb"),
    )

    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.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"

Note: This endpoint is deprecated.

PUT https://api.ap1.datadoghq.com/api/v2/apicatalog/api/{id}/openapihttps://api.datadoghq.eu/api/v2/apicatalog/api/{id}/openapihttps://api.ddog-gov.com/api/v2/apicatalog/api/{id}/openapihttps://api.datadoghq.com/api/v2/apicatalog/api/{id}/openapihttps://api.us3.datadoghq.com/api/v2/apicatalog/api/{id}/openapihttps://api.us5.datadoghq.com/api/v2/apicatalog/api/{id}/openapi

Overview

Update information about a specific API. The given content will replace all API content of the given ID. The ID is returned by the create API, or can be found in the URL in the API catalog UI. This endpoint requires the apm_api_catalog_write permission.

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

Arguments

Path Parameters

Name

Type

Description

id [required]

string

ID of the API to modify

Request

Body Data (required)

Expand All

Field

Type

Description

openapi_spec_file

binary

Binary OpenAPI spec file

{
  "openapi_spec_file": "string"
}

Response

API updated successfully

Response for UpdateOpenAPI.

Expand All

Field

Type

Description

data

object

Data envelope for UpdateOpenAPIResponse.

attributes

object

Attributes for UpdateOpenAPI.

failed_endpoints

[object]

List of endpoints which couldn't be parsed.

method

string

The endpoint method.

path

string

The endpoint path.

id

uuid

API identifier.

{
  "data": {
    "attributes": {
      "failed_endpoints": [
        {
          "method": "string",
          "path": "string"
        }
      ]
    },
    "id": "90646597-5fdb-4a17-a240-647003f8c028"
  }
}

Bad request

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

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

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

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

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

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

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

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

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

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

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

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

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

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

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

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

API not found error

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

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

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

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

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

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

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

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

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Code Example

"""
Update an API returns "API updated successfully" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.api_management_api import APIManagementApi

# there is a valid "managed_api" in the system
MANAGED_API_DATA_ID = environ["MANAGED_API_DATA_ID"]

configuration = Configuration()
configuration.unstable_operations["update_open_api"] = True
with ApiClient(configuration) as api_client:
    api_instance = APIManagementApi(api_client)
    response = api_instance.update_open_api(
        id=MANAGED_API_DATA_ID,
        openapi_spec_file=open("openapi-spec.yaml", "rb"),
    )

    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.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"

Note: This endpoint is deprecated.

GET https://api.ap1.datadoghq.com/api/v2/apicatalog/api/{id}/openapihttps://api.datadoghq.eu/api/v2/apicatalog/api/{id}/openapihttps://api.ddog-gov.com/api/v2/apicatalog/api/{id}/openapihttps://api.datadoghq.com/api/v2/apicatalog/api/{id}/openapihttps://api.us3.datadoghq.com/api/v2/apicatalog/api/{id}/openapihttps://api.us5.datadoghq.com/api/v2/apicatalog/api/{id}/openapi

Overview

Retrieve information about a specific API in OpenAPI format file. This endpoint requires the apm_api_catalog_read permission.

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

Arguments

Path Parameters

Name

Type

Description

id [required]

string

ID of the API to retrieve

Response

OK

Expand All

Field

Type

Description

No response body

{}

Bad request

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

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

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

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

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

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

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

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

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

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

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

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

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

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

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

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

API not found error

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

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

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

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

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

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

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

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

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Code Example

"""
Get an API returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.api_management_api import APIManagementApi

# there is a valid "managed_api" in the system
MANAGED_API_DATA_ID = environ["MANAGED_API_DATA_ID"]

configuration = Configuration()
configuration.unstable_operations["get_open_api"] = True
with ApiClient(configuration) as api_client:
    api_instance = APIManagementApi(api_client)
    response = api_instance.get_open_api(
        id=MANAGED_API_DATA_ID,
    )

    print(response.read())

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.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"

Note: This endpoint is deprecated.

GET https://api.ap1.datadoghq.com/api/v2/apicatalog/apihttps://api.datadoghq.eu/api/v2/apicatalog/apihttps://api.ddog-gov.com/api/v2/apicatalog/apihttps://api.datadoghq.com/api/v2/apicatalog/apihttps://api.us3.datadoghq.com/api/v2/apicatalog/apihttps://api.us5.datadoghq.com/api/v2/apicatalog/api

Overview

List APIs and their IDs. This endpoint requires the apm_api_catalog_read permission.

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

Arguments

Query Strings

Name

Type

Description

query

string

Filter APIs by name

page[limit]

integer

Number of items per page.

page[offset]

integer

Offset for pagination.

Response

OK

Response for ListAPIs.

Expand All

Field

Type

Description

data

[object]

List of API items.

attributes

object

Attributes for ListAPIsResponseData.

name

string

API name.

id

uuid

API identifier.

meta

object

Metadata for ListAPIsResponse.

pagination

object

Pagination metadata information for ListAPIsResponse.

limit

int64

Number of items in the current page.

offset

int64

Offset for pagination.

total_count

int64

Total number of items.

{
  "data": [
    {
      "attributes": {
        "name": "Payments API"
      },
      "id": "90646597-5fdb-4a17-a240-647003f8c028"
    }
  ],
  "meta": {
    "pagination": {
      "limit": 20,
      "offset": 0,
      "total_count": 35
    }
  }
}

Bad request

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

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

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

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

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

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

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

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

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

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

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

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

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

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

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

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

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Code Example

"""
List APIs returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.api_management_api import APIManagementApi

configuration = Configuration()
configuration.unstable_operations["list_apis"] = True
with ApiClient(configuration) as api_client:
    api_instance = APIManagementApi(api_client)
    response = api_instance.list_apis()

    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.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"

Note: This endpoint is deprecated.

DELETE https://api.ap1.datadoghq.com/api/v2/apicatalog/api/{id}https://api.datadoghq.eu/api/v2/apicatalog/api/{id}https://api.ddog-gov.com/api/v2/apicatalog/api/{id}https://api.datadoghq.com/api/v2/apicatalog/api/{id}https://api.us3.datadoghq.com/api/v2/apicatalog/api/{id}https://api.us5.datadoghq.com/api/v2/apicatalog/api/{id}

Overview

Delete a specific API by ID. This endpoint requires the apm_api_catalog_write permission.

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

Arguments

Path Parameters

Name

Type

Description

id [required]

string

ID of the API to delete

Response

API deleted successfully

Bad request

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

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

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

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

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

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

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

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

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

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

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

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

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

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

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

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

API not found error

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

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

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

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

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

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

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

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

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Code Example

"""
Delete an API returns "API deleted successfully" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.api_management_api import APIManagementApi

# there is a valid "managed_api" in the system
MANAGED_API_DATA_ID = environ["MANAGED_API_DATA_ID"]

configuration = Configuration()
configuration.unstable_operations["delete_open_api"] = True
with ApiClient(configuration) as api_client:
    api_instance = APIManagementApi(api_client)
    api_instance.delete_open_api(
        id=MANAGED_API_DATA_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.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"

PREVIEWING: joepeeples/10234-ci-health