Key-Value Storage API — Agentuity Documentation

Key-Value Storage API

Store and retrieve arbitrary data by key within namespaces

Store and retrieve arbitrary data by key within namespaces.

https://catalyst-usw.agentuity.cloud

Authentication

All requests require a Bearer token. Pass your SDK key in the Authorization header.

HeaderValue
AuthorizationBearer YOUR_SDK_KEY

You can find your SDK key in the Agentuity Console under your project settings.


Get Value

Retrieve a stored value by its namespace and key. Returns the raw value with the original content type.

GET/kv/{namespace}/{key}
https://catalyst-usw.agentuity.cloud/kv/{namespace}/{key}

Parameters

path
NameTypeRequiredDescription
namespacestringYesThe namespace name
keystringYesThe key to retrieve

Response

Returns the raw stored value with the original content type. The response body is the value itself (not wrapped in JSON).

StatusDescription
200Value found and returned
401Unauthorized — invalid or missing API key
404Key does not exist in the namespace

Response Headers

HeaderDescription
Content-TypeMIME type of the stored value (e.g., application/json, text/plain, application/octet-stream)
x-expires-atISO 8601 expiration timestamp. Omitted if the key does not expire.

Example

curl -X GET 'https://catalyst-usw.agentuity.cloud/kv/my-namespace/user-123' \
  -H 'Authorization: Bearer $AGENTUITY_SDK_KEY'

Store Value

Store a value in key-value storage. The namespace is auto-created if it doesn't exist. Set the Content-Type header to match your data format.

PUT/kv/{namespace}/{key}[/{ttl}]
https://catalyst-usw.agentuity.cloud/kv/{namespace}/{key}[/{ttl}]

Parameters

path
NameTypeRequiredDescription
namespacestringYesThe namespace name (auto-created if not exists)
keystringYesThe key to store the value under
ttlnumberNoOptional TTL in seconds (60–31,536,000). Omit for namespace default. Use `0` for no expiration.

Request Body

The raw value to store. Can be any content type — JSON, text, or binary.

Response

Empty response on success.

StatusDescription
200Value stored successfully
401Unauthorized — invalid or missing API key
402Payment required — upgrade to a paid plan

Notes

TTL behavior:

  • Omitted: Key inherits namespace default TTL (7 days if not configured)
  • 0: Key never expires
  • 60–31,536,000: Expires after specified seconds (values outside range are clamped)

Example

curl -X PUT 'https://catalyst-usw.agentuity.cloud/kv/my-namespace/user-123' \
  -H 'Authorization: Bearer $AGENTUITY_SDK_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "Alice",
  "email": "alice@example.com"
}'

Delete Value

Delete a specific key from a namespace.

DELETE/kv/{namespace}/{key}
https://catalyst-usw.agentuity.cloud/kv/{namespace}/{key}

Parameters

path
NameTypeRequiredDescription
namespacestringYesThe namespace name
keystringYesThe key to delete

Response

Empty response on success.

StatusDescription
200Key deleted successfully
401Unauthorized

Example

curl -X DELETE 'https://catalyst-usw.agentuity.cloud/kv/my-namespace/user-123' \
  -H 'Authorization: Bearer $AGENTUITY_SDK_KEY'

Search Keys

Search for keys matching a keyword within a namespace. Returns matching keys with their values and metadata.

GET/kv/search/{namespace}/{keyword}
https://catalyst-usw.agentuity.cloud/kv/search/{namespace}/{keyword}

Parameters

path
NameTypeRequiredDescription
namespacestringYesThe namespace to search in
keywordstringYesThe keyword to search for in key names

Response

JSON object mapping key names to their values and metadata.

StatusDescription
200Search results returned
401Unauthorized

Response Fields

FieldTypeDescription
{key}.valueanyThe stored value (base64-encoded for binary)
{key}.contentTypestringMIME type of the stored value
{key}.sizenumberSize in bytes
{key}.expiresAtstring | nullISO 8601 expiration timestamp
{key}.firstUsednumber | nullUnix timestamp (ms) of first access
{key}.lastUsednumber | nullUnix timestamp (ms) of last access
{key}.countnumber | nullNumber of times accessed

Example

curl -X GET 'https://catalyst-usw.agentuity.cloud/kv/search/my-namespace/user' \
  -H 'Authorization: Bearer $AGENTUITY_SDK_KEY'

List Keys

Get all key names in a namespace.

