---
title: "Set access for the team, the link, or project members by email, all at once. A null role removes access given on this file; inherited folder access stays and audiences not listed keep theirs. Owner or workspace admin only."
method: PUT
path: "/files/{fileId}/sharing"
tags: ["Files"]
---

# Set access for the team, the link, or project members by email, all at once. A null role removes access given on this file; inherited folder access stays and audiences not listed keep theirs. Owner or workspace admin only.

`PUT /files/{fileId}/sharing`

## Request

- Base URL: `https://api.replo.app/v1`
- URL: `https://api.replo.app/v1/files/{fileId}/sharing`
- Auth: HTTP bearer

**Beta** — this endpoint may change before general availability.

## Path parameters

- `fileId` string, uuid, required

## Headers

- `Replo-Api-Version` '2026-10-29', required

## Request body

- object
  - `access` union[], required: Access to set. Audiences not listed keep their current access. Each audience or email appears once.
    - union: FileAccessEntry
      - object
        - `to` 'team', required: Everyone who can open the file's project.
        - `role` 'viewer' | 'commenter' | 'editor' | 'null', nullable, required: The access to give; null removes this audience's access.
      - object
        - `to` 'link', required: Anyone with the link, signed in or not. This publishes the file.
        - `role` 'viewer' | 'commenter' | 'null', nullable, required: viewer or commenter; null turns the link off.
      - object
        - `to` string, email, required: The email of a person who can already open the project.
        - `role` 'viewer' | 'commenter' | 'editor' | 'null', nullable, required: The access to give; null removes this audience's access.

## Response `200`

Set access for the team, the link, or project members by email, all at once. A null role removes access given on this file; inherited folder access stays and audiences not listed keep theirs. Owner or workspace admin only.

- object
  - `object` 'file_sharing', required
  - `fileId` string, uuid, required
  - `owner` object, nullable, required
    - `email` string, nullable, required
    - `name` string, nullable, required
  - `access` object[], required
    - `to` string, required: "team", "link", or a person's email.
    - `role` 'viewer' | 'commenter' | 'editor', required: AgentFileRole
  - `inherited` object[], required: Access granted on a parent folder. Change it on that folder, not here.
    - `to` string, required: "team", "link", or a person's email.
    - `role` 'owner' | 'editor' | 'commenter' | 'viewer', required: AgentFileAccessRole
    - `folderName` string, nullable, required: Null when the caller cannot open that folder.
  - `artifactUrl` string, uri, nullable, required: The viewer link for an artifact; null for other files.

## Other responses

- `400`: Invalid request.
- `401`: Missing or invalid Replo Public API token. Send an active key as `Authorization: Bearer replo_sk_...`; if it was revoked, create a new key in Replo Settings.
- `403`: You are not authorized to access this resource. Ask a workspace owner to perform this action or to grant the key's creator access.
- `404`: Not Found. The resource may not exist, this key may lack the required scope, or the key's creator may have lost access. Check the key's scopes in Replo Settings and the creator's project or workspace access; a workspace owner can grant access.
- `409`: The resource is in a conflicting state.
- `413`: File content exceeds the 10 MiB limit.
- `429`: Too many requests. Please retry after the time indicated by the Retry-After header.
- `500`: An internal error occurred.
- `503`: Service temporarily unavailable.

## Changes

- **2026-11-04** `53d194ba2067`: 9 info
  - added the optional property `error/issues` to the response with the `400` status
  - added the optional property `error/issues` to the response with the `401` status
  - added the optional property `error/issues` to the response with the `403` status
  - added the optional property `error/issues` to the response with the `404` status
  - …5 more
- **2026-10-30** `a8116fd4eeb2`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/replo/apis/replo-public-api/changes/files/:fileId/sharing/put.md)

---

[API](https://skmtc.dev/replo/apis/replo-public-api.md) - [All operations](https://skmtc.dev/replo/apis/replo-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/replo/apis/replo-public-api/revisions/53d194ba2067?raw)
