POST/databases/{uuid}/storages

Create Storage

Create a persistent storage or file storage for a database.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 6 body fields
uuidstringrequired
UUID of the database.
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).
typestringrequired
The type of storage.
Allowed:persistentfile

6 status codes
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.