Skip to content
Console
Menu

Queues

Workflows

Getting Started

Authentication

KV Store

Zset add in KV

Adds members to a sorted set or updates their scores (ZADD), creating it.

Adds members to a sorted set or updates their scores (ZADD), creating it.

  • Path POST https://api.data.sylphx.com/v1/kv-zsets
  • 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 sorted set's key. Required.
membersZSetMember[]The members to add or rescore. Required.

#ZSetMember

FieldTypeWhat it is
memberstringThe member. Required.
scoredoubleThe score; unset in a range read without with_scores.

#Response

FieldTypeWhat it is
addeduint64How many members were new.
versionuint64The sorted set's version after the write.

#Errors

Every error arrives in the body Errors describes.

#Examples

curl -X POST "https://api.data.sylphx.com/v1/kv-zsets" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"key":"…","members":[{"member":"…"}],"namespace_id":"…"}'