---
title: "Assign User"
method: POST
path: "/management/v1/projects/{projectId}/users"
tags: ["Management"]
---

# Assign User

`POST /management/v1/projects/{projectId}/users`

Assigns a user to a given project. The user must be an existing user in Voucherify.

> 🚧 Correct Use of Data
>
>To avoid errors, use the `"role"` key with either `"id"` or `"login"` keys.

## Request body

- ManagementProjectsUsersAssignRequestBody
  - `id` string — The unique identifier of the user who will be assigned to the project. It can be found in Team Settings > Team > Edit member. **Required** with the `role` string. Do **not** use with the `login` string.
  - `login` string — The login data of the user who will be assigned to the project. **Required** with the `role` string. Do **not** use with the `id` string.
  - `role` string, required — The role of the user to be added. It can be one of the following predefined roles: `ADMIN`, `USER`, `VIEWER`, `MERCHANT`, or an ID of a custom role.

## Response `200`

Returns the details about the user assigned to the project.

- ManagementProjectsUsersAssignResponseBody — Details about the user.
  - `id` string, required — The unique identifier of the user who has been assigned to the project.
  - `login` string, required — The login data of the user who has been assigned to the project.
  - `email` string, required — The email address of the user who has been assigned to the project.
  - `first_name` string, required — The first name of the user who has been assigned to the project.
  - `last_name` string, required — The last name of the user who has been assigned to the project.
  - `projects` object, required — Lists key-value pairs, where the key is the project to which the user is assigned. The value is the role assigned in a given project. The predefined Voucherify roles are: `ADMIN`, `USER`, `VIEWER`, `MERCHANT`, `USER_RESTRICTED` (for the Areas and Stores, an Enterprise feature).
  - `is_owner` boolean, required — Determines if the user is the owner for the organization in Voucherify.

## Other responses

- `400` — Returns an error if the payload includes all three keys or the required data is missing.
- `401` — Returns an error if an invalid token was provided.
- `402` — Returns an error if the current plan does not include the Management API feature.

---

[API](https://skmtc.net/voucherifyio/apis/voucherify-api-async-actions.md) · [All operations](https://skmtc.net/voucherifyio/apis/voucherify-api-async-actions/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/voucherifyio/voucherify-api-async-actions/revisions/4982266e0494/schema)
