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

# Preflight a source

> Check a database before connecting it — creates nothing

Preflight checks reachability, writer status, logical replication settings, slot capacity, plugin availability, permissions, and whether the source is already connected — without creating anything.

A failed check is still a `200` — read `preflight_pass` in the response. When grants are the problem, `grant_script` holds ready-to-run SQL that fixes them.


## OpenAPI

````yaml openapi.public.json POST /v1/connectors/preflight
openapi: 3.1.0
info:
  description: >-
    Public Ardent API. Generated by scripts/export_public_openapi.py — do not
    edit by hand.
  title: Ardent API
  version: v1
servers:
  - url: https://api.tryardent.com
security: []
paths:
  /v1/connectors/preflight:
    post:
      tags:
        - v1-connectors
      summary: Preflight Connector Endpoint
      operationId: preflight_connector_endpoint_v1_connectors_preflight_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PreflightConnectorRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PreflightReport'
          description: >-
            The full preflight report. A failed gate is still a 200 — read
            `preflight_pass`.
        '400':
          description: Unsupported service, or the connection details failed validation.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - bearerAuth: []
components:
  schemas:
    PreflightConnectorRequest:
      properties:
        allow_high_rtt_placement:
          default: false
          description: Allow customer-cloud placement far from the worker region.
          title: Allow High Rtt Placement
          type: boolean
        connection_details:
          additionalProperties: true
          description: Connection details for the source database. Nothing is stored.
          title: Connection Details
          type: object
        database:
          anyOf:
            - type: string
            - type: 'null'
          description: Database to render in the grant script. Affects only `grant_script`.
          title: Database
        environment_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Customer-cloud environment; required when your org has more than
            one.
          title: Environment Id
        org_id:
          anyOf:
            - type: string
            - type: 'null'
          description: Organization to preflight for. Inferred from your auth when omitted.
          title: Org Id
        private_link_id:
          anyOf:
            - type: string
            - type: 'null'
          description: Private connection for the source database; needs `use_environment`.
          title: Private Link Id
        selected_schemas:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: Schemas to render in the grant script. Affects only `grant_script`.
          title: Selected Schemas
        service_name:
          description: Service type. `postgresql` is the only supported value today.
          title: Service Name
          type: string
        use_environment:
          default: false
          description: Route preflight through a customer-cloud environment.
          title: Use Environment
          type: boolean
      required:
        - service_name
        - connection_details
      title: PreflightConnectorRequest
      type: object
    PreflightReport:
      additionalProperties: true
      properties:
        branching_prerequisites_pass:
          anyOf:
            - type: boolean
            - type: 'null'
          description: True when the checks required for branching pass.
          title: Branching Prerequisites Pass
        checks:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          description: Individual check results, keyed by check name.
          title: Checks
        grant_script:
          anyOf:
            - type: string
            - type: 'null'
          description: Ready-to-run SQL grant script for the source database.
          title: Grant Script
        preflight_pass:
          anyOf:
            - type: boolean
            - type: 'null'
          description: True when every preflight check passes.
          title: Preflight Pass
        source_metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          description: Metadata gathered from the source during preflight.
          title: Source Metadata
        source_placement:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Source Placement
        source_preflight:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Source Preflight
        source_provider:
          anyOf:
            - type: string
            - type: 'null'
          description: Detected source provider, for example `supabase` or `vanilla`.
          title: Source Provider
      title: PreflightReport
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      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:
    bearerAuth:
      description: >-
        Ardent API key (sk-ard_live_… / sk-ard_test_…) or a dashboard session
        token.
      scheme: bearer
      type: http

````