---
title: "Add user to a project"
method: POST
path: "/workspaces/{workspace_id}/projects/{project_id}/users"
tags: ["Projects"]
---

# Add user to a project

`POST /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 addition of a user to a project.

## 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

## Request body

- AddUsersToProject: Add user to a project. Only project_admin and project_analyst are allowed
  - `users` AddUserSpec[], required: List of user IDs to add to project
    - `user_id` integer, required: User id
    - `role` 'project_admin' | 'project_analyst': Role name

## Response `200`

Successfully add user from project

## Other responses

- `201`: Document created, URL follows
- `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)
