---
title: "Update user role on a project"
method: PATCH
path: "/workspaces/{workspace_id}/projects/{project_id}/users"
tags: ["Projects"]
---

# Update user role on a project

`PATCH /workspaces/{workspace_id}/projects/{project_id}/users`

## Request

- Base URL: `https://app.mammoth.io/api/v2`
- URL: `https://app.mammoth.io/api/v2/workspaces/{workspace_id}/projects/{project_id}/users`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-KEY` and API key in header `X-API-SECRET` and API key in header `X-WORKSPACE-ID`

This endpoint allows updation of a user to a project.             User role can be changed from editor to admin or vice versa.

## Path parameters

- `workspace_id` integer, required: Workspace refers to a collection of projects. Workspace ID is unique identifier for workspace.
- `project_id` integer, required: Project to delete

## Query parameters

- `user_id` integer, nullable: Id of the user
- `invite_id` integer, nullable: Id of the invited user

## Request body

- ProjectUserPatch: Add user to a project
  - `patch` ProjectUserPatchOp[], required
    - `op` 'replace', required: Operation
    - `path` 'permissions', required: Path
    - `value` 'project_admin' | 'project_analyst', required

## Response `200`

Successfully updated user role on project

## Other responses

- `400`: Bad Request
- `401`: Authorization error
- `403`: Request forbidden -- authorization will not help

---

[API](https://skmtc.dev/mammoth/apis/mammoth-analytics.md) · [All operations](https://skmtc.dev/mammoth/apis/mammoth-analytics/llms.txt) · [OpenAPI document](https://skmtc.dev/mammoth/apis/mammoth-analytics/revisions/fe078afe239b?raw)
