> ## Documentation Index
> Fetch the complete documentation index at: https://docs.baseten.co/llms.txt
> Use this file to discover all available pages before exploring further.

# List sandbox preview tokens

> Lists tokens for a private sandbox preview, including expired tokens.



## OpenAPI

````yaml get /v1/sandboxes/instances/{sandbox_name}/previews/{preview_name}/tokens
openapi: 3.1.0
info:
  description: REST API for management of Baseten resources
  title: Baseten management API
  version: 1.0.0
servers:
  - url: https://api.baseten.co
security:
  - BearerAuth: []
paths:
  /v1/sandboxes/instances/{sandbox_name}/previews/{preview_name}/tokens:
    parameters:
      - $ref: '#/components/parameters/SandboxName'
      - $ref: '#/components/parameters/PreviewName'
    get:
      tags:
        - Previews
      summary: List preview tokens
      description: >-
        Return the tokens of a private preview in the paginated list format,
        including expired tokens until they are removed. cursor and limit are
        accepted but not applied yet; all tokens fit on one page, so has_more is
        false. Follow pagination.cursor while has_more is true to stay
        compatible when they are applied.
      operationId: ListSandboxPreviewTokens
      parameters:
        - $ref: '#/components/parameters/TeamId'
        - $ref: '#/components/parameters/TeamIdHeader'
        - $ref: '#/components/parameters/Cursor'
        - $ref: '#/components/parameters/Limit'
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListSandboxPreviewTokensResponseV1'
              examples:
                complete:
                  $ref: '#/components/examples/SandboxPreviewTokensList'
        '400':
          description: >-
            The preview is public, so it has no tokens. Returns a JSON error
            with code, message, and optional details.
          content:
            application/json:
              example:
                code: INVALID_REQUEST
                message: Public preview cannot have tokens.
        '401':
          $ref: '#/components/responses/SandboxError401'
        '403':
          $ref: '#/components/responses/SandboxError403'
        '404':
          $ref: '#/components/responses/SandboxError404'
        '429':
          $ref: '#/components/responses/SandboxError429'
        '500':
          $ref: '#/components/responses/SandboxError500'
components:
  parameters:
    SandboxName:
      name: sandbox_name
      in: path
      required: true
      description: Immutable sandbox name returned by creation.
      schema:
        type: string
        minLength: 1
        example: baseten-api-review-0916
    PreviewName:
      name: preview_name
      in: path
      required: true
      description: Preview name returned by creation.
      schema:
        type: string
        minLength: 1
        example: web
    TeamId:
      name: team_id
      in: query
      required: false
      description: >-
        Optional team ID. Must match X-Team-Id when both are supplied. If
        neither selector is supplied, defaults to the caller's only accessible
        team. Callers with multiple accessible teams must select a team.
        Requests without access to any team are forbidden.
      schema:
        minLength: 1
        type: string
    TeamIdHeader:
      name: X-Team-Id
      in: header
      required: false
      description: >-
        Optional team ID. Must match the team_id query parameter when both are
        supplied. If neither selector is supplied, defaults to the caller's only
        accessible team. Callers with multiple accessible teams must select a
        team. Requests without access to any team are forbidden.
      schema:
        minLength: 1
        type: string
    Cursor:
      name: cursor
      in: query
      required: false
      description: Opaque cursor from the previous page; omit for the first page.
      schema:
        type: string
        example: >-
          eyJ2IjoxLCJsYXN0X2tleSI6ImJhc2V0ZW4tYXBpLXJldmlldy0wOTE2Iiwic29ydCI6ImRlc2MifQ
    Limit:
      name: limit
      in: query
      required: false
      description: Maximum number of items to return.
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 20
        example: 20
  schemas:
    ListSandboxPreviewTokensResponseV1:
      type: object
      description: One page of tokens of a preview.
      properties:
        items:
          type: array
          description: Resources on this page.
          items:
            $ref: '#/components/schemas/SandboxPreviewTokenV1'
        pagination:
          $ref: '#/components/schemas/SandboxApiPaginationV1'
      required:
        - items
        - pagination
    SandboxPreviewTokenV1:
      type: object
      description: Access token for a private preview.
      properties:
        name:
          type: string
          description: Token name, used in token_name path parameters.
          example: 7f3k2m9q1x8c4v6b0n5z
        token:
          type: string
          description: Value to send as the bl_preview_token query parameter.
          example: 7f3k2m9q1x8c4v6b0n5z
        expires_at:
          type: string
          format: date-time
          example: '2026-10-13T12:00:00Z'
        expired:
          type: boolean
          description: Whether expires_at has passed.
          example: false
      required:
        - name
        - token
        - expires_at
        - expired
    SandboxApiPaginationV1:
      type: object
      description: >-
        Cursor pagination information. The cursor is present only when another
        page is available.
      properties:
        has_more:
          type: boolean
          description: Whether another page is available.
          example: true
        cursor:
          type: string
          description: >-
            Opaque cursor to pass to the next list request. Keep the same
            filters.
          minLength: 1
          example: >-
            eyJ2IjoxLCJsYXN0X2tleSI6ImJhc2V0ZW4tYXBpLXJldmlldy0wOTE2Iiwic29ydCI6ImRlc2MifQ
      required:
        - has_more
      example:
        has_more: true
        cursor: >-
          eyJ2IjoxLCJsYXN0X2tleSI6ImJhc2V0ZW4tYXBpLXJldmlldy0wOTE2Iiwic29ydCI6ImRlc2MifQ
  examples:
    SandboxPreviewTokensList:
      summary: Tokens of a preview
      value:
        items:
          - name: 7f3k2m9q1x8c4v6b0n5z
            token: 7f3k2m9q1x8c4v6b0n5z
            expires_at: '2026-10-13T12:00:00Z'
            expired: false
        pagination:
          has_more: false
  responses:
    SandboxError401:
      description: >-
        Missing or invalid authentication. Returns a JSON error with code,
        message, and optional details.
      content:
        application/json:
          example:
            code: UNAUTHORIZED
            message: Provide a valid authentication token in the Authorization header.
            details:
              header: Authorization
    SandboxError403:
      description: >-
        Insufficient permissions. Returns a JSON error with code, message, and
        optional details.
      content:
        application/json:
          example:
            code: FORBIDDEN
            message: >-
              This authentication token does not grant permission to perform
              this operation.
            details:
              request_id: a3b7c4d2-91e6-4f08-9b5a-2c6d7e8f1043
    SandboxError404:
      description: >-
        Resource not found. Returns a JSON error with code, message, and
        optional details.
      content:
        application/json:
          example:
            code: NOT_FOUND
            message: The requested resource was not found.
            details:
              request_id: a3b7c4d2-91e6-4f08-9b5a-2c6d7e8f1043
    SandboxError429:
      description: >-
        Request limit exceeded. Returns a JSON error with code, message, and
        optional details.
      content:
        application/json:
          example:
            code: RATE_LIMITED
            message: Too many requests. Try again in 30 seconds.
            details:
              retry_after_seconds: 30
    SandboxError500:
      description: >-
        Internal server error. Returns a JSON error with code, message, and
        optional details.
      content:
        application/json:
          example:
            code: INTERNAL_ERROR
            message: The request could not be completed. Try again later.
            details:
              request_id: a3b7c4d2-91e6-4f08-9b5a-2c6d7e8f1043
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Send `Authorization: Bearer <api_key>`. The legacy `Authorization:
        Api-Key <api_key>` scheme is also accepted.

````