Create collection
create_collectionCreate a new PocketBase collection with a chosen name and type. Provide fields, API rules, indexes, view query, or auth options in the data payload.
Instructions
Create a new collection. Provide name and type ('base', 'auth' or 'view'). Use data for the rest of the collection payload: fields (array of field definitions), API rules (listRule, viewRule, createRule, updateRule, deleteRule — string or null), indexes (array of CREATE INDEX statements), viewQuery (for view collections), and auth options for auth collections. Tip: call get_collection_scaffolds first to see the expected shape. Example field: { "name": "title", "type": "text", "required": true }. IMPORTANT (PocketBase 0.23+): 'created'/'updated' timestamps are NOT added automatically — add them explicitly as autodate fields if you need them, e.g. { "name": "created", "type": "autodate", "onCreate": true } and { "name": "updated", "type": "autodate", "onCreate": true, "onUpdate": true }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | Rest of the collection payload (fields, rules, indexes, viewQuery, auth options...). | |
| name | Yes | Collection name. | |
| type | No | Collection type (default 'base'). |