Using
Sets the key to an explicit null value (upsert): the key stays registered and appears in scans, but carries no data — GET answers 204. A write like any other; it resets a previously set TTL, and takes the same `If-Match` / `If-None-Match: *` preconditions as PUT.
applies to v0.5.1PATCH
/store-api/kv/{domain}/keys/{key}/null
const url = 'https://example.com/store-api/kv/example/keys/example/null';const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://example.com/store-api/kv/example/keys/example/null \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”domain
required
string
Domain name
key
required
string
Key (valid UTF-8, max 256 bytes)
Header Parameters
Section titled “Header Parameters”If-Match
string | null
ETag from a prior read: write only if it is still the key’s current version, else 412
If-None-Match
string | null
Only *: write only if the key does not exist, else 412. Evaluated after If-Match
Responses
Section titled “Responses”Key set to the null value state
Invalid key, or invalid If-Match / If-None-Match header
Media typetext/plain
string
Domain is being deleted
Media typetext/plain
string
If-Match or If-None-Match does not hold; nothing was written
Media typetext/plain
string
Headers
Section titled “Headers”ETag
string
ETag of the key’s current version; absent when the key does not exist
The domain requires conditional writes and neither If-Match nor If-None-Match is set
Media typetext/plain
string
Headers
Section titled “Headers”Cache-Control
string
No-store
Rate limit exceeded
Media typetext/plain
string
Headers
Section titled “Headers”Retry-After
integer format: int64
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
Headers
Section titled “Headers”Retry-After
integer