To add users to an account.
This API requires JWT generated by an application created only from Bot Admin Console.
To use this API, app needs the Admin API Scope of User Management under Security & Control.
POST https://{{host}}/api/public/users
NOTE: This feature was introduced in ver7.1 of the platform.
Query Parameters
Parameter | Description |
---|---|
host | Environment URL, for example, https://bots.kore.ai |
Body Parameters
Parameter | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
users | The array of details for each user to include user email id, user first name, group to which the user will belong, roles to be assigned to the Bots, and the permissions
|
||||||||||||||||||||
sendEmail (optional) |
Determines if an email needs to be sent to the user containing activation link to activate users under the account. Set to true or false. Default value is “true”. |
Authorization
Invoke the API with JWT in the header with the following syntax:
auth: {{JWT}}
Response Content Type
application/json
Sample Request
curl -X POST \ https://{{host}}/api/public/users \ -H 'Content-Type: application/json' \ -H 'auth: YOUR_JWT_ACCESS_TOKEN' \ -d '{ "users": [ { "userInfo": { "emailId": "deskkore1@gmail.com", "orgUserId": "org assigned user id", "firstName": "user1" }, "groups": [ "e-06b41cdd-7678-5394-b958-40ca5662f502" ], "roles": [ { "roleId": "5d9d8db30d54920a8df1e68b", "botId": "st-b8525f88-6dd3-54a7-8a97-734ecb748733" }, { "roleId": "5d9d920dabdc1e6e8ec99342", "botId": "st-16511425-15c5-5cdf-b652-a796db7d134b" }, { "roleId": "5bbcb20c8bfd33db440ec1d1" }, { "roleId": "5d9d8d930d54920a8df1e689" } ], "assignBotTasks": [ { "streamId": "st-xxx-xx-xxx-xxx-xxxx", "dialogs": ["dg-xxxx-xx-xx-xx-xxxx"] } ], "canCreateBot": true, "isDeveloper": true } ] }'
Sample Response
- For success case:
{ "msg": "Users are created Successfully" };
- Failure case:
{ "failedUserDetails": [ { "userInfo": { "emailId": "deskkore1", "firstName": "user1", "status": "failure", "reason": { "statusCode": 400, "status": 400, "customCode": 400, "errors": [ { "msg": "INVALID_EMAIL", "code": 400 } ], "_headers": {}, "message": "INVALID_EMAIL", "name": "BadRequest" } } } ] }