Athena
Rpc

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.

POST
/gateway/rpc

Header Parameters

X-Athena-Client*string
apikey?string
x-api-key?string
x-supabase-url?string
Formaturi
x-supabase-key?string

Request Body

application/json

function*string

Function name (or schema.function when schema is public)

function_name?string

Alias of function accepted in JSON

schema?string
Default"public"
args?
select?string

Comma-separated columns for SELECT over RPC result

filters?array<>
count?string

Set to exact to include an exact row count

limit?integer
Formatint64
offset?integer
Formatint64
order?

Response 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
}
Empty
Empty
Empty
Empty