TotalBase
Data API

Routes

Every Data API route on one page: the patterns over your tables, views and functions, and the fixed routes.

Every route of the Data API, under /api. Most of them are patterns over your own database: {schema}, {table}, {view} and {function} are the names of what you exposed, so Acme's work orders are /api/public/table/work_orders. The rest are fixed routes, the same on every instance.

Each route answers as the caller: a session or a token, with its roles' permissions. A resource you didn't expose answers 404 RESOURCE_NOT_FOUND, as if it didn't exist; an action the caller's roles don't allow, 403 ACTION_DENIED.

For the routes of your instance, with your tables and their columns, open Docs › Endpoints in the admin, or fetch GET /api/openapi.json: the OpenAPI document of what the caller can reach. See OpenAPI.

Your tables, views and functions

MethodRouteDoesNeeds
GET/api/{schema}/table/{table}read rows: fields, where, search, order_by, limit, aggregatesREAD
GET/api/{schema}/table/{table}/{pk}read one row by its primary keyREAD
POST/api/{schema}/table/{table}create a row, several (a list), with related rows (nested), or upsert (on_conflict)CREATE (and UPDATE to upsert)
PATCH/api/{schema}/table/{table}/{pk}update one rowUPDATE
PATCH/api/{schema}/table/{table}?where[…]update every row the filter selectsUPDATE
DELETE/api/{schema}/table/{table}/{pk}delete one rowDELETE
DELETE/api/{schema}/table/{table}?where[…]delete every row the filter selectsDELETE
GET/api/{schema}/view/{view}read a view's rows, with the same parametersREAD
POST/api/{schema}/function/{function}call a function; ?async=true runs it in the backgroundEXECUTE

With Acme's names:

GET    /api/public/table/work_orders?fields=number,status,site.name&where[status][_eq]=NEW
GET    /api/public/table/work_orders/3f2b…
POST   /api/public/table/work_orders
PATCH  /api/public/table/work_orders/3f2b…
DELETE /api/public/table/work_orders/3f2b…
GET    /api/public/view/vehicles_latest_positions
POST   /api/public/function/create_invoice_from_work_order

An update or delete without {pk} needs a where (unless Settings › Data API › Limits says otherwise), so a missing filter can't change every row. Several rows at once are one transaction: one failure rolls back them all.

TotalBase's own tables use the same patterns under the totalbase schema, as far as each one is exposed and the caller is granted: /api/totalbase/table/users lists users for a delegated manager. See Delegated administration.

Guides: Reading, Filtering, Aggregating, Writing, Nested writes, Calling functions.

Fixed routes

Authentication

MethodRouteDoes
POST/api/auth/loginsign in with email and password; answers a session token
POST/api/auth/logoutend the session
GET/api/auth/methe signed-in user
POST/api/auth/registercreate an account, when self-registration is on
POST/api/auth/password/forgotemail a reset link
POST/api/auth/password/resetset a new password with a reset token
POST/api/auth/password/changechange the signed-in user's password
POST/api/auth/email/verifyverify an email with its token
POST/api/auth/email/resendsend a new verification link
POST/api/auth/invitations/acceptaccept an invitation and set the password
GET/api/auth/oauth/{provider}start signing in with a provider
GET/api/auth/oauth/{provider}/callbackthe provider's return

Bodies and answers: Authentication API.

Your tokens

MethodRouteDoes
GET/api/tokenslist your API tokens
POST/api/tokenscreate one; the secret is in the answer, once
POST/api/tokens/{id}/rotateissue a new secret, the old one valid for a while you choose
POST/api/tokens/{id}/revokestop it for good
DELETE/api/tokens/{id}delete it

See API tokens.

Transactions and background work

MethodRouteDoes
POST/api/transactionsseveral writes in one PostgreSQL transaction; needs the Can run transactions capability. See Transactions
GET/api/executions/{id}the status and result of an asynchronous function call you started
POST/api/executions/{id}/cancelcancel it

Files

MethodRouteDoes
POST/api/totalbase/table/filesupload a file (multipart)
GET/api/totalbase/table/files/{id}its content; images take transformations
GET/api/totalbase/table/files/{id}/infoits details
PATCH/api/totalbase/table/files/{id}change its details, rename or move it
PUT/api/totalbase/table/files/{id}/contentreplace its content
DELETE/api/totalbase/table/files/{id}delete it and its content
POST/api/totalbase/table/templates/{id}/pdfrender a PDF template with your data

Listing files and folders uses the table pattern: /api/totalbase/table/files, /api/totalbase/table/folders. See Using files in tables.

Workflows

MethodRouteDoes
POST/api/workflows/{slug}/runrun a Manual workflow; needs its invoke grant. See Manual trigger
GET, POST/api/workflows/{slug}/webhooka Webhook workflow's endpoint, with the method it's set to. See Webhook trigger
GET/api/workflows/runs/{runId}/resulta run's result, after an asynchronous start

The instance

MethodRouteDoes
GET/api/openapi.jsonthe OpenAPI document of what the caller can reach
GET/api/instancethe instance's public presentation: name, logo, language, sign-in layout. No sign-in needed

Not part of the Data API

  • /admin/api/* is the Admin API, for administrators.
  • /app/api/* serves the admin and the App themselves. It's internal: build on the Data API and the Admin API instead.
  • /mcp is the MCP server.
  • /health/live and /health/ready are for load balancers: see Deployment.

Next steps