PgBeam Docs
Databases

Test database connection

Attempts to connect to the upstream database using the stored credentials and returns the result.

At a glance

ItemValue
MethodPOST
Path/v1/projects/{project_id}/databases/{database_id}/test-connection
AuthAuthorization: Bearer <token-or-api-key>

Quick request

Use this as a starting point. Replace the placeholder IDs, set PGBEAM_TOKEN, and create body.json from the schema below.

curl -X POST \
  "$PGBEAM_API_URL/v1/projects/<project_id>/databases/<database_id>/test-connection" \
  -H "Authorization: Bearer $PGBEAM_TOKEN" \
  -H "Content-Type: application/json" \
  --data @body.json
POST
/v1/projects/{project_id}/databases/{database_id}/test-connection
AuthorizationBearer <token>

JWT issued by Better Auth. Verified via JWKS.

In: header

Path Parameters

project_id*string

Unique project identifier (prefixed, e.g. prj_xxx).

Match^[a-zA-Z0-9_.-]+$
database_id*string

Unique database identifier (prefixed, e.g. db_xxx).

Match^[a-zA-Z0-9_.-]+$

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.pgbeam.com/v1/projects/string/databases/string/test-connection"
{
  "ok": true,
  "latency_ms": 0,
  "error": "string",
  "server_version": "string"
}
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
{
  "error": {
    "code": "string",
    "message": "string"
  }
}