Skip to main content

Databases and connections

All paths below use https://api.lordbase.com. Read conventions for headers, authentication, pagination and error handling. Values in responses are illustrative; examples show selected fields, not fixed quotas or service guarantees.

Developer tokens authorize only explicitly supported operations. Required scopes appear below; account, billing and token-management operations require a dashboard session. See token permissions.

List databases or provision a database — GET​

GET /e/v1/developer/workspaces/{workspace_id}/databases/

Authentication: Authenticated developer with an active Lordbase subscription. Use the dashboard session, or Authorization: Bearer YOUR_DEVELOPER_TOKEN with read_databases (or api). Resource roles and quotas still apply.

Request and permissions: Workspace member. Optional integer query limit (default 20,max 100) and offset (default 0). Lists creating/active/paused databases.

Required path parameters: workspace_id (UUID).

Response: 200

{
"count": 1,
"limit": 20,
"offset": 0,
"results": [
{
"id": "11111111-1111-4111-8111-111111111111",
"workspace": "22222222-2222-4222-8222-222222222222",
"display_name": "Example PostgreSQL",
"db_name": "lb_example",
"engine": "postgres",
"status": "active",
"storage_used_mb": 0,
"max_storage_mb": 1024,
"max_connections": 20,
"allowed_cidrs": [],
"allowlist_enforced": false
}
]
}

Failures: Common API errors, plus the validation, role, state, engine and plan restrictions stated above.

List databases or provision a database — POST​

POST /e/v1/developer/workspaces/{workspace_id}/databases/

Authentication: Authenticated developer with an active Lordbase subscription. Use the dashboard session, or Authorization: Bearer YOUR_DEVELOPER_TOKEN with write_databases (or api). Resource roles and quotas still apply.

Request and permissions: Owner/admin. Required JSON display_name (trimmed string,min 2); optional engine (postgres default, redis, mongodb), description, allowed_cidrs (array of CIDR/IP strings). Workspace is supplied by the path. Storage/connections are assigned from the workspace owner’s plan. Returns 201 only after provisioning succeeds; a 500 can include a database_id for inspection. Do not blindly repeat a timed-out create.

Required path parameters: workspace_id (UUID).

Field reference: Database. The operation above defines which fields to send.

Example JSON body:

{
"display_name": "Example PostgreSQL",
"engine": "postgres"
}

Response: 201

{
"id": "11111111-1111-4111-8111-111111111111",
"workspace": "22222222-2222-4222-8222-222222222222",
"display_name": "Example PostgreSQL",
"db_name": "lb_example",
"engine": "postgres",
"status": "active",
"storage_used_mb": 0,
"max_storage_mb": 1024,
"max_connections": 20,
"allowed_cidrs": [],
"allowlist_enforced": false
}

Failures: Common API errors, plus the validation, role, state, engine and plan restrictions stated above.

Inspect, update or delete a database — GET​

GET /e/v1/developer/databases/{database_id}/

Authentication: Authenticated developer with an active Lordbase subscription. Use the dashboard session, or Authorization: Bearer YOUR_DEVELOPER_TOKEN with read_databases (or api). Resource roles and quotas still apply.

Request and permissions: Workspace member; no body. Includes status and allowlist_enforced.

Required path parameters: database_id (UUID).

Response: 200

{
"id": "11111111-1111-4111-8111-111111111111",
"workspace": "22222222-2222-4222-8222-222222222222",
"display_name": "Example PostgreSQL",
"db_name": "lb_example",
"engine": "postgres",
"status": "active",
"storage_used_mb": 0,
"max_storage_mb": 1024,
"max_connections": 20,
"allowed_cidrs": [],
"allowlist_enforced": false
}

Failures: Common API errors, plus the validation, role, state, engine and plan restrictions stated above.

Inspect, update or delete a database — PATCH​

PATCH /e/v1/developer/databases/{database_id}/

Authentication: Authenticated developer with an active Lordbase subscription. Use the dashboard session, or Authorization: Bearer YOUR_DEVELOPER_TOKEN with write_databases (or api). Resource roles and quotas still apply.

Request and permissions: Workspace owner only. Partial JSON display_name, description, or allowed_cidrs. Bare IPs become /32 or /128; duplicates are removed. An empty allowlist means unrestricted IP access. This endpoint is not an engine-conversion or resource-resize workflow. Check allowlist_enforced after saving; a saved list alone does not prove enforcement.

Required path parameters: database_id (UUID).

Field reference: Database. The operation above defines which fields to send.

Example JSON body:

{
"allowed_cidrs": [
"203.0.113.10/32"
]
}

Response: 200

{
"id": "11111111-1111-4111-8111-111111111111",
"workspace": "22222222-2222-4222-8222-222222222222",
"display_name": "Example PostgreSQL",
"db_name": "lb_example",
"engine": "postgres",
"status": "active",
"storage_used_mb": 0,
"max_storage_mb": 1024,
"max_connections": 20,
"allowed_cidrs": [],
"allowlist_enforced": false
}

