API Reference

Manage PostgreSQL databases, branches, computes, and more via REST. Base URL: https://api-test.lampion.cloud/v1/

Every request requires:

Authorization: Bearer lmp_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Create a key in Settings > API Keys.

Authentication

All API requests require a Bearer token. Create an API key from Settings > API Keys in the console. Keys are scoped to your organization with developer permissions. Keys expire after 90 days by default. RBAC roles hierarchy: analyst < viewer < developer < admin/owner. Analysts can only access branches where anonymization is enabled and receive a dedicated connection string with masked data.

Projects

A project is a PostgreSQL database with branching, monitoring, and auto-suspend. Creating a project provisions a compute and returns a ready-to-use connection string.

GET /v1/projects

List all projects.

Request

curl -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects

Response

[{"id":"abc123","name":"my-app","region":"fr-par-1"}]
POST /v1/projects

Create a project. Returns connection string, endpoint, password.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" \
  -d '{"name":"my-app","region":"fr-par-1"}' https://api-test.lampion.cloud/v1/projects

Response

{"id":"abc123","name":"my-app","endpoint_id":"ep-abc",
 "connection_string":"postgresql://cloud_admin:xxx@db-test.lampion.cloud:5432/ep-abc.postgres?sslmode=require",
 "pg_password":"YaQYfbg...","host":"db-test.lampion.cloud","port":5432}
GET /v1/projects/{project_id}

Get a project by ID.

Request

curl -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}

Response

{"id":"abc123","name":"my-app","region":"fr-par-1"}
PATCH /v1/projects/{project_id}

Update a project (rename, change settings).

Request

curl -X PATCH -H "Authorization: Bearer $TOKEN" -d '{"name":"my-new-name"}' https://api-test.lampion.cloud/v1/projects/{id}

Response

{"id":"abc123","name":"my-new-name","region":"fr-par-1"}
DELETE /v1/projects/{project_id}

Delete a project and all data. Irreversible.

Request

curl -X DELETE -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}

Response

204 No Content

Database Seeds

Attach up to 10 ordered SQL scripts per project. They run automatically on every new branch — test data, fixtures, extensions. Reorder, enable/disable individually.

GET /v1/projects/{id}/seeds

List all seed scripts for this project.

Request

curl -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/seeds

Response

[{"id":"seed-1","name":"fixtures","sql":"INSERT INTO ...","position":1,"enabled":true}]
POST /v1/projects/{id}/seeds

