---
title: "Update multiple projects by adding/removing users or changing roles of the users"
method: PATCH
path: "/workspaces/{workspace_id}/projects"
tags: ["Projects"]
---

# Update multiple projects by adding/removing users or changing roles of the users

`PATCH /workspaces/{workspace_id}/projects`

## Request

- Base URL: `https://app.mammoth.io/api/v2`
- URL: `https://app.mammoth.io/api/v2/workspaces/{workspace_id}/projects`
- 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`

Update multiple projects by adding/removing users or changing roles of the users

## Path parameters

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

## Request body

- ProjectsPatch: Add users to a projects/Remove users from projects/Update user roles in projects
  - `patches` ProjectsPatchOp[], required
    - `op` 'replace' | 'add' | 'remove', required: Operation
    - `path` 'role', required: Path
    - `value` UsersToProjectsPatch[], required
      - `project_id` integer, nullable: Project ID
      - `user_ids` integer[], nullable: List of user IDs to add/remove to/from project
      - `invite_ids` integer[], nullable: List of invite IDs to add/remove to/from project
      - `user_roles` UserRolesPatch[], nullable: List of user to role mapping to assign to the project
        - `user_id` integer, nullable: User ID
        - `role` 'project_admin' | 'project_analyst': Role
      - `invite_roles` InviteProjectRolePatch[], nullable: List of invite to role mapping to assign to the project
        - `invite_id` integer, nullable: Invite ID
        - `role` 'project_admin' | 'project_analyst': Role

## Response `200`

Request fulfilled, document follows

- union
  - ResponseJobSchema
    - `id` integer, required
    - `status` 'success' | 'failure' | 'processing', required
    - `response` object, required
    - `last_updated_at` string, date-time, required
    - `created_at` string, date-time, nullable
    - `path` string, nullable
    - `operation` string, nullable
  - ResponseJobSchema[]
    - `id` integer, required
    - `status` 'success' | 'failure' | 'processing', required
    - `response` object, required
    - `last_updated_at` string, date-time, required
    - `created_at` string, date-time, nullable
    - `path` string, nullable
    - `operation` string, nullable

## Other responses

- `400`: Bad request syntax or unsupported method
- `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/4b2c943a00dc?raw)
