Browser Sessions
sfp server API reference for Browser Sessions: 13 endpoints.
/sfp/api/browser-sessionsAuthorization
access-token In: header
Query Parameters
Filter by repository identifier (e.g., owner/repo)
Filter by pull request number
Filter by environment id
Filter by session status
Value in
- "provisioning"
- "live"
- "ended"
- "expired"
- "error"
Response Body
curl -X GET "https://example.com/sfp/api/browser-sessions"/sfp/api/browser-sessions/record-for-prResolves 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 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 }'/sfp/api/browser-sessions/{id}Authorization
access-token In: header
Path Parameters
Browser session id
Response Body
curl -X GET "https://example.com/sfp/api/browser-sessions/string"/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 In: header
Path Parameters
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 '{}'/sfp/api/browser-sessions/{id}Stops the remote Browserbase session if it is still running, then removes the session record.
Authorization
access-token In: header
Path Parameters
Browser session id
Response Body
curl -X DELETE "https://example.com/sfp/api/browser-sessions/string"/sfp/api/browser-sessions/{id}/replaysProxies 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 In: header
Path Parameters
Browser session id
Response Body
curl -X GET "https://example.com/sfp/api/browser-sessions/string/replays"/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 In: header
Path Parameters
Browser session id
Replay page id
Response Body
curl -X GET "https://example.com/sfp/api/browser-sessions/string/replays/string"/sfp/api/browser-sessions/{id}/replays/{pageId}/segmentFetches 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 In: header
Path Parameters
Browser session id
Replay page id
Query Parameters
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"/sfp/api/browser-sessions/{id}/extendBumps expires_at by the requested minutes, capped so total lifetime never exceeds 60 minutes.
Authorization
access-token In: header
Path Parameters
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 '{}'/sfp/api/browser-sessions/{id}/stopEnds 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 In: header
Path Parameters
Browser session id
Response Body
curl -X POST "https://example.com/sfp/api/browser-sessions/string/stop"/sfp/api/environments/{envId}/browser/recordProvisions 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 In: header
Path Parameters
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 '{}'/sfp/api/environments/{envId}/browser/replay/{sessionId}Proxies the Browserbase replays listing for the session.
Authorization
access-token In: header
Path Parameters
Browser session id
Environment id
Response Body
curl -X GET "https://example.com/sfp/api/environments/{envId}/browser/replay/string"/sfp/api/environments/{envId}/browser/replay/{sessionId}/{pageId}Proxies the Browserbase replay page and returns its HLS playlist.
Authorization
access-token In: header
Path Parameters
Browser session id
Replay page id
Environment id
Response Body
curl -X GET "https://example.com/sfp/api/environments/{envId}/browser/replay/string/string"