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

# Update a custom API connector

> Update a custom API connector. Every field is optional; omitted fields keep their stored value, and a blank `access_token` keeps the stored credential. Moving `base_api_url` or `test_url` to a new origin (scheme, host or port) requires a new `access_token` in the same request and replaces the stored refresh token with the request's `refresh_token`, if any. Only custom API connectors can be updated here; other providers answer 404. Requires full access.



## OpenAPI

````yaml /sprites/api/openapi.json put /v1/oauth/connections/custom_api/{id}
openapi: 3.1.0
info:
  title: Sprites API
  version: 0.1.12
  x-sprite-env-version: 0.0.5
servers:
  - url: https://api.sprites.dev
security: []
paths:
  /v1/oauth/connections/custom_api/{id}:
    put:
      tags:
        - Connectors
      summary: Update a custom API connector
      description: >-
        Update a custom API connector. Every field is optional; omitted fields
        keep their stored value, and a blank `access_token` keeps the stored
        credential. Moving `base_api_url` or `test_url` to a new origin (scheme,
        host or port) requires a new `access_token` in the same request and
        replaces the stored refresh token with the request's `refresh_token`, if
        any. Only custom API connectors can be updated here; other providers
        answer 404. Requires full access.
      operationId: o_auth_connections_update_custom_api_put
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCustomApiConnectionRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectionResponse'
          description: Success
        '400':
          description: Invalid request parameters
        '401':
          description: Missing or invalid authentication
        '403':
          description: Full access required
        '404':
          description: Connector not found
        '422':
          description: >-
            Connector could not be updated, or the destination moved to a new
            origin without a new `access_token`
      security:
        - bearerAuth: []
