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

# Update a provider connection



## OpenAPI

````yaml /api-reference/openapi.yaml put /api/llm-gateway/admin/connections/{id}
openapi: 3.1.0
info:
  title: Barndoor.ai Public API
  description: Unified public API specification for Barndoor.ai platform
  version: 2.18.0
servers:
  - url: https://{host}
    description: Barndoor public API
    variables:
      host:
        default: platform.barndoor.ai
        description: >-
          The host serving your Barndoor deployment. Defaults to production;
          override it for another environment or a dedicated deployment.
security:
  - ApiKey: []
  - OAuth2:
      - openid
      - profile
      - email
tags:
  - name: dlp
    x-group: Data Control Center
  - name: identity
    x-group: Identity
  - name: llm-gateway
    x-group: LLM Gateway
  - name: notification
    x-group: Notifications
  - name: policy
    x-group: Policies
  - name: registry
    x-group: MCP Gateway
  - name: system-management
    x-group: Log Exports
paths:
  /api/llm-gateway/admin/connections/{id}:
    put:
      tags:
        - llm-gateway
      summary: Update a provider connection
      operationId: update_connection
      parameters:
        - name: id
          in: path
          description: Identifier, a UUID
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateConnectionRequest'
        required: true
      responses:
        '200':
          description: The requested record
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Connection'
        '401':
          description: Missing or invalid credentials
        '403':
          description: Caller is not permitted to act on this resource in this organization
        '404':
          description: No such resource in this organization
        '409':
          description: Another record in this organization already uses this name
components:
  schemas:
    UpdateConnectionRequest:
      type: object
      properties:
        api_key:
          type:
            - string
            - 'null'
        auth_type:
          type:
            - string
            - 'null'
        base_url:
          type:
            - string
            - 'null'
        change_note:
          type:
            - string
            - 'null'
          description: >-
            Optional free-text note explaining why this edit was made. Omitting
            it

            clears any previous note, which is deliberate: the note describes
            the

            latest change, so keeping the old one would explain the wrong edit.
        credentials: {}
        name:
          type:
            - string
            - 'null'
        settings: {}
    Connection:
      allOf:
        - $ref: '#/components/schemas/ChangeAttribution'
          description: >-
            Who created and last changed this credential, and why (BCP-3998).


            Flattened rather than nested so the response keeps the flat shape
            the

            portal already consumes — the same choice `AdminModelPricing` makes
            for

            its wrapped `ModelPricing`.
        - type: object
          required:
            - id
            - org_id
            - name
            - model_provider
            - auth_type
            - base_url
            - secret_path
            - settings
            - stores_key_material
            - created_at
            - updated_at
          properties:
            auth_type:
              type: string
            base_url:
              type: string
            created_at:
              type: string
              format: date-time
            id:
              type: string
              format: uuid
            key_last4:
              type:
                - string
                - 'null'
              description: >-
                Last four characters of the stored key, once known.


                `None` means "no tail to show", which is three different
                situations —

                `stores_key_material` is what tells them apart. Populated
                whenever key

                material is written, and derived on first read for credentials
                that

                predate the column.
            model_provider:
              type: string
            name:
              type: string
            org_id:
              type: string
              format: uuid
            secret_path:
              type: string
            settings: {}
            stores_key_material:
              type: boolean
              description: >-
                Whether this credential's auth type holds a secret at all.
                Derived from

                `auth_type`, not stored: it is a property of the auth type, so a
                column

                would be a second copy of the same fact, free to drift.
            updated_at:
              type: string
              format: date-time
      description: >-
        Every column of `llm_gw.connections`, plus one derived field.


        Serialized straight to the admin API — there is no separate response
        type,

        which is safe because no column here holds key material. `secret_path`
        is a

        pointer into OpenBao; `key_last4` is four characters of a tail
        (BCP-3821).
    ChangeAttribution:
      type: object
      description: >-
        The attribution carried on an admin-configurable row, as returned to the

        portal.


        Every field is `Option` and nothing is backfilled: a row that predates
        V75

        has no truthful actor to attribute it to, and inventing one would be
        worse

        than rendering a placeholder. Rows pick up attribution on their first

        write.
      properties:
        created_by_email:
          type:
            - string
            - 'null'
        created_by_name:
          type:
            - string
            - 'null'
        created_by_user_id:
          type:
            - string
            - 'null'
          format: uuid
        last_change_note:
          type:
            - string
            - 'null'
          description: >-
            Optional free text explaining *why* the last change was made

            ("Raised for the Q3 batch job", "Vendor deprecated the old
            endpoint").


            Admin-authored and rendered in the portal, so it is untrusted input:

            length-capped here, escaped on render.
        last_modified_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            When the change named by `last_modified_by_*` happened.


            Its own column rather than the row's `updated_at`, because
            `updated_at`

            is bumped by writes nobody is attributed for -- pairing the two
            would

            date a named admin's edit to a background job's clock. See the V75

            migration for the full reasoning.
        last_modified_by_email:
          type:
            - string
            - 'null'
        last_modified_by_name:
          type:
            - string
            - 'null'
        last_modified_by_user_id:
          type:
            - string
            - 'null'
          format: uuid
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      description: >-
        A Barndoor API key, sent as `Authorization: Bearer <key>`. Keys are
        prefixed `bdai_` and are opaque — do not attempt to decode one.
        Interchangeable with an OAuth 2.0 access token.
    OAuth2:
      type: oauth2
      x-issuer: https://auth.barndoor.ai/realms/barndoor
      description: >-
        An OAuth 2.0 access token from Barndoor's identity provider, sent as
        `Authorization: Bearer <token>`. Public clients must use PKCE.
        Interchangeable with an API key.
      flows:
        authorizationCode:
          authorizationUrl: >-
            https://auth.barndoor.ai/realms/barndoor/protocol/openid-connect/auth
          tokenUrl: >-
            https://auth.barndoor.ai/realms/barndoor/protocol/openid-connect/token
          scopes:
            openid: Issue an OIDC ID token identifying the caller.
            profile: Read the caller's basic profile claims.
            email: Read the caller's email address.
            offline_access: Issue a refresh token. Optional — no operation requires it.
        clientCredentials:
          tokenUrl: >-
            https://auth.barndoor.ai/realms/barndoor/protocol/openid-connect/token
          scopes:
            openid: Issue an OIDC ID token identifying the caller.
            profile: Read the caller's basic profile claims.
            email: Read the caller's email address.
            offline_access: Issue a refresh token. Optional — no operation requires it.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.