POST
/services/{uuid}/storagesCreate Storage
Create a persistent storage or file storage for a service sub-resource.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
uuidstringrequired
UUID of the service.
contentstringoptional
File content (file only, optional). Needs the deploy ability when set.
fs_pathstringoptional
Host path. Required for directory mounts and host file mounts. Optional for file mounts with content (default: inside the resource directory). An absolute path can be anywhere on the host; a relative path is inside the resource directory. A directory or file mount outside the resource directory needs a token with the deploy permission. Coolify never deletes a path outside the resource directory.
is_directorybooleanoptional
Whether this is a directory mount (file only, default false).
mount_pathstringrequired
The container mount path.
namestringoptional
Volume name (persistent only, required for persistent).
resource_uuidstringrequired
UUID of the service application or database sub-resource.
typestringrequired
The type of storage.
201Storage created.
400Invalid token.
messagestringoptional
401Unauthenticated.
messagestringoptional
403The token needs the deploy permission for a mount outside the resource directory or for a file storage with content.
404Resource not found.
messagestringoptional
422Validation error.
errorsobjectoptional
messagestringoptional
Error handling
A 400 is returned: Invalid token. A 401 is returned: Unauthenticated. A 403 is returned: The token needs the deploy permission for a mount outside the resource directory or for a file storage with content. A 404 is returned: Resource not found. A 422 is returned: Validation error.