Call a Postgres function
POST/v1/db/{project_id}/rpc/{function}
Invokes a PL/pgSQL function. Automatically generated TypeScript types. RLS applied in the function body via SECURITY INVOKER.
Bodysuit#
| Parameter | Type | Required | Description |
|---|---|---|---|
function | string | yes | Name of the Postgres function (in your project schema). |
args | object | no | Named arguments passed to the function. Inferred types on the SDK side. |
Engine#
Attention
This route only exists for Postgres projects served by PostgREST — it is PostgREST that executes the call. The aura-db service (MongoDB project, or Postgres with PostgREST disabled) does not declare any /rpc/routes.
Security#
Attention
By default, functions are created in SECURITY INVOKER. To bypass RLS in a function, use SECURITY DEFINER with caution — document why.
Last updated · Apr 15, 2026↗ Edit on GitHub↗ Report a problem