How-to
Manage documents
Create, read, update, and delete JSON documents in a collection.
Create a document
Post a JSON object to a collection to create a document. The request body is stored as-is as the document data.
curl https://ineedadatabase.com/api/v1/projects/proj_123/collections/recipes/documents \
-H "Authorization: Bearer inadb_..." \
-H "Content-Type: application/json" \
-d '{"title":"Pasta","servings":4,"published":true}'{
"id": "A1b2C3d4",
"created_at": "2026-05-08T12:00:00Z",
"updated_at": "2026-05-08T12:00:00Z",
"revision": "rev_E5f6G7h8",
"data": {
"title": "Pasta",
"servings": 4,
"published": true
}
}List documents
List documents while building screens, admin views, or exports. List responses are objects with items and next_cursor, not bare arrays.
curl https://ineedadatabase.com/api/v1/projects/proj_123/collections/recipes/documents \
-H "Authorization: Bearer inadb_..."{
"items": [
{
"id": "A1b2C3d4",
"created_at": "2026-05-08T12:00:00Z",
"updated_at": "2026-05-08T12:00:00Z",
"revision": "rev_E5f6G7h8",
"data": {
"title": "Pasta",
"servings": 4,
"published": true
}
}
],
"next_cursor": null
}Read a document
Read one document by id when editing a record or showing a detail view.
curl https://ineedadatabase.com/api/v1/projects/proj_123/collections/recipes/documents/A1b2C3d4 \
-H "Authorization: Bearer inadb_..."Update a document
- Use
PATCHto merge a partial JSON object. - Use
PUTto replace the whole document body. - Send
If-Matchwith the current revision to avoid overwriting newer edits.
curl https://ineedadatabase.com/api/v1/projects/proj_123/collections/recipes/documents/A1b2C3d4 \
-X PATCH \
-H "Authorization: Bearer inadb_..." \
-H "Content-Type: application/json" \
-H "If-Match: rev_E5f6G7h8" \
-d '{"servings":6}'curl https://ineedadatabase.com/api/v1/projects/proj_123/collections/recipes/documents/A1b2C3d4 \
-X PUT \
-H "Authorization: Bearer inadb_..." \
-H "Content-Type: application/json" \
-H "If-Match: rev_E5f6G7h8" \
-d '{"title":"Pasta","servings":6,"published":true}'Delete a document
Delete one document by id.
curl https://ineedadatabase.com/api/v1/projects/proj_123/collections/recipes/documents/A1b2C3d4 \
-X DELETE \
-H "Authorization: Bearer inadb_..." \
-H "If-Match: rev_E5f6G7h8"