Create a new seed script.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" \
  -d '{"name":"fixtures","sql":"INSERT INTO users (name) VALUES (\'Alice\');"}' \
  https://api-test.lampion.cloud/v1/projects/{id}/seeds

Response

{"id":"seed-1","name":"fixtures","position":1,"enabled":true}
PATCH /v1/projects/{id}/seeds/{seed_id}

Update a seed (name, sql, enabled).

Request

curl -X PATCH -H "Authorization: Bearer $TOKEN" \
  -d '{"enabled":false}' https://api-test.lampion.cloud/v1/projects/{id}/seeds/{seed_id}

Response

{"id":"seed-1","enabled":false}
DELETE /v1/projects/{id}/seeds/{seed_id}

Delete a seed script.

Request

curl -X DELETE -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/seeds/{seed_id}

Response

204 No Content
POST /v1/projects/{id}/seeds/reorder

Reorder seed scripts.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" \
  -d '{"order":["seed-2","seed-1","seed-3"]}' https://api-test.lampion.cloud/v1/projects/{id}/seeds/reorder

Response

[{"id":"seed-2","position":1},{"id":"seed-1","position":2},{"id":"seed-3","position":3}]

Query Replay

Capture top queries from one branch (via pg_stat_statements) and replay them on another to detect performance regressions after migrations.

POST /v1/projects/{id}/replay

Replay top N queries from source on target. Returns timing comparison with regression detection.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" \
  -d '{"source_endpoint_id":"ep-main","target_endpoint_id":"ep-staging","limit":20}' \
  https://api-test.lampion.cloud/v1/projects/{id}/replay

Response

{"queries":[{"query":"SELECT...","source_mean_ms":1.2,"target_mean_ms":3.8,"ratio":3.17,"status":"regression"}],"summary":{"total":20,"regressions":2,"improvements":5,"stable":13}}

Branches

Copy-on-write forks. Create in under a second for testing, staging, or CI. Seed SQL runs automatically on new branches.

GET /v1/projects/{id}/branches

List all branches.

Request

curl -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/branches

Response

[{"id":"tid","name":"main","is_primary":true},{"id":"feat","name":"staging"}]
POST /v1/projects/{id}/branches

Create a branch (fork). Provisions a new compute.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" \
  -d '{"name":"staging","parent_id":"main-tid"}' https://api-test.lampion.cloud/v1/projects/{id}/branches

Response

{"id":"new-tid","name":"staging","compute_id":"ep-new","pg_port":55436}
PATCH /v1/projects/{id}/branches/{bid}

Update branch settings (TTL auto-delete, protected status).

Request

curl -X PATCH -H "Authorization: Bearer $TOKEN" -d '{"ttl_hours":24,"protected":true}' https://api-test.lampion.cloud/v1/projects/{id}/branches/{bid}

Response

{"id":"feat","name":"staging","ttl_hours":24,"protected":true}
POST .../{bid}/reset

Reset a branch to its parent's current state (like git reset --hard). Recreates the compute.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/branches/{bid}/reset

Response

{"id":"feat","name":"staging","compute_id":"ep-new2","status":"running"}
POST .../{bid}/merge

Merge schema changes (DDL only) from this branch to the parent. Use dry_run=true to preview SQL.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" \
  -d '{"dry_run":true}' https://api-test.lampion.cloud/v1/projects/{id}/branches/{bid}/merge

Response

{"dry_run":true,"sql":"ALTER TABLE users ADD COLUMN avatar TEXT;","changes":1}
DELETE /v1/projects/{id}/branches/{bid}

Delete a branch and its compute.

Request

curl -X DELETE -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/branches/{bid}

Response

204 No Content

Endpoints (Computes)

PostgreSQL compute instances. Suspend/resume, configure auto-suspend, manage IP allowlists.

GET /v1/projects/{id}/endpoints/{eid}

Get a single endpoint by ID (status, connection string, settings).

Request

curl -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}

Response

{"id":"ep-abc","status":"running","connection_string":"postgresql://...","auto_suspend_seconds":300,"compute_cu":0.25}
GET /v1/projects/{id}/endpoints

List endpoints with connection strings and passwords.

Request

curl -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/endpoints

Response

[{"id":"ep-abc","status":"running","connection_string":"postgresql://...","pg_password":"xxx"}]
POST .../{eid}/suspend

Suspend (scale to zero).

Request

curl -X POST -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}/suspend

Response

{"id":"ep-abc","status":"suspended"}
POST .../{eid}/resume

Resume a suspended compute.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}/resume

Response

{"id":"ep-abc","status":"running"}
PATCH .../{eid}

Update settings (auto_suspend_seconds).

Request

curl -X PATCH -H "Authorization: Bearer $TOKEN" -d '{"auto_suspend_seconds":600}' https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}

Response

{"id":"ep-abc","auto_suspend_seconds":600}
GET .../{eid}/allowlist

Get IP allowlist.

Request

curl -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}/allowlist

Response

["10.0.0.0/8"]
PUT .../{eid}/allowlist

Replace IP allowlist.

Request

curl -X PUT -H "Authorization: Bearer $TOKEN" -d '{"allowlist":["10.0.0.0/8"]}' https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}/allowlist

Response

["10.0.0.0/8"]
GET /v1/projects/{id}/endpoints/compute-sizes

List available compute sizes (CU tiers).

Request

curl -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/endpoints/compute-sizes

Response

[{"cu":0.25,"label":"0.25 CU","vcpu":0.25,"memory_gb":0.5},{"cu":1,"label":"1 CU","vcpu":1,"memory_gb":2},{"cu":4,"label":"4 CU","vcpu":4,"memory_gb":8}]
PATCH .../{eid}

