← Back to index Logout

title: Checkin API version: 1.0 date: 2026-10-25 author: Core Team status: Active


Workspace Checkin/Checkout

Manage isolated workspace databases for files. Allows safe concurrent processing without conflicts.

POST /api/v1/file/:file_uuid/checkin

Auth: Required Scope: file-level

Check in a file from its isolated workspace database to the main database. Moves pre-chunks, speaker detections, and vectors from workspace to main tables.

Path Parameters

Parameter Type Description
file_uuid string File UUID (32-char hex)

Example

curl -X POST "$API/api/v1/file/$FILE_UUID/checkin" -H "X-API-Key: $KEY"

Response (200)

{
  "file_uuid": "3a6c1865...",
  "pre_chunks_moved": 152,
  "speaker_detections_moved": 45,
  "vectors_moved": 152,
  "status": "completed"
}
Field Type Description
file_uuid string File UUID
pre_chunks_moved integer Number of pre-chunks moved
speaker_detections_moved integer Number of speaker detections moved
vectors_moved integer Number of vectors moved
status string Always "completed"

Error Responses

HTTP When
401 Missing or invalid API key
500 Checkin failed (database error)

POST /api/v1/file/:file_uuid/checkout

Auth: Required Scope: file-level

Check out a file from the main database. Deletes workspace data for the file.

Path Parameters

Parameter Type Description
file_uuid string File UUID (32-char hex)

Example

curl -X POST "$API/api/v1/file/$FILE_UUID/checkout" -H "X-API-Key: $KEY"

Response (200)

{
  "file_uuid": "3a6c1865...",
  "rows_deleted": 197,
  "status": "checked_out"
}
Field Type Description
file_uuid string File UUID
rows_deleted integer Total rows deleted from workspace
status string Always "checked_out"

GET /api/v1/file/:file_uuid/workspace

Auth: Required Scope: file-level

Check if a workspace database exists for a file.

Path Parameters

Parameter Type Description
file_uuid string File UUID (32-char hex)

Example

curl -s "$API/api/v1/file/$FILE_UUID/workspace" -H "X-API-Key: $KEY"

Response (200)

{
  "file_uuid": "3a6c1865...",
  "exists": true
}
Field Type Description
file_uuid string File UUID
exists boolean Whether workspace database exists

Workspace Architecture

┌─────────────────────────────────────────┐
│           Main Database                  │
│  (PostgreSQL + Qdrant vectors)           │
│                                          │
│  videos, identities, chunk, ...          │
└─────────────────────────────────────────┘
           ↑ checkin
           ↓ checkout
┌─────────────────────────────────────────┐
│     Isolated Workspace Database          │
│  (SQLite per file)                       │
│                                          │
│  pre_chunks, speaker_detections          │
│  vectors (Qdrant _workspace collection)  │
└─────────────────────────────────────────┘

Workspace Benefits

  1. Concurrent Processing: Multiple files can be processed simultaneously without lock conflicts
  2. Isolation: Processing errors don't affect main database
  3. Rollback: Failed processing can be discarded without cleanup
  4. Performance: SQLite workspace is faster for bulk inserts

Use Cases

1. Complete Processing and Check In

# After processing completes successfully
curl -X POST "$API/api/v1/file/$FILE_UUID/checkin" -H "X-API-Key: $KEY"

2. Discard Failed Processing

# If processing failed, checkout to clean up
curl -X POST "$API/api/v1/file/$FILE_UUID/checkout" -H "X-API-Key: $KEY"

3. Check Workspace Status

# Before checkin, verify workspace exists
curl -s "$API/api/v1/file/$FILE_UUID/workspace" -H "X-API-Key: $KEY" | jq '.exists'

Workflow

Normal Processing Flow

1. Register file → status: REGISTERED
2. Start processing → workspace created → status: PROCESSING
3. Processing complete → workspace populated
4. Checkin → move to main DB → status: COMPLETED
5. Workspace deleted automatically

Error Recovery Flow

1. Processing failed → workspace contains partial data
2. Checkout → delete workspace → status: COMPLETED
3. Re-trigger processing if needed

Implementation Notes


Version History

Version Date Changes
1.0 2026-10-25 Initial documentation