---
title: "Create or Update Repository User Roles"
method: POST
path: "/v1/repositories/{repositoryId}/users/add"
tags: ["Repositories"]
---

# Create or Update Repository User Roles

`POST /v1/repositories/{repositoryId}/users/add`

Manages user roles on a repository, allowing for updating of existing repository users or adding roles for new users on the repository.

## Path parameters

- `repositoryId` string, required — Unique identifier for a repository folder, prefixed with `repo_`

## Request body

- AddRepositoryUsersRequest
  - `users` AddRepositoryUserRequest[], required — Array of users and their roles to add or update on the repository
    - `userId` integer, required — Unique identifier of the user to add or update
    - `role` 'REPOSITORY_OWNER' | 'REPOSITORY_MEMBER', required — Role of a user on a repository

## Response `204`

No Content. User and group roles have been successfully added or updated.

## Other responses

- `400` — Bad Request. Occurs when duplicate or invalid user IDs are provided, or REPOSITORY_MEMBERs are added to an UNRESTRICTED repository.
- `403` — Forbidden. Occurs when the user does not have permission to modify the repository.

---

[API](https://skmtc.net/lucid/apis/lucid-rest-api.md) · [All operations](https://skmtc.net/lucid/apis/lucid-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/lucid/lucid-rest-api/revisions/6a32cb9e1aa7/schema)