Resize compute. Set compute_cu, or enable autoscaling with min_cu/max_cu.

Request

curl -X PATCH -H "Authorization: Bearer $TOKEN" \
  -d '{"compute_cu":2,"min_cu":0.5,"max_cu":4}' https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}

Response

{"id":"ep-abc","compute_cu":2,"min_cu":0.5,"max_cu":4}

SQL Execution

Execute queries via the API. Supports multi-statement scripts and psql meta-commands.

POST .../{eid}/sql

Execute SQL. Returns columns, rows, duration.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" \
  -d '{"query":"SELECT * FROM users LIMIT 5"}' https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}/sql

Response

{"columns":["id","name"],"rows":[{"id":1,"name":"Alice"}],"duration":12}

Schema Introspection

Browse databases, schemas, tables, and columns.

GET /v1/projects/{id}/schema

No params = databases. ?database=X = schemas. ?database=X&schema=Y = tables + columns.

Request

curl -H "Authorization: Bearer $TOKEN" "https://api-test.lampion.cloud/v1/projects/{id}/schema?database=postgres&schema=public"

Response

{"type":"tables","items":[{"name":"users","columns":[{"name":"id","type":"integer"},{"name":"email","type":"text"}]}]}

Databases

CRUD PostgreSQL databases within an endpoint.

GET .../{eid}/databases

List databases.

Request

curl -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}/databases

Response

[{"name":"postgres","encoding":"UTF8","size_bytes":8945664}]
POST .../{eid}/databases

Create a database.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" -d '{"name":"myapp"}' https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}/databases

Response

{"name":"myapp"}
DELETE .../{eid}/databases/{name}

Drop a database.

Request

curl -X DELETE -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}/databases/myapp

Response

204 No Content

Roles

Manage PostgreSQL roles.

GET .../{eid}/roles

List roles.

Request

curl -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}/roles

Response

[{"name":"cloud_admin","is_superuser":true,"can_login":true}]
POST .../{eid}/roles

Create a role.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" -d '{"name":"appuser","password":"secret","can_login":true}' https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}/roles

Response

{"name":"appuser","can_login":true}
DELETE .../{eid}/roles/{name}

Drop a role.

Request

curl -X DELETE -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}/roles/appuser

Response

204 No Content
POST .../{eid}/roles/{name}/reset-password

Generate a new password for a role. Visible ONCE in the response.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}/roles/appuser/reset-password

Response

{"name":"appuser","password":"new-generated-password-xyz"}

Permissions

Manage table-level privileges (GRANT/REVOKE). Supported privileges: SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER, ALL.

GET .../{eid}/permissions

List table-level grants for the endpoint.

Request

curl -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}/permissions

Response

[{"table":"public.users","role":"appuser","privileges":["SELECT","INSERT","UPDATE"]},{"table":"public.orders","role":"appuser","privileges":["SELECT"]}]
GET .../{eid}/permissions/tables

List available tables for granting permissions.

Request

curl -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}/permissions/tables

Response

[{"schema":"public","table":"users"},{"schema":"public","table":"orders"}]
POST .../{eid}/permissions/grant

Grant privileges on a table to a role.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" \
  -d '{"role":"appuser","schema":"public","table":"users","privileges":["SELECT","INSERT"]}' \
  https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}/permissions/grant

Response

{"role":"appuser","table":"public.users","granted":["SELECT","INSERT"]}
POST .../{eid}/permissions/revoke

Revoke privileges on a table from a role.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" \
  -d '{"role":"appuser","schema":"public","table":"users","privileges":["INSERT"]}' \
  https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}/permissions/revoke

Response

{"role":"appuser","table":"public.users","revoked":["INSERT"]}

Tables (DDL)

Create, drop, and alter tables and columns via the API. All operations execute DDL statements on the target endpoint.

POST .../{eid}/tables

Create a table with columns (name, type, primary key, NOT NULL).

Request

curl -X POST -H "Authorization: Bearer $TOKEN" \
  -d '{"name":"orders","columns":[{"name":"id","type":"serial","primary_key":true},{"name":"total","type":"numeric","nullable":false}]}' \
  https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}/tables

