---
title: "Create a new API"
method: POST
path: "/api/v2/apicatalog/openapi"
tags: ["API Management"]
deprecated: true
---

# Create a new API

`POST /api/v2/apicatalog/openapi`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/apicatalog/openapi`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token` scopes: `apm_api_catalog_write`

> **Deprecated.**

Create a new API from the [OpenAPI](https://spec.openapis.org/oas/latest.html) specification given.
See the [API Catalog documentation](https://docs.datadoghq.com/api_catalog/add_metadata/) for additional
information about the possible metadata.
It returns the created API ID.

## Request body `multipart/form-data`

- OpenAPIFile: Object for API data in an `OpenAPI` format as a file.
  - `openapi_spec_file` string, binary: Binary `OpenAPI` spec file

## Response `201`

API created successfully

- CreateOpenAPIResponse: Response for `CreateOpenAPI` operation.
  - `data` CreateOpenAPIResponseData: Data envelope for `CreateOpenAPIResponse`.
    - `attributes` CreateOpenAPIResponseAttributes: Attributes for `CreateOpenAPI`.
      - `failed_endpoints` OpenAPIEndpoint[]: List of endpoints which couldn't be parsed.
        - `method` string: The endpoint method.
        - `path` string: The endpoint path.
    - `id` string, uuid: API identifier.

## Other responses

- `400`: Bad request
- `403`: Forbidden
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/da68bf029e4c?raw)
