---
title: "Create Connection"
method: POST
path: "/v1/openapi-connections/"
tags: ["v1", "protected", "openapi-connections"]
---

# Create Connection

`POST /v1/openapi-connections/`

## Request body

- OpenAPIConnectionCreate — Payload for creating an OpenAPI connection. The connection ties a base URL (where requests are sent) to an OpenAPI 3.x specification (which is parsed eagerly into a tool list). Provide either ``spec_url`` or ``spec_content`` — not both required.
  - `auth_config_id` string, uuid, nullable — Optional MCPAuthConfig UUID for OAuth2 token rotation. When set, tokens are minted/refreshed on the connection's behalf.
  - `base_url` string, required — Base URL for API requests, e.g. 'https://api.example.com'.
  - `custom_headers` HeaderInput[], nullable — Custom HTTP headers attached to every request. Non-safe headers (e.g. Authorization) are stored encrypted in the secret manager.
    - `name` string, required — HTTP header name. Allowed characters: letters, digits, '-', '_'.
    - `value` string — Header value. May not contain CR, LF, or NUL bytes.
  - `description` string, nullable — Optional human-readable summary of what this API exposes.
  - `name` string, required — Display name for the connection (unique per workspace).
  - `spec_content` object, nullable — Inline OpenAPI 3.x spec as a JSON object. Use instead of ``spec_url`` when the spec host is unreachable from the API.
  - `spec_url` string, nullable — URL to an OpenAPI 3.x JSON or YAML spec. The spec is fetched and parsed eagerly at create time so the connection is ready for use.

## Response `201`

Successful Response

- OpenAPIConnectionResponse
  - `auth_config_id` string, uuid, nullable
  - `available_tools` object[]
  - `base_url` string, required
  - `created_at` unknown, required
  - `custom_headers` HeaderOutput[], nullable
    - `name` string, required
    - `secret` boolean, required
    - `value` string, nullable
  - `description` string, nullable
  - `id` string, uuid, required
  - `name` string, required
  - `spec_url` string, nullable
  - `status` string, required
  - `updated_at` unknown, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/agentarea/apis/agentarea-api.md) · [All operations](https://skmtc.net/agentarea/apis/agentarea-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/agentarea/agentarea-api/versions/e3650e48373b/schema)
