/api/v1) and require authentication. Reads are workspace-member; writes require the work:write scope over OAuth. See Collections for the model.
Collections
| Method | Path | Perm | Purpose |
|---|---|---|---|
POST | /workspaces/:slug/collections | member (work:write) | Create a collection |
GET | /workspaces/:slug/collections | member | List collections (?status) |
GET | /workspaces/:slug/collections/doctor | member | Audit collections (?full) |
GET | /workspaces/:slug/collections/:id | member | Collection detail |
GET | /workspaces/:slug/collections/:id/context | member | Resolve the criterion Knowledge |
PATCH | /workspaces/:slug/collections/:id | member (work:write) | Update a collection |
CreateCollectionDto): name (required), archetype (required, one of pipeline, analysis, content), record_schema, views, criterion_rel_slugs, distill_policy, owner_clerk_id. Update accepts name, status (active or archived), record_schema, views, criterion_rel_slugs, distill_policy.
Records
Base path/workspaces/:slug/collections/:id.
| Method | Path | Perm | Purpose |
|---|---|---|---|
POST | .../records | member (work:write) | Add a record |
GET | .../records | member | List records (cursor paginated) |
GET | .../retrieve | member | Records plus criterion in one call |
GET | .../records/:recordId | member | Record detail |
PATCH | .../records/:recordId | member (work:write) | Update a record |
DELETE | .../records/:recordId | member (work:write) | Delete a record |
CreateRecordDto / UpdateRecordDto): fields, status, field_meta, entity_id, and drifted on update. A record’s status is validated against the collection’s stages. List and retrieve accept status, entity_id, drifted, updated_after, view, fields, limit, and cursor.
Entities
| Method | Path | Perm | Purpose |
|---|---|---|---|
POST | /workspaces/:slug/entities | member (work:write) | Upsert an entity |
GET | /workspaces/:slug/entities | member | List entities (?kind) |
GET | /workspaces/:slug/entities/:id | member | Entity detail |
UpsertEntityDto): kind (required), name (required), dedup_key, attributes. The upsert is idempotent on (kind, dedup_key).
Pagination and errors
Records and retrieve paginate by keyset (limit plus cursor, returning nextCursor). Collections and entities list without a cursor. An invalid status (outside the collection’s stages) or archetype, or an unknown body field, returns 400 VALIDATION_FAILED. See errors for the envelope.
Related
- Collections - archetypes, field types, and the criterion seam.
- CLI: Collections, Records, and Entities - the command-line surface.
