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
| Field | Type | Required | Description |
|---|---|---|---|
host_details | array | ✅ Yes | Array of { host, port } objects |
username | string | ✅ Yes | Database username |
password | string | ✅ Yes | Database password |
db_name | string | ✅ Yes | Database name to connect to |
db_type | string | ✅ Yes | mysql, postgres, mariadb, or clickhouse |
connect_timeout_secs | integer | ✅ Yes | Connection timeout in seconds |
idle_timeout_secs | integer | ✅ Yes | Idle connection timeout in seconds |
query_timeout_secs | integer | ✅ Yes | Query execution timeout in seconds |
max_open_connections | integer | ✅ Yes | Maximum open connections in the pool |
max_idle_connections | integer | ✅ Yes | Maximum 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
| Header | Description |
|---|---|
X-User-Id | Authenticated user's identifier |
X-Server-Key | Server key from config.yml |
Content-Type | Must 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
| Code | Cause |
|---|---|
400 | Connection failed — wrong host, port, credentials, or database name |
401 | Missing X-User-Id header |
403 | Invalid or missing X-Server-Key |
422 | Malformed request body — missing required field or wrong type |