Skip to content
中文

Database API

Database is a headless content store: structured tables and rows that people, agents and scripts read and write directly through the API, the way a headless CMS works. Concepts and behavior follow Supabase (PostgREST filters, projections, ordering and row writes via supabase-js), so Supabase experience applies. Differences: storage uses SQLite, not PostgreSQL, and schema changes use table/field APIs rather than SQL migrations or raw SQL; access uses a Praxis credential scoped to its tenant, with no Supabase Auth or row-level security policies; realtime row subscriptions are unavailable; casts, aggregates, spread and join modifiers are unsupported, and filtered planned/estimated counts may be unknown; upsert targets id or one unique field rather than composite keys. A database is one of two types, and the URL says which: /database/v1/table holds tables and rows, read and written through the tables and rows operations and the Supabase-compatible face described above; /database/v1/kv (键值库, a key-value store) holds Redis-style keys and values (strings, hashes, lists, sets, sorted sets with optional TTL), read and written through the keys and commands operations or the Upstash-compatible Redis face at /redis/<database_id>. Choose table for structured records you filter and join by field; choose kv for caches, counters, sessions, queues and anything an existing Redis or @upstash/redis client already talks to. The path is the type: the id of a database of the other type returns 404 DATABASE_NOT_FOUND, the same as an unknown id. The older /database/v1/databases paths are deprecated and stop working on 2027-03-01. Start with praxis.database.table.create to create a table database, then use its returned id for tables and rows; or praxis.database.kv.create for a key-value database, then use its id for keys and commands. In the Praxis Application Model, Database is the system of record for an application’s business data; applications keep only application state in their own components.

Use your API Key as a Bearer credential to manage databases and table structure.

https://api.deepraxis.com/database/v1

Guide →

Resource Path
Table databases /database/v1/table
Tables /database/v1/table/{database_id}/tables
Fields /database/v1/table/{database_id}/tables/{table}/fields
Events /database/v1/table/{database_id}/events · /database/v1/kv/{database_id}/events
REST /database/v1/table/{database_id}/rest/{table}
Key-value databases /database/v1/kv
Keys /database/v1/kv/{database_id}/keys
Commands /database/v1/kv/{database_id}/commands

The path is the type: table databases live under /database/v1/table and use the tables and rows operations; key-value databases live under /database/v1/kv and use the keys and commands operations. Reaching a database through the other type’s path returns 404 DATABASE_NOT_FOUND, the same as an unknown id. The create body has no kind; kind in a response is read-only information.

Upstash-compatible API

Error codes

Deprecation

The older paths under /database/v1/databases and the SDK names praxis.database.databases.* are deprecated and stop working on 2027-03-01. Until then they behave as before and responses carry Deprecation and Sunset headers. New code uses the paths above and praxis.database.table.* and praxis.database.kv.*. The changelog has the mapping and dates: changelog. Old paths and the paths that replace them:

  • POST /database/v1/databases → POST /database/v1/table, POST /database/v1/kv
  • GET /database/v1/databases → GET /database/v1/table, GET /database/v1/kv
  • GET /database/v1/databases/{database_id} → GET /database/v1/table/{database_id}, GET /database/v1/kv/{database_id}
  • PATCH /database/v1/databases/{database_id} → PATCH /database/v1/table/{database_id}, PATCH /database/v1/kv/{database_id}
  • DELETE /database/v1/databases/{database_id} → DELETE /database/v1/table/{database_id}, DELETE /database/v1/kv/{database_id}
  • POST /database/v1/databases/{database_id}/restore → POST /database/v1/table/{database_id}/restore, POST /database/v1/kv/{database_id}/restore
  • POST /database/v1/databases/{database_id}/purge → POST /database/v1/table/{database_id}/purge, POST /database/v1/kv/{database_id}/purge
  • GET /database/v1/databases/{database_id}/events → GET /database/v1/table/{database_id}/events, GET /database/v1/kv/{database_id}/events
  • POST /database/v1/databases/{database_id}/tables → POST /database/v1/table/{database_id}/tables
  • GET /database/v1/databases/{database_id}/tables → GET /database/v1/table/{database_id}/tables
  • GET /database/v1/databases/{database_id}/tables/{table} → GET /database/v1/table/{database_id}/tables/{table}
  • PATCH /database/v1/databases/{database_id}/tables/{table} → PATCH /database/v1/table/{database_id}/tables/{table}
  • DELETE /database/v1/databases/{database_id}/tables/{table} → DELETE /database/v1/table/{database_id}/tables/{table}
  • POST /database/v1/databases/{database_id}/tables/{table}/fields → POST /database/v1/table/{database_id}/tables/{table}/fields
  • PATCH /database/v1/databases/{database_id}/tables/{table}/fields/{field} → PATCH /database/v1/table/{database_id}/tables/{table}/fields/{field}
  • DELETE /database/v1/databases/{database_id}/tables/{table}/fields/{field} → DELETE /database/v1/table/{database_id}/tables/{table}/fields/{field}
  • GET /database/v1/databases/{database_id}/rest/{table} → GET /database/v1/table/{database_id}/rest/{table}
  • HEAD /database/v1/databases/{database_id}/rest/{table} → HEAD /database/v1/table/{database_id}/rest/{table}
  • POST /database/v1/databases/{database_id}/rest/{table} → POST /database/v1/table/{database_id}/rest/{table}
  • PATCH /database/v1/databases/{database_id}/rest/{table} → PATCH /database/v1/table/{database_id}/rest/{table}
  • DELETE /database/v1/databases/{database_id}/rest/{table} → DELETE /database/v1/table/{database_id}/rest/{table}
  • GET /database/v1/databases/{database_id}/keys → GET /database/v1/kv/{database_id}/keys
  • GET /database/v1/databases/{database_id}/keys/{key} → GET /database/v1/kv/{database_id}/keys/{key}
  • PUT /database/v1/databases/{database_id}/keys/{key} → PUT /database/v1/kv/{database_id}/keys/{key}
  • PATCH /database/v1/databases/{database_id}/keys/{key} → PATCH /database/v1/kv/{database_id}/keys/{key}
  • DELETE /database/v1/databases/{database_id}/keys/{key} → DELETE /database/v1/kv/{database_id}/keys/{key}
  • POST /database/v1/databases/{database_id}/commands → POST /database/v1/kv/{database_id}/commands