Skip to content
v0.5.1GitHub

Using

Upserts a document. With an `If-Match: "<etag>"` header the write is a conditional update; with `If-None-Match: *` it is create-only. Both may be combined and are evaluated in that order; a failed precondition answers 412 with the current `ETag`.

applies to v0.5.1
PUT
/store-api/json/{domain}/documents/{key}
curl --request PUT \
--url https://example.com/store-api/json/example/documents/example \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'
domain
required
string

JSON domain

key
required
string

Document key

If-Match
string | null

Opaque ETag from a prior read: write only if it is still the document’s current version, else 412

If-None-Match
string | null

Only * is supported: create-only write, 412 if the document exists. Evaluated after If-Match

Media typeapplication/json
object

Example generated

{}

Document updated

Media typeapplication/json

A document as returned by the store: _key/_version metadata merged into the user’s fields.

object
_key
required

Document key.

string
_version
required

Write counter: 1 on create, incremented on every write.

integer format: int64
key
additional properties

The document’s own fields. A document whose content is not a JSON object appears as a single _content field holding that value.

Example generated

{
"_key": "example",
"_version": 1
}

Document created

Media typeapplication/json

A document as returned by the store: _key/_version metadata merged into the user’s fields.

object
_key
required

Document key.

string
_version
required

Write counter: 1 on create, incremented on every write.

integer format: int64
key
additional properties

The document’s own fields. A document whose content is not a JSON object appears as a single _content field holding that value.

Example generated

{
"_key": "example",
"_version": 1
}

Invalid key, reserved top-level field (_key, _version, _content), or invalid If-Match or If-None-Match header

Media typetext/plain
string

Domain not found

Media typetext/plain
string

Domain is being deleted

Media typetext/plain
string

If-Match or If-None-Match does not hold (version mismatch, missing document, or document already exists); nothing was written

Media typetext/plain
string
ETag
string

ETag of the document’s current version; absent when the document does not exist

The domain requires conditional writes and neither If-Match nor If-None-Match is set

Media typetext/plain
string
Cache-Control
string

No-store

JSON engine disabled

Media typetext/plain
string

Insufficient Storage — disk space or memory runs short; the write was not applied. Reads go on; retry after the seconds in Retry-After.

Media typetext/plain
string
Retry-After
integer