Set the default visibility for new root files
set_storage_root_visibility
Sets whether new files uploaded with no visibility default to public or private at the top level of a site's storage.
The default covers files uploaded with no visibility straight to the top level, and into a folder that has no default of its own and sits under no folder that has one. A folder carrying its own default, or sitting inside one that does, keeps following that folder, as Which files are private describes.
It changes nothing about files that already exist, and get_storage_info reports the current value as rootVisibility. While a storage backup is being restored, the call is refused with a 409 and Your storage is being restored from a backup. Try again when the restore finishes! See While a restore runs.
Request
Call it with a POST to https://api.modulify.ai/v1/set_storage_root_visibility, sending the inputs below as a JSON object. The token needs the data:write scope.
It makes changes, so send an Idempotency-Key header whenever you might retry it. A retry with the same key gets the first answer back instead of running again.
curl -X POST https://api.modulify.ai/v1/set_storage_root_visibility \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"projectId":"PROJECT_ID","visibility":"VISIBILITY"}'Over MCP, the same method is the set_storage_root_visibility tool.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
projectId |
string | Yes | The site id. |
visibility |
string | Yes | public or private. |
Response
Every call answers with the JSON envelope of success, message, data, code and version. data holds the result described above, and on a method that returns a total, count carries it. The response headers carry the call's X-Request-Id and what is left of your per-minute budget in X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. Errors explains every status code a call can answer with.