Skip to Content
API ReferenceDatabases

Databases

All endpoints require Authorization: Bearer TOKEN.

Create Database

POST /api/v1/databases

Body:

{ "name": "my-postgres", "engine": "postgresql", "project_id": "prj_abc123" }
FieldTypeOptions
namestringAlphanumeric, hyphens allowed
enginestringpostgresql, redis, mongodb
project_idstringProject to associate with

List Databases

GET /api/v1/databases

Get Database

GET /api/v1/databases/:id

Delete Database

DELETE /api/v1/databases/:id

Get Credentials

GET /api/v1/databases/:id/credentials

Response: 200

{ "host": "pg-mypostgres-a1b2c3d4-0.databases.svc.cluster.local", "port": 5432, "username": "u_mypostgres", "password": "generated_password", "database": "db_mypostgres", "connection_string": "postgresql://u_mypostgres:pass@host:5432/db_mypostgres" }

Injects connection environment variables into the project.

POST /api/v1/databases/:id/link

Body:

{ "project_id": "prj_abc123" }
POST /api/v1/databases/:id/unlink

Expose (Enable External Access)

POST /api/v1/databases/:id/expose

Creates a public proxy at *.db.espace-tech.com.

Unexpose

POST /api/v1/databases/:id/unexpose

Rotate Credentials

POST /api/v1/databases/:id/rotate

Stop / Start

POST /api/v1/databases/:id/stop POST /api/v1/databases/:id/start

Backups

Create Backup

POST /api/v1/databases/:id/backups

List Backups

GET /api/v1/databases/:id/backups

Restore Backup

POST /api/v1/databases/:id/backups/:backupId/restore

Delete Backup

DELETE /api/v1/databases/:id/backups/:backupId