Browser Sessions

sfp server API reference for Browser Sessions: 13 endpoints.

GET/sfp/api/browser-sessions

Authorization

access-token
AuthorizationBearer <token>

In: header

Query Parameters

repositoryIdentifier?string

Filter by repository identifier (e.g., owner/repo)

prNumber?number

Filter by pull request number

environmentId?string

Filter by environment id

status?string

Filter by session status

Value in

  • "provisioning"
  • "live"
  • "ended"
  • "expired"
  • "error"

Response Body

curl -X GET "https://example.com/sfp/api/browser-sessions"
Empty
POST/sfp/api/browser-sessions/record-for-pr

Resolves the active review-environment assignment for the PR, then dispatches the record flow. Works for pool review-environment sandboxes (which are not named environments). Use POST /environments/:id/browser/record to record against a named environment instead.

Authorization

access-token
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X POST "https://example.com/sfp/api/browser-sessions/record-for-pr" \  -H "Content-Type: application/json" \  -d '{    "repositoryIdentifier": "string",    "prNumber": 0  }'
Empty
GET/sfp/api/browser-sessions/{id}

Authorization

access-token
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Browser session id

Response Body

curl -X GET "https://example.com/sfp/api/browser-sessions/string"
Empty
PATCH/sfp/api/browser-sessions/{id}

Application-token only. Used by the Hatchet worker to write session faces (provider session id, live view URL, status) back to the server. Not a user-facing endpoint.

Authorization

access-token
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Browser session id

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X PATCH "https://example.com/sfp/api/browser-sessions/string" \  -H "Content-Type: application/json" \  -d '{}'
Empty
DELETE/sfp/api/browser-sessions/{id}

Stops the remote Browserbase session if it is still running, then removes the session record.

Authorization

access-token
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Browser session id

Response Body

curl -X DELETE "https://example.com/sfp/api/browser-sessions/string"
Empty
GET/sfp/api/browser-sessions/{id}/replays

Proxies the Browserbase replays listing for the session. Resolved by session id — no environment id required, so it works for pool review environments and the in-app inspect view.

Authorization

access-token
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Browser session id

Response Body

curl -X GET "https://example.com/sfp/api/browser-sessions/string/replays"
Empty
GET/sfp/api/browser-sessions/{id}/replays/{pageId}

Proxies the Browserbase replay page and returns its HLS playlist with segment URLs rewritten to the same-origin segment proxy.

Authorization

access-token
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Browser session id

pageId*string

Replay page id

Response Body

curl -X GET "https://example.com/sfp/api/browser-sessions/string/replays/string"
Empty
GET/sfp/api/browser-sessions/{id}/replays/{pageId}/segment

Fetches a single HLS segment (or init segment) from the Browserbase CDN server-side and streams it, so the recording stays behind the server auth instead of exposing tokened CDN URLs.

Authorization

access-token
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Browser session id

pageId*unknown

Replay page id

Query Parameters

u*string

Opaque (base64url) reference to the CDN segment, as emitted in the proxied playlist

Response Body

curl -X GET "https://example.com/sfp/api/browser-sessions/string/replays/{pageId}/segment?u=string"
Empty
POST/sfp/api/browser-sessions/{id}/extend

Bumps expires_at by the requested minutes, capped so total lifetime never exceeds 60 minutes.

Authorization

access-token
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Browser session id

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X POST "https://example.com/sfp/api/browser-sessions/string/extend" \  -H "Content-Type: application/json" \  -d '{}'
Empty
POST/sfp/api/browser-sessions/{id}/stop

Ends the remote Browserbase session and marks the session ended, keeping the record so its recording can be replayed. Use DELETE to discard the record instead.

Authorization

access-token
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Browser session id

Response Body

curl -X POST "https://example.com/sfp/api/browser-sessions/string/stop"
Empty
POST/sfp/api/environments/{envId}/browser/record

Provisions a browser session and dispatches the record-browser-session flow to Hatchet. Owner/application only — a recorded session auto-authenticates into the org, matching the owner-gated frontdoor for named environments.

Authorization

access-token
AuthorizationBearer <token>

In: header

Path Parameters

envId*string

Environment id

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X POST "https://example.com/sfp/api/environments/string/browser/record" \  -H "Content-Type: application/json" \  -d '{}'
Empty
GET/sfp/api/environments/{envId}/browser/replay/{sessionId}

Proxies the Browserbase replays listing for the session.

Authorization

access-token
AuthorizationBearer <token>

In: header

Path Parameters

sessionId*string

Browser session id

envId*unknown

Environment id

Response Body

curl -X GET "https://example.com/sfp/api/environments/{envId}/browser/replay/string"
Empty
GET/sfp/api/environments/{envId}/browser/replay/{sessionId}/{pageId}

Proxies the Browserbase replay page and returns its HLS playlist.

Authorization

access-token
AuthorizationBearer <token>

In: header

Path Parameters

sessionId*string

Browser session id

pageId*string

Replay page id

envId*unknown

Environment id

Response Body

curl -X GET "https://example.com/sfp/api/environments/{envId}/browser/replay/string/string"
Empty