Execute a Postgres function as an RPC call
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
}Execute SQL POST
Executes raw SQL against the Athena client selected by `X-Athena-Client`. PostgreSQL clients may also be targeted with a direct PostgreSQL URI header (`x-pg-uri` preferred). 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. Direct URI requests execute inline (deferred queue bypassed). Optional `schema_name` sets a schema-local search_path (`schema_name, public`) for PostgreSQL execution only.
Execute SQL via driver (gateway alias) POST
Same request body and behavior as `POST /query/sql`. Provided for SDKs that target a `/gateway/*` prefix. PostgreSQL driver behavior: - `X-Athena-Client` or direct PostgreSQL URI headers (`x-pg-uri` preferred; `x-athena-jdbc-url` / `x-jdbc-url` compatibility). - Direct URI auth bypass requires URI username + password credentials. - Non-PostgreSQL drivers keep standard auth requirements. - Optional `schema_name` is supported only for the PostgreSQL driver and configures execution search_path as `schema_name, public`.