Skip to content
Skip to Content

Add a volume

POST
/services/{serviceId}/volumes

Persistent storage at a path in the container. Its data lives on the server the service is placed on at its next deploy; a service with a volume runs as one instance.

Authorization

bearer
headerAuthorizationBearer <token>

An API key (opk_…) or a CLI token (opc_…).

Path parameters

serviceId*string

The service's id.

Header parameters

Idempotency-Key?string

Any unique string up to 255 characters. Sending the same request again with it returns the first answer instead of creating twice.

Lengthlength <= 255

Request body

application/json
  1. body
mountPath*string

An absolute path in the container, such as /data.

Lengthlength <= 255
sizeGb?|null

Response body

Add a volume

application/json
  1. response
id*string
Formatuuid
mountPath*string
sizeGb*integer|null
serverId*|

The server its data lives on, set at the first deploy.

Example request
curl -X POST "https://openpanel.sh/api/v1/services/$SERVICE_ID/volumes" \  -H "Authorization: Bearer $OPENPANEL_TOKEN" \  -H "Content-Type: application/json" \  -d '{  "mountPath": "string"}'
Example response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "mountPath": "string",  "sizeGb": 0,  "serverId": "10d2345a-e43d-463d-830e-4f5b19b60d41"}