Skip to content
Console
Menu

Queues

Workflows

Getting Started

Authentication

KV Store

Increment in KV

Adds `delta` (default 1) to an integer value, creating it at zero.

Adds delta (default 1) to an integer value, creating it at zero.

  • Path POST https://api.data.sylphx.com/v1/kv-increments
  • 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.
deltaint64The amount to add; unset adds 1, and zero reads the count.

#Response

FieldTypeWhat it is
valueValueRecordThe entry after the increment; value is the decimal text of the count.

#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 POST "https://api.data.sylphx.com/v1/kv-increments" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"key":"…","namespace_id":"…"}'