http api
every dashboard surface is built on these endpoints; you can build your own client on top of them too. base url https://api.briven.tech. all responses are JSON unless otherwise noted. auth is either a dashboard session cookie (Better Auth) or a project API key in Authorization: Bearer brk_…; each section calls out which.
admin-only routes under /v1/admin/*aren't listed here — they need platform-admin and are documented in the operator runbook.
invoke
Call a deployed function. Auth: project API key (brk_…) in Authorization: Bearer header.
POST
/v1/projects/:id/invokeBody: { function: string, args?: unknown }. Returns { result, durationMs } or { error }. Counts against your project's monthly invocation cap.
realtime
Subscribe to reactive queries over WebSocket. SDK clients (@briven/react / svelte / vue) wrap this.
GET
/v1/projects/:id/realtimeWSS upgrade. Send { type: "subscribe", function, args }, receive frames as the underlying rows change. Auth: project API key.
projects
Project CRUD. Auth: dashboard session cookie.
GET
/v1/projectsList every project the caller can see.
POST
/v1/projectsBody: { name, slug?, region?, orgId? }. Creates a fresh schema + runtime under the named org (defaults to your personal org).
GET
/v1/projects/:idProject details.
PATCH
/v1/projects/:idBody: { name?, slug? }. Rename a project.
POST
/v1/projects/:id/moveBody: { orgId }. Re-parent to a different org (you must be a member of both).
DELETE
/v1/projects/:idSoft-delete. The schema and data are retained for 30 days before hard deletion.
deployments
Bundle uploads + history. Auth: project API key (POST) or session (GET).
POST
/v1/projects/:id/deploymentsUpload a schema + functions bundle. Body: multipart form with bundle.tar.gz. Server diffs against the live schema, generates a migration, applies transactionally.
GET
/v1/projects/:id/deploymentsList recent deployments with their status + schema diff summary.
GET
/v1/projects/:id/deployments/:deploymentIdDeployment detail including error code/message if it failed.
POST
/v1/projects/:id/deployments/:deploymentId/cancelCancel a pending or running deployment.
studio
Dashboard data browser + DDL surface. Auth: dashboard session, admin role on the project.
GET
/v1/projects/:id/studio/tablesList user tables.
POST
/v1/projects/:id/studio/tablesBody: { tableName, columns: [{ name, type, notNull?, primaryKey?, defaultExpr?, references? }] }. CREATE TABLE.
PATCH
/v1/projects/:id/studio/tables/:tableBody: { newName }. Rename a table.
POST
/v1/projects/:id/studio/tables/:table/truncateBody: { cascade? }. TRUNCATE TABLE … RESTART IDENTITY.
DELETE
/v1/projects/:id/studio/tables/:tableDROP TABLE.
GET
/v1/projects/:id/studio/tables/:table/columnsPer-column metadata with PK + FK target.
POST
/v1/projects/:id/studio/tables/:table/columnsBody: { column: { name, type, notNull?, defaultExpr?, references? } }. ADD COLUMN.
PATCH
/v1/projects/:id/studio/tables/:table/columns/:columnTwo-mode: { newName } to rename, or { notNull?, defaultExpr? } to alter nullability / default.
DELETE
/v1/projects/:id/studio/tables/:table/columns/:columnDROP COLUMN.
GET
/v1/projects/:id/studio/tables/:table/indexesList indexes on a table.
POST
/v1/projects/:id/studio/tables/:table/indexesBody: { columns: string[], unique?, name? }. CREATE INDEX.
DELETE
/v1/projects/:id/studio/tables/:table/indexes/:nameDROP INDEX (refuses the primary-key index).
GET
/v1/projects/:id/studio/tables/:table/rowsPaginated rows. Query: limit, offset, orderBy + dir, and per-column <col>__eq=value filters.
POST
/v1/projects/:id/studio/tables/:table/rowsBody: { values: { col: value, … } }. Insert a row.
PATCH
/v1/projects/:id/studio/tables/:table/rowsBody: { primaryKeyColumn, primaryKeyValue, column, value }. Update a single cell.
DELETE
/v1/projects/:id/studio/tables/:table/rowsBody: { primaryKeyColumn, primaryKeyValue }. Delete a row.
POST
/v1/projects/:id/studio/queryBody: { sql }. Run arbitrary SQL scoped to the project owner role. 5s statement_timeout. Audit-logged.
GET
/v1/projects/:id/studio/schemaOne-shot read of every table + columns + FK edges.
GET
/v1/projects/:id/studio/schema.tsGenerates the equivalent briven/schema.ts so a dashboard-built database can graduate to git + CLI.
GET
/v1/projects/:id/studio/relationshipsEvery FK edge in the schema (used by the studio overview).
logs + stats
Function invocation history. Auth: dashboard session.
GET
/v1/projects/:id/function-logsQuery: function, status (ok|err), before (cursor), limit.
GET
/v1/projects/:id/function-namesDistinct function names actually called in this project.
GET
/v1/projects/:id/function-statsQuery: function (required), hours (default 24). Returns count + errCount + p50Ms + p99Ms.
GET
/v1/projects/:id/hourly-invocations24-hour series of invocation counts per hour (used by the project sparkline).
GET
/v1/projects/:id/logs/streamSSE stream of new invocations as they arrive.
usage
Metering. Auth: project API key or session.
GET
/v1/projects/:id/usageCurrent period: invocations.count + totalDurationMs, storage.bytes, limits.
api keys
Per-project deploy / invoke keys.
GET
/v1/projects/:id/api-keysList keys (hashes only).
POST
/v1/projects/:id/api-keysBody: { name, scope }. Returns the plaintext key once — record it then; never retrievable again.
PATCH
/v1/projects/:id/api-keys/:keyIdRename a key.
DELETE
/v1/projects/:id/api-keys/:keyIdRevoke a key.
project members + invitations
Per-project access control (separate from org membership).
GET
/v1/projects/:id/membersList members + roles.
POST
/v1/projects/:id/invitationsBody: { email, role, callbackURL }. Sends an email with a one-time accept link.
GET
/v1/me/invitationsPending project invitations for the signed-in user.
POST
/v1/me/invitations/acceptBody: { token }. Accept by token from the email link.
orgs (teams)
Multi-org workspace. Personal org is auto-created on signup.
GET
/v1/me/orgsEvery org the caller belongs to.
POST
/v1/orgsBody: { name, slug? }. Create a team org (paid tiers only — free tier caps at the personal org).
PATCH
/v1/orgs/:idBody: { name }. Rename a team org.
DELETE
/v1/orgs/:idSoft-delete a team org. Refuses while live projects still belong to it; move or delete them first.
GET
/v1/orgs/:id/membersList org members with roles.
PATCH
/v1/orgs/:id/members/:userIdBody: { role }. Change role. Refuses to demote the last owner.
DELETE
/v1/orgs/:id/members/:userIdRemove a member.
GET
/v1/orgs/:id/invitationsPending org invitations.
POST
/v1/orgs/:id/invitationsBody: { email, role, callbackURL }. Invite a collaborator.
POST
/v1/org-invitations/acceptBody: { token }.
billing
Polar.sh-backed subscription management.
GET
/v1/billing/subscriptionCurrent tier, status, period end, polar customer id.
GET
/v1/billing/plansPublic plan + price list (matches docs.briven.tech/pricing).
POST
/v1/billing/checkoutBody: { tier, successURL }. Returns { url } — hosted Polar checkout URL.
POST
/v1/billing/portalReturns { url } for the Polar customer portal (manage payment / cancel).
POST
/v1/billing/webhookPolar.sh webhook receiver. HMAC-validated. Server-side only — your app doesn't call this.