---
title: "PUT /api/repos/{namespace}/{repository}/collaborators"
method: PUT
path: "/api/repos/{namespace}/{repository}/collaborators"
tags: ["repository"]
---

# PUT /api/repos/{namespace}/{repository}/collaborators

`PUT /api/repos/{namespace}/{repository}/collaborators`

## Path parameters

- `namespace` string, required
- `repository` string, required

## Request body

- UpsertCollaboratorRequest
  - `accessLevel` 'viewer' | 'supporter' | 'coder' | 'manager' | 'admin', required
  - `username` string, required

## Response `200`

Collaborator added or updated

- CollaboratorResponse
  - `access_level` 'viewer' | 'supporter' | 'coder' | 'manager' | 'admin', required
  - `user_id` string, uuid, required
  - `username` string, required

## Other responses

- `400` — Invalid request or cannot modify repo owner
- `401` — Authentication required
- `403` — Insufficient permissions
- `404` — Repository or target user not found

---

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