HTTP API reference
Two HTTP surfaces. The app API is what your app, and any backend or mobile client, calls: data, actions, named queries, sign-in, AI, files and realtime, under /__appbricx on the app's own origin. The developer API is what the CLI, MCP tools and CI call to build, verify, deploy and operate apps.
App API
- Data APIList, read, create, update and delete rows of the app's tables, with filters, embedded related rows, aggregates, full-text search, lifecycle transitions, batches of calls, and raw SQL for trusted backends. Every call runs as the caller under your row-level security policies. (13 endpoints)
- Actions, queries and webhooksCall a server action (server/*.ts), run a named query (db/queries/*.sql), deliver an inbound webhook to a workflow, and read workflow runs and notifications. (11 endpoints)
- Sign-in APIThe app's own end-user accounts: sign-up, password and sign-in-link sign-in, social sign-in, two-factor codes, sessions, admin user management and organisations. (31 endpoints)
- AI APIChat completions and embeddings on the project's own AI key, with per-app and per-user budgets. (2 endpoints)
- Files APISigned uploads of users' files, owner-scoped downloads and deletes. (4 endpoints)
- Topics and realtimeTokens for app realtime (live rows per user, broadcast and presence channels over WebSocket), and topics and row-changed feeds over server-sent events. (4 endpoints)
- Connector proxyCall a connected integration's action without the app ever holding the credential. (2 endpoints)
Developer API
- Developer API: buildTokens, projects, the project's files (the dev draft), check and apply, versions, previews and templates. The CLI and the MCP tools call the same operations. (38 endpoints)
- Developer API: test, ship and operateVerify, screenshots, deploys and rollbacks, data and SQL, snapshots, runs, logs, secrets, sign-in, accounts, roles, routing, domains and data transfer. (38 endpoints)
Credentials
- App key + data marker
- A project key (dpk_c_… in browsers, bound to the app's origins and sent with Origin; dpk_s_… on servers) plus the data-API marker header. With an app session (the header, or the appbricx_app_session cookie) the call acts as that user under row-level security; without one it acts as a signed-out visitor. A server key may assert x-appbricx-app-user and x-appbricx-app-role.
- App key + signed-in user
- A project key and a signed-in app session (header or cookie). Signed-out callers get 401.
- Server key
- A server-tier project key (dpk_s_…). Browser keys and end-user sessions are refused. Treat it like a database password.
- App key + admin session
- A project key and the session of an app user with the admin flag. Anyone else gets 403.
- App key
- A project key identifies the app. No user session is needed.
- Webhook signature
- No bearer token. Sign the raw body with the webhook's secret (HMAC-SHA256, hex), or, for webhook(name, { verify: "stripe" | "github" | "razorpay" }), send the provider's own signature header.
- Developer token
- A personal access token (apx_pat_…, one workspace, scopes read / apply / deploy), an MCP client's OAuth token, or a console session. A project outside the token's reach answers 404, never 403.
- Console session only
- The signed-in console session. A personal access token can't mint another token.
Every endpoint
Not in this reference
These routes exist in the source but are steps inside a flow, or kept for apps made from a JSON contract before code-first:
GET /__appbricx/auth/oauth/:provider/broker: A hop inside the shared Google sign-in for testing, started by GET /__appbricx/auth/oauth/:provider/start. Never called directly.GET /__appbricx/auth/sso/start: Workspace single sign-on for the app's own users: a browser redirect flow.GET /__appbricx/auth/sso/callback: Workspace single sign-on's redirect target.POST /__appbricx/functions/:name: Server functions of apps made from a JSON contract. Code-first apps call server actions: POST /__appbricx/actions/:name.GET /__appbricx/pay/methods: Basket payments of apps made from a JSON contract. A code-first app takes payments in a server action (ctx.http.fetch to the provider, the key by reference) and a verified webhook.POST /__appbricx/pay/checkout: As GET /__appbricx/pay/methods.POST /__appbricx/pay/confirm: As GET /__appbricx/pay/methods.GET /__appbricx/pay/for/:table/:id: As GET /__appbricx/pay/methods.GET /__appbricx/connector-proxy/mcp/available: MCP connectors aren't available on this platform yet: it lists no tools.POST /__appbricx/connector-proxy/mcp/:tool: As GET /__appbricx/connector-proxy/mcp/available: it answers MCP_TOOL_NOT_FOUND.POST /__appbricx/mcp/call: As GET /__appbricx/connector-proxy/mcp/available.GET /api/dev/v1/projects/:id/contract: The settings document and files of a project (get_contract over MCP). Read files with GET /api/dev/v1/projects/:id/files?content=1.POST /api/dev/v1/components/check: check_component over MCP; check a component with POST /api/dev/v1/projects/:id/check-code or check the whole draft.