Skip to main content
POST
/
v1
/
sessions
/
{id}
/
embed
/
recording
Recording Embed
curl --request POST \
  --url https://api.bctrl.ai/v1/sessions/{id}/embed/recording \
  --header 'Authorization: Bearer <token>'
{
  "token": "<string>",
  "iframeUrl": "<string>",
  "expiresAt": "<string>",
  "expiresInSeconds": 123
}
id
string
required
Session ID.
The token is valid for 24 hours. Use the iframeUrl in an iframe to embed the recording player. The SDK session.recording() method combines this with metadata from GET /v1/sessions/&#123;id&#125;/recording into a single response.

Examples

import { Bctrl } from '@bctrl/sdk';

const bctrl = new Bctrl({ apiKey: process.env.BCTRL_API_KEY! });

// The SDK recording() method combines metadata + embed token
const session = await bctrl.session.playwright();
const rec = await session.recording();
console.log(rec.playbackUrl); // embeddable URL
console.log(rec.token);       // JWT token
console.log(rec.expiresAt);   // token expiry
console.log(rec.status);      // recording status
console.log(rec.duration);    // duration in ms

Response

token
string
required
Signed JWT for authenticated playback.
iframeUrl
string
required
Embeddable URL for the recording player.
expiresAt
string
required
Token expiration time (ISO datetime).
expiresInSeconds
number
required
Token TTL in seconds (86400).
Response Example
{
  "token": "eyJhbGciOiJIUzI1NiIs...",
  "iframeUrl": "/embed/recording/sess_abc123?token=eyJhbGci...",
  "expiresAt": "2025-01-16T10:00:00Z",
  "expiresInSeconds": 86400
}