GET/kv/keys/{namespace}
https://catalyst-usw.agentuity.cloud/kv/keys/{namespace}

Parameters

path
NameTypeRequiredDescription
namespacestringYesThe namespace to list keys from

Response

JSON array of key name strings.

StatusDescription
200Key list returned
401Unauthorized

Example

curl -X GET 'https://catalyst-usw.agentuity.cloud/kv/keys/my-namespace' \
  -H 'Authorization: Bearer $AGENTUITY_SDK_KEY'

Get Namespace Stats

Get statistics for a specific namespace including record count and size.

GET/kv/stats/{namespace}
https://catalyst-usw.agentuity.cloud/kv/stats/{namespace}

Parameters

path
NameTypeRequiredDescription
namespacestringYesThe namespace to get stats for

Response

JSON object with namespace statistics.

StatusDescription
200Stats returned
401Unauthorized

Response Fields

FieldTypeDescription
sumnumberTotal size in bytes for the namespace.
countnumberNumber of records in the namespace.
createdAtnumberUnix timestamp (milliseconds) when the namespace was created. (optional)
lastUsedAtnumberUnix timestamp (milliseconds) when the namespace was last used. (optional)

Example

curl -X GET 'https://catalyst-usw.agentuity.cloud/kv/stats/my-namespace' \
  -H 'Authorization: Bearer $AGENTUITY_SDK_KEY'

List All Namespace Stats

Get statistics for all namespaces with optional pagination and filtering.

GET/kv/stats
https://catalyst-usw.agentuity.cloud/kv/stats

Parameters

query
NameTypeRequiredDescription
limitnumberNoMaximum namespaces to return (default: 100, max: 1000)
offsetnumberNoNumber of namespaces to skip (default: 0)
sortstringNoSort field: `name`, `size`, `records`, `created`, or `lastUsed`
directionstringNoSort direction: `asc` or `desc` (default: `desc`)
namestringNoFilter namespaces by name substring

Response

Paginated response with namespace statistics.

StatusDescription
200Stats returned
401Unauthorized

Response Fields

FieldTypeDescription
namespacesobjectMap of namespace names to their statistics
totalnumberTotal number of namespaces across all pages
limitnumberNumber of namespaces requested per page
offsetnumberNumber of namespaces skipped
hasMorebooleanWhether there are more namespaces available

Example

curl -X GET 'https://catalyst-usw.agentuity.cloud/kv/stats?limit=10&sort=size&direction=desc' \
  -H 'Authorization: Bearer $AGENTUITY_SDK_KEY'

List Namespaces

Get all namespace names (up to 1000, ordered by creation date, most recent first).

GET/kv/namespaces
https://catalyst-usw.agentuity.cloud/kv/namespaces

Response

JSON array of namespace name strings.

StatusDescription
200Namespace list returned
401Unauthorized

Example

curl -X GET 'https://catalyst-usw.agentuity.cloud/kv/namespaces' \
  -H 'Authorization: Bearer $AGENTUITY_SDK_KEY'

Create Namespace

Create a new namespace with optional default TTL configuration.

POST/kv/{namespace}
https://catalyst-usw.agentuity.cloud/kv/{namespace}

Parameters

path
NameTypeRequiredDescription
namespacestringYesThe namespace name to create

Request Body

Optional JSON body with namespace configuration.

FieldTypeDescription
default_ttl_secondsnumberDefault TTL for keys in this namespace (in seconds). If omitted, defaults to 7 days (604,800). Use 0 for keys that never expire. (optional)

Response

Empty response on success.

StatusDescription
200Namespace created successfully
401Unauthorized
402Payment required

Example

curl -X POST 'https://catalyst-usw.agentuity.cloud/kv/my-namespace' \
  -H 'Authorization: Bearer $AGENTUITY_SDK_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "default_ttl_seconds": 86400
}'

Delete Namespace

Delete an entire namespace and all its keys.

DELETE/kv/{namespace}
https://catalyst-usw.agentuity.cloud/kv/{namespace}

Parameters

path
NameTypeRequiredDescription
namespacestringYesThe namespace to delete

Response

Empty response on success.

StatusDescription
200Namespace deleted successfully
401Unauthorized

Example

curl -X DELETE 'https://catalyst-usw.agentuity.cloud/kv/my-namespace' \
  -H 'Authorization: Bearer $AGENTUITY_SDK_KEY'