Response

{"table":"orders","columns":["id","total"]}
DELETE .../{eid}/tables/{table}

Drop a table. Irreversible.

Request

curl -X DELETE -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}/tables/orders

Response

204 No Content
POST .../{eid}/tables/{table}/rename

Rename a table.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" \
  -d '{"new_name":"customer_orders"}' https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}/tables/orders/rename

Response

{"old_name":"orders","new_name":"customer_orders"}
POST .../{eid}/tables/{table}/columns

Add a column to a table.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" \
  -d '{"name":"status","type":"text","nullable":true,"default":"pending"}' \
  https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}/tables/orders/columns

Response

{"column":"status","type":"text"}
DELETE .../{eid}/tables/{table}/columns/{col}

Drop a column from a table.

Request

curl -X DELETE -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}/tables/orders/columns/status

Response

204 No Content
POST .../{eid}/tables/{table}/columns/rename

Rename a column.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" \
  -d '{"old_name":"total","new_name":"total_amount"}' \
  https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}/tables/orders/columns/rename

Response

{"old_name":"total","new_name":"total_amount"}
PATCH .../{eid}/tables/{table}/columns/{col}

Alter a column (type, nullable, default).

Request

curl -X PATCH -H "Authorization: Bearer $TOKEN" \
  -d '{"type":"numeric(10,2)","nullable":false,"default":"0"}' \
  https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}/tables/orders/columns/total

Response

{"column":"total","type":"numeric(10,2)","nullable":false,"default":"0"}

Extensions

Install and manage PostgreSQL extensions.

GET .../{eid}/extensions

List extensions.

Request

curl -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}/extensions

Response

[{"name":"plpgsql","installed":true},{"name":"pgvector","installed":false}]
POST .../{eid}/extensions

Install an extension.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" -d '{"name":"pgvector"}' https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}/extensions

Response

{"name":"pgvector","installed":true}
DELETE .../{eid}/extensions/{name}

Uninstall an extension.

Request

curl -X DELETE -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}/extensions/pgvector

Response

204 No Content

PII Masking (Anonymization)

Dynamically mask sensitive columns on a branch using postgresql_anonymizer. Enable per branch (never on production), define rules per column, choose from a strict allowlist of masking functions. When enabled, a PostgreSQL role lampion_analyst with MASKED label is auto-created. Users with the analyst RBAC role get a dedicated analyst_connection_string that connects as lampion_analyst and sees only anonymized data.

GET .../branches/{bid}/anonymization

Get anonymization status and active rules.

Request

curl -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/branches/{bid}/anonymization

Response

{"enabled":true,"analyst_connection_string":"postgresql://lampion_analyst:xxx@db-test.lampion.cloud:5432/ep-abc.postgres?sslmode=require","rules":[{"id":"r-1","schema_name":"public","table_name":"users","column_name":"email","masking_function":"anon.fake_email()"}]}
POST .../anonymization/enable

Enable dynamic masking on this branch. Installs the anon extension, applies all rules, and creates a lampion_analyst PostgreSQL role with MASKED label. Returns an analyst_connection_string for read-only anonymized access.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/branches/{bid}/anonymization/enable

Response

{"enabled":true,"analyst_connection_string":"postgresql://lampion_analyst:xxx@db-test.lampion.cloud:5432/ep-abc.postgres?sslmode=require"}
POST .../anonymization/disable

Disable masking and remove all security labels.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/branches/{bid}/anonymization/disable

Response

{"enabled":false}
GET .../anonymization/functions

List allowed masking functions (allowlist anti-injection).

Request

curl -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/branches/{bid}/anonymization/functions

Response

[{"function":"anon.fake_email()","description":"Fake email address"},{"function":"anon.fake_iban()","description":"Fake IBAN"},{"function":"anon.hash({COL})","description":"SHA256 hash"}]
GET .../anonymization/rules

List masking rules for this branch.

Request

curl -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/branches/{bid}/anonymization/rules

Response

