For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/api/latest/api-management/update-an-api.md. A documentation index is available at /llms.txt.
Language
Datadog site

Update an API

WARNINGNote: This endpoint is deprecated.
PUThttps://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}/openapihttps://api.datadoghq.eu/api/v2/apicatalog/api/{id}/openapihttps://api.ap1.datadoghq.com/api/v2/apicatalog/api/{id}/openapihttps://api.ap2.datadoghq.com/api/v2/apicatalog/api/{id}/openapihttps://api.uk1.datadoghq.com/api/v2/apicatalog/api/{id}/openapihttps://api.ddog-gov.com/api/v2/apicatalog/api/{id}/openapihttps://api.us2.ddog-gov.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)

Field
Type
Description
openapi_spec_file
binary

Binary OpenAPI spec file

Response

API updated successfully

Response for UpdateOpenAPI.

Field
Type
Description
data
object

Data envelope for UpdateOpenAPIResponse.

Code Example

Update an API
# Path parameters
export id="90646597-5fdb-4a17-a240-647003f8c028"

# 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 PUT "https://api.${DD_SITE}/api/v2/apicatalog/api/${id}/openapi" \
-H "Accept: application/json" \
-H "Content-Type: multipart/form-data" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-F openapi_spec_file=@string
# Path parameters
export id="90646597-5fdb-4a17-a240-647003f8c028"

# 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 PUT "https://api.${DD_SITE}/api/v2/apicatalog/api/${id}/openapi" \
-H "Accept: application/json" \
-H "Content-Type: multipart/form-data" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-F openapi_spec_file=@string
# Path parameters
export id="90646597-5fdb-4a17-a240-647003f8c028"

# 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 PUT "https://api.${DD_SITE}/api/v2/apicatalog/api/${id}/openapi" \
-H "Accept: application/json" \
-H "Content-Type: multipart/form-data" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-F openapi_spec_file=@string
# Path parameters
export id="90646597-5fdb-4a17-a240-647003f8c028"

# 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 PUT "https://api.${DD_SITE}/api/v2/apicatalog/api/${id}/openapi" \
-H "Accept: application/json" \
-H "Content-Type: multipart/form-data" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-F openapi_spec_file=@string
# Path parameters
export id="90646597-5fdb-4a17-a240-647003f8c028"

# 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 PUT "https://api.${DD_SITE}/api/v2/apicatalog/api/${id}/openapi" \
-H "Accept: application/json" \
-H "Content-Type: multipart/form-data" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-F openapi_spec_file=@string
# Path parameters
export id="90646597-5fdb-4a17-a240-647003f8c028"

# 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 PUT "https://api.${DD_SITE}/api/v2/apicatalog/api/${id}/openapi" \
-H "Accept: application/json" \
-H "Content-Type: multipart/form-data" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-F openapi_spec_file=@string
# Path parameters
export id="90646597-5fdb-4a17-a240-647003f8c028"

# 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 PUT "https://api.${DD_SITE}/api/v2/apicatalog/api/${id}/openapi" \
-H "Accept: application/json" \
-H "Content-Type: multipart/form-data" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-F openapi_spec_file=@string
# Path parameters
export id="90646597-5fdb-4a17-a240-647003f8c028"

# 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 PUT "https://api.${DD_SITE}/api/v2/apicatalog/api/${id}/openapi" \
-H "Accept: application/json" \
-H "Content-Type: multipart/form-data" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-F openapi_spec_file=@string
# Path parameters
export id="90646597-5fdb-4a17-a240-647003f8c028"

# 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 PUT "https://api.${DD_SITE}/api/v2/apicatalog/api/${id}/openapi" \
-H "Accept: application/json" \
-H "Content-Type: multipart/form-data" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-F openapi_spec_file=@string