---
title: "Create links to a browser window (beta)"
method: POST
path: "/api/v2/sandboxes/browsers/{name}/attachments/{attachment_id}/links"
tags: ["sandboxes"]
---

# Create links to a browser window (beta)

`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: one of:
  - API key in header `X-API-Key`
  - API key in header `X-Tenant-Id`
  - HTTP bearer

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.

## Path parameters

- `name` string, required
- `attachment_id` string, required

## Request body

- SandboxesCreateBrowserWindowLinksPayload
  - `embed_origins` string[]: 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_seconds` integer: TTLSeconds is how long the links work, from 60 seconds to 24 hours. Defaults to 24 hours.

## Response `200`

OK

- SandboxesBrowserWindowLinks
  - `act_embed_url` string
  - `act_url` string: ActURL also lets the person take control of the window, use it, and hand it back.
  - `expires_at` string, date-time
  - `view_embed_url` string: 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_url` string: ViewURL shows the window and takes no input.

## Other responses

- `400`: An embed origin is not an https origin, or ttl_seconds is out of range
- `403`: The caller neither created the browser nor has sandboxes:exec
- `404`: Browser or attachment not found
- `501`: The browser beta is not enabled, or window links are not available

## Changes

- **2026-10-26** `dfe647d1748e`: 2 info
  - added the optional property `act_embed_url` to the response with the `200` status
  - added the optional property `view_embed_url` to the response with the `200` status
- **2026-10-21** `87ee89aa5368`: 1 info
  - removed the non-success response with the status `409`
- **2026-10-19** `18397ec91b83`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/langchain-ai/apis/langsmith/changes/api/v2/sandboxes/browsers/:name/attachments/:attachment_id/links/post.md)

---

[API](https://skmtc.dev/langchain-ai/apis/langsmith.md) - [All operations](https://skmtc.dev/langchain-ai/apis/langsmith/llms.txt) - [OpenAPI document](https://skmtc.dev/langchain-ai/apis/langsmith/revisions/28621d1a347a?raw)