[{"id":"r-1","schema_name":"public","table_name":"users","column_name":"email","masking_function":"anon.fake_email()"}]
POST .../anonymization/rules

Add a masking rule. Applied live if anonymization is enabled.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" \
  -d '{"table_name":"users","column_name":"email","masking_function":"anon.fake_email()"}' \
  https://api-test.lampion.cloud/v1/projects/{id}/branches/{bid}/anonymization/rules

Response

{"id":"r-1","schema_name":"public","table_name":"users","column_name":"email","masking_function":"anon.fake_email()"}
DELETE .../anonymization/rules/{rule_id}

Delete a masking rule. Removes the security label live if enabled.

Request

curl -X DELETE -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/branches/{bid}/anonymization/rules/{rule_id}

Response

204 No Content

Metrics & Usage

Real-time metrics and monthly usage for billing.

GET /v1/projects/{id}/metrics

Live: connections, cache ratio, storage, CPU, memory.

Request

curl -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/metrics

Response

{"connections_total":5,"cache_hit_ratio":98.5,"storage_logical_mb":42.3,"compute_cpu_seconds":123.4}
GET /v1/projects/{id}/metrics/history

Historical metrics (24h max, every 30s).

Request

curl -H "Authorization: Bearer $TOKEN" "https://api-test.lampion.cloud/v1/projects/{id}/metrics/history?hours=6"

Response

[{"snapshot_at":"...","connections_total":3,"storage_logical_mb":42.1}]
GET /v1/projects/{id}/usage

Monthly: compute hours, storage GB, transfer GB.

Request

curl -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/usage

Response

{"compute_hours":12.5,"storage_gb":0.042,"transfer_total_gb":0.001,"period":"2026-03"}
GET /v1/usage

Org-wide usage with plan info and cost estimation.

Request

curl -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/usage

Response

{"plan":{"name":"dev"},"total":{"compute_hours":25},"estimated_cost":{"total_usd":2.65}}
GET /v1/projects/{id}/metrics/compute-history

Compute usage history (suspend/resume events).

Request

curl -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/metrics/compute-history

Response

[{"timestamp":"...","event":"resume","duration_s":3600}]
GET /v1/projects/{id}/metrics/vacuum

Vacuum and autovacuum statistics per table.

Request

curl -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/metrics/vacuum

Response

[{"table":"users","last_vacuum":"...","dead_tuples":42,"autovacuum_count":3}]

Query Analysis

Slow query dashboard via pg_stat_statements. Top queries by total time, mean time, or call count.

GET .../{eid}/analyse/slow-queries

Top slow queries. ?order_by=total_time|mean_time|calls&limit=30

Request

curl -H "Authorization: Bearer $TOKEN" "https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}/analyse/slow-queries?order_by=mean_time"

Response

[{"query":"SELECT...","calls":150,"mean_time_ms":12.3,"total_time_ms":1845,"cache_hit_pct":98.5}]
POST .../{eid}/analyse/reset-stats

Reset all pg_stat_statements counters.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}/analyse/reset-stats

Response

{"ok":true}

Logs

PostgreSQL server logs.

GET .../{eid}/logs

Tail PG logs. ?lines=N (default 200, max 5000).

Request

curl -H "Authorization: Bearer $TOKEN" "https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}/logs?lines=50"

Response

{"lines":["2026-03-30 LOG: connection authorized"],"count":50}

Backups & PITR

Snapshot your database at any point. Restore to a new branch without touching production.

GET /v1/projects/{id}/backups

List backup snapshots.

Request

curl -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/backups

Response

[{"id":"bk-42","name":"before-migration","branch_id":"main-tid","lsn":"0/15A2C08","created_at":"2026-04-01T10:00:00Z"}]
GET /v1/projects/{id}/backups/{bid}

Get a backup by ID.

Request

curl -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/backups/{bid}

Response

{"id":"bk-42","name":"before-migration","lsn":"0/15A2C08"}
POST /v1/projects/{id}/backups

Create a backup snapshot.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" \
  -d '{"name":"before-migration","branch_id":"main-tid"}' https://api-test.lampion.cloud/v1/projects/{id}/backups

