Execute a Postgres function as RPC
Invokes `schema.function(arg => ...)` on the pool selected by `X-Athena-Client`. Requires API key with right `gateway.rpc.execute`. Success responses return **`{"data": [...], "count": ...}`** (not the usual `status`/`message` envelope). Rows are JSON objects keyed by selected columns.
Header Parameters
uriRequest Body
application/json
Function name (or schema.function when schema is public)
Alias of function accepted in JSON
"public"Comma-separated columns for SELECT over RPC result
Set to exact to include an exact row count
int64int64Response Body
application/json
curl -X POST "https://athena-cluster.com/gateway/rpc" \ -H "X-Athena-Client: string" \ -H "Content-Type: application/json" \ -d '{ "function": "get_recent_events", "schema": "public", "args": { "p_limit": 10 }, "select": "id,event_type,created_at", "order": { "column": "created_at", "ascending": false } }'{
"data": [
{
"id": "5d845b27-8d06-40a0-9e76-08de9d9f3c1f",
"event_type": "user_login",
"created_at": "2026-04-14T10:15:00Z"
}
],
"count": 1
}Run a raw SQL query against the selected PostgreSQL pool POST
Executes raw SQL against the client selected by `X-Athena-Client`. This route is intended for advanced workflows where structured gateway payloads are insufficient. Use carefully with parameterized SQL on the caller side when constructing dynamic queries.
Execute SQL via driver (gateway alias) POST
Same request body and behavior as `POST /query/sql`. Provided for SDKs that target a `/gateway/*` prefix.