Overview
The Database API provides PostgREST-style CRUD operations for your database tables. All requests require authentication headers.Headers
Query Records
Retrieve records from a table with filtering, sorting, and pagination.Query Parameters
Filter Operators
Example
Response
Response Headers
Create Records
Create one or more records in a table.Headers
Example
Response
WithoutPrefer header:
Prefer: return=representation:
Update Records
Update records matching query filters.Query Parameters
Use filter operators to specify which records to update.Headers
Example
Response
Delete Records
Delete records matching query filters.Query Parameters
Use filter operators to specify which records to delete.Headers
Example
Response
WithoutPrefer header: 204 No Content
With Prefer: return=representation:
Error Responses
Table Not Found (404)
Invalid Query (400)
Validation Error (400)
Examples
Pagination
Complex Filters
Upsert (Insert or Update)
Insert a record or update it if a conflict occurs on a unique constraint.Headers
Example
Response
Upsert requires a unique constraint (e.g., primary key or unique index) on the table. The conflict resolution is based on this constraint.
Call RPC Function
Execute a database function via PostgREST RPC. Supports all HTTP methods (GET, POST, PUT, PATCH, DELETE).Example
Response
Admin Endpoints
The following endpoints require admin authentication.Headers for Admin Endpoints
List Database Functions
Get all database functions in the public schema. Requires admin authentication.Example
Response
List Database Indexes
Get all database indexes. Requires admin authentication.Example
Response
List RLS Policies
Get all Row Level Security policies. Requires admin authentication.Example
Response
List Database Triggers
Get all database triggers. Requires admin authentication.Example
Response
List Database Migrations
Get the history of successful custom migrations. InsForge stores these insystem.custom_migrations, but the endpoint returns only the migration metadata and executed statements. Requires admin authentication.