Aurabase Logo
aurabasedocs
Aurabase Logo
aurabasedocs
API/Database/Insert rows

Insert rows

POST/v1/db/{project_id}/{table}

Inserts one or more records into a table in the project schema. Supports upsert via on_conflict and returns rows created by default.

This English text was generated automatically from the French original and has not been reviewed yet.
#
Request

Headers

HeaderRequiredValue
apikeyyesClé API du projet (anon ou service_role). X-API-Key accepté aussi.
AuthorizationnoBearer <JWT utilisateur> — sans lui, la requête est traitée en anon
Content-Typeyesapplication/json
Preferno`return=representation (défaut) \
#
Request

Body parameters

ParameterTypeRequiredDescription
tablestringyesName of the target table, in the path. Internal tables prefixed _aura_ are refused in 403.
values`object \object[]`yes
values.iduuid—Default: gen_random_uuid(). Omit for server generation.
values.created_attimestamptz—Default: now(). Omit for server timestamp.
values.[key]any—Any column declared by your schema.
on_conflictstringnoQuery parameter (no body). Constraint column(s) for upsert: ?on_conflict=id. An upsert responds 200 OK, a simple insert 201 Created.
#
Response

Response codes

201CreatedInsertion successful. Body = { data, meta } by default.

200OKUpsert succeeded (?on_conflict= present).

204No ContentPrefer: return=minimal — no body, Preference-Applied header returned.

400Invalid Bad RequestBody, unknown column, or empty array. error.code = BAD_REQUEST or COLUMN_NOT_FOUND.

403ForbiddenRLS refuses write, or internal table _aura_*.

409ConflictSingle constraint violation without on_conflict. error.code = DUPLICATE_KEY.

413Payload Too LargeRequest body beyond MAX_BODY_SIZE (default 50 MB). There is no cap on the number of lines.

#
Notes

To know

Info

The Prefer: return=representation header is added automatically by the SDK. Add Prefer: return=minimal to make the answer lighter.

Attention

Batch inserts are atomic: if one row violates a constraint, all are rolled back.

Attention

The Idempotency-Key header is not read on this route: two identical POSTs with the same key create two lines. To deduplicate, use ?on_conflict= and a unique constraint.

v1.0 · revised Apr 15, 2026