scribase
APIs and HTTPversion 0.20.4preloaded

pg_net

Send HTTP requests from SQL, triggers and cron jobs.

What it is for

pg_net queues HTTP requests from SQL and sends them from a background worker, so a trigger can call a webhook without waiting for the response inside the transaction. Responses land in net._http_response for a while so you can check them.

Enable it

sql
create extension if not exists pg_net with schema extensions;

Its library is preloaded when the database starts (shared_preload_libraries), so CREATE EXTENSION is all you need.

Example

sql
select net.http_post(
  url := 'https://example.com/hooks/order-paid',
  body := jsonb_build_object('order_id', 42),
  headers := '{"Content-Type": "application/json"}'::jsonb
) as request_id;

-- later: the response for that request id
select status_code, content from net._http_response where id = 1;

Questions

How do I enable pg_net?

Run create extension if not exists pg_net with schema extensions; in the SQL editor, or switch it on from the Extensions page in the console. You do not need superuser access.

Which version of pg_net is installed?

0.20.4, on Postgres 17.6, as read from the running engine on 2026-10-08. Check yours with: select extversion from pg_extension where extname = 'pg_net';

Upstream project: github.com/supabase/pg_net

More apis and http extensions

  • pg_graphql A GraphQL API over your tables at /graphql/v1.
  • pg_jsonschema Check json and jsonb values against a JSON Schema in a CHECK constraint.