> For the complete documentation index, see [llms.txt](https://eshop.gitbook.io/eshopbox-developers/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://eshop.gitbook.io/eshopbox-developers/setting/team/update-a-team-member.md).

# Update a Team Member

As an owner/Admin, you may want or need to update the details of your team members.

For illustrate, if you want to:

1. To change the activation status of your team members.
2. Change the role of the team member. This may affect the rights given to them to use the workspace.

## Update team by ID

<mark style="color:orange;">`PUT`</mark> `https://{{workspace}}.myeshopbox.com/api/v1/user-account-mapping/:id`

This endpoint is required to update a  team member by a particular id&#x20;

#### Headers

| Name          | Type   | Description                                |
| ------------- | ------ | ------------------------------------------ |
| Authorization | string | The Bearer token is required to access API |

#### Request Body

| Name       | Type   | Description                                           |
| ---------- | ------ | ----------------------------------------------------- |
| role       | string | role which is updated for a user                      |
| status     | string | user is currently active or inactive                  |
| userGroups | array  | list of groups which is updated for a particular user |

{% tabs %}
{% tab title="200 Team is successfully updated" %}

```
{
    "id": "1",
    "userId": "1",
    "accountId": "1",
    "email": "johndoe@gmail.com",
    "role": "user",
    "status": "0",
    "firstName":"John",
    "lastName":"Doe",
    "preferences": null,
    "invitationUrl": "http://invitations",
     "userGroups": [
       {
           "groupName": "Operations",
           "groupId": "1"
       },
       {
           "groupName": "Operations",
           "groupId": "2"
       }
   ],
    "createdAt": "2019-04-08T12:41:05.000+05:30",
    "updatedAt": "2019-04-08T12:41:05.000+05:30"
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X PUT https://{{workspace}}.myeshopbox.com/api/v1/user-account-mapping/:id \
     -H "Authorization: Bearer XXXX" \
     -H "Content-Type: application/json" \
     -d $'{
      "data": {
      "role": "user",
      "userGroups": [
        {
            "accountId": 28,
            "groupName": "Operations",
            "id": 89,
            "createdAt": "2019-04-08T12:41:05.000+05:30",
            "updatedAt": "2019-04-08T12:41:05.000+05:30"
            "groupId": 89
        }
    ],
    "status": "2"
}
    }'
```

{% endtab %}
{% endtabs %}
