Skip to main content
The Collections API allows superusers to manage database collections, schemas, and configurations. All collection endpoints require superuser authentication.
All collection management endpoints require superuser authentication.

List collections

Retrieve a list of all collections.
number
default:"1"
Page number
number
default:"30"
Records per page
string
Sort fields (e.g., -created,name)
string
Filter expression (e.g., type='base', system=true)
Authentication: Superuser required

Response

Returns paginated list of collection objects.

View collection

Get a single collection by name or ID.
string
required
Collection name or ID
Authentication: Superuser required

Response

Returns the collection object with full configuration.
string
Collection unique identifier
string
Creation timestamp
string
Last update timestamp
string
Collection name (must be unique)
string
Collection type: base, auth, or view
boolean
Whether this is a system collection
array
Array of field definitions
array
Database indexes configuration
string | null
API rule for listing records
string | null
API rule for viewing individual records
string | null
API rule for creating records
string | null
API rule for updating records
string | null
API rule for deleting records

Create collection

Create a new collection.
Authentication: Superuser required

Request body

string
required
Collection name (alphanumeric and underscores only)
string
required
Collection type: base, auth, or view
array
Field definitions
array
Index definitions
string | null
List API rule
string | null
View API rule
string | null
Create API rule
string | null
Update API rule
string | null
Delete API rule

Response

Returns the created collection object (200 OK).

Update collection

Update an existing collection.
string
required
Collection name or ID to update
Authentication: Superuser required

Request body

Same as create collection. Only include fields you want to update.

Response

Returns the updated collection object (200 OK).
Modifying collection schema may cause data loss. Always backup before making structural changes.

Delete collection

Delete a collection and all its records.
string
required
Collection name or ID to delete
Authentication: Superuser required

Response

Returns 204 No Content on success.
Deleting a collection permanently removes all its records and cannot be undone. Collections with references from other collections cannot be deleted.

Truncate collection

Delete all records from a collection without deleting the collection itself.
string
required
Collection name or ID to truncate
Authentication: Superuser required

Response

Returns 204 No Content on success.
View collections cannot be truncated since they don’t store their own records.

Import collections

Bulk import/update collections from JSON.
Authentication: Superuser required

Request body

array
required
Array of collection objects to import
boolean
default:"false"
Whether to delete collections not present in the import

Response

Returns 204 No Content on success.

Get collection scaffolds

Get empty collection templates for each type.
Authentication: Superuser required

Response

Returns scaffold objects for base, auth, and view collection types.

Collection types

Base collection

Standard collection for storing records.

Auth collection

Collection for user authentication with built-in auth fields.
Auth collections automatically include:
  • email - User email address
  • verified - Email verification status
  • emailVisibility - Whether email is publicly visible
  • password - Hashed password

View collection

Virtual collection based on SQL query.
View collections are read-only. Create, update, and delete operations are not supported.

Field types

Supported field types:
  • text - Single line text
  • editor - Rich text editor
  • number - Numeric value
  • bool - Boolean (true/false)
  • email - Email address
  • url - URL
  • date - Date only
  • select - Single select dropdown
  • json - JSON data
  • file - File upload
  • relation - Relation to another collection
  • autodate - Auto-updated timestamp

API rules

API rules control record access:

Rule examples