Skip to content
Console
Menu

Queues

Workflows

Getting Started

Authentication

KV Store

Put in KV

Writes a value.

Writes a value. Without ttl_seconds the namespace default applies; zero means no expiry.

  • Path PUT https://api.data.sylphx.com/v1/kv/namespace-id/key
  • Scope data:write
  • Effect write — a successful call changes state.
  • Collection kv
  • Host https://api.data.sylphx.com

#Request

FieldTypeWhat it is
namespace_idstringThe namespace's id. Required.
keystringThe key. Required.
valuebytesThe bytes, base64.
ttl_secondsuint64Seconds to live; unset uses the namespace default, zero never expires.
expected_versionuint64Write only when the current version equals this one (0: any).
nxboolWrite only when the key is absent (SET NX).
xxboolWrite only when the key is present (SET XX); excludes nx.

#Response

FieldTypeWhat it is
valueValueRecordThe stored entry.

#ValueRecord

FieldTypeWhat it is
namespace_idstringThe namespace's id in the environment, for example ratelimit.
keystringThe key.
valuebytesThe bytes, base64.
sha256stringsha256:<hex> of the value.
versionuint64The version, increasing per key.
expires_at_unix_msint64Expiry in Unix milliseconds; zero never expires.
updated_at_unix_msint64When this version was written, in Unix milliseconds.

#Errors

Every error arrives in the body Errors describes.

#Examples

curl -X PUT "https://api.data.sylphx.com/v1/kv/namespace-id/key" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'