Change who can read a file
Set who this file is shared with: private (only the person who added it, plus workspace admins), team (everyone in the workspace, the default), or external (the workspace, and it may also be shared outside through a link). Sending the same level twice leaves the same state. Widening to 'Anyone with the link' opens every live link to the file for outsiders, including links colleagues created earlier.
Only the person who ADDED the file may change this, plus workspace admins — everyone else gets a 403 saying so, not a 404: they can already see the file, so pretending it is missing would be the confusing answer. A 404 here means the file does not exist, has been removed, belongs to another workspace, or is somebody else's private file.
Setting a file to private FROM another level also REVOKES every share link whose revoked_at is still empty, including a link that already expired. A file that is already private KEEPS the links it has: a private file has an address like any other, and the revoke fires on the transition INTO private, not on the level, so re-sending private revokes nothing and answers revoked_share_links: 0. Use DELETE /assets/{id}/share-links/{link_id} to close one of them. Narrowing to team revokes none of them: a link is an address, so those URLs keep opening for the people the new level admits and stop opening for everybody else, except an external-minted file token can still open through a folder with a live folder link. private is the one level that ends the links themselves, and it ends them for the file's own author too. Revoking rather than pausing is deliberate — 'Only me' is the off-switch people reach for, so widening the file again must not re-arm a URL somebody believed they had killed. Share the file again with a new link instead. Read GET /assets/{id}/share-links first if you need to tell somebody what they are about to switch off.
Request
- Base URL: https://api.patricia.app (the document declares no server; this is the origin it was published from)
- URL: https://api.patricia.app/v1/assets/{asset_id}/visibility
- Auth: HTTP bearer
Path parameters
The asset's id.
Headers
Request body
Response
Successful Response
Changes
No recorded changes to this operation across all 1 revision of this API.