API Reference

Sovrium exposes a complete REST API for managing tables, records, views, activity logs, analytics, and authentication. All endpoints accept and return JSON.

Early Preview

The API surface is evolving. Endpoints may change before v1.0.

Interactive API Explorer

Browse and test every endpoint interactively with the Scalar API client. Includes request builder, response viewer, and code generation.

Open API Explorer

Base URL

All endpoints are relative to your Sovrium instance base URL.

Text
http://localhost:3000/api

Health

Server health check endpoint.

GET/api/health

Check server status

Tables

Read table definitions, including field schemas and permission rules.

GET/api/tables

List all tables

GET/api/tables/{tableId}

Get table by ID

GET/api/tables/{tableId}/permissions

Get table permissions

Records

Full CRUD, batch operations, soft-delete lifecycle, revision history, and record comments.

CRUD

GET/api/tables/{tableId}/records

List records

POST/api/tables/{tableId}/records

Create a record

GET/api/tables/{tableId}/records/{recordId}

Get record by ID

PATCH/api/tables/{tableId}/records/{recordId}

Update a record

DELETE/api/tables/{tableId}/records/{recordId}

Soft-delete a record

Batch Operations

POST/api/tables/{tableId}/records/batch

Create multiple records

PATCH/api/tables/{tableId}/records/batch

Update multiple records

DELETE/api/tables/{tableId}/records/batch

Soft-delete multiple records

POST/api/tables/{tableId}/records/upsert

Create or update a record

Trash & History

GET/api/tables/{tableId}/trash

List trashed records

POST/api/tables/{tableId}/records/{recordId}/restore

Restore a deleted record

POST/api/tables/{tableId}/records/batch/restore

Restore multiple records

GET/api/tables/{tableId}/records/{recordId}/history

Get record revision history

Comments

GET/api/tables/{tableId}/records/{recordId}/comments

List comments on a record

POST/api/tables/{tableId}/records/{recordId}/comments

Add a comment

GET.../{recordId}/comments/{commentId}

Get comment by ID

PATCH.../{recordId}/comments/{commentId}

Update a comment

DELETE.../{recordId}/comments/{commentId}

Delete a comment

Views

Pre-configured views that filter, sort, and group records from a table.

GET/api/tables/{tableId}/views

List views for a table

GET/api/tables/{tableId}/views/{viewId}

Get view by ID

GET/api/tables/{tableId}/views/{viewId}/records

Get records through a view

Activity

Audit log of data changes across all tables.

GET/api/activity

List activity entries

GET/api/activity/{activityId}

Get activity detail

Analytics

Privacy-friendly, cookie-free usage analytics.

POST/api/analytics/collect

Collect a page view event

GET/api/analytics/overview

Get analytics overview

GET/api/analytics/pages

Get top pages

GET/api/analytics/referrers

Get top referrers

GET/api/analytics/devices

Get device breakdown

GET/api/analytics/campaigns

Get campaign stats

Authentication

Powered by Better Auth with 28+ endpoints for sign-in, sign-up, sessions, OAuth, 2FA, and admin user management.

Authentication is handled by Better Auth and includes email/password sign-in, social OAuth providers, session management, password reset, email verification, two-factor authentication, and admin endpoints. See the Auth configuration docs or explore all endpoints in the interactive API explorer.

Cross-Cutting Features

Capabilities that apply across all API endpoints.

PaginationSoft DeletesRBACRate LimitingField-Level PermissionsOpenAPI 3.1

OpenAPI Schema

Download the OpenAPI 3.1 specification for use with any API client or code generator.

Terminal
curl https://your-instance.com/docs/openapi.json