Response

{"id":"bk-42","name":"before-migration","lsn":"0/15A2C08"}
DELETE /v1/projects/{id}/backups/{bid}

Delete a backup.

Request

curl -X DELETE -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/backups/{bid}

Response

204 No Content
POST /v1/projects/{id}/backups/{bid}/restore

Restore to a new branch at this LSN.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/backups/{bid}/restore

Response

{"branch_id":"restored-bk-42","compute_id":"ep-new"}

SQL Dump

pg_dump export via the API. Filterable by database or table.

GET .../{eid}/dump

Download pg_dump SQL. ?database=X&table=Y for single table.

Request

curl -H "Authorization: Bearer $TOKEN" "https://api-test.lampion.cloud/v1/projects/{id}/endpoints/{eid}/dump" -o dump.sql

Response

-- SQL dump saved to dump.sql

Read Replicas

Add read-only replicas to any branch. Each replica has its own connection string and can be suspended independently.

GET /v1/projects/{id}/branches/{bid}/replicas

List replicas for a branch.

Request

curl -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/branches/{bid}/replicas

Response

[{"id":"rep-1","status":"running","connection_string":"postgresql://...","read_only":true}]
POST /v1/projects/{id}/branches/{bid}/replicas

Create a read replica.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/branches/{bid}/replicas

Response

{"id":"rep-1","status":"running","connection_string":"postgresql://...","read_only":true}
DELETE .../{rid}

Delete a replica.

Request

curl -X DELETE -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/branches/{bid}/replicas/{rid}

Response

204 No Content
POST .../{rid}/suspend

Suspend a replica.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/branches/{bid}/replicas/{rid}/suspend

Response

{"id":"rep-1","status":"suspended"}
POST .../{rid}/resume

Resume a suspended replica.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/branches/{bid}/replicas/{rid}/resume

Response

{"id":"rep-1","status":"running"}

Webhooks

HTTP notifications on events. Payloads signed HMAC-SHA256.

GET /v1/orgs/webhooks

List webhooks.

Request

curl -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/orgs/webhooks

Response

[{"id":"wh-abc","url":"https://...","events":["*"],"enabled":true}]
POST /v1/orgs/webhooks

Create webhook. Returns signing secret.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" \
  -d '{"url":"https://hook.example.com","events":["project.created"]}' https://api-test.lampion.cloud/v1/orgs/webhooks

Response

{"id":"wh-abc","secret":"a1b2c3...","events":["project.created"]}
PATCH /v1/orgs/webhooks/{id}

Update webhook.

Request

curl -X PATCH -H "Authorization: Bearer $TOKEN" -d '{"enabled":false}' https://api-test.lampion.cloud/v1/orgs/webhooks/{id}

Response

{"id":"wh-abc","enabled":false}
DELETE /v1/orgs/webhooks/{id}

Delete webhook.

Request

curl -X DELETE -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/orgs/webhooks/{id}

Response

204 No Content

Members & Invitations

Manage organization members, invite collaborators, transfer ownership. Roles: owner, admin, developer, viewer, analyst. The analyst role restricts access to branches with anonymization enabled — analysts see only masked data via a dedicated connection string.

GET /v1/orgs/members

List organization members.

Request

curl -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/orgs/members

Response

[{"user_id":"u-1","email":"alice@corp.com","role":"owner"},{"user_id":"u-2","email":"bob@corp.com","role":"developer"},{"user_id":"u-3","email":"analyst@corp.com","role":"analyst"}]
PATCH /v1/orgs/members/{uid}/role

Change a member's role. Valid roles: owner, admin, developer, viewer, analyst.

Request

curl -X PATCH -H "Authorization: Bearer $TOKEN" -d '{"role":"analyst"}' https://api-test.lampion.cloud/v1/orgs/members/{uid}/role

Response

{"user_id":"u-3","role":"analyst"}
DELETE /v1/orgs/members/{uid}

Remove a member from the organization.

Request

curl -X DELETE -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/orgs/members/{uid}

Response

204 No Content
POST /v1/orgs/transfer-ownership

