---
title: "PUT /v1/sandboxes/{id}/preview-password"
method: PUT
path: "/v1/sandboxes/{id}/preview-password"
tags: ["Sandboxes"]
---

# PUT /v1/sandboxes/{id}/preview-password

`PUT /v1/sandboxes/{id}/preview-password`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/v1/sandboxes/{id}/preview-password`
- Auth: HTTP bearer

## Path parameters

- `id` string, required

## Request body

- SetPreviewPasswordBody
  - `password` string, password, required: Plaintext password to protect the sandbox's preview URLs. Hashed server-side with argon2id — we never persist or echo this back. Must be between 8 and 256 characters.

## Response `200`

Preview password set or rotated

- SetPreviewPasswordResponse
  - `preview_password_hint` string, required: Last 4 chars of the password we just stored. Surface in the UI so users can confirm which password is live without re-entering it.

## Other responses

- `400`: Password too short or too long
- `404`: Sandbox not found

## Changes

- **2026-10-23** `7d41b820a372`: 1 breaking
  - the `password` request property format changed from no format to `password`
- **2026-10-23** `24af93ff5379`: 1 info
  - the `password` request property format was generalized from `password` to no format
- **2026-10-22** `842d42ed4659`: 1 breaking
  - the `password` request property format changed from no format to `password`
- **2026-10-22** `1a12a50b75ee`: 1 info
  - the `password` request property format was generalized from `password` to no format
- **2026-10-21** `79089e9f49ee`: 1 breaking
  - the `password` request property format changed from no format to `password`

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/v1/sandboxes/:id/preview-password/put.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)
