---
title: "Replace a custom External API's OpenAPI schema."
method: POST
path: "/api/v1/projects/{projectId}/actions/external-apis/{integrationId}/openapi"
tags: ["Agent Actions"]
---

# Replace a custom External API's OpenAPI schema.

`POST /api/v1/projects/{projectId}/actions/external-apis/{integrationId}/openapi`

## Request

- Base URL: `https://app.customgpt.ai`
- URL: `https://app.customgpt.ai/api/v1/projects/{projectId}/actions/external-apis/{integrationId}/openapi`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/poll-the-people/apis/customgpt-ai/docs/api/v1/projects/:projectId/actions/external-apis/:integrationId/openapi/post.ts> (a function with typed inputs; its response is checked against the schema)

Takes the same `openapi_url` (JSON) or `openapi_file` (multipart/form-data) field as create; exactly one of them
is required.

## Path parameters

- `projectId` integer, required
- `integrationId` integer, required

## Request body

- object
  - `openapi_url` string, required: Public HTTPS URL of the OpenAPI (JSON or YAML) schema.

## Response `200`

The External API.

- object
  - `status` 'error' | 'success': The status of the response
  - `data` object
    - `external_api` ExternalApi
      - `id` integer: External API identifier.
      - `name` string: Display name.
      - `is_enabled` boolean: Whether the agent can call this API.
      - `host` string: Host taken from the OpenAPI schema servers.
      - `base_url` string: Base URL the agent calls.
      - `auth_type` 'bearer' | 'header' | 'query', nullable: Authentication scheme detected in the OpenAPI schema.
      - `auth_key_name` string, nullable: Header or query parameter that carries the key.
      - `has_openapi` boolean: Whether an OpenAPI schema is stored.
      - `openapi_metadata` object, nullable: Summary of the stored OpenAPI schema.
        - `title` string, nullable
        - `version` string, nullable
        - `endpoint_count` integer
      - `last_used_at` string, date-time, nullable: Last time the agent called this API.
      - `created_at` string, date-time, nullable: Creation time.

## Other responses

- `400`: Bad Argument
- `401`: API Token is either missing or invalid
- `404`: External API not found
- `422`: Unsupported Argument
- `429`: Too many requests. You have exceeded your API rate limit.
- `500`: Internal Server Error
- `503`: Service unavailable

## Changes

- **2026-11-03** `77aab4354382`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/poll-the-people/apis/customgpt-ai/changes/api/v1/projects/:projectId/actions/external-apis/:integrationId/openapi/post.md)

---

[API](https://skmtc.dev/poll-the-people/apis/customgpt-ai.md) - [All operations](https://skmtc.dev/poll-the-people/apis/customgpt-ai/llms.txt) - [OpenAPI document](https://skmtc.dev/poll-the-people/apis/customgpt-ai/revisions/77aab4354382?raw)
