write_record
Create or update a single record in a PocketBase collection by specifying collection, action, and data. Use create for new records or update with record_id to modify existing ones.
Instructions
USE WHEN you need to create or update a single record.
EXAMPLES:
Create: write_record(collection="posts", action="create", data={"title": "Hi", "body": "..."})
Update: write_record(collection="posts", action="update", record_id="abc", data={"title": "New"})
NEXT STEPS: find_records to verify, describe_collection for field names.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Field values to set. For update, include only fields to change. | |
| action | Yes | Whether to create a new record or update an existing one. | |
| expand | No | Comma-separated relation fields to expand in the response. | |
| record_id | No | Required for action='update'. The id of the record to update. | |
| collection | Yes | Collection name or id. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||