Working with Data (CRUD)
Full reference for creating, reading, updating, partially patching, and soft-deleting entries.
1. List Entries
Returns a paginated array of entries matching the collection schema. Entry IDs in lists are strings. See Querying Data for filters and sorting.
{
"data": [
{
"id": "1",
"title": "First Task",
"priority": "high",
"completed": false,
"created_at": "2026-05-01 12:00:00",
"updated_at": "2026-05-01 12:00:00"
}
],
"meta": {
"total": 1,
"limit": 20,
"offset": 0,
"has_more": false
}
}2. Create Entry
Creates a new entry. Validates submitted fields against schema rules. Returns 201 Created with the stored entry (id, collection, data, created_at, updated_at).
{
"title": "Deploy staging build",
"priority": "urgent",
"completed": false
}3. Get Single Entry
Retrieves a single entry by its ID. The response is the stored entry, the same shape as a create response.
4. Replace Entry (PUT)
Replaces the full entry record. All required schema fields must be present and will be re-validated. Omitted optional fields are reset to their default empty values.
Optimistic concurrency: include the updated_at_ts you received when you loaded the entry. If someone else saved a newer version since, Pottr returns 409 concurrency_conflict instead of overwriting their work. Send "force": true (or omit updated_at_ts) to overwrite anyway.
5. Partial Update (PATCH)
Partially updates an entry. Only the submitted fields are validated and updated; omitted fields retain their existing values.
// Mark a task as completed without sending other fields:
await fetch('https://example.com/wp-json/pottr/v1/collections/tasks/42', {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({ completed: true })
});6. Delete Entry (Soft-Delete)
Soft-deletes the entry. The entry immediately becomes invisible to all REST API queries. The row stays in the database, and removing it permanently is only possible from the WordPress admin.
{
"success": true,
"id": 42
}Standard Response Envelope
Add ?format=standard (or the header Accept: application/vnd.pottr.v1+json) to any collection endpoint to get the same shape for lists and single entries: data with string id, collection, attributes, created_at and updated_at, plus meta on lists. See API Overview.