🔐 Authentication
All endpoints except /signup and /login require an API key.
🔑
Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Create a new account. Returns an API key for your first project.
Request Body
| Field | Type | | Description |
| email |
string |
required |
Email address |
| password |
string |
required |
Password (min 8 characters) |
| project_name |
string |
optional |
Project name (default: "My Project") |
Response
{
"success": true,
"api_key": "tenantsdb_sk_a91de156...",
"project_id": "tdb_2abf90d3"
}
Login to existing account. Returns all projects with API keys.
Request Body
| Field | Type | | Description |
| email |
string |
required |
Email address |
| password |
string |
required |
Password |
Response
{
"success": true,
"projects": [
{
"project_id": "tdb_2abf90d3",
"name": "Healthcare SaaS",
"api_key": "tenantsdb_sk_a91de156..."
}
]
}
📁 Projects
Projects are the top-level organizational boundary. Each project has its own workspaces, blueprints, tenants, and API keys.
List all projects for the authenticated customer.
{
"success": true,
"count": 2,
"projects": [
{
"project_id": "tdb_2abf90d3",
"name": "Healthcare SaaS",
"api_key_count": 2,
"created_at": "2026-01-17T20:12:06Z"
},
{
"project_id": "tdb_43cd4942",
"name": "E-commerce Platform",
"api_key_count": 1,
"created_at": "2026-01-17T20:12:24Z"
}
]
}
Create a new project. Returns a new API key.
Request Body
| Field | Type | | Description |
| name |
string |
required |
Project name |
Switch to a different project. Returns the API key for the target project. Accepts project ID or project name.
Response
{
"success": true,
"project_id": "tdb_43cd4942",
"name": "E-commerce Platform",
"api_key": "tenantsdb_sk_42d5be1a...",
"proxy_password": "tdb_a9b55759ef905535"
}
Delete a project and all its resources (workspaces, blueprints, tenants, API keys).
🔑 API Keys
Manage API keys for the current project.
List all API keys for the current project.
🏗️ Workspaces
Workspaces are development environments where you design your database schema. Changes in workspaces are captured as blueprints for deployment.
Create a workspace. Automatically creates a linked blueprint.
Request Body
| Field | Type | | Description |
| name |
string |
required |
Workspace name |
| database |
string |
required |
PostgreSQL, MySQL, MongoDB, or Redis |
Response
{
"success": true,
"id": "myapp",
"blueprint": "myapp",
"database": "PostgreSQL",
"connection": {
"host": "pg.tenantsdb.com",
"port": 5432,
"database": "myapp_dev",
"user": "tdb_2abf90d3",
"password": "tdb_d2bf66ed7898c448"
},
"connection_string": "postgresql://tdb_2abf90d3:tdb_d2bf66ed@pg.tenantsdb.com:5432/myapp_dev"
}
Get workspace details including schema and connection info.
Delete a workspace. Fails if tenants are deployed to its blueprint.
Run a query in the workspace dev database.
Import schema from template, JSON, or external database.
From Template
{
"source": "template",
"template": "fintech"
}
From Database
{
"source": "database",
"connection": {
"type": "postgresql",
"host": "db.example.com",
"port": 5432,
"database": "mydb",
"user": "admin",
"password": "secret"
}
}
Get pending DDL changes ready for deployment.
Import data from an external database. Tenants are auto-created based on the routing field.
Request Body
{
"connection": {
"type": "postgresql",
"host": "db.example.com",
"port": 5432,
"database": "mydb",
"user": "admin",
"password": "secret"
},
"routing_field": "tenant_id",
"options": {
"drop_routing_column": true,
"create_tenants": true
}
}
📐 Blueprints
Blueprints are versioned schema snapshots created from workspaces. They define what gets deployed to tenant databases.
Get blueprint schema and deployment status.
List all versions of a blueprint.
👥 Tenants
Tenants are your customers' isolated database instances. Each tenant gets its own physical database, created from a blueprint.
L1
Shared
Multi-tenant pool. Cost-effective, instant provisioning. Each tenant gets a separate database on a shared server.
L2
Dedicated
Own VM. Full physical isolation, dedicated resources. Provisioned on Hetzner Cloud (~2 min).
List all tenants for the current project.
Create a new tenant with database(s) from blueprint(s).
Request Body
| Field | Type | | Description |
| tenant_id |
string |
required |
Tenant name |
| databases |
array |
required |
Array of {blueprint, isolation_level} |
Response
{
"success": true,
"tenant_id": "acme",
"status": "ready",
"databases": [
{
"blueprint": "fintech",
"database_type": "PostgreSQL",
"isolation_level": 1,
"connection": {
"database": "fintech__acme",
"connection_string": "postgresql://tdb_2abf90d3:tdb_d2bf66ed@pg.tenantsdb.com:5432/fintech__acme"
}
}
]
}
Get tenant details with all database connections.
Soft-delete a tenant. Add ?hard=true for permanent deletion.
Suspend a tenant (block all queries).
Resume a suspended tenant.
Migrate tenant between isolation levels (L1 ↔ L2). Zero-downtime migration with automatic data transfer.
Request Body
Trigger an on-demand backup to S3.
List all backups for a tenant.
Get query execution logs.
Query Parameters
| Param | Type | | Description |
| type |
string |
optional |
Filter: error, slow |
| since |
string |
optional |
Time filter: 1h, 24h, 7d |
Get performance metrics (query count, latency, success rate).
🚀 Deployments
Deploy blueprint schema changes to tenant databases. Runs DDL migrations across all or selected tenants.
List all deployment jobs.
Create a new deployment.
Request Body
| Field | Type | | Description |
| blueprint_name |
string |
required |
Blueprint to deploy |
| version |
string |
optional |
Version to deploy |
| deploy_all |
boolean |
optional |
Deploy to all tenants |
Get deployment status and progress.
⚡ Admin
Direct query execution on tenant databases.
Run a query directly on one or all tenant databases.
Request Body
| Field | Type | | Description |
| tenant_id |
string |
optional* |
Target tenant |
| query |
string |
required |
OQL or native query |
| database_type |
string |
optional |
PostgreSQL, MySQL, MongoDB, Redis |
| blueprint |
string |
required |
Blueprint name |
| all_tenants |
boolean |
optional* |
Query all tenants |
* Either tenant_id or all_tenants: true is required.