> This page is for Taurus PROTECT, version v3.38.
> For other versions, use one of these documentation indexes:
> - v3.58 (default): https://taurushq.ferndocs.com/protect-capital/v3.58/llms.txt
> - v3.56: https://taurushq.ferndocs.com/protect-capital/v3.56/llms.txt
> - v3.54: https://taurushq.ferndocs.com/protect-capital/v3.54/llms.txt
> - v3.52: https://taurushq.ferndocs.com/protect-capital/v3.52/llms.txt
> - v3.50: https://taurushq.ferndocs.com/protect-capital/v3.50/llms.txt
> - v3.48: https://taurushq.ferndocs.com/protect-capital/v3.48/llms.txt
> - v3.46: https://taurushq.ferndocs.com/protect-capital/v3.46/llms.txt
> - v3.44: https://taurushq.ferndocs.com/protect-capital/v3.44/llms.txt
> - v3.42: https://taurushq.ferndocs.com/protect-capital/v3.42/llms.txt
> - v3.40: https://taurushq.ferndocs.com/protect-capital/v3.40/llms.txt
> - v3.38: https://taurushq.ferndocs.com/protect-capital/v3.38/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://taurushq.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://taurushq.ferndocs.com/_mcp/server.

# Creating A User Via A Change

## Basic Description

This endpoint is used to create a User in Taurus-PROTECT via a Change.\
A User Account is allowed to interact with Taurus-PROTECT based on the roles that have been assigned to them.

This endpoint would accept a POST Request with a JSON payload containing the Change details. The `firstname` ,  `lastname`, `username`,  `email` `externaluserid`, and `roles` are the required parameters that must be nested within the `changes` field of the JSON payload for the User Creation to be successful.

## Prerequisites

### Required Roles

Certain API endpoints require that the user has a specific role in order to access them. Roles are used to restrict access to certain functionality within the system and ensure that only authorized users are able to perform specific actions.

Here is the list of required Roles for this particular endpoint:

* User Manager
* TPUser

To find out more about roles, please refer to the following [page](/user-guides/docs/users-1#creating-a-new-user) in the Taurus User Guides.

### Required Input Parameters

Certain API endpoints require specific input parameters. Here is the list of Required Input Parameters for this particular endpoint:

* **firstname**: The name of the new User.
* **lastname**: The surname of the new User.
* **username**: The username of the new User.
* **email**: The email of the new User.
* **externaluserid**: The external ID of the new User.
* **roles**: The one or more roles that will be assigned to the new User.

The above parameters need to be nested with the '**changes**' field in the JSON Body. Please take a closer look at the example below.

> **Warning**
>
> **List of Available Roles**
>
> This is an exhaustive list of all the available roles that can be used in API interactions:
> "tpuser"
> "admin"
> "adminreadonly"
> "auditviewer"
> "superadmin"
> "superadminreadonly"
> "requestcreator"
> "requestapprover"
> "requestcanceler"
> "priceupdater"
> "pricemanager"
> "contractcaller"
> "usermanager"
> "accountcreator"
> "whitelistedaddresscreator"
> "whitelistedaddressapprover"
> "operator"
> "fileuploader"
> "filedownloader"

> **Note**
>
> **Preconditions**
>
> As there is an email verification process, it is important to note that email needs to preexist and be active for the user creation process to finish successfully.

## Call Example

You can find a basic example in cURL below.\
Please note that you will need to update the `BASEURL` and the `APITOKEN` for the command to function. The below command has created a Change Request for the user John Doe with email `john.doe@taurusgroup.ch` with the assigned roles of **TPUser** and **RequestCreator**.

**`cURL`**

```curl cURL
export BASEURL=https://taurus-protect-instance.com
export APIToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZXh0ZXJuYWxVc2VySUQiOiJ0ZWFtMUV4dGVybmFsVXNlcklEIiwidGVuYW50SUQiOjEsImNhcGl0YWxUZW5hbnRJRCI6MSwiZmlyc3RuYW1lIjoiSm9obiIsImxhc3RuYW1lIjoiRG9lIiwicm9sZXMiOlsidHB1c2VyIl0sImVtYWlsIjoidGVhbTFAYmFuay5jb20iLCJ1c2VybmFtZSI6InRlYW0xIiwiand0X3JlbmV3YWJsZV9hbW91bnQiOjAsImlzX3RvdHBfZW5hYmxlZCI6ZmFsc2UsImF1dGhfc3RhdHVzIjoiU1VDQ0VTUyIsImxhc3RfbG9naW4iOiIyMDIzLTAxLTAxVDAwOjAwOjAwLjE0OTc0NDIzMloiLCJsb2dnZWRfaW5fd2l0aF9zc28iOmZhbHNlLCJrZXkiOiIiLCJleHAiOjE2ODEyMTkyNzYsImlhdCI6MTY4MTIxNzQ3Nn0.K_85arIrigpkN1yHttCydpeT6oVg2c6PyQnuji907Og
curl --location "$BASEURL/api/rest/v1/changes" \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header "Authorization: Bearer $APIToken" \
--data '{
    "action": "create",
    "entity": "user",
    "changes": {
        "externaluserid": "johndoe",
        "username": "johndoe",
        "firstname": "John",
        "lastname": "Doe",
        "email": "john.doe@taurusgroup.ch",
        "roles": "tpuser,requestcreator"
    }
}'
```

This piece of code sends a POST request to  [https://your-protect-instance.example.com/api/rest/v1/changes](https://your-protect-instance.example.com/api/rest/v1/changes) with the JSON string in the request body.

> **Tip**
>
> **Call Result**
>
> A successful response for the POST call to create a change for a new user might look like this:

```json
{
    "result": {
        "id": "4626"
    }
}
```

In this example, Taurus-PROTECT has provisionally created a new User with the specified externaluserid, firstname, lastname, email, roles, and username, and has assigned the relevant Change the unique ID of "4626".

## Requirements for Future Use

For this particular endpoint, we do not have any storage requirements other than the Change`id` that is included in the JSON Body Response. This `id` will be used to Approve the Change with a different Admin in the next steps.

You can find the Swagger-generated page for this endpoint in the following [link](https://docs.taurushq.com/user-and-technical-guides/reference/userservice_createuser).