> ## Documentation Index
> Fetch the complete documentation index at: https://koreai.mintlify.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Create User API

<Badge icon="arrow-left" color="gray">[Back to API List](/ai-for-service/apis/automation/api-list)</Badge>

To add users to an account.

**Prerequisite**: Before using this API, go to **Automation AI > App Settings > Target Audience** and select **Enterprise Users**. Then publish the app to enable user invitations.

<Note>
  This API requires a JWT generated by an application created only from the Admin Console.
</Note>

| Field             | Value                                                                                                                            |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| **Method**        | POST                                                                                                                             |
| **Endpoint**      | `https://{{host}}/api/public/users`                                                                                              |
| **Content Type**  | `application/json`                                                                                                               |
| **Authorization** | `auth: {{JWT}}` See [How to generate the JWT Token](/ai-for-service/apis/automation/api-introduction/#generating-the-jwt-token). |
| **API Scope**     | App Builder: Not Applicable; Admin Console: User Management > User Management                                                    |

## Path Parameters

| Parameter | Description                                               |
| --------- | --------------------------------------------------------- |
| `host`    | Environment URL, for example, `https://platform.kore.ai`. |

## Sample Request

```bash theme={null}
curl -X POST \
  https://{{host}}/api/public/users \
  -H 'Content-Type: application/json' \
  -H 'auth: YOUR_JWT_ACCESS_TOKEN' \
  -d '{
    "users": [
        {
            "userInfo": {
                "emailId": "john.doe@example.com",
                "orgUserId": "org assigned user id",
                "firstName": "john",
                "lastName": "doe",
                "companyName": "company_name",
                "dept": "dept"
            },
            "groups": [
                "e-06b41cdd-7678-5394-b958-40ca5662xxxx"
            ],
            "roles": [
                {
                    "roleId": "5d9d8db30d54920a8df1xxxx",
                    "botId": "st-b8525f88-6dd3-54a7-8a97-734ecb74xxxx"
                }
            ],
            "canCreateBot": true,
            "isDeveloper": true
        }
    ]
}'
```

## Body Parameters

| Parameter                      | Required | Description                                                                  |
| ------------------------------ | -------- | ---------------------------------------------------------------------------- |
| `users`                        |          | Array of user details.                                                       |
| `userInfo.emailId`             | Required | Email ID of the user being added.                                            |
| `userInfo.orgUserId`           | Optional | Organization-assigned user ID.                                               |
| `userInfo.firstName`           | Optional | First name of the user.                                                      |
| `userInfo.lastName`            | Optional | Last name of the user.                                                       |
| `userInfo.companyName`         | Optional | Company of the user.                                                         |
| `userInfo.dept`                | Optional | Department of the user.                                                      |
| `userInfo.companyContactPhone` | Optional | Company contact phone.                                                       |
| `userInfo.worknumber`          | Optional | Work number.                                                                 |
| `userInfo.street`              | Optional | Street address.                                                              |
| `userInfo.suiteNo`             | Optional | Suite number.                                                                |
| `userInfo.city`                | Optional | City.                                                                        |
| `userInfo.zip`                 | Optional | ZIP code.                                                                    |
| `userInfo.state`               | Optional | State.                                                                       |
| `userInfo.country`             | Optional | Country.                                                                     |
| `groups`                       | Optional | Array of group IDs to which the user should belong.                          |
| `roles`                        | Optional | Array of `roleId`-`botId` combinations defining the user's role on each bot. |
| `assignBotTasks`               | Optional | Array of agents to assign to the user.                                       |
| `canCreateBot`                 | Optional | Whether the user can create agents. Default: `true`.                         |
| `isDeveloper`                  | Optional | Whether the user has App Builder access. Default: `true`.                    |
| `sendEmail`                    | Optional | Whether to send an activation email to the user. Default: `true`.            |

## Sample Response

**Success:**

```json theme={null}
{
    "msg": "Users are created Successfully"
}
```

**Failure:**

```json theme={null}
{
    "failedUserDetails": [
        {
            "userInfo": {
                "emailId": "jane.doe@example.com",
                "firstName": "jane",
                "status": "failure",
                "reason": {
                    "errors": [
                        {
                            "msg": "INVALID_EMAIL",
                            "code": 400
                        }
                    ]
                }
            }
        }
    ]
}
```
