JSON Store API

Store small JSON documents and read or update them over REST: merge patch, versions, optimistic locking, TTL and optional public read without a key.

GETPOSTPUTPATCHDELETEhttps://apibox.io.vn/v1/json-store
Data & JSON

POST /v1/json-store with {"data": …} (any JSON value), an optional name, public and ttl_seconds creates a document and returns its id and URL /v1/json-store/{id}. GET returns it with metadata (raw=true: just the document, with an ETag), PUT (or POST) replaces data, PATCH applies a JSON Merge Patch (RFC 7386: null deletes a key) and DELETE removes it. Name, public flag and TTL can be changed without touching the data.

Every write increases version; send if_version (or If-Match: "v3") to refuse the write when someone else changed the document in between (409 version_conflict). Previous versions are kept (/{id}/versions, /{id}/versions/{n}): 3 on Free, 10 on Starter, 25 on Pro. A document with public=true can be read by anyone with GET /v1/json-store/{id} and no API key (raw JSON, CORS *, served as application/json with nosniff so it can never act as a web page; such reads are free, cached 10 s and limited per document). Documents with ttl_seconds (60 s to 365 days) disappear when they expire.

Documents belong to an account (API key or signed in). Limits per plan: Free 10 documents of up to 100 KB (5 MB in total with versions), Starter 100 × 512 KB (100 MB), Pro 1,000 × 1 MB (500 MB). Every authenticated call counts one request. Data is stored in our D1 database (strongly consistent: a read right after a write sees it). Do not store secrets or personal data in public documents.

Parameters

NameInTypeRequiredDefault
databodyobjectyesThe JSON document (any JSON value). Required to create; with PATCH it is a merge patch.
namebodystringnoDisplay name (max 100 characters).
publicbodybooleannofalseAllow GET without an API key (raw JSON).
ttl_secondsbodynumbernoExpire the document after 60 s – 365 days; 0 removes the expiry.
if_versionbody|querynumbernoPUT / PATCH only if the document is still at this version (or If-Match: "v<n>").
rawquerybooleannofalseGET: return only the document.
idpathstringno/{id} (GET, PUT, POST, PATCH, DELETE), /{id}/versions, /{id}/versions/{n}.

Example

curl -X POST "https://apibox.io.vn/v1/json-store" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Cấu hình","public":true,"data":{"theme":"dark","flags":{"beta":true,"old":1}}}'

Response

{
  "id": "js_vb1uxwnz96v8s4nvmydv",
  "name": "Cấu hình",
  "url": "https://apibox.io.vn/v1/json-store/js_vb1uxwnz96v8s4nvmydv",
  "public": true,
  "size": 46,
  "version": 1,
  "expires_at": null,
  "created_at": "2026-11-11T03:21:15.000Z",
  "updated_at": "2026-11-11T03:21:15.000Z",
  "data": {
    "theme": "dark",
    "flags": {
      "beta": true,
      "old": 1
    }
  }
}

Use cases

  • Keep feature flags or remote config for an app without a backend
  • Save state of a prototype, hackathon project or no-code tool
  • Publish a small JSON dataset that front-end code reads without a key
  • Share test fixtures between CI jobs with versioning

FAQ

Can a public document be read without an API key?

Yes, GET /v1/json-store/{id} without a key returns the raw JSON when the document is public. Writes always need the owner’s key.

How do I avoid overwriting someone else’s change?

Read the version, then send if_version (or If-Match: "v<n>") with PUT / PATCH. If the document changed meanwhile you get 409 version_conflict.

What happens when a document expires?

After ttl_seconds it returns 404 and is deleted with its versions by the daily clean-up.

Related APIs

Start with 1,000 free requests every month. Get free API key →