The Recordings API enables capturing terminal sessions in asciicast format for playback and sharing.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/brimblehq/rexec/llms.txt
Use this file to discover all available pages before exploring further.
Recording Architecture
Storage Options
Recordings support three storage backends (priority order):- Cloudflare R2 (Recommended): Global CDN with edge caching
- S3-Compatible: Any S3-compatible object storage
- PostgreSQL: Database storage (default fallback)
Configuration
Format: Asciicast v2
Recordings use the asciicast v2 format:[time_in_seconds, event_type, data]
Start Recording
Begin recording a terminal session./api/recordings/start
Request
Container ID to record (Docker ID or name)
Recording title (default: “Recording YYYY-MM-DD HH:MM”)
Response
UUID of the recording
ISO 8601 timestamp
Resolved Docker container ID
Confirmation message
Response Example
Error Responses
409 Conflict
Stop Recording
Stop recording and save the session./api/recordings/:containerId/stop
Path Parameters
Container ID (Docker ID or name)
Response
UUID of the saved recording
Recording duration in milliseconds
Human-readable duration (e.g., “2m 35s”)
Total number of recorded events
Recording size in bytes
Public share token (22 characters)
Where recording is stored: “r2”, “s3”, or “database”
Public CDN URL (R2/S3 only)
Response Example
Error Responses
404 Not Found
403 Forbidden
Get Recording Status
Check if a container is currently being recorded. GET/api/recordings/:containerId/status
Response
List Recordings
Retrieve all recordings for the authenticated user./api/recordings
Response
Array of recording objects
Response Example
Get Recording
Retrieve metadata for a specific recording. GET/api/recordings/:id
Path Parameters
Recording UUID
Authorization
- Requires authentication if recording is private
- Public recordings accessible without auth
Response
Same structure as single item in List Recordings.Get Recording by Token
Retrieve recording metadata using public share token. GET/api/recordings/shared/:token
Path Parameters
Share token (22 characters)
Response
Stream Recording
Download the recording file (asciicast format)./api/recordings/:id/stream
Response
- Content-Type:
application/x-asciicast - Content-Disposition:
attachment; filename="{title}.cast" - Cache-Control:
public, max-age=31536000, immutable
Behavior by Storage Type
- R2 (CDN)
- S3
- Database
Redirects to global CDN URL:
Stream Recording by Token
Public access to recording file using share token. GET/api/recordings/shared/:token/stream
Path Parameters
Share token
Response
Same as Stream Recording (no authentication required).Update Recording
Update recording settings (title, visibility)./api/recordings/:id
Request
Make recording publicly accessible
Update recording title
Response
Delete Recording
Permanently delete a recording./api/recordings/:id
Behavior
- Deletes from external storage (R2/S3) if applicable
- Removes database record
- Invalidates share token
Response
Recording Event Capture
The recording system captures three event types:Output Events
- Type:
"o" - Data: Terminal output bytes (base64 encoded in JSON)
- When: Every terminal output chunk
Input Events (Optional)
- Type:
"i" - Data: User input
- When: User types or pastes
Resize Events
- Type:
"r" - Data: Empty string
- Cols/Rows: New terminal dimensions
- When: Terminal window resized
Event Structure
Playback Integration
Asciinema Player
Best Practices
Performance
Storage Management
Security
- Share tokens are cryptographically random (16 bytes base64)
- Public recordings accessible without authentication
- Private recordings require ownership verification
- R2/S3 URLs are public if configured with public bucket
Recording Quality
- Typical Sizes: 10-50 KB per minute of terminal activity
- Event Count: 100-500 events per minute (varies by activity)
- Compression: Asciicast format is already efficient (line-delimited JSON)
Complete Recording Workflow
User Interacts
Terminal I/O automatically captured by handler:
- Output events:
AddEvent(containerID, "o", data, 0, 0) - Resize events:
AddEvent(containerID, "r", "", cols, rows)
Troubleshooting
No Events Recorded
Check container ID resolution:Storage Upload Failures
R2 Configuration
R2 Configuration
Verify environment variables:Test connection:
S3 Permissions
S3 Permissions
Required IAM permissions: