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

# Test import source

> Probe an import source's connectivity and credentials. Optionally accepts a partial 'source' body to preview a credential change without persisting it.



## OpenAPI

````yaml /generated/openapi-import-generated-2023-12-01.json post /import/sources/{id}/test-source
openapi: 3.1.0
info:
  title: Prequel Data Import
  description: Data Import API spec
  version: '2023-12-01'
servers:
  - url: https://api.prequel.co
    description: Cloud-hosted server (US)
  - url: https://eu-api.prequel.co
    description: Cloud-hosted server (EU)
  - url: https://{custom_host}
    description: Self-hosted Prequel API host
security:
  - ApiKeyAuth: []
paths:
  /import/sources/{id}/test-source:
    post:
      tags:
        - Import Sources
      summary: Test import source
      description: >-
        Probe an import source's connectivity and credentials. Optionally
        accepts a partial 'source' body to preview a credential change without
        persisting it.
      operationId: test-import-source
      parameters:
        - name: id
          in: path
          required: true
          description: Import Source ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TestSourceRequest'
              $schema: https://json-schema.org/draft/2020-12/schema
              $id: >-
                https://github.com/prequel-co/datafeed/internal/import/api/models/test-source-request
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    const: success
                  data:
                    $ref: '#/components/schemas/TestSourceResponse'
                    $schema: https://json-schema.org/draft/2020-12/schema
                    $id: >-
                      https://github.com/prequel-co/datafeed/internal/import/api/models/test-source-response
                  message:
                    type: string
                type: object
                required:
                  - status
                  - data
                  - message
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    TestSourceRequest:
      properties:
        source:
          $ref: '#/components/schemas/UpdateSourceOptions'
          title: Source
          description: >-
            Optional partial source patch merged onto the saved source to test
            connection without persisting.
      additionalProperties: false
      type: object
    TestSourceResponse:
      properties:
        code:
          type: string
        message:
          type: string
      additionalProperties: false
      type: object
    UpdateSourceOptions:
      properties:
        name:
          type: string
          description: Unique name for this import source.
        vendor:
          type: string
          readOnly: true
        postgres:
          $ref: '#/components/schemas/UpdatePostgresSourceOptions'
          title: PostgreSQL
        redshift:
          $ref: '#/components/schemas/UpdateRedshiftSourceOptions'
          title: Amazon Redshift
        redshift_serverless:
          $ref: '#/components/schemas/UpdateRedshiftServerlessSourceOptions'
          title: Amazon Redshift Serverless
        bigquery:
          $ref: '#/components/schemas/UpdateBigQuerySourceOptions'
          title: Google BigQuery
        s3:
          $ref: '#/components/schemas/UpdateS3SourceOptions'
          title: Amazon S3
        abs:
          $ref: '#/components/schemas/UpdateABSSourceOptions'
          title: Azure Blob Storage
        sftp:
          $ref: '#/components/schemas/UpdateSFTPSourceOptions'
          title: SFTP
        gcs:
          $ref: '#/components/schemas/UpdateGCSSourceOptions'
          title: Google Cloud Storage
        s3_compatible:
          $ref: '#/components/schemas/UpdateS3CompatibleSourceOptions'
          title: S3 Compatible
        snowflake:
          $ref: '#/components/schemas/UpdateSnowflakeSourceOptions'
          title: Snowflake
        delta_sharing:
          $ref: '#/components/schemas/UpdateDeltaSharingSourceOptions'
          title: Delta Sharing
      additionalProperties: false
      type: object
    ErrorResponse:
      properties:
        status:
          type: string
          const: error
        message:
          type: string
        data:
          type: 'null'
      type: object
      required:
        - status
        - message
    UpdatePostgresSourceOptions:
      properties:
        host:
          type: string
          description: The hostname of the PostgreSQL server.
        port:
          type: integer
          exclusiveMinimum: 0
          description: The port of the PostgreSQL server.
        database:
          type: string
          description: The name of the database to connect to.
        auth_method:
          type: string
          enum:
            - password_auth
          description: Authentication method.
        password_auth:
          $ref: '#/components/schemas/UpdatePasswordAuth'
          description: Required details for username/password authentication.
        use_ssh_tunnel:
          type: boolean
          title: Use SSH Tunnel
          description: Whether to use an SSH tunnel for the connection.
        ssh_tunnel:
          $ref: '#/components/schemas/SSHTunnelParams'
          description: Required details if using SSH tunneling.
        disable_ssl:
          type: boolean
          description: Whether to disable SSL for the connection.
      additionalProperties: false
      type: object
    UpdateRedshiftSourceOptions:
      properties:
        host:
          type: string
          description: The hostname of the Redshift server.
        port:
          type: integer
          exclusiveMinimum: 0
          description: The port of the Redshift server.
        database:
          type: string
          description: The name of the database to connect to.
        cluster:
          type: string
          description: The name of the Redshift cluster.
        region:
          type: string
          description: The AWS region of the Redshift cluster.
        workgroup:
          type: string
          description: The name of the Redshift Serverless workgroup.
        username:
          type: string
          description: The username for authentication.
        auth_method:
          type: string
          enum:
            - aws_iam_role
            - aws_access_keys
        aws_access_keys:
          $ref: '#/components/schemas/UpdateRedshiftAccessKeys'
          description: Required details for AWS access keys authentication.
        aws_iam_role:
          $ref: '#/components/schemas/AWSIAMRole'
          description: Required details for AWS IAM role authentication.
        use_ssh_tunnel:
          type: boolean
          title: Use SSH Tunnel
          description: Whether to use an SSH tunnel for the connection.
        ssh_tunnel:
          $ref: '#/components/schemas/SSHTunnelParams'
          description: Required details if using SSH tunneling.
        disable_ssl:
          type: boolean
          description: Whether to disable SSL for the connection.
        connection_timeout_in_seconds:
          type: integer
          minimum: 0
          description: Duration to wait for successful connection.
      additionalProperties: false
      type: object
    UpdateRedshiftServerlessSourceOptions:
      properties:
        host:
          type: string
          description: The hostname of the Redshift Serverless server.
        port:
          type: integer
          exclusiveMinimum: 0
          description: The port of the Redshift Serverless server.
        database:
          type: string
          description: The name of the database to connect to.
        workgroup:
          type: string
          description: The name of the Redshift Serverless workgroup.
        region:
          type: string
          description: The AWS region of the Redshift Serverless workgroup.
        auth_method:
          type: string
          enum:
            - aws_iam_role
            - aws_access_keys
        aws_access_keys:
          $ref: '#/components/schemas/UpdateRedshiftAccessKeys'
          description: Required details for AWS access keys authentication.
        aws_iam_role:
          $ref: '#/components/schemas/AWSIAMRole'
          description: Required details for AWS IAM role authentication.
        use_ssh_tunnel:
          type: boolean
          title: Use SSH Tunnel
          description: Whether to use an SSH tunnel for the connection.
        ssh_tunnel:
          $ref: '#/components/schemas/SSHTunnelParams'
          description: Required details if using SSH tunneling.
        disable_ssl:
          type: boolean
          description: Whether to disable SSL for the connection.
        connection_timeout_in_seconds:
          type: integer
          minimum: 0
          description: Duration to wait for successful connection.
      additionalProperties: false
      type: object
    UpdateBigQuerySourceOptions:
      properties:
        project_id:
          $comment: >-
            BigQuery Project IDs must consist of 4-30 lowercase letters,
            numbers, and hyphens, and must begin with a lowercase letter and end
            with a lowercase letter or number.
          type: string
          pattern: ^[a-z][a-z0-9-]{2,28}[a-z0-9]$
          title: Project ID
        region:
          type: string
          title: Region
        auth_method:
          type: string
          enum:
            - gcp_service_account_role
            - gcp_service_account_key
            - federated_gcp_service_account_role
          title: Auth method
          description: The method of authentication to use for this source.
        gcp_service_account_role:
          $ref: '#/components/schemas/UpdateGCPServiceAccountRole'
          description: Required details if authenticating using a GCP service account role.
        federated_gcp_service_account_role:
          $ref: '#/components/schemas/UpdateFederatedGCPServiceAccountRole'
          description: Required details if authenticating using a GCP service account role.
        gcp_service_account_key:
          $ref: '#/components/schemas/UpdateGCPSourceServiceAccountKey'
          description: Required details if authenticating using a GCP service account key.
      additionalProperties: false
      type: object
    UpdateS3SourceOptions:
      properties:
        bucket_name:
          type: string
          description: The name of the S3 bucket.
        region:
          type: string
          description: The AWS region of the S3 bucket.
        auth_method:
          type: string
          enum:
            - aws_iam_role
            - aws_access_keys
        aws_iam_role:
          $ref: '#/components/schemas/AWSIAMRole'
          description: Required details for AWS IAM role authentication.
        aws_access_keys:
          $ref: '#/components/schemas/UpdateAWSAccessKeys'
          description: Required details for AWS access keys authentication.
        bucket_host:
          type: string
          description: The host address of the S3 bucket.
        use_ssh_tunnel:
          type: boolean
          title: Use SSH Tunnel
          description: Whether to use an SSH tunnel for the connection.
        ssh_tunnel:
          $ref: '#/components/schemas/SSHTunnelParams'
          description: Required details if using SSH tunneling.
      additionalProperties: false
      type: object
    UpdateABSSourceOptions:
      properties:
        bucket_name:
          type: string
          description: The name of the ABS container.
        storage_account_name:
          type: string
          description: The name of the Azure storage account.
        auth_method:
          type: string
          enum:
            - azure_service_shared_access_signature
          description: Authentication method.
        azure_service_shared_access_signature:
          $ref: '#/components/schemas/UpdateAzureServiceSharedAccessSignature'
          description: Required parameters to authenticate to Azure using a SAS token.
      additionalProperties: false
      type: object
    UpdateSFTPSourceOptions:
      properties:
        username:
          type: string
          description: The username for the SFTP connection.
        host:
          type: string
          description: The hostname of the SFTP server.
        port:
          type: integer
          exclusiveMinimum: 0
          description: The port of the SFTP server.
        auth_method:
          type: string
          enum:
            - public_key_auth
          description: Authentication method.
        public_key_auth:
          $ref: '#/components/schemas/UpdatePublicKeyAuth'
          description: Required details for public key authentication.
      additionalProperties: false
      type: object
    UpdateGCSSourceOptions:
      properties:
        bucket_name:
          type: string
          description: The name of the GCS bucket.
        region:
          type: string
          description: The GCP region of the GCS bucket.
        auth_method:
          type: string
          enum:
            - gcp_service_account_role
            - federated_gcp_service_account_role
            - gcs_hmac_keys
            - gcp_service_account_key
          description: Authentication method.
        gcp_service_account_role:
          $ref: '#/components/schemas/UpdateGCPServiceAccountRole'
          description: Required details if authenticating using a GCP service account role.
        federated_gcp_service_account_role:
          $ref: '#/components/schemas/UpdateFederatedGCPServiceAccountRole'
          description: Required details if authenticating using a GCP service account role.
        gcs_hmac_keys:
          $ref: '#/components/schemas/UpdateGCSAccessKeys'
          description: Required details if authenticating using GCS HMAC keys.
        gcp_service_account_key:
          $ref: '#/components/schemas/UpdateGCPSourceServiceAccountKey'
          description: Required details if authenticating using a GCP service account key.
      additionalProperties: false
      type: object
    UpdateS3CompatibleSourceOptions:
      properties:
        host:
          type: string
          description: The hostname of the S3-compatible server.
        port:
          type: integer
          exclusiveMinimum: 0
          description: The port of the S3-compatible server.
        bucket_name:
          type: string
          description: The name of the S3-compatible bucket.
        auth_method:
          type: string
          enum:
            - access_keys
          description: Authentication method.
        aws_access_keys:
          $ref: '#/components/schemas/UpdateAWSAccessKeys'
          description: Required details for access key authentication.
        disable_ssl:
          type: boolean
          description: Whether to disable SSL for the connection.
        use_ssh_tunnel:
          type: boolean
          title: Use SSH Tunnel
          description: Whether to use an SSH tunnel for the connection.
        ssh_tunnel:
          $ref: '#/components/schemas/SSHTunnelParams'
          description: Required details if using SSH tunneling.
      additionalProperties: false
      type: object
    UpdateSnowflakeSourceOptions:
      properties:
        host:
          type: string
          pattern: .*\.snowflakecomputing.com$
          description: The hostname of the Snowflake account.
        port:
          type: integer
          exclusiveMinimum: 0
          description: The port of the Snowflake server.
        database:
          type: string
          description: The name of the database to connect to.
        username:
          type: string
          description: The username for authentication.
        auth_method:
          type: string
          enum:
            - public_key_auth
        public_key_auth:
          $ref: '#/components/schemas/UpdatePublicKeyAuth'
          description: Required details for public key authentication.
      additionalProperties: false
      type: object
    UpdateDeltaSharingSourceOptions:
      properties:
        host:
          type: string
          description: The hostname of the Delta Sharing server.
        port:
          type: integer
          exclusiveMinimum: 0
          description: The port of the Delta Sharing server.
        auth_method:
          type: string
          enum:
            - bearer_token
            - oauth2
        bearer_token:
          $ref: '#/components/schemas/BearerTokenAuth'
          description: Required details for bearer token authentication.
        oauth2:
          $ref: '#/components/schemas/OAuthAuth'
          description: Required details for OAuth2 authentication.
      additionalProperties: false
      type: object
    UpdatePasswordAuth:
      properties:
        username:
          type: string
          description: The username to use for authentication.
        password:
          type: string
          description: The password to use for authentication.
      additionalProperties: false
      type: object
    SSHTunnelParams:
      properties:
        ssh_tunnel_host:
          type: string
          title: SSH tunnel host
        ssh_tunnel_port:
          type: integer
          title: SSH tunnel port
          default: 22
        ssh_tunnel_username:
          type: string
          title: SSH tunnel username
        ssh_public_key:
          type: string
          enum:
            - primary_public_key
            - secondary_public_key
          title: SSH Public Key
          description: >-
            This is the public SSH key that will be used to establish the SSH
            tunnel. It should be added to the list of authorized keys on the
            bastion host.
      additionalProperties: false
      type: object
      required:
        - ssh_tunnel_host
        - ssh_tunnel_port
        - ssh_tunnel_username
    UpdateRedshiftAccessKeys:
      properties:
        password:
          type: string
          title: Password
        access_id:
          type: string
          title: Bucket access ID
        secret_key:
          type: string
          title: Bucket secret key
      additionalProperties: false
      type: object
      required:
        - password
        - access_id
        - secret_key
    AWSIAMRole:
      properties:
        aws_iam_role_arn:
          type: string
          title: IAM role ARN
          default: arn:aws:iam::123456789012:role/service-role/role-name
      additionalProperties: false
      type: object
      required:
        - aws_iam_role_arn
    UpdateGCPServiceAccountRole:
      properties:
        service_account_email:
          type: string
          pattern: ^.*gserviceaccount.com$
          format: email
          description: The email of the GCP service account to use for authentication.
        workload_identity_federation_metadata:
          $ref: '#/components/schemas/GcpExternalAccountMetadata'
          title: Workload identity metadata
          description: The federation metadata to use for authentication.
      additionalProperties: false
      type: object
    UpdateFederatedGCPServiceAccountRole:
      properties:
        service_account_email:
          type: string
          pattern: ^.*gserviceaccount.com$
          format: email
          title: Service account email
          default: service-account-name@project-id.iam.gserviceaccount.com
        workload_identity_federation_metadata:
          $ref: '#/components/schemas/GcpExternalAccountMetadata'
          title: Workload identity metadata
      additionalProperties: false
      type: object
      required:
        - service_account_email
    UpdateGCPSourceServiceAccountKey:
      properties:
        service_account_email:
          type: string
          pattern: ^.*gserviceaccount.com$
          format: email
          description: The email of the GCP service account to use for authentication.
        service_account_key:
          description: The full Google-generated JSON service account key object.
      additionalProperties: false
      type: object
    UpdateAWSAccessKeys:
      properties:
        access_id:
          type: string
          description: The access key ID to use for authentication.
        secret_key:
          type: string
          description: The secret key to use for authentication.
      additionalProperties: false
      type: object
    UpdateAzureServiceSharedAccessSignature:
      properties:
        shared_access_signature_token:
          type: string
          title: Storage Account SAS Token
      additionalProperties: false
      type: object
    UpdatePublicKeyAuth:
      properties:
        public_key:
          type: string
          title: Public key
          description: This is the PKCS8 public key generated for keypair authentication.
      additionalProperties: false
      type: object
    UpdateGCSAccessKeys:
      properties:
        access_key:
          type: string
          description: The access key to use for authentication.
        secret:
          type: string
          description: The secret to use for authentication.
      additionalProperties: false
      type: object
    BearerTokenAuth:
      properties:
        bearer_token:
          type: string
          title: Bearer Token
      additionalProperties: false
      type: object
      required:
        - bearer_token
    OAuthAuth:
      properties:
        client_id:
          type: string
          title: Client ID
        client_secret:
          type: string
          title: Client Secret
      additionalProperties: false
      type: object
      required:
        - client_id
        - client_secret
    GcpExternalAccountMetadata:
      properties:
        type:
          type: string
        audience:
          type: string
        subject_token_type:
          type: string
        service_account_impersonation_url:
          type: string
        token_url:
          type: string
        credential_source:
          $ref: '#/components/schemas/CredentialSource'
      type: object
      required:
        - type
        - audience
        - subject_token_type
        - service_account_impersonation_url
        - token_url
        - credential_source
    CredentialSource:
      properties:
        environment_id:
          type: string
        region_url:
          type: string
        url:
          type: string
        regional_cred_verification_url:
          type: string
      additionalProperties: false
      type: object
      required:
        - environment_id
        - region_url
        - url
        - regional_cred_verification_url
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````