Database

Insert records into a table

Insert one record (JSON object) or multiple records (JSON array) into a table.

Authentication

  • Requires a valid bearer token unless the project policy has require_auth: false.
  • Service-role tokens bypass row-level security.

Row-Level Security (RLS) For non-service tokens with owner mode RLS, the user_id column (or configured owner field) is automatically set to the caller's user ID. Any client-supplied value for that field is ignored and overwritten.

Upsert / conflict handling Append ?on_conflict=col1,col2 to perform an upsert on the specified columns. Non-conflict columns are updated; conflict columns are unchanged.

Return inserted rows Send the Prefer: return=representation header to receive the inserted rows in the response body (uses RETURNING *). Response is 201 either way.

camelCase keys in the request body are automatically converted to snake_case.

post/api/db/{project_id}/rest/v1/{table}

Request

  • Base URL
    https://core.blink.new
  • URL
    https://core.blink.new/api/db/{project_id}/rest/v1/{table}
  • Auth
    • HTTP bearer
    • or none

Path parameters

project_idstring required
Example:my-project-123

Unique identifier for the project

tablestring required
Example:users

Table name (alphanumeric + underscores)

Query parameters

on_conflict'return=representation' | 'return=minimal'
Example:email

Comma-separated conflict columns for upsert (INSERT OR REPLACE on conflict)

Request body

TableRecord required

Generic table record with dynamic fields

OR
TableRecord[] required

Multiple records to insert

Example request

{
  "id": 1,
  "name": "John Doe",
  "email": "john@example.com",
  "status": "active",
  "created_at": "2024-01-20T10:30:00Z"
}

Response

Record(s) inserted successfully

object required

Empty object when Prefer header is not set

OR
TableRecord[] required

Inserted rows when Prefer: return=representation is set

Example response

[
  {
    "id": 1,
    "name": "John Doe",
    "email": "john@example.com",
    "status": "active",
    "created_at": "2024-01-20T10:30:00Z"
  }
]

Changes

No recorded changes to this operation across all 1 revision of this API.