Skip to main content
POST
Run a query

Authorizations

X-API-Key
string
header
required

API key for authentication. Each key is bound to a specific account.

Path Parameters

database_id
string
required

Database ID (UUID) or short id (the database_id field, e.g. a1b2c3d4)

Body

application/json
statement
string
required

One SQL statement, or one Valkey command

Example:

"SELECT id, email FROM users LIMIT 10;"

read_only
boolean
default:true

Refuse writes. Set false to run statements that change data or schema.

max_rows
integer
default:1000

Most rows to return (ceiling 5,000)

Response

Query result

success
boolean
columns
string[]
rows
object[]
rows_affected
integer

Rows changed by a write

command
string

Engine command tag, for example SELECT 10 or INSERT 0 1

notices
string[]
truncated
boolean

More rows existed than max_rows

duration_ms
number
Last modified on October 5, 2026