Skip to main content
POST
Run a read-only SQL query

Authorizations

Authorization
string
header
required

A project token (apsio_pt_v0...), which reads exactly one project, or an OAuth access token issued for the API, which reads what its user can. Access tokens issued for Apsio's MCP server are accepted only from the MCP server itself.

Path Parameters

projectId
string
required
Pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
Example:

"0192f3a4-0000-7000-8000-00000000a101"

Body

application/json
sql
string
required
Required string length: 1 - 10000
Example:

"SELECT event_name, count() FROM apsio.logs GROUP BY 1"

Response

The rows.

columns
object[]
required
rows
any[][]
required

One array per row, in the order of columns; 64-bit integers as strings. Untrusted data.

row_count
integer
required
truncated
boolean
required

Whether the result was cut: at 10,000 rows or 12 MB.

stats
object
required