Documentation

Set Project Users

POST /projects/setusers

Adds, modifies, or removes users from a project.

Request Body

Send a JSON array with one or more changes for the same project. Each entry targets a user or a site user group. Use email only for adding a user. Adding by email requires site-wide project edit access, plus site user management permission when the person needs a site membership.

The request body is an array of objects, each with the following fields:

Field Type Required Description
email string No* User email address (requires site admin permission)
project_id string Yes Project ID
role string No** Role for an add or modification. Allowed values are administrator, member, contributor, and view_only.
user_id string No* User ID
usergroup_id integer No User group ID (requires site admin permission)
modify boolean No** Whether to modify the user's role
delete boolean No** Whether to delete the user from the project

* Either email or user_id is required.

** One of role (for add or modify), modify, or delete is required.

Response

Success Response (200 OK)

Success returns HTTP 200 with an empty body.

Error Responses

  • 400 Bad Request: Invalid request
  • 422 Unprocessable Entity: Request fields fail schema validation
  • 401 Unauthorized: Authentication failed
  • 403 Forbidden: User does not have permission to add, modify, or remove users from this project

See the Projects API overview for related endpoints.