---
title: "Signs the console's own browser in to a `temps_login` sandbox preview without showing the sign-in page: the same grant `/ingress/login-grants` issues after that page, for a console that already has a session and wants to frame the preview."
method: POST
path: "/ingress/sandbox-preview-sessions"
tags: ["Sandboxes"]
---

# Signs the console's own browser in to a \`temps_login\` sandbox preview without showing the sign-in page: the same grant \`/ingress/login-grants\` issues after that page, for a console that already has a session and wants to frame the preview.

`POST /ingress/sandbox-preview-sessions`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/ingress/sandbox-preview-sessions`
- Auth: HTTP bearer

## Request body

- CreateSandboxPreviewSessionRequest: The console asking to frame a sandbox's preview page.
  - `sandbox_id` string, required: The sandbox's public id (`sbx_<hex>`).
  - `url` string, required: The preview page to open, as the console would frame it: `http(s)://ws-<hex>-<port>.<preview domain>[:port]/path?query`.

## Response `201`

Grant issued; load redirect_url in the frame (or tab) that shows the preview. It signs the browser in to that preview host and lands on the requested page

- IngressLoginGrantResponse
  - `expires_at` string, required: When the session this grant can start expires. ISO 8601, UTC.
  - `grant_id` integer, required
  - `redirect_url` string, required: Where the browser goes next: the host's exchange path with a short-lived grant. Contains a credential; do not store it.

## Other responses

- `400`: The URL is not one of the sandbox's preview pages
- `401`: Unauthorized
- `403`: Not a browser session, not the sandbox's owner, or insufficient permissions
- `404`: Sandbox not found
- `409`: The sandbox's preview does not ask for a Temps login (it is public or password-protected): load the URL as it is, or use a preview link
- `500`: Internal server error

## Changes

- **2026-11-09** `12896146b193`: 6 breaking
  - removed the required property `extensions` from the response with the `400` status
  - removed the required property `extensions` from the response with the `401` status
  - removed the required property `extensions` from the response with the `403` status
  - removed the required property `extensions` from the response with the `404` status
  - …2 more
- **2026-10-28** `b8d51a990805`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/ingress/sandbox-preview-sessions/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
