---
title: "Create Sandbox Preview"
method: POST
path: "/sandboxes/{sandboxName}/previews"
tags: ["compute"]
---

# Create Sandbox Preview

`POST /sandboxes/{sandboxName}/previews`

Create a preview

## Query parameters

- `force` boolean

## Request body

- Preview — Preview of a Resource
  - `events` CoreEvent[] — Events happening on a resource deployed on Blaxel
    - `canaryRevision` string — Canary revisionID link to the event
    - `message` string — Event message
    - `revision` string — RevisionID link to the event
    - `status` string — Event status
    - `time` string — Event time
    - `type` string — Event type
  - `metadata` PreviewMetadata, required — Owner fields for Persistence
    - `createdAt` string — The date and time when the resource was created
    - `updatedAt` string — The date and time when the resource was updated
    - `createdBy` string — The user or service account who created the resource
    - `updatedBy` string — The user or service account who updated the resource
    - `displayName` string — Model display name
    - `name` string, required — Preview name
    - `resourceName` string — Resource name
    - `resourceType` string — Resource type
    - `workspace` string — Workspace name
  - `spec` PreviewSpec, required — Preview of a Resource
    - `customDomain` string — Custom domain bound to this preview
    - `expires` string — The expiration date for the preview in ISO 8601 format - 2024-12-31T23:59:59Z
    - `port` integer — Port of the preview
    - `prefixUrl` string — Prefix URL
    - `public` boolean — Whether the preview is public
    - `region` string — Region where the preview is deployed, this is readonly
    - `requestHeaders` object — Those headers will be set in all requests to your preview. This is especially useful to set the Authorization header.
    - `responseHeaders` object — Those headers will be set in all responses of your preview. This is especially useful to set the CORS headers.
    - `ttl` string — Time to live for the preview (e.g., "1h", "24h", "7d"). After this duration, the preview will be automatically deleted.
    - `url` string — URL of the preview
  - `status` 'DELETING' | 'TERMINATED' | 'FAILED' | 'DEACTIVATED' | 'DEACTIVATING' | 'UPLOADING' | 'BUILDING' | 'DEPLOYING' | 'DEPLOYED' | 'BUILT' — Deployment status of a resource deployed on Blaxel

## Response `200`

successful operation

- Preview — Preview of a Resource
  - `events` CoreEvent[] — Events happening on a resource deployed on Blaxel
    - `canaryRevision` string — Canary revisionID link to the event
    - `message` string — Event message
    - `revision` string — RevisionID link to the event
    - `status` string — Event status
    - `time` string — Event time
    - `type` string — Event type
  - `metadata` PreviewMetadata, required — Owner fields for Persistence
    - `createdAt` string — The date and time when the resource was created
    - `updatedAt` string — The date and time when the resource was updated
    - `createdBy` string — The user or service account who created the resource
    - `updatedBy` string — The user or service account who updated the resource
    - `displayName` string — Model display name
    - `name` string, required — Preview name
    - `resourceName` string — Resource name
    - `resourceType` string — Resource type
    - `workspace` string — Workspace name
  - `spec` PreviewSpec, required — Preview of a Resource
    - `customDomain` string — Custom domain bound to this preview
    - `expires` string — The expiration date for the preview in ISO 8601 format - 2024-12-31T23:59:59Z
    - `port` integer — Port of the preview
    - `prefixUrl` string — Prefix URL
    - `public` boolean — Whether the preview is public
    - `region` string — Region where the preview is deployed, this is readonly
    - `requestHeaders` object — Those headers will be set in all requests to your preview. This is especially useful to set the Authorization header.
    - `responseHeaders` object — Those headers will be set in all responses of your preview. This is especially useful to set the CORS headers.
    - `ttl` string — Time to live for the preview (e.g., "1h", "24h", "7d"). After this duration, the preview will be automatically deleted.
    - `url` string — URL of the preview
  - `status` 'DELETING' | 'TERMINATED' | 'FAILED' | 'DEACTIVATED' | 'DEACTIVATING' | 'UPLOADING' | 'BUILDING' | 'DEPLOYING' | 'DEPLOYED' | 'BUILT' — Deployment status of a resource deployed on Blaxel

---

[API](https://skmtc.net/blaxel/apis/blaxel-control-plane.md) · [All operations](https://skmtc.net/blaxel/apis/blaxel-control-plane/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/blaxel/blaxel-control-plane/versions/dfa264bc72ee/schema)
