---
title: "POST /internal/environments/{environment_id}/volumes"
method: POST
path: "/internal/environments/{environment_id}/volumes"
tags: ["Workload Volumes"]
---

# POST /internal/environments/{environment_id}/volumes

`POST /internal/environments/{environment_id}/volumes`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/internal/environments/{environment_id}/volumes`
- Auth: HTTP bearer

## Path parameters

- `environment_id` integer, required

## Request body

- CreateEnvironmentVolumeRequest
  - `name` string, required: 2-64 characters of `[a-z0-9_.-]`, starting with a letter or digit; unique per environment.
  - `retain_on_delete` boolean: Keep the data when the volume is deleted.
  - `size_mb` integer, nullable

## Response `201`

- EnvironmentVolumeResponse
  - `attachment` VolumeAttachmentDto, nullable
    - `mount_path` string, required: Absolute path inside every replica.
    - `read_only` boolean, required
  - `backing` string, required: `named` (a Docker named volume).
  - `created_at` string, required: ISO 8601, UTC.
  - `environment_id` integer, required
  - `id` integer, required
  - `name` string, required
  - `node_id` integer, nullable: The node holding the data: `null` until first created, `0` for the control plane. A replica that mounts it is pinned there.
  - `pin_reason` string, nullable: The pin the console shows, e.g. "pinned to node 0 by volume `data`".
  - `retain_on_delete` boolean, required
  - `size_mb` integer, nullable
  - `updated_at` string, required

## Other responses

- `400`: Invalid volume
- `401`: Unauthorized
- `403`: Instance admin required
- `404`: Environment not found
- `409`: Name taken
- `500`: Storage failed

## Changes

- **2026-11-09** `12896146b193`: 6 breaking
  - removed the required property `extensions` from the response with the `400` status
  - removed the required property `extensions` from the response with the `401` status
  - removed the required property `extensions` from the response with the `403` status
  - removed the required property `extensions` from the response with the `404` status
  - …2 more
- **2026-10-28** `b8d51a990805`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/internal/environments/:environment_id/volumes/post.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)
