Records API reference
Reference the PocketBase record endpoints for listing, viewing, creating, updating, and deleting collection records.
This reference covers /api/collections/{collection}/records and its record operations. Replace {collection} with a collection ID or name and {recordId} with a record ID. Authentication is determined by the collection's API rules; if a rule is unset, the corresponding action is restricted to superusers.
List records
GET /api/collections/{collection}/records returns a paginated list. The request supports filtering, sorting, relation expansion, field selection, and skipTotal optimization.
/api/collections/{collection}/recordsCollection ID or name.
Page number. Default: `1`.
Maximum records per page. Default: `30`.
Comma-separated fields; prefix a field with `-` for descending order.
Filter expression evaluated with the collection list rule.
Comma-separated relation paths to expand, up to six nested levels.
Comma-separated response fields. Omit it to return all fields.
Skip total-count queries; `totalItems` and `totalPages` become `-1`.
curl --request GET \ --url http://127.0.0.1:8090/api/collections/posts/records?page=1&perPage=30&sort=-created&filter=title~'note'&expand=author&fields=title%2Ccreated&skipTotal=false
{ "page": 1, "perPage": 30, "totalItems": 1, "totalPages": 1, "items": [{ "id": "RECORD_ID", "collectionName": "posts", "title": "A note" }] }Use operators such as =, !=, >, >=, <, <=, ~, and !~; combine expressions with &&, ||, and parentheses. For relation or array-like fields, prefix an operator with ? when you need any-match behavior. The collection rule still limits the result, and hidden fields are not available to ordinary callers.
View a record
GET /api/collections/{collection}/records/{recordId} returns one record when its view rule permits access. expand includes only relations the caller can view.
/api/collections/{collection}/records/{recordId}Collection ID or name.
Record ID.
Relation paths to expand, up to six nested levels.
Fields to return.
curl --request GET \ --url http://127.0.0.1:8090/api/collections/posts/records/RECORD_ID?expand=author&fields=title%2Ccreated
{ "id": "RECORD_ID", "collectionName": "posts", "title": "A note" }Create a record
POST /api/collections/{collection}/records accepts JSON or multipart/form-data. Use multipart data when uploading files. An ID may be supplied, but if omitted PocketBase generates one.
/api/collections/{collection}/recordsCollection ID or name.
Relations to expand in the response.
Fields to return in the response.
Optional 15-character record ID.
Values for fields defined by the collection schema.
curl --request POST \
--url http://127.0.0.1:8090/api/collections/posts/records?expand=author&fields=title%2Ccreated \
--header 'Content-Type: application/json' \
--data '{
"id": "RECORD_ID",
"schemaFields": "title\":\"A note"
}'{ "id": "RECORD_ID", "collectionName": "posts", "title": "A note" }Update a record
PATCH /api/collections/{collection}/records/{recordId} applies schema fields and optional auth-record password fields. Use JSON for ordinary fields and multipart form data for file changes.
/api/collections/{collection}/records/{recordId}Collection ID or name.
Record ID.
Relations to expand in the response.
Fields to return in the response.
Fields to change.
Current auth password when changing a password, unless the caller has the required management access.
New auth-record password.
Confirmation of the new password.
curl --request PATCH \
--url http://127.0.0.1:8090/api/collections/posts/records/RECORD_ID?expand=author&fields=title%2Cupdated \
--header 'Content-Type: application/json' \
--data '{
"schemaFields": "title\":\"An updated note",
"oldPassword": "old-password-example",
"password": "new-password-example",
"passwordConfirm": "new-password-example"
}'{ "id": "RECORD_ID", "collectionName": "posts", "title": "An updated note" }Delete a record
DELETE /api/collections/{collection}/records/{recordId} permanently removes the record and associated record data allowed by the server to be removed. Confirm the ID and delete rule before sending it.
/api/collections/{collection}/records/{recordId}Collection ID or name.
Record ID.
curl --request DELETE \ --url http://127.0.0.1:8090/api/collections/posts/records/RECORD_ID
{}Related tasks
Start with work with records and queries, then configure API rules and filters. SDK examples are available in JavaScript SDK and Dart SDK.