Failures: Common API errors, plus the validation, role, state, engine and plan restrictions stated above.

Inspect, update or delete a database — DELETE​

DELETE /e/v1/developer/databases/{database_id}/

Authentication: Authenticated developer with an active Lordbase subscription. Use the dashboard session, or Authorization: Bearer YOUR_DEVELOPER_TOKEN with write_databases (or api). Resource roles and quotas still apply.

Request and permissions: Workspace owner only; no body. Deletes the underlying database/namespace and marks the resource deleted. Data loss is destructive; verify the intended resource and recovery plan first.

Required path parameters: database_id (UUID).

Response: 204

Empty body. Do not parse JSON for this response.

Failures: Common API errors, plus the validation, role, state, engine and plan restrictions stated above.

Pause a database — POST​

POST /e/v1/developer/databases/{database_id}/pause/

Authentication: Authenticated developer with an active Lordbase subscription. Use the dashboard session, or Authorization: Bearer YOUR_DEVELOPER_TOKEN with write_databases (or api). Resource roles and quotas still apply.

Request and permissions: Owner/admin; no body. Database must be active. Pause also checks the caller’s plan can_pause_database feature. Pausing interrupts access; it is not a backup.

Required path parameters: database_id (UUID).

Response: 200

{
"id": "11111111-1111-4111-8111-111111111111",
"workspace": "22222222-2222-4222-8222-222222222222",
"display_name": "Example PostgreSQL",
"db_name": "lb_example",
"engine": "postgres",
"status": "active",
"storage_used_mb": 0,
"max_storage_mb": 1024,
"max_connections": 20,
"allowed_cidrs": [],
"allowlist_enforced": false
}

Failures: Common API errors, plus the validation, role, state, engine and plan restrictions stated above.

Resume a database — POST​

POST /e/v1/developer/databases/{database_id}/resume/

Authentication: Authenticated developer with an active Lordbase subscription. Use the dashboard session, or Authorization: Bearer YOUR_DEVELOPER_TOKEN with write_databases (or api). Resource roles and quotas still apply.

Request and permissions: Owner/admin; no body. Database must be paused. Restores access to a paused database.

Required path parameters: database_id (UUID).

Response: 200

{
"id": "11111111-1111-4111-8111-111111111111",
"workspace": "22222222-2222-4222-8222-222222222222",
"display_name": "Example PostgreSQL",
"db_name": "lb_example",
"engine": "postgres",
"status": "active",
"storage_used_mb": 0,
"max_storage_mb": 1024,
"max_connections": 20,
"allowed_cidrs": [],
"allowlist_enforced": false
}

Failures: Common API errors, plus the validation, role, state, engine and plan restrictions stated above.

Clone a PostgreSQL database — POST​

POST /e/v1/developer/databases/{database_id}/clone/

Authentication: Authenticated developer with an active Lordbase subscription. Use the dashboard session, or Authorization: Bearer YOUR_DEVELOPER_TOKEN with write_databases (or api). Resource roles and quotas still apply.

Request and permissions: Owner/admin; active source. Required JSON new_display_name (trimmed string,2..100). Clone requires plan support and quota. The copy stays in the source workspace; the optional workspace schema field does not move it. This operation currently uses PostgreSQL cloning; do not use it for Redis/MongoDB.

Required path parameters: database_id (UUID).

Field reference: DatabaseClone. The operation above defines which fields to send.

Example JSON body:

{
"new_display_name": "Example staging copy"
}

Response: 201

{
"id": "11111111-1111-4111-8111-111111111111",
"workspace": "22222222-2222-4222-8222-222222222222",
"display_name": "Example PostgreSQL",
"db_name": "lb_example",
"engine": "postgres",
"status": "active",
"storage_used_mb": 0,
"max_storage_mb": 1024,
"max_connections": 20,
"allowed_cidrs": [],
"allowlist_enforced": false
}

Failures: Common API errors, plus the validation, role, state, engine and plan restrictions stated above.

Read privileged connection details — GET​

GET /e/v1/developer/databases/{database_id}/connection/

Authentication: Authenticated developer with an active Lordbase subscription. Use the dashboard session, or Authorization: Bearer YOUR_DEVELOPER_TOKEN with write_databases (or api). Resource roles and quotas still apply.

Request and permissions: Owner/admin; no body. Database must be active or paused. Returns the admin username and decrypted password. Use the returned public host/port; do not assume the API hostname is the database host. Redis also returns key_prefix. A paused database can return details while still refusing connections.

Required path parameters: database_id (UUID).

Response: 200

{
"host": "YOUR_DATABASE_HOST",
"port": 6432,
"database": "lb_example",
"username": "ADMIN_USERNAME",
"password": "ADMIN_PASSWORD",
"connection_string": "postgresql://ADMIN_USERNAME:ADMIN_PASSWORD@YOUR_DATABASE_HOST:6432/lb_example?sslmode=require",
"ssl_mode": "require",
"engine": "postgres"
}

Failures: Common API errors, plus the validation, role, state, engine and plan restrictions stated above.