> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentarea.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Connection



## OpenAPI

````yaml /api-reference/openapi.json post /v1/openapi-connections/
openapi: 3.1.0
info:
  description: >-
    Modular and extensible framework for building AI agents. This API requires
    JWT Bearer token authentication for most endpoints. Include your JWT token
    in the Authorization header. Public endpoints include /, /health, /docs,
    /redoc, and /openapi.json.
  title: AgentArea API
  version: 0.1.0
servers: []
security:
  - bearer: []
paths:
  /v1/openapi-connections/:
    post:
      tags:
        - v1
        - protected
        - openapi-connections
      summary: Create Connection
      operationId: create_connection_v1_openapi_connections__post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OpenAPIConnectionCreate'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAPIConnectionResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    OpenAPIConnectionCreate:
      additionalProperties: false
      description: |-
        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.
      properties:
        auth_config_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          description: >-
            Optional MCPAuthConfig UUID for OAuth2 token rotation. When set,
            tokens are minted/refreshed on the connection's behalf.
          title: Auth Config Id
        base_url:
          description: Base URL for API requests, e.g. 'https://api.example.com'.
          maxLength: 500
          title: Base Url
          type: string
        custom_headers:
          anyOf:
            - items:
                $ref: '#/components/schemas/HeaderInput'
              type: array
            - type: 'null'
          description: >-
            Custom HTTP headers attached to every request. Non-safe headers
            (e.g. Authorization) are stored encrypted in the secret manager.
          title: Custom Headers
        description:
          anyOf:
            - type: string
            - type: 'null'
          description: Optional human-readable summary of what this API exposes.
          title: Description
        name:
          description: Display name for the connection (unique per workspace).
          maxLength: 255
          minLength: 1
          title: Name
          type: string
        spec_content:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          description: >-
            Inline OpenAPI 3.x spec as a JSON object. Use instead of
            ``spec_url`` when the spec host is unreachable from the API.
          title: Spec Content
        spec_url:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            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.
          title: Spec Url
      required:
        - name
        - base_url
      title: OpenAPIConnectionCreate
      type: object
    OpenAPIConnectionResponse:
      properties:
        auth_config_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          title: Auth Config Id
        available_tools:
          default: []
          items:
            additionalProperties: true
            type: object
          title: Available Tools
          type: array
        base_url:
          title: Base Url
          type: string
        created_at:
          title: Created At
        custom_headers:
          anyOf:
            - items:
                $ref: '#/components/schemas/HeaderOutput'
              type: array
            - type: 'null'
          title: Custom Headers
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        id:
          format: uuid
          title: Id
          type: string
        name:
          title: Name
          type: string
        spec_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Spec Url
        status:
          title: Status
          type: string
        updated_at:
          title: Updated At
      required:
        - id
        - name
        - base_url
        - status
        - created_at
        - updated_at
      title: OpenAPIConnectionResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    HeaderInput:
      additionalProperties: false
      description: >-
        One custom HTTP header attached to an OpenAPI connection.


        Non-safe header names (e.g. ``Authorization``) are stored encrypted in
        the

        secret manager — pass the plaintext value here at create/update time.
      properties:
        name:
          description: 'HTTP header name. Allowed characters: letters, digits, ''-'', ''_''.'
          maxLength: 256
          title: Name
          type: string
        value:
          default: ''
          description: Header value. May not contain CR, LF, or NUL bytes.
          maxLength: 8192
          title: Value
          type: string
      required:
        - name
      title: HeaderInput
      type: object
    HeaderOutput:
      description: Header metadata returned in API responses (secret values are masked).
      properties:
        name:
          title: Name
          type: string
        secret:
          title: Secret
          type: boolean
        value:
          anyOf:
            - type: string
            - type: 'null'
          title: Value
      required:
        - name
        - secret
      title: HeaderOutput
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    bearer:
      bearerFormat: JWT
      description: JWT Bearer token for authentication
      scheme: bearer
      type: http
    HTTPBearer:
      scheme: bearer
      type: http

````