Create User API¶
To add users to an account.
Prerequisite
Before you use this API, go to Automation AI > App Settings > Target Audience, and select Enterprise Users. Then publish the app to enable user invitations on the platform.
Note
This API requires JWT generated by an application created only from the Admin Console.
Method | POST |
Endpoint | https://{{host}}/api/public/users
|
Content Type | application/json
|
Authorization | auth: {{JWT}}
|
API Scope |
|
Path Parameters¶
PARAMETER | DESCRIPTION |
host | Environment URL, for example, https://platform.kore.ai |
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",
"lastName":"user1",
"companyName":"company_name",
"dept":"dept",
"companyContactPhone":"12334444",
"worknumber":"321",
"street":"street",
"suiteNo":"suite",
"city":"city",
"zip":"123123",
"state":"state",
"country":"country"
},
"groups": [
"e-06b41cdd-7678-5394-b958-40ca5662xxxx"
],
"roles": [
{
"roleId": "5d9d8db30d54920a8df1xxxx",
"botId": "st-b8525f88-6dd3-54a7-8a97-734ecb74xxxx"
},
{
"roleId": "5d9d920dabdc1e6e8ec9xxxx",
"botId": "st-16511425-15c5-5cdf-b652-a796db7dxxxx"
},
{
"roleId": "5bbcb20c8bfd33db440exxxx"
},
{
"roleId": "5d9d8d930d54920a8df1xxxx"
}
],
"assignBotTasks": [
{
"streamId": "st-xxx-xx-xxx-xxx-xxxx",
"dialogs": ["dg-xxxx-xx-xx-xx-xxxx"]
}
],
"canCreateBot": true,
"isDeveloper": true
}
]
}'
Body Parameters¶
PARAMETER | REQUIRED/OPTIONAL | 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 AI agents, and the permissions.
Note: The following entries till isDeveloper are the sub-parameters of the users parameter. |
|
userInfo.emailId | Required | Email Ids of the user being added |
userInfo.orgUserId | Optional | User id assigned by your organization of the user being added |
userInfo.firstName | Optional | First name of the user being added |
userInfo.lastName | Optional | Last name of the user being added |
userInfo.companyName | Optional | Company to which the user being added belongs |
userInfo.dept | Optional | Department to which the user being added belongs |
userInfo.companyContactPhone | Optional | Contact Phone of the Company to which the user being added belongs |
userInfo.worknumber | Optional | Work number of the user being added |
userInfo.street | Optional | Street Address of the user being added |
userInfo.suiteNo | Optional | Suite No Address of the user being added |
userInfo.city | Optional | City Address of the user being added |
userInfo.zip | Optional | Zip Address of the user being added |
userInfo.state | Optional | State Address of the user being added |
userInfo.country | Optional | Country Address of the user being added |
groups | Optional | array of group ids to which the user should belong |
roles | Optional | array of roleId-botId combinations saying what role the user has on which bot |
assignBotTasks | Optional | array of agents that need to be assigned to the user |
streamId | Id of the Bot to be assigned to the user | |
dialogs | Array of dialog task ids within the bot that need to be assigned to the user. If not given, all the dialog tasks are assigned | |
canCreateBot | Optional | Determines if the specified users can create agents in their App Builder accounts. Set to true or false. Default value is _“true”._ |
isDeveloper | Optional | Determines if the specified users can have access to App Builder. Set to true or false. Default value is _“true”._ |
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”._ |
Sample Response¶
- For success case:
-
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" } } } ] }