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
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
| Field | Type | What it is |
|---|---|---|
namespace_id | string | The namespace's id. Required. |
key | string | The key. Required. |
value | bytes | The bytes, base64. |
ttl_seconds | uint64 | Seconds to live; unset uses the namespace default, zero never expires. |
expected_version | uint64 | Write only when the current version equals this one (0: any). |
nx | bool | Write only when the key is absent (SET NX). |
xx | bool | Write only when the key is present (SET XX); excludes nx. |
#Response
| Field | Type | What it is |
|---|---|---|
value | ValueRecord | The stored entry. |
#ValueRecord
| Field | Type | What it is |
|---|---|---|
namespace_id | string | The namespace's id in the environment, for example ratelimit. |
key | string | The key. |
value | bytes | The bytes, base64. |
sha256 | string | sha256:<hex> of the value. |
version | uint64 | The version, increasing per key. |
expires_at_unix_ms | int64 | Expiry in Unix milliseconds; zero never expires. |
updated_at_unix_ms | int64 | When this version was written, in Unix milliseconds. |
#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.ETAG_MISMATCH— The etag sent does not match the Resource's current etag.
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 '{}'