Skip to main content
CapOut supports two realtime transports:
  • WebSocket for long-lived interactive clients that may want to change subscriptions after connecting
  • SSE for simpler browser-friendly one-way event delivery
Both transports start with POST /ws/token.

1. Mint a realtime token

Example response:
If the response contains relative paths, resolve them against https://api.capout.ai or wss://api.capout.ai.

WebSocket example

SSE example

Scoping subscriptions

You can scope the initial stream in two ways:
  • Repeat document_id to follow specific documents
  • Send recent=10 to follow the latest organization-owned documents
export.completed is the download-ready signal. Its export object contains the same stable links returned by upload, status, and document history:
download_url selects Contractor by default. CapOut broadcasts only the stable clean links, never the expiring S3 signature. Request a clean link with the organization’s capout-api-key; after authorizing the document, CapOut obtains a fresh signature and returns a non-cached 307 redirect.

Reconnect behavior

Handle disconnects with token expiry in mind:
  1. Detect closure or error.
  2. Mint a fresh realtime token.
  3. Re-open the connection with the same document scope.
See Download ESX files for profile selection and redirect behavior.