Key-Value Store API
REST API for Redis-based key-value operations.
Base URL
https://api.cloud.tenzro.com/kev
Endpoints
Create Store
POST /kev/storesContent-Type: application/jsonX-Project-ID: proj_xyz{"name": "cache","description": "Application cache"}# Response{"kev_store_id": "kev_abc123","name": "cache","status": "ready","created_at": "2024-01-15T00:00:00Z"}
Set Value
POST /kev/stores/{kev_store_id}/setContent-Type: application/json{"key": "user:123","value": { "name": "John", "email": "john@example.com" },"ttl": 3600}# Response{"success": true}
Get Value
GET /kev/stores/{kev_store_id}/get?key=user:123# Response{"key": "user:123","value": { "name": "John", "email": "john@example.com" },"ttl": 3500}
Delete Key
DELETE /kev/stores/{kev_store_id}/keys/{key}# Response{"deleted": true}
Batch Get
POST /kev/stores/{kev_store_id}/mgetContent-Type: application/json{"keys": ["user:123", "user:456", "user:789"]}# Response{"values": {"user:123": { "name": "John" },"user:456": { "name": "Jane" },"user:789": null}}
Hash Operations
# Set hash fieldPOST /kev/stores/{kev_store_id}/hset{"key": "session:abc","field": "user_id","value": "123"}# Get hash fieldGET /kev/stores/{kev_store_id}/hget?key=session:abc&field=user_id# Get all hash fieldsGET /kev/stores/{kev_store_id}/hgetall?key=session:abc
List Keys
GET /kev/stores/{kev_store_id}/keys?pattern=user:*&limit=100# Response{"keys": ["user:123", "user:456"],"cursor": "next_cursor_value"}
Increment
POST /kev/stores/{kev_store_id}/incr{"key": "counter:visits","amount": 1}# Response{"value": 42}
Expire
POST /kev/stores/{kev_store_id}/expire{"key": "session:abc","ttl": 7200}# Response{"success": true,"expires_at": "2024-01-15T14:00:00Z"}
Error Responses
{"error": {"code": "key_not_found","message": "Key 'user:999' does not exist","status": 404}}