# Add User and folder

```http
POST https://api.synup.com/api/v4/users/add_user_and_folder
```

This api is a combination of add_user and create_folder and assign_folder_to_user APIs. The API will take in all parameters of add_user API and create_folder APIs. Operations to be done are create user, create folder and assign folder to user.

Source: https://developer.synup.com/api/user-management/add-user-and-folder

## Request body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `input` | object | required |  |
| `input.roleId` | string | required |  |
| `input.firstName` | string | required |  |
| `input.lastName` | string | required |  |
| `input.email` | string | required |  |
| `input.directCustomer` | boolean | required |  |
| `input.locale` | string | required |  |
| `input.locationIds` | array of string | required |  |
| `input.socialProfileIds` | array of string | required |  |
| `input.name` | string | required |  |
| `input.userId` | string | required | Base64 encoded user ID |
| `input.isDefaultFolder` | boolean | required |  |

## Example request

```bash
curl -X POST 'https://api.synup.com/api/v4/users/add_user_and_folder' \
  -H 'Authorization: API YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "input": {
    "roleId": "Q3VzdG9tUm9sZToyMDgzMQ==",
    "firstName": "testing ",
    "lastName": "user",
    "email": "sandeep.kota+918673997@synup.com",
    "directCustomer": true,
    "locale": "ENGLISH",
    "locationIds": [
      "TG9jYXRpb246ODcxMjE="
    ],
    "socialProfileIds": [],
    "name": "sandybroskis19",
    "isDefaultFolder": true
  }
}'
```

## Responses

| Status | Description |
| --- | --- |
| `200` | Successfully added folders to user |
