Skip to main content
POST
/
api
/
public
/
organizations
/
{orgId}
/
data-sources
/
verify
Verify data source credentials
curl --request POST \
  --url https://charts.basedash.com/api/public/organizations/{orgId}/data-sources/verify \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "dialect": "POSTGRES",
  "snowflakeAccountId": "<string>",
  "snowflakeWarehouse": "<string>",
  "snowflakeRole": "<string>",
  "snowflakePrivateKey": "<string>",
  "snowflakePrivateKeyPassphrase": "<string>",
  "databaseName": null,
  "username": "<string>",
  "host": "<string>",
  "port": 32767,
  "password": "<string>",
  "bigQueryJsonKey": "<string>",
  "bigQueryProjectId": "<string>",
  "spannerInstanceId": "<string>",
  "sslEnabled": true,
  "sshEnabled": false,
  "sshHost": "<string>",
  "sshPort": 32767,
  "sshUsername": "<string>",
  "sshPassword": "<string>",
  "sshPrivateKey": "<string>",
  "sshPrivateKeyPassphrase": "<string>"
}
'
{
  "data": {
    "success": true
  }
}

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.

Authorizations

Authorization
string
header
required

API key authentication using Bearer token format: Bearer <basedash_api_key>

Path Parameters

orgId
string
required

Organization ID

Body

application/json
dialect
required

Database dialect/type

Available options:
POSTGRES
snowflakeAccountId
string

Snowflake account ID

snowflakeWarehouse
string

Snowflake warehouse

snowflakeRole
string

Snowflake role

snowflakePrivateKey
string

Snowflake private key

snowflakePrivateKeyPassphrase
string

Snowflake private key passphrase

databaseName
string | null

Database name

username
string

Database username

host
string

Database host

port
integer

Database port

Required range: 0 <= x <= 65535
password
string

Database password

bigQueryJsonKey
string

BigQuery JSON key

bigQueryProjectId
string

BigQuery project ID

spannerInstanceId
string

Spanner instance ID

sslEnabled
boolean
default:true

Enable SSL connection

sshEnabled
boolean
default:false

Enable SSH tunnel

sshHost
string

SSH tunnel host

sshPort
integer

SSH tunnel port

Required range: 0 <= x <= 65535
sshUsername
string

SSH tunnel username

sshPassword
string

SSH tunnel password

sshPrivateKey
string

SSH private key

sshPrivateKeyPassphrase
string

SSH private key passphrase

Response

Credentials verified successfully

data
object
required