Skip to main content

Create a share

POST 

/shares

Required role: admin. Only an account or token with the admin role can call this operation.

Example request
curl --request POST \
--header "Authorization: Bearer $HOSERVA_TOKEN" \
--header "Content-Type: application/json" \
--data @body.json \
"https://$HOSERVA_HOST:8008/api/v1/shares"

Persists the share, creates its directory tree on the branches its cache mode uses, writes the per-share mergerfs mount through the existing pool renderer, and regenerates smb.conf. Refused with 409 maintenance_mode while the array is stopped: create would mkdir under bare disk mountpoints on the root filesystem, and the next array start would hide those writes. Refused with 409 migration_in_progress while an Unraid import is pending its point of no return: a new share would need a directory on every adopted disk, and those are not written until then. The import creates its own shares (startMigrationImport).

Request​

Responses​

The created share.