---
title: "Set a file's visibility flag"
method: PATCH
path: "/v1/workspaces/{workspace}/files/visibility"
---

# Set a file's visibility flag

`PATCH /v1/workspaces/{workspace}/files/visibility`

## Request

- Base URL: `https://api.uploads.sh`
- URL: `https://api.uploads.sh/v1/workspaces/{workspace}/files/visibility`
- Auth: HTTP bearer

## Query parameters

- `key` string, required

## Request body

- object
  - `visibility` 'public' | 'private', required

## Response `200`

The updated visibility.

- object
  - `key` string, required
  - `visibility` 'public' | 'private', required

## Other responses

- `400`: Invalid request.
- `401`: Missing or invalid credential.
- `403`: The credential lacks the required scope or role.
- `404`: The resource was not found.
- `429`: The workspace rate limit or upload budget was exceeded.

---

[API](https://skmtc.dev/uploads/apis/uploads-sh-api.md) · [All operations](https://skmtc.dev/uploads/apis/uploads-sh-api/llms.txt) · [OpenAPI document](https://skmtc.dev/uploads/apis/uploads-sh-api/revisions/6df242babacd?raw)