Transfer ownership to another member.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" -d '{"user_id":"u-2"}' https://api-test.lampion.cloud/v1/orgs/transfer-ownership

Response

{"ok":true}
GET /v1/orgs/invitations

List pending invitations.

Request

curl -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/orgs/invitations

Response

[{"id":"inv-1","email":"carol@corp.com","role":"developer","status":"pending"}]
POST /v1/orgs/invitations

Invite a user by email.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" \
  -d '{"email":"carol@corp.com","role":"developer"}' https://api-test.lampion.cloud/v1/orgs/invitations

Response

{"id":"inv-1","email":"carol@corp.com","role":"developer","status":"pending"}
DELETE /v1/orgs/invitations/{inv_id}

Cancel a pending invitation.

Request

curl -X DELETE -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/orgs/invitations/{inv_id}

Response

204 No Content

API Keys

Manage API keys for your organization. Keys use the lmp_live_ prefix and have developer-level permissions.

GET /v1/orgs/api-keys

List API keys (truncated values).

Request

curl -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/orgs/api-keys

Response

[{"id":"key-1","name":"CI/CD","prefix":"lmp_live_abc...","created_at":"2026-04-01T10:00:00Z"}]
POST /v1/orgs/api-keys

Create a new API key. The full key is returned only once.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" -d '{"name":"CI/CD"}' https://api-test.lampion.cloud/v1/orgs/api-keys

Response

{"id":"key-1","name":"CI/CD","key":"lmp_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}
DELETE /v1/orgs/api-keys/{key_id}

Revoke an API key.

Request

curl -X DELETE -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/orgs/api-keys/{key_id}

Response

204 No Content

Audit Log

Every action (project creation, invitation, role change, deletion) is tracked. Available to owners.

GET /v1/orgs/audit-log

List audit events. ?limit=N&offset=N for pagination.

Request

curl -H "Authorization: Bearer $TOKEN" "https://api-test.lampion.cloud/v1/orgs/audit-log?limit=10"

Response

[{"action":"project.created","actor":"alice@corp.com","target":"my-app","created_at":"2026-04-01T10:00:00Z"}]

Database Import

Import an external PostgreSQL database into a new branch via pg_dump | psql. Validates the source, checks extensions compatibility, and creates the branch automatically.

POST /v1/projects/{id}/import/validate

Validate source DSN: test connection, check PG version, size, extensions compatibility.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" \
  -d '{"source_dsn":"postgresql://user:pass@host:5432/mydb"}' \
  https://api-test.lampion.cloud/v1/projects/{id}/import/validate

Response

{"ok":true,"errors":[],"source":{"pg_version":"17.5","size_mb":142,"tables":12,"extensions":[{"name":"pgvector","version":"0.8.0","available_on_target":true}]}}
POST /v1/projects/{id}/import/start

Start the import. Creates a new branch and pipes pg_dump | psql from the source DSN.

Request

curl -X POST -H "Authorization: Bearer $TOKEN" \
  -d '{"source_dsn":"postgresql://user:pass@host:5432/mydb","branch_name":"imported"}' \
  https://api-test.lampion.cloud/v1/projects/{id}/import/start

Response

{"branch_id":"imp-tid","branch_name":"imported","compute_id":"ep-imp","status":"importing"}

Data Residency

Proof of where your data physically resides. Region, datacenter, provider, certifications, encryption per layer.

GET /v1/projects/{id}/residency

Get full data residency report for a project.

Request

curl -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/projects/{id}/residency

Response

{"region_id":"fr-par-1","region":{"city":"Paris","provider":"Scaleway","datacenter":"DC2","certifications":["ISO 27001","HDS"]},"data_layers":[...],"compliance":{"data_in_country":"France"}}

Plans

Pricing plans.

GET /v1/plans

List plans with limits and pricing.

Request

curl -H "Authorization: Bearer $TOKEN" https://api-test.lampion.cloud/v1/plans

Response

[{"name":"free","max_projects":3,"cu_hour_usd":0},{"name":"dev","cu_hour_usd":0.09},{"name":"pro","cu_hour_usd":0.09}]