---
title: "Replace all existing repository privileges with those specified."
method: PUT
path: "/repos/{owner}/{identifier}/privileges"
tags: ["repos"]
---

# Replace all existing repository privileges with those specified.

`PUT /repos/{owner}/{identifier}/privileges`

Replace all existing repository privileges with those specified.

## Request body

- RepositoryPrivilegeInputRequest
  - `privileges` RepositoryPrivilegeDict[], required — List of objects with explicit privileges to the repository.
    - `privilege` 'Admin' | 'Write' | 'Read', required — The level of privilege that the user or team should be granted to the specified repository.
    - `service` string, slug — The service identifier (slug).
    - `team` string, slug — The team identifier (slug).
    - `user` string, slug — The user identifier (slug).

## Response `204`

Repository privileges replaced

## Other responses

- `400` — Request could not be processed (see detail).
- `404` — Owner namespace or repository not found
- `422` — Missing or invalid parameters (see detail).

---

[API](https://skmtc.dev/cloudsmith/apis/cloudsmith-api-v1.md) · [All operations](https://skmtc.dev/cloudsmith/apis/cloudsmith-api-v1/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/cloudsmith/cloudsmith-api-v1/revisions/d84142c9e5ad/schema)
