Skip to main content

Validate DB Connection

Test a database connection configuration before adding it to a project. Use this to verify host, credentials, and connection pool settings are correct — without creating or modifying any project.


Check DB Config

POST /minimal/system/api/v1/check/db/config

Request Body

FieldTypeRequiredDescription
host_detailsarray✅ YesArray of { host, port } objects
usernamestring✅ YesDatabase username
passwordstring✅ YesDatabase password
db_namestring✅ YesDatabase name to connect to
db_typestring✅ Yesmysql, postgres, mariadb, or clickhouse
connect_timeout_secsinteger✅ YesConnection timeout in seconds
idle_timeout_secsinteger✅ YesIdle connection timeout in seconds
query_timeout_secsinteger✅ YesQuery execution timeout in seconds
max_open_connectionsinteger✅ YesMaximum open connections in the pool
max_idle_connectionsinteger✅ YesMaximum idle connections in the pool
tip

Use the same connection object format here as in Create Project — if this check passes, the config is safe to use directly in your project's database array.

Required Headers

HeaderDescription
X-User-IdAuthenticated user's identifier
X-Server-KeyServer key from config.yml
Content-TypeMust be application/json

Response

200 OK — connection successful:

{
"code": 200,
"status": "OK",
"message": "database connection successful"
}

400 Bad Request — connection failed:

{
"code": 400,
"status": "Bad Request",
"message": "failed to connect to database: connection refused"
}

Common Errors

CodeCause
400Connection failed — wrong host, port, credentials, or database name
401Missing X-User-Id header
403Invalid or missing X-Server-Key
422Malformed request body — missing required field or wrong type