---
title: "Build and deploy a custom sandbox template"
method: POST
path: "/projects/{id}/sandboxes/{sandboxId}/deployments"
tags: ["Sandboxes"]
---

# Build and deploy a custom sandbox template

`POST /projects/{id}/sandboxes/{sandboxId}/deployments`

## Request

- Base URL: `https://api.volcano.dev`
- URL: `https://api.volcano.dev/projects/{id}/sandboxes/{sandboxId}/deployments`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer
  - HTTP bearer

Upload a tar.gz context with a Dockerfile. The template ID may be new. Retries with the same Idempotency-Key and content return the same deployment. Existing sessions retain their image while the replacement builds and validates.

## Path parameters

- `id` string, uuid, required
- `sandboxId` string, uuid, required

## Headers

- `Idempotency-Key` string, uuid, required

## Request body `multipart/form-data`

- object
  - `name` string, required
  - `code` string, binary, required: Source tar.gz archive, limited to 32 MiB compressed and expanded.
  - `memory_mb` 1024 | 2048: Memory in MiB. Defaults to 1024 when omitted.
  - `ports` string: JSON array of application ports that must become ready before activation, for example [8080].

## Response `202`

Deployment queued or replayed

- SandboxDeployment
  - `id` string, uuid, required
  - `status` string, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `default`: Invalid source (400), denied access (401, 403), conflicting retry (409), or a temporarily unavailable deployment service (503). Code `feature_unavailable` with 404 means sandboxes or custom templates are not available in this environment.

## Changes

- **2026-10-14** `d8d8f53d847b`: 1 info
  - the endpoint scheme security `ProjectAccessToken` was added to the API
- **2026-10-07** `09b595274dea`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/kong/apis/volcano-api/changes/projects/:id/sandboxes/:sandboxId/deployments/post.md)

---

[API](https://skmtc.dev/kong/apis/volcano-api.md) - [All operations](https://skmtc.dev/kong/apis/volcano-api/llms.txt) - [OpenAPI document](https://skmtc.dev/kong/apis/volcano-api/revisions/84c4488f91e9?raw)
