Gateway

Execute SQL query

Execute a single SQL query or a batch of queries against a PostgreSQL branch.

Single query: provide query (and optional params) at the top level.

Batch: provide queries as an array of query objects, or send the request body as a JSON array. Batch queries execute within a single transaction.

post/sql

Headers

Connection-Stringstring uri

PostgreSQL connection string (postgres://user:pass@host/db). The hostname encodes the target branch and endpoint type.

Array-Mode'true' | 'false'

When true, return rows as arrays instead of objects.

Raw-Text-Output'true' | 'false'

When true, return all values as strings without type conversion.

Batch-Isolation-Level'ReadCommitted' | 'ReadUncommitted' | 'RepeatableRead' | 'Serializable'

Transaction isolation level for batch queries.

Batch-Read-Only'true' | 'false'

When true, execute the batch transaction in read-only mode.

Batch-Deferrable'true' | 'false'

When true, execute the batch transaction in deferrable mode.

Request body

querystring

SQL query to execute (single query mode).

arrayModeboolean

Override array mode for this query (single query mode only).

Response

Query executed successfully

OR

Changes