Menu
Platform
AI
App store purchases
Database
Flags
Jobs and cron
Localization
Monitoring
Notifications
Payments
Queues
Sandboxes
Webhooks
Getting Started
Authentication
KV Store
Deploy & Infrastructure
Reference
On this page
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
| Field | Type | What it is |
|---|---|---|
namespace_id | string | The namespace's id. Required. |
key | string | The sorted set's key. Required. |
members | ZSetMember[] | The members to add or rescore. Required. |
#ZSetMember
| Field | Type | What it is |
|---|---|---|
member | string | The member. Required. |
score | double | The score; unset in a range read without with_scores. |
#Response
| Field | Type | What it is |
|---|---|---|
added | uint64 | How many members were new. |
version | uint64 | The sorted set's version after the write. |
#Errors
UNAUTHENTICATED— No valid key or token was presented.PERMISSION_DENIED— The key lacks the method's permission.INVALID_FIELD— A field failed validation.RESOURCE_NOT_FOUND— The named Resource does not exist or is not visible.
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":"…"}'