components:
  schemas:
    UpdateCustomApiConnectionRequest:
      description: Update custom API connector request
      properties:
        access_token:
          description: >-
            Replacement credential. Omitted or blank values keep the stored
            credential and leave `refresh_token` untouched; they are rejected
            with 422 when `base_api_url` or `test_url` moves to an origin the
            stored credential was not entered for. Stored encrypted and never
            returned.
          example: sk-live-...
          type: string
        auth_custom_header_name:
          description: >-
            Header name for `auth_method` `custom_header`. Reserved headers are
            rejected.
          example: X-Api-Key
          type: string
        auth_header_prefix:
          description: >-
            Prefix for the `Authorization` header value when `auth_method` is
            `header`.
          example: Bearer
          type: string
        auth_method:
          description: >-
            Where the credential is placed on provider requests. See the create
            request for each method.
          enum:
            - header
            - url_path
            - query_param
            - custom_header
          example: header
          type: string
        auth_query_param_name:
          description: Query parameter name for `auth_method` `query_param`.
          example: api_key
          type: string
        auth_url_path_template:
          description: >-
            Path template for `auth_method` `url_path`. `{token}` is replaced
            with the credential.
          example: /bot{token}
          type: string
        base_api_url:
          description: Base URL of the provider API.
          example: https://api.acme.example
          type: string
        description:
          description: Free-form description shown in the dashboard.
          example: Acme production account
          type: string
        name:
          description: >-
            New connector name. The name is the connector's identity within the
            organization, so it must not collide with another custom API
            connector.
          example: acme-api
          type: string
        refresh_token:
          description: >-
            Replacement refresh token, applied only together with a non-empty
            `access_token`; sent on its own it changes nothing. Omit it to keep
            the stored refresh token, except when the update moves the connector
            to a new origin: then the stored refresh token is dropped. An empty
            string sent with a new `access_token` stores an empty refresh token.
          example: rt-...
          type: string
        test_url:
          description: >-
            URL the connector test fetches. A path relative to `base_api_url`
            (such as `/me`) for `auth_method` `url_path`; an absolute URL for
            every other method.
          example: https://api.acme.example/me
          type: string
      required: []
      type: object
    ConnectionResponse:
      description: Connector response
      properties:
        connection:
          $ref: '#/components/schemas/Connection'
          description: >-
            Sanitized connector. Secrets and encrypted token fields are never
            returned.
          example:
            id: conn_abc123
            provider: slack
      required:
        - connection
      type: object
    Connection:
      description: Connector
      properties:
        access_policy:
          $ref: '#/components/schemas/AccessPolicy'
          description: >-
            Policy controlling which sprites and provider endpoints may use this
            connector.
          example:
            allow_all: true
            allowed_endpoints:
              - /*
        connection_type:
          description: How the connector was created.
          enum:
            - oauth
            - api_key
            - provisioned
            - internal
            - database
          example: oauth
          type: string
        id:
          description: >-
            Connector ID used in HTTP gateway URLs or as a native database
            selector.
          example: conn_abc123
          type: string
        inserted_at:
          description: When the connector was created.
          example: '2026-04-28T12:00:00Z'
          format: date-time
          type: string
        native_connection_uri:
          description: >-
            Credential-free PostgreSQL URI when native ingress is available;
            otherwise null. Use Sprite discovery for runtime-specific details.
          type:
            - string
            - 'null'
        notes:
          description: >-
            Provider notes about this connection, derived from its saved
            settings.
          example:
            - body: Full-access key.
              title: null
          items:
            $ref: '#/components/schemas/ProviderNote'
          type: array
        postgres:
          $ref: '#/components/schemas/PostgresDescriptor'
          description: >-
            S2 native descriptor: available, host, port, database, non-secret
            selector username, sslmode and protection. Legacy S1 and unspecified
            Sprites have no usable endpoint.
        provider:
          description: >-
            Provider key. See https://fly.io/sprites/ecosystem/ for current
            connectors.
          example: slack
          type: string
        provider_account_id:
          description: Provider account, workspace, or key identifier.
          example: T12345
          type: string
        provider_account_name:
          description: Human-readable provider account name.
          example: Example Workspace
          type: string
        provider_info:
          description: >-
            Public provider settings such as workspace URLs, database targets
            and auth_generation, custom API base URLs, or icon references.
            Credentials are excluded.
          example:
            team_domain: example
          type: object
        scopes:
          description: Comma-separated OAuth scopes granted to the connector.
          example: chat:write,channels:read
          type: string
        token_expires_at:
          description: >-
            When the stored token expires, if the provider issues expiring
            tokens.
          example: '2026-04-29T12:00:00Z'
          format: date-time
          type: string
        transport:
          description: The wire protocol this connector requires.
          enum:
            - http
            - postgres
          type: string
        updated_at:
          description: When the connector was last updated.
          example: '2026-04-29T12:00:00Z'
          format: date-time
          type: string
        usage_snippet:
          description: >-
            Provider-specific HTTP curl snippet using the connector gateway
            origin, or native PostgreSQL usage. Null when native ingress is
            unavailable.
          example: curl https://api.sprites.dev/v1/gateway/slack/conn_abc123/auth.test
          type:
            - string
            - 'null'
        user_id:
          description: Sprites user ID that created or owns the connector.
          example: user_abc123
          type: string
      required:
        - id
        - provider
        - provider_account_id
      type: object
    AccessPolicy:
      description: Connector access policy
      properties:
        allow_all:
          description: When true, all sprites in the organization may use this connector.
          example: false
          type: boolean
        allowed_endpoints:
          description: >-
            HTTP provider API paths the connector may call. Supports exact paths
            and trailing `*` prefix wildcards. Database connectors reject
            endpoint rules.
          example:
            - /chat.*
          items:
            type: string
          type: array
        blocked_endpoints:
          description: >-
            HTTP provider API paths the connector may not call, matched without
            regard to case. Block rules are checked before allow rules. Database
            connectors reject endpoint rules.
          example:
            - /admin.*
          items:
            type: string
          type: array
        name_prefix:
          description: Sprite name prefix required to use this connector.
          example: prod-
          type: string
        sprite_labels:
          description: Labels the calling sprite must have. All listed labels are required.
          example:
            - api-access
          items:
            type: string
          type: array
      required: []
      type: object
    ProviderNote:
      description: Connector provider note
      properties:
        body:
          description: Note body. Backticks mark inline code.
          type: string
        title:
          description: Note title.
          type:
            - string
            - 'null'
      required:
        - body
      type: object
    PostgresDescriptor:
      description: Native PostgreSQL descriptor
      properties:
        available:
          description: >-
            Whether this S2 Sprite has enabled native routing. False for legacy
            S1 Sprites.
          type: boolean
        database:
          description: The immutable saved database name.
          type: string
        host:
          description: >-
            S2 internal connector hostname, or null for unsupported or
            unspecified Sprites.
          type:
            - string
            - 'null'
        port:
          description: Native ingress port.
          type: integer
        protection:
          description: Transport protecting the Sprite's SQL bytes.
          enum:
            - authenticated_platform_tunnel
          type: string
        sslmode:
          description: >-
            The S2 platform tunnel protects guest traffic; upstream TLS is
            always verified.
          enum:
            - disable
          type: string
        username:
          description: Non-secret connector selector, not the upstream SQL role.
          type: string
      required:
        - available
        - host
        - port
        - database
        - username
        - sslmode
        - protection
      type: object
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````