Oblive Docs
Replays

Replays reference

Commands, flags, settings, routes, day states and limits for Replays.

Before running commands

replays:setup loads apps/backend/.env itself. replays:flag, history:capture and replay:environment do not, and stop with DATABASE_URL is required without it. On a source install, load the backend environment in your shell first:

set -a; . apps/backend/.env; set +a

On a deployed install, export the backend’s environment the same way your deployment does.

replays:setup

Run from the repository root. It reads apps/backend/.env; variables already set in the shell win. It prints JSON: the setup status, or {"status":"failed","code":...} with a hint on error.

bun run replays:setup --organization <id> --basis "<agreement reference>"
FlagsWhat it does
--basis "<agreement>" (alone)Turns Replays on with the Standard preset, or finishes an earlier run.
--statusShows status. Changes nothing.
--confirm --basis "<agreement>"Records every tool waiting for approval.
--pause --basis "<reason>"Pauses all new capture. History stays readable.
--resume --basis "<reason>"Resumes capture. New tools still wait for approval.
--remove-history --confirm-remove <id> --basis "<reason>"Pauses, then deletes kept history after 7 days.
--cancel-removal --basis "<reason>"Cancels a scheduled removal. Capture stays paused.

--organization is always required. --basis is 1 to 2,000 characters. The actor is your operating system user. Per-integration recording has no flag: use the Setup tab or the backend call. The command line does not check what you reviewed: run --status first.

The command prints raw codes, which differ from the page codes:

Command codePage codeMeaning
source_unavailablehistory_capture_offHistory capture is off, or recovery mode is on.
capture_pausedreplays_pausedResume first.
removal_pendingremoval_scheduledCancel the removal first.
removal_dueremoval_dueThe removal can no longer be cancelled.
removal_not_scheduledremoval_not_scheduledNothing to cancel.
missing_sourceorganization_not_found, setup_requiredUnknown business, or Replays not turned on yet.
invalid_requestinvalid_requestBad flags, or --confirm-remove is not this business’s id.

replays:flag

bun run replays:flag --organization <id> --enabled true

Sets only the business’s Replays switch (replaysEnabled). Turning Replays on with replays:setup already sets it. With the switch off, the Timeline, trial results and trial start refuse with replays_disabled. It does not stop capture; pause does.

history:capture

Each subcommand takes one private JSON file. The ones Replays operators use most:

SubcommandWhat it does
seedWrites a disabled collection policy proposal to filePath.
configureStores a collection policy.
readinessChecks a collection policy’s configuration. No provider calls.
policiesLists a business’s recording and run-input policies.
overview, show, contentInspect retained history.
observation-configureWrites a hand-written recording policy (never changed by the preset).
run-configureWrites a hand-written run-input policy.

The full list and file formats are in historical data preservation.

replay:environment

bun run replay:environment run --config /private/replay-runner.json [--organization <id>] [--once]
bun run replay:environment import-backup --organization <id> --config /private/backup-import.json

run is the replay runner. import-backup stores an operator-supplied MongoDB or Redis backup for replay. See prepare replay environments.

Settings

config/local-stack.jsonEnvironment variableDefaultPurpose
historyCaptureEnabledHISTORY_CAPTURE_ENABLEDfalseTurns history capture on for the install.
historyDailyPreservationHISTORY_DAILY_PRESERVATIONfalseHands scheduled collection to the daily S3 sync.
replayReadTokenREPLAY_READ_TOKENnoneTimeline, entries and trial results.
replayTrialTokenREPLAY_TRIAL_TOKENnoneStart and cancel trials.
replaySetupTokenREPLAY_SETUP_TOKENnoneRead and change Replays setup.
historyArchiveS3HISTORY_ARCHIVE_S3noneObject with the private S3 bucket, region and credentials for history; else the install’s object store.
integrationCredentialKeyINTEGRATION_CREDENTIAL_KEYgeneratedEncrypts history. Keep it for as long as history.

Tokens are at least 32 characters and must all differ from each other and from the agent service and execution-capture read tokens. They go to the backend and the frontend server only.

Per business, in the organization’s settings: snapshot days and the Replays display use UTC; replaysEnabled is the Replays switch.

In the runner’s JSON file: trialTimeLimitMinutes (5 to 1,440; default 60).

Routes

All routes are under /organizations/{organizationId}. Each accepts one token and refuses every other.

RouteTokenUse
GET /replays/timelineREPLAY_READ_TOKENSaved history over a range
GET /replays/entries/{entryId}REPLAY_READ_TOKENOne saved entry’s content
GET /eval-runs, /eval-runs/{trialId}, /eval-runs/{trialId}/trajectoryREPLAY_READ_TOKENTrial results
GET /replay-trials/optionsREPLAY_TRIAL_TOKENDays and their states
POST /replay-trialsREPLAY_TRIAL_TOKENStart a trial
DELETE /replay-trials/{trialId}REPLAY_TRIAL_TOKENCancel a trial
GET /replays/setupREPLAY_SETUP_TOKENSetup status
POST /replays/setupREPLAY_SETUP_TOKENChange setup
/replay-environments/...AGENT_SERVICE_TOKENReplay control API (environments)

POST /replays/setup takes an action: apply, confirm, pause, resume, cancel_removal, remove (with confirmOrganizationId), recording_off or recording_on (with integrationId). Each needs a basis. apply, confirm and recording_on also send reviewed: the exact tools staff saw, so consent never covers tools nobody reviewed.

The full contracts are in the API reference: Replays and Replay environments.

Day states

StateMeaningCan start a trial
frozenA complete snapshot exists.Yes
not_frozenNo snapshot yet. Starting a trial freezes one.Yes
missing_dataThe snapshot lacks required data.No
no_historyThe day ended before the business’s state was first saved.No
not_overThe day has not ended in UTC.No

Limits

LimitValue
Default retention90 days
Recorded tools per integration policy200 (the rest are listed as over the limit)
Requirements per snapshot100
Requirements pointing outside internal state50
Integrations per generated snapshot32
Days offered for a trialToday and the 13 before
Unfinished trials per business3
Trial time limit60 minutes by default
Removal grace period7 days
Insights copy window6 hours after the day ends
Timeline range92 days
Agreement reference2,000 characters