Skip to main content
GET
/
api
/
updates
Real-time Updates (SSE)
curl --request GET \
  --url https://api.example.com/api/updates
Stream real-time processing status updates via Server-Sent Events (SSE).

Request

No parameters required. This endpoint returns a long-lived SSE connection.
The request must include Accept: text/event-stream header.

Request Example

cURL
curl -N -H "Accept: text/event-stream" http://localhost:60534/api/updates
Python
import requests
import json

response = requests.get(
    'http://localhost:60534/api/updates',
    headers={'Accept': 'text/event-stream'},
    stream=True
)

for line in response.iter_lines():
    if line:
        decoded = line.decode('utf-8')
        if decoded.startswith('data: '):
            event = json.loads(decoded[6:])
            print(f"[{event['opcode']}] {event['data']}")
JavaScript
const eventSource = new EventSource('http://localhost:60534/api/updates');

eventSource.addEventListener('update', (event) => {
  const data = JSON.parse(event.data);
  console.log(`[${data.opcode}]`, data.data);
});

Event Format

Each SSE event is sent as an update event type:
event: update
data: {"opcode": "file_parsing", "data": {"path": "/path/to/file.txt", "filename": "file.txt"}}

The data field is a JSON object with:
  • opcode: The event type (see table below)
  • data: Event-specific payload

All Event Opcodes

File Processing Events

OpcodeData FieldsDescription
file_parsingpath, filenameFile content extraction started
file_parsedpath, filenameContent extraction complete
file_summarizingpath, filenameAI summarization started
file_summarizedpath, filenameSummarization complete
file_embeddingpath, filenameVector embedding started
file_embeddedpath, filenameEmbedding complete
file_completepath, filenameFile fully indexed
file_failedpath, filename, errorProcessing error
file_skippedpath, filename, reasonFile skipped

File System Events

OpcodeData FieldsDescription
file_createdpathNew file detected
file_modifiedpathFile content changed
file_deletedpathFile removed
file_movedsrc_path, dest_pathFile renamed/moved
directory_deletedpathDirectory removed
directory_movedsrc_path, dest_pathDirectory renamed/moved

Watch Events

OpcodeData FieldsDescription
watch_startedpath, recursiveWatcher started for directory
watch_addedpathDirectory added to watch list
watch_removedpathDirectory removed from watch list

Directory Processing Events

OpcodeData FieldsDescription
directory_processing_startedpathInitial scan started
directory_processing_completedpathInitial scan finished

Queue Events

OpcodeData FieldsDescription
queue_item_addedid, file_path, action, statusItem added to queue
queue_item_updatedid, file_path, action, statusItem cooldown reset
queue_item_processingid, file_path, action, statusProcessing started
queue_item_completedid, file_path, action, statusProcessing succeeded
queue_item_failedid, file_path, action, errorProcessing failed permanently
queue_item_removedid, file_path, action, statusItem removed from queue
queue_pausedsourceQueue manually paused
queue_resumedsourceQueue manually resumed

Scheduler Events

OpcodeData FieldsDescription
scheduler_pausedQueue paused by scheduler
scheduler_resumedQueue resumed by scheduler

General Events

OpcodeData FieldsDescription
status_updatevariesGeneral status update
errormessageBackend error
infomessageInformational message
shutting_downBackend is shutting down (connection will close)

Keep-alive

The server sends SSE comments (: keepalive) every 15 seconds if there are no events. This prevents proxy/browser timeouts.
This is a long-lived HTTP connection. Ensure your client supports streaming responses and doesn’t timeout.