> 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/create-a-team-member.md).

# Create a Team Member

## Create a team

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

This endpoint allows to add team member in group to use resources.

#### Headers

| Name          | Type   | Description                                 |
| ------------- | ------ | ------------------------------------------- |
| Authorization | string | The Bearer token which allows to access API |

#### Request Body

| Name       | Type   | Description                                                                                |
| ---------- | ------ | ------------------------------------------------------------------------------------------ |
| email      | string | Email address of an invited user                                                           |
| role       | string | Role(user,admin) for which invitation is to be sent                                        |
| userGroups | array  | <p>invited user is added to a single or multiple groups <br>or can create a new group </p> |

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

```
{
    "id": 1,
    "userId": 1,
    "accountId": 1,
    "email": "jogndoe@gmail.com",
    "role": "user",
    "status": "0",
    "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 POST https://{{workspace}}.myeshopbox.com/api/v1/user-account-mapping \
     -H "Authorization: Bearer XXXX" \
     -H "Content-Type: application/json" \
     -d $'{
      "data": {
       "email": "johndoe@gmail.com",
       "role": "user",
       "userGroups": [
        {
            "accountId": 28,
            "createdAt": "2020-03-17 12:27:16.0",
            "groupName": "Operations",
            "id": 89,
            "updatedAt": "2020-03-17 12:29:13.0",
            "groupId": 89
        },
        {
            "accountId": 28,
            "createdAt": "2019-05-07 16:02:14.0",
            "groupName": "Operations",
            "id": 11,
            "updatedAt": "2019-05-07 16:02:14.0",
            "groupId": 11
        }
      ]  
      }
    }'
```

{% endtab %}
{% endtabs %}
