The Collections API allows superusers to manage database collections, schemas, and configurations. All collection endpoints require superuser authentication.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/pocketbase/pocketbase/llms.txt
Use this file to discover all available pages before exploring further.
List collections
Retrieve a list of all collections.Page number
Records per page
Sort fields (e.g.,
-created,name)Filter expression (e.g.,
type='base', system=true)Response
Returns paginated list of collection objects.View collection
Get a single collection by name or ID.Collection name or ID
Response
Returns the collection object with full configuration.Collection unique identifier
Creation timestamp
Last update timestamp
Collection name (must be unique)
Collection type:
base, auth, or viewWhether this is a system collection
Array of field definitions
Database indexes configuration
API rule for listing records
API rule for viewing individual records
API rule for creating records
API rule for updating records
API rule for deleting records
Create collection
Create a new collection.Request body
Collection name (alphanumeric and underscores only)
Collection type:
base, auth, or viewField definitions
Index definitions
List API rule
View API rule
Create API rule
Update API rule
Delete API rule
Response
Returns the created collection object (200 OK).Update collection
Update an existing collection.Collection name or ID to update
Request body
Same as create collection. Only include fields you want to update.Response
Returns the updated collection object (200 OK).Delete collection
Delete a collection and all its records.Collection name or ID to delete
Response
Returns 204 No Content on success.Truncate collection
Delete all records from a collection without deleting the collection itself.Collection name or ID to truncate
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.Request body
Array of collection objects to import
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.Response
Returns scaffold objects forbase, 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.email- User email addressverified- Email verification statusemailVisibility- Whether email is publicly visiblepassword- 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 texteditor- Rich text editornumber- Numeric valuebool- Boolean (true/false)email- Email addressurl- URLdate- Date onlyselect- Single select dropdownjson- JSON datafile- File uploadrelation- Relation to another collectionautodate- Auto-updated timestamp