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

# Verify data source credentials

> Tests database connection credentials without creating a data source. Use this endpoint to validate credentials before creating or updating a data source.

## When to use

This endpoint is commonly used in combination with the create or update data source endpoints. It allows you to verify that the provided credentials can successfully connect to the database before committing to creating or updating a data source.

## Typical workflow

1. **Verify credentials** - Call this endpoint with the connection details
2. **Check response** - If successful, proceed to create/update; if failed, display field-specific errors to the user
3. **Create/update data source** - Once verified, call the create or update endpoint with the same credentials

## Field-specific errors

When a connection fails, the response includes `fieldErrors` that map specific fields to their errors. This allows you to display targeted feedback to users about which credential field is incorrect.

Common field errors:

* `host`: "Host not found" - The hostname could not be resolved
* `port`: "Incorrect port" - The connection was refused on the specified port
* `username`/`password`: "Incorrect username or password" - Authentication failed
* `databaseName`: "Database does not exist" - The specified database was not found

## IP whitelisting

If the connection times out, ensure the Basedash IP address (24.199.77.73) is whitelisted in your database firewall rules.


## OpenAPI

````yaml https://charts.basedash.com/api/public/openapi post /api/public/organizations/{orgId}/data-sources/verify
openapi: 3.1.0
info:
  title: Basedash Public API
  version: 0.0.0
  description: >-
    API for programmatic access to Basedash features. Use API keys for
    authentication.
  contact:
    name: Basedash Support
    url: https://basedash.com
    email: support@basedash.com
servers:
  - url: https://charts.basedash.com
    description: Production
security: []
tags:
  - name: Organizations
    description: Manage organizations
  - name: Groups
    description: Manage organization groups and memberships
  - name: Data Sources
    description: Manage database connections and data sources
  - name: MCP servers
    description: Manage MCP server data sources
  - name: Insights
    description: Manage generated insights
  - name: Automations
    description: Manage automations and automation runs
  - name: Skills
    description: Manage organization skills
  - name: Definitions
    description: Manage reusable SQL definitions
paths:
  /api/public/organizations/{orgId}/data-sources/verify:
    post:
      tags:
        - Data Sources
      summary: Verify data source credentials
      description: >-
        Tests database connection credentials without creating a data source.
        Use this endpoint to validate credentials before creating or updating a
        data source.
      parameters:
        - schema:
            type: string
            description: Organization ID
          required: true
          description: Organization ID
          name: orgId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                snowflakeAccountId:
                  type: string
                  description: Snowflake account ID
                snowflakeWarehouse:
                  type: string
                  description: Snowflake warehouse
                snowflakeRole:
                  type: string
                  description: Snowflake role
                snowflakePrivateKey:
                  type: string
                  description: Snowflake private key
                snowflakePrivateKeyPassphrase:
                  type: string
                  description: Snowflake private key passphrase
                databaseName:
                  type:
                    - string
                    - 'null'
                  default: null
                  description: Database name
                username:
                  type: string
                  description: Database username
                host:
                  type: string
                  description: Database host
                port:
                  type: integer
                  minimum: 0
                  maximum: 65535
                  description: Database port
                password:
                  type: string
                  description: Database password
                bigQueryJsonKey:
                  type: string
                  description: BigQuery JSON key
                bigQueryProjectId:
                  type: string
                  description: BigQuery project ID
                spannerInstanceId:
                  type: string
                  description: Spanner instance ID
                athenaWorkgroup:
                  type: string
                  description: Athena workgroup
                athenaOutputLocation:
                  type: string
                  description: Athena output location (s3://...)
                athenaCatalog:
                  type: string
                  description: Athena catalog
                sslEnabled:
                  type: boolean
                  default: true
                  description: Enable SSL connection
                sshEnabled:
                  type: boolean
                  default: false
                  description: Enable SSH tunnel
                sshHost:
                  type: string
                  description: SSH tunnel host
                sshPort:
                  type: integer
                  minimum: 0
                  maximum: 65535
                  description: SSH tunnel port
                sshUsername:
                  type: string
                  description: SSH tunnel username
                sshPassword:
                  type: string
                  description: SSH tunnel password
                sshPrivateKey:
                  type: string
                  description: SSH private key
                sshPrivateKeyPassphrase:
                  type: string
                  description: SSH private key passphrase
                maxPoolSize:
                  type: integer
                  minimum: 1
                  maximum: 100
                  description: Maximum number of connections in the pool per container
                dialect:
                  $ref: '#/components/schemas/DatabaseDialect'
              required:
                - dialect
      responses:
        '200':
          description: Credentials verified successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      success:
                        type: boolean
                        enum:
                          - true
                        description: Indicates successful connection
                    required:
                      - success
                required:
                  - data
        '400':
          description: >-
            Bad request - Invalid JSON body, validation error, or connection
            failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      title:
                        type: string
                        enum:
                          - ConnectionFailed
                        description: Error type identifier
                      detail:
                        type: string
                        description: Human-readable error description
                      fieldErrors:
                        type: object
                        properties:
                          host:
                            type: string
                            description: Host-related error
                          port:
                            type: string
                            description: Port-related error
                          username:
                            type: string
                            description: Username-related error
                          password:
                            type: string
                            description: Password-related error
                          databaseName:
                            type: string
                            description: Database name error
                          athenaOutputLocation:
                            type: string
                            description: Athena output location error
                          bigQueryJsonKey:
                            type: string
                            description: BigQuery JSON key error
                          snowflakePrivateKey:
                            type: string
                            description: Snowflake private key error
                          snowflakePrivateKeyPassphrase:
                            type: string
                            description: Snowflake passphrase error
                        description: Field-specific connection errors
                    required:
                      - title
                      - detail
                required:
                  - error
        '401':
          description: Unauthorized - Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found - Organization not found or no admin access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded - Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    DatabaseDialect:
      anyOf:
        - type: string
          enum:
            - POSTGRES
        - type: string
          enum:
            - SUPABASE
        - type: string
          enum:
            - MYSQL
        - type: string
          enum:
            - PLANETSCALE
        - type: string
          enum:
            - ATHENA
        - type: string
          enum:
            - BIGQUERY
        - type: string
          enum:
            - CLICKHOUSE
        - type: string
          enum:
            - SPANNER
        - type: string
          enum:
            - SNOWFLAKE
        - type: string
          enum:
            - REDSHIFT
        - type: string
          enum:
            - SQL_SERVER
        - type: string
          enum:
            - ORACLE
        - type: string
          enum:
            - DATABRICKS
        - type: string
          enum:
            - POSTHOG
        - type: string
          enum:
            - DUCKDB
      description: Database dialect/type
    ErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ApiError'
      required:
        - error
    RateLimitErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/RateLimitError'
      required:
        - error
    ApiError:
      type: object
      properties:
        title:
          type: string
          description: Error type identifier
        detail:
          type: string
          description: Human-readable error description
      required:
        - title
        - detail
    RateLimitError:
      allOf:
        - $ref: '#/components/schemas/ApiError'
        - type: object
          properties:
            title:
              type: string
              enum:
                - RateLimitExceeded
            retryAfterMs:
              type: number
              description: Milliseconds until the rate limit window resets
          required:
            - retryAfterMs
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authentication using Bearer token format: `Bearer
        <basedash_api_key>`

````