Skip to content

Key-Value Store

The key-value store lets you persist string data organized in named groups. All operations require authentication via the x-token header.

Base URL: https://api.echovalue.dev/kv/<group>/<key>

URL ParameterDescriptionMax length
groupLogical namespace for keys (e.g. default)30 characters
keyKey identifier30 characters

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

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

Request headers:

HeaderDescription
x-tokenYour API token

Query parameters:

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

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

Response: 200 OK

OK

HTTP status codes:

StatusMeaning
200Value stored successfully
400Malformed request
401Invalid token
402Insufficient credits
429Rate limit exceeded
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'

GET https://api.echovalue.dev/kv/<group>/<key>

Retrieves the stored value for a key.

Request headers:

HeaderDescription
x-tokenYour API token

Response: 200 — The stored value as plain text.

hello world

HTTP status codes:

StatusMeaning
200Value returned
401Invalid token
402Insufficient credits
404Key does not exist or has expired
429Rate limit exceeded
Terminal window
curl 'https://api.echovalue.dev/kv/default/mykey' \
-H 'x-token: mytoken'

DELETE https://api.echovalue.dev/kv/<group>/<key>

Deletes a key and its associated value.

Request headers:

HeaderDescription
x-tokenYour API token

Response: 200 OK

OK

HTTP status codes:

StatusMeaning
200Key deleted successfully
401Invalid token
402Insufficient credits
404Key does not exist
429Rate limit exceeded
Terminal window
curl 'https://api.echovalue.dev/kv/default/mykey' \
-H 'x-token: mytoken' \
-X DELETE