Skip to main content

Supabase: Insert

Insert one or many rows into a Supabase table via the PostgREST API. Optionally switch to upsert semantics (Prefer: resolution=merge-duplicates) to overwrite existing rows on conflict.

Pre-requisite: Install Supabase application in Profile > {Organization} > Applications. The Supabase API key must have insert (and upsert when applicable) permission on the target table.

Parameters

ApplicationREQUIRED

Configured Supabase application (project URL + API key).

Table NameREQUIRED

Target Postgres table name (PostgREST resource).

Upsert

When enabled, rows whose On Conflict columns match an existing row update it in place instead of failing with a duplicate-key error.

On Conflict

Comma-separated column names used as the conflict target when Upsert is enabled (e.g. id, tenant_id,sku). Must form a unique or primary-key constraint on the table.

Input

JSON / FileREQUIRED

Row(s) to insert — either an inline JSON object/array or a JSONL file. Each row's keys must map to columns of the target table.

Output

JSON

PostgREST response containing the inserted/updated rows.