POST /api/v1/schemas//data
Insert rows into a schema’s underlying PostgreSQL table. UsesON CONFLICT DO NOTHING to skip duplicate rows when a unique constraint exists.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Schema ID |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
rows | object[] | Yes | Array of row objects. Each key must match a column name in the schema. Min 1 row. |
Example
Response — 201 Created
Error Codes
| Code | Reason |
|---|---|
400 | Empty rows array or invalid column names |
404 | Schema not found |
500 | Database insert failure |
Roles
admin, editorGET /api/v1/schemas//data
Preview rows from a schema’s underlying PostgreSQL table. Only works for tables created by the schema system (tables withds_ prefix).
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Schema ID |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | integer | 50 | Max rows to return (1-500) |
offset | integer | 0 | Pagination offset |
Response
{ "total": 0, "rows": [] }.
Roles
admin, editor, viewerGET /api/v1/schemas//stats
Returns per-field statistics for a schema’s data. Results are cached for 5 minutes.Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Schema ID |
Response
Field Stat Types
Numeric fields include:min, max, avg, distinctCount
Text fields include: distinctCount, topValues (top 5 by frequency)
Error Codes
| Code | Reason |
|---|---|
403 | Table name is not a schema-system table (missing ds_ prefix) |
404 | Schema not found |
Roles
admin, editor, viewerPOST /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.| Field | Type | Required | Description |
|---|---|---|---|
file | File | Yes | CSV file (max 50MB) |
Limits
| Constraint | Value |
|---|---|
| Max file size | 50 MB |
| Allowed types | text/csv, application/vnd.ms-excel, text/plain |
| Sample size | First 1 MB of file, up to 100 rows |
Example
Response
Error Codes
| Code | Reason |
|---|---|
400 | Missing file, no columns found, or CSV parse error |
413 | File exceeds 50 MB limit |
415 | Invalid file type (not CSV) |
Roles
admin, editorRole Summary
| Endpoint | Method | Allowed Roles |
|---|---|---|
/schemas/{id}/data | POST | admin, editor |
/schemas/{id}/data | GET | admin, editor, viewer |
/schemas/{id}/stats | GET | admin, editor, viewer |
/schemas/upload | POST | admin, editor |