Skip to content

Load Enterprise Data Using the REST API

Enterprise data from external systems can be loaded into your tenant’s PostgreSQL schema using simple REST calls.
You’ll learn how to: - Create schemas tied to tenant identity
- Upload structured (relational) and JSON-based data
- Organize application data using named schemas


Step 0 — Drop existing schema

Drop existing schema with cascade.

DB_BASE=""
curl -X POST "${DB_BASE}/drop-schema" \
    -H "Authorization: Bearer ${DB_KEY}" \
    -H "Content-Type: application/json" \
    -d '{
    "schema_name": "filmdata1",
    "if_exists": true
    }'

DB_BASE=""
import requests

resp = requests.post(
    f"{DB_BASE}/drop-schema",
    headers={"Authorization": f"Bearer {DB_KEY}", "Content-Type": "application/json"},
    json={"schema_name": "filmdata1", "if_exists": True}
)
print(resp.json())

DB_BASE=""
await fetch(`${DB_BASE}/drop-schema`, {
method: "POST",
headers: {
    "Authorization": `Bearer ${DB_KEY}`,
    "Content-Type": "application/json"
},
body: JSON.stringify({ schema_name: "filmdata1", if_exists: true })
});


Step 1 — Restore a Database Backup

This step sends your local SQL dump to the /restore-backup endpoint. The schemaName query parameter controls which PostgreSQL schema the data is loaded into.

Step 2 — Generate ERD (Mermaid)

Invoke /create-erd to produce an entity-relationship diagram in Mermaid format for your restored schema.


Inspect the API: After you restore the database, you can view and test all of your schema’s database endpoints in Swagger: