Skip to content

Set Key/Value

POST https://api.echovalue.dev/kv/<bucket>/<key>

Stores a value for the given key. If the key already exists, its value is overwritten.

Headers:

HeaderDescription
x-tokenYour API token

Path parameters:

ParameterTypeDescription
bucketstringLogical namespace. Max 30 characters. Cannot start with reserved- or end with ---.
keystringKey identifier. Max 30 characters.

Query parameters:

ParameterTypeDescriptionDefault
ttlintegerTime-to-live in seconds. Min: 0 (= max 30 days). Max: 2592000 (30 days).30 days

Body (text/plain): The value to store. Max 1000 characters.

Terminal window
curl 'https://api.echovalue.dev/kv/default/mykey' \
-H 'x-token: mytoken' \
-d 'hello world'
# With 30-second TTL
curl 'https://api.echovalue.dev/kv/default/mykey?ttl=30' \
-H 'x-token: mytoken' \
-d 'hello world'

200 OK

OK

Response headers:

HeaderDescription
x-balanceWallet balance after this call
x-costCredits consumed

See Response Headers for details.

StatusMeaning
200Value stored successfully
400Malformed request
401Invalid token
402Insufficient credits
  • ttl=0 means the maximum TTL, which is 30 days.
  • Values are stored as plain text and overwrite any existing value for the same bucket/key.