Skip to main content
Use Server-Sent Events (SSE) to receive real-time progress updates for moderation jobs. This is more efficient than polling the job status endpoint.

Connecting

Open an SSE connection to the progress endpoint:
The server responds with Content-Type: text/event-stream.

Event types

connected

Sent immediately when the connection opens. Contains the current job state.
If the job has already completed, the connected event includes progress: 100 and the stream closes immediately.

progress

Sent as the job progresses through the moderation pipeline.
For video moderation jobs, progress events include frame counts:

Event data fields

Stream lifecycle

  • The stream closes automatically when progress reaches 100 or status is completed or failed.
  • A keepalive comment (: keepalive) is sent every 15 seconds to prevent connection timeouts.
  • If the client disconnects, the server cleans up the subscription.

Code examples

JavaScript

cURL