Skip to content
中文

Commands

Guide →

Base URL and authentication

These operations exist only under /database/v1/kv; a table database’s id returns 404 DATABASE_NOT_FOUND. Reads need a read credential and writes a read-write credential.

Limits: a key is at most 1 KiB, a value at most 1 MiB, a reply at most 8 MiB (read in ranges with SCAN, HSCAN, LRANGE or ZRANGE) and a database at most 1 GiB.

To connect an existing Redis client use the Upstash-compatible API.

Execute command

POST /database/v1/kv/{database_id}/commands

Parameter Location Description
database_id path Identifier of the key-value database: the id (db_…) returned by databaseCreateKvDatabase or databaseListKvDatabases. A display name is not accepted; the id of a table database returns 404 DATABASE_NOT_FOUND.

Request body

Field Type Required Description
command string[] yes The Redis command name followed by its arguments, every element a string, for example ["INCR","counter"] or ["LRANGE","queue","0","9"]; one command per call.

Returns: object.

Response

HTTP 200

Success

application/json

Name Type Description
result any Redis's reply as JSON: an integer, a string, an array (possibly nested) or null, exactly the Redis reply for the command; not base64-encoded.
终端窗口
curl -X POST "https://api.deepraxis.com/database/v1/kv/${DATABASE_ID}/commands" \
-H "Authorization: Bearer $PRAXIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"command":["INCR","visits"]}'

Response example — HTTP 200

{
"result": 1
}