sandboxes

Create links to a browser window (beta)

Changed on

Beta: mint a view link and an act link for one window, as every attachment response does, with a chosen lifetime and the origins allowed to embed the window's pages in an iframe. Without embed_origins no page may frame them. view_embed_url and act_embed_url carry the same tokens in the URL fragment, for an iframe, so no server sees them. An embedded page sends its parent window messages when control changes and when it connects or disconnects (see the browser guide). Either link opens the window to anyone who holds it until it expires; detaching the window ends it early. A stopped browser starts when links are minted and when a link is opened, and resumes with its windows. Minting takes being the browser's creator or a role with sandboxes:exec.

post/api/v2/sandboxes/browsers/{name}/attachments/{attachment_id}/links

Request

  • Base URL
    https://api.smith.langchain.com
  • URL
    https://api.smith.langchain.com/api/v2/sandboxes/browsers/{name}/attachments/{attachment_id}/links
  • Auth
    • API key in header X-API-Key
    • or API key in header X-Tenant-Id
    • or HTTP bearer

Path parameters

namestring required

Browser name or ID

attachment_idstring required

Attachment ID

Request body

embed_originsstring[]

EmbedOrigins are the origins whose pages may show the window's pages in an iframe, such as https://app.example.com: https, or http on localhost, with no path. Without them no page may frame the window.

ttl_secondsinteger

TTLSeconds is how long the links work, from 60 seconds to 24 hours. Defaults to 24 hours.

Response

OK

act_embed_urlstring
act_urlstring

ActURL also lets the person take control of the window, use it, and hand it back.

expires_atstring date-time
view_embed_urlstring

ViewEmbedURL and ActEmbedURL open the same window in an iframe with the token in the URL fragment, which no server, log or Referer header sees. Viewer options follow the token in the fragment, as in {act_embed_url}&fit=follow&zoom=1.

view_urlstring

ViewURL shows the window and takes no input.

Changes

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      removed the non-success response with the status