> ## 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.

# Test a custom API connector

> Send one request to a custom API's test URL with the credential attached, without storing anything. Pass `connection_id` to test a stored connector, filling in only the fields you want to override. The stored credential is only sent to the connector's stored `base_api_url` or `test_url` origin (scheme, host and port); to test against any other origin, send the `access_token` again. The outcome is in the 200 body: credential failures are `status: error`, not an HTTP error. Requires full access.



## OpenAPI

````yaml /sprites/api/openapi.json post /v1/oauth/connections/custom_api/test
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/test:
    post:
      tags:
        - Connectors
      summary: Test a custom API connector
      description: >-
        Send one request to a custom API's test URL with the credential
        attached, without storing anything. Pass `connection_id` to test a
        stored connector, filling in only the fields you want to override. The
        stored credential is only sent to the connector's stored `base_api_url`
        or `test_url` origin (scheme, host and port); to test against any other
        origin, send the `access_token` again. The outcome is in the 200 body:
        credential failures are `status: error`, not an HTTP error. Requires
        full access.
      operationId: o_auth_connections_test_custom_api_post
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomApiTestRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomApiTestResponse'
          description: Success
        '401':
          description: Missing or invalid authentication
        '403':
          description: Full access required
      security:
        - bearerAuth: []
components:
  schemas:
    CustomApiTestRequest:
      description: Custom API connector test request
      properties:
        access_token:
          description: >-
            Credential to test. Required unless `connection_id` supplies the
            stored one, which it does only for a request to the connector's
            stored origins.
          example: sk-live-...
          type: string
        auth_custom_header_name:
          description: Header name for `auth_method` `custom_header`.
          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. See the create request for each
            method. Defaults to `header`.
          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`.
          example: /bot{token}
          type: string
        base_api_url:
          description: >-
            Base URL of the provider API. Used to build the request when
            `auth_method` is `url_path`.
          example: https://api.acme.example
          type: string
        connection_id:
          description: >-
            Existing custom API connector to test. When set, omitted or blank
            fields fall back to the connector's stored credential and settings,
            so a stored connector can be re-tested without resending its token.
            The stored credential is only sent to the connector's stored
            `base_api_url` or `test_url` origin (scheme, host and port); testing
            against any other origin needs `access_token`.
          example: conn_abc123
          type: string
        test_url:
          description: >-
            URL fetched with the credential attached. For `auth_method`
            `url_path` give a path relative to `base_api_url` (such as `/me`);
            the request joins `base_api_url`, the token path and this value, so
            an absolute URL here would be appended to the base URL. For every
            other method give an absolute URL. Required unless `connection_id`
            supplies a stored test URL. URLs that resolve to internal addresses
            are rejected.
          example: https://api.acme.example/me
          type: string
      required: []
      type: object
    CustomApiTestResponse:
      description: Custom API connector test response
      properties:
        result:
          $ref: '#/components/schemas/CustomApiTestResult'
          description: Test outcome.
          example:
            latency_ms: 42
            message: HTTP 200 — Connection OK
            status: ok
      required:
        - result
      type: object
    CustomApiTestResult:
      description: Custom API connector test result
      properties:
        latency_ms:
          description: Round-trip time of the test request. Null when no request was sent.
          example: 42
          type:
            - integer
            - 'null'
        message:
          description: >-
            Human-readable outcome, such as the HTTP status the provider
            returned.
          example: HTTP 200 — Connection OK
          type: string
        status:
          description: >-
            `ok` when the test URL answered with a 2xx status. Credential and
            validation failures are reported as `error` inside a 200 response.
          enum:
            - ok
            - error
          example: ok
          type: string
      required:
        - status
        - message
      type: object
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````