Skip to content
Console
Menu

Queues

Workflows

Getting Started

Authentication

KV Store

Expire in KV

Sets a key's time to live (EXPIRE) without rewriting its value; zero makes it persistent.

Sets a key's time to live (EXPIRE) without rewriting its value; zero makes it persistent.

  • Path POST https://api.data.sylphx.com/v1/kv-expiries
  • 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.
ttl_secondsuint64Seconds to live, at most one year; zero makes the key persistent. Required.

#Response

FieldTypeWhat it is
appliedboolWhether the key existed and its expiry was set.
versionuint64The key's version (an expiry does not change it).
expires_at_unix_msint64The new expiry in Unix milliseconds; zero never expires.

#Errors

Every error arrives in the body Errors describes.

#Examples

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