workspace API
Workspace Checkin/Checkout¶
Workspace checkin/checkout provides a transactional editing model for file data:
- Checkout: Clears PG tables (face_detections, speaker_detections, pre_chunks) and Qdrant vectors, creating an isolated workspace SQLite for editing.
- Checkin: Restores data from the workspace SQLite back to PG and Qdrant, marking the file as Indexed.
This allows safe concurrent editing — while a file is checked out, its main database records are cleared, preventing conflicts.
POST /api/v1/file/:file_uuid/checkout¶
Auth: Required Scope: file-level
Checkout a file workspace. Clears face detections, speaker detections, pre_chunks from PostgreSQL, deletes Qdrant vectors, and creates a workspace SQLite database for isolated editing.
Example¶
Response (200)¶
| Field | Type | Description |
|---|---|---|
file_uuid |
string | 32-char hex UUID |
rows_deleted |
integer | Total rows cleared from PG tables |
status |
string | "checked_out" |
Error Responses¶
| HTTP | When |
|---|---|
500 |
Checkout failed (DB error, workspace creation error) |
POST /api/v1/file/:file_uuid/checkin¶
Auth: Required Scope: file-level
Checkin a file workspace. Restores face detections, speaker detections, pre_chunks from workspace SQLite back to PostgreSQL, re-indexes vectors to Qdrant, and sets video status to Indexed.
Example¶
Response (200)¶
{
"file_uuid": "d3f9ae8e471a1fc4d47022c66091b920",
"pre_chunks_moved": 45,
"face_detections_moved": 1200,
"speaker_detections_moved": 320,
"vectors_moved": 45,
"status": "indexed"
}
| Field | Type | Description |
|---|---|---|
file_uuid |
string | 32-char hex UUID |
pre_chunks_moved |
integer | Pre-chunks restored from workspace |
face_detections_moved |
integer | Face detections restored from workspace |
speaker_detections_moved |
integer | Speaker detections restored from workspace |
vectors_moved |
integer | Vectors re-indexed to Qdrant |
status |
string | "indexed" |
Error Responses¶
| HTTP | When |
|---|---|
500 |
Checkin failed (DB error, workspace not found, vector index error) |
GET /api/v1/file/:file_uuid/workspace¶
Auth: Required Scope: file-level
Check if a workspace SQLite database exists for a file.
Example¶
Response (200)¶
| Field | Type | Description |
|---|---|---|
file_uuid |
string | 32-char hex UUID |
exists |
boolean | True if workspace SQLite exists |
Workflow¶
REGISTERED ──→ CHECKED_OUT ──→ INDEXED
│ │ │
│ checkout checkin
│ │ │
│ clear PG + Qdrant restore from SQLite
│ create workspace re-index vectors
│ set status set status
- Register file → status:
REGISTERED - Process file → processors run, data stored in PG + Qdrant
- Checkout file → clear editable data, create workspace SQLite → status:
CHECKED_OUT - Edit workspace via Agent Search / identity binding
- Checkin file → restore from workspace SQLite → status:
INDEXED - Rebuild TKG if needed after checkin
Updated: 2026-06-20 12:00:00
Version History¶
| Version | Date | Changes |
|---|---|---|
| 1.0 | 2026-10-24 | Initial documentation |