# Volumes API

Service volumes. 3 operations under /api/v1. Errors are RFC 9457 problem+json with a stable `code` field. The complete schemas are in https://nebulactrl.com/api/v1/openapi.json.

## GET /services/{serviceId}/volumes

List a service's volumes

Authentication: session cookie or `Authorization: Bearer nct_…` token.

Parameters:
- `serviceId` (path, string, required)

Response 200: OK (VolumeListOutputBody)
  - `items` (VolumeView[] | null, required)
Errors: 401 Unauthorized; 403 Forbidden; 404 Not Found; 422 Unprocessable Entity; 500 Internal Server Error

## POST /services/{serviceId}/volumes

Attach a named volume (staged until deployed)

Authentication: session cookie or `Authorization: Bearer nct_…` token.

Parameters:
- `serviceId` (path, string, required)

Request body (application/json, required): CreateVolumeInputBody
  - `mountPath` (string, required)
  - `name` (string, required)

Response 201: Created (VolumeView)
  - `dockerName` (string, required)
  - `id` (string, required)
  - `mountPath` (string, required)
  - `name` (string, required)
  - `restoreLabel` (string)
Errors: 401 Unauthorized; 403 Forbidden; 404 Not Found; 409 Conflict; 422 Unprocessable Entity; 500 Internal Server Error

## DELETE /volumes/{volumeId}

Detach a volume (staged); the Docker volume and its data are kept

Authentication: session cookie or `Authorization: Bearer nct_…` token.

Parameters:
- `volumeId` (path, string, required)

Response 204: No Content
Errors: 401 Unauthorized; 403 Forbidden; 404 Not Found; 422 Unprocessable Entity; 500 Internal Server Error
