---
title: "Get tokens for Sandbox Preview"
method: GET
path: "/sandboxes/{sandboxName}/previews/{previewName}/tokens"
tags: ["compute"]
---

# Get tokens for Sandbox Preview

`GET /sandboxes/{sandboxName}/previews/{previewName}/tokens`

## Request

- Base URL: `https://api.blaxel.ai/v0`
- URL: `https://api.blaxel.ai/v0/sandboxes/{sandboxName}/previews/{previewName}/tokens`
- Auth: one of:
  - OAuth 2
    - Authorization code: `/oauth/authorize`
    - Client credentials
    - Token URL: `/oauth/token` scopes: `sandboxes:get`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/blaxel/apis/blaxel-control-plane/docs/sandboxes/:sandboxName/previews/:previewName/tokens/get.ts> (a function with typed inputs; its response is checked against the schema)

Gets tokens for a Sandbox Preview.

## Path parameters

- `sandboxName` string, required
- `previewName` string, required

## Response `200`

successful operation

- PreviewToken[]
  - `metadata` PreviewTokenMetadata, required: PreviewTokenMetadata
    - `name` string, required: Token name
    - `previewName` string: Preview name
    - `resourceName` string: Resource name
    - `resourceType` string: Resource type
    - `workspace` string: Workspace name
  - `spec` PreviewTokenSpec, required: Spec for a Preview Token
    - `expired` boolean: Whether the token is expired
    - `expiresAt` string: Expiration time of the token
    - `token` string: Token

---

[API](https://skmtc.dev/blaxel/apis/blaxel-control-plane.md) - [All operations](https://skmtc.dev/blaxel/apis/blaxel-control-plane/llms.txt) - [OpenAPI document](https://skmtc.dev/blaxel/apis/blaxel-control-plane/revisions/dfa264bc72ee?raw)
