Skip to main content

POST /api/v1/schemas//data

Insert rows into a schema’s underlying PostgreSQL table. Uses ON CONFLICT DO NOTHING to skip duplicate rows when a unique constraint exists.

Path Parameters

Request Body

Example

Response — 201 Created

inserted is the number of rows actually written (from Postgres’ affected-row count), and skipped is the number dropped by ON CONFLICT DO NOTHING (duplicate rows against a unique constraint). inserted + skipped equals the number of valid rows submitted.

Error Codes

Roles

admin, editor

GET /api/v1/schemas//data

Preview rows from a schema’s underlying PostgreSQL table. Only works for tables created by the schema system (tables with ds_ prefix).

Path Parameters

Query Parameters

Response

If the table does not exist yet (no data seeded), returns { "total": 0, "limit": <limit>, "offset": <offset>, "rows": [] }.

Roles

admin, editor, viewer

GET /api/v1/schemas//stats

Returns per-field statistics for a schema’s data. Results are cached for 5 minutes.

Path Parameters

Response

Field Stat Types

Numeric fields include: min, max, avg, distinctCount Text fields include: distinctCount, topValues (top 5 by frequency)

Error Codes

Roles

admin, editor, viewer

POST /api/v1/schemas/upload

Upload a CSV file to infer column names and types. Does not create a schema or import data — only analyzes the file structure. Useful for building schema creation forms from uploaded files.

Request

Multipart form data with a single file field.

Limits

Example

Response

Error Codes

Roles

admin, editor

Role Summary

See also: Schemas | Data Platform