Free for now while in alpha pre-release-candidate phase
Home/Documentation

Documents

Create, read, update, and delete JSON documents in a collection.

Create a Document

POST/{ns}/{collection}

Creates a new document with an auto-generated ID.

Path Parameters

NameTypeDescription
nsrequiredstringProject name (e.g. 'default')
collectionrequiredstringCollection name (e.g. 'users')
curl -X POST https://api.jsondb.cloud/default/users \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Alice", "email": "[email protected]"}'

Response (201 Created)

{
  "_id": "use_a1b2c3d4e5f6",
  "$createdAt": "2026-02-24T12:00:00.000Z",
  "$updatedAt": "2026-02-24T12:00:00.000Z",
  "$version": 1,
  "name": "Alice",
  "email": "[email protected]"
}
POST/default/users
Enter your API key above

Get a Document

GET/{ns}/{collection}/{id}

Retrieves a single document by its ID.

Path Parameters

NameTypeDescription
nsrequiredstringProject name
collectionrequiredstringCollection name
idrequiredstringDocument ID
curl https://api.jsondb.cloud/default/users/use_a1b2c3d4e5f6 \
  -H "Authorization: Bearer YOUR_API_KEY"

Replace a Document

PUT/{ns}/{collection}/{id}

Replaces the entire document. Creates it if it doesn't exist.

PUT replaces the entire document body. Use PATCH for partial updates.
curl -X PUT https://api.jsondb.cloud/default/users/use_a1b2c3d4e5f6 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Alice Updated", "email": "[email protected]", "role": "admin"}'

Partial Update (Merge Patch)

PATCH/{ns}/{collection}/{id}

Merge-patches a document (RFC 7396). Only fields you send are updated.

curl -X PATCH https://api.jsondb.cloud/default/users/use_a1b2c3d4e5f6 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/merge-patch+json" \
  -d '{"role": "admin"}'

JSON Patch (RFC 6902)

PATCH/{ns}/{collection}/{id}

Applies JSON Patch operations. Set Content-Type to application/json-patch+json.

curl -X PATCH https://api.jsondb.cloud/default/users/use_a1b2c3d4e5f6 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json-patch+json" \
  -d '[{"op": "replace", "path": "/name", "value": "Alice Smith"}, {"op": "add", "path": "/verified", "value": true}]'

Delete a Document

DELETE/{ns}/{collection}/{id}

Permanently deletes a document.

curl -X DELETE https://api.jsondb.cloud/default/users/use_a1b2c3d4e5f6 \
  -H "Authorization: Bearer YOUR_API_KEY"

Returns 204 No Content on success.

Document Metadata

Every document includes auto-managed metadata fields:

Metadata Fields

NameTypeDescription
_idstringAuto-generated unique identifier (e.g. 'use_a1b2c3d4')
$createdAtstringISO 8601 timestamp of creation
$updatedAtstringISO 8601 timestamp of last update
$versionnumberIncrements on every write (starts at 1)