{"id":22685,"date":"2019-11-01T11:29:40","date_gmt":"2019-11-01T11:29:40","guid":{"rendered":"https:\/\/developer.kore.ai\/v8-0\/?p=22685"},"modified":"2021-03-25T08:56:04","modified_gmt":"2021-03-25T08:56:04","slug":"create-user-api","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v8-0\/docs\/bots\/api-guide\/create-user-api\/","title":{"rendered":"Create User API"},"content":{"rendered":"<section class=\"l-section wpb_row height_auto\"><div class=\"l-section-h i-cf\"><div class=\"g-cols vc_row type_default valign_top\"><div class=\"vc_col-sm-12 wpb_column vc_column_container\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p>To add users to an account.<\/p>\n<p class=\"note\">This API requires JWT generated by an application created only from Bot Admin Console.<br \/>\nTo use this API, app needs the Admin API Scope of <em>User Management<\/em> under <em>Security &amp; Control<\/em>.<\/p>\n<p><b>POST <\/b><code>https:\/\/{{host}}\/api\/public\/users<\/code><\/p>\n<p>NOTE: This feature was introduced in ver7.1 of the platform.<\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Query_Parameters\">Query Parameters<\/span><\/h3>\n<table>\n<tbody>\n<tr>\n<th>Parameter<\/th>\n<th>Description<\/th>\n<\/tr>\n<tr>\n<td>host<\/td>\n<td>Environment URL, for example, https:\/\/bots.kore.ai<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Body_Parameters\">Body Parameters<\/span><\/h3>\n<table>\n<tbody>\n<tr>\n<th>Parameter<\/th>\n<th>Description<\/th>\n<\/tr>\n<tr>\n<td>users<\/td>\n<td>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<\/p>\n<table>\n<tbody>\n<tr>\n<td>userInfo.emailId<br \/>\n(mandatory)<\/td>\n<td>Email Ids of the user being added<\/td>\n<\/tr>\n<tr>\n<td>userInfo.orgUserId<br \/>\n(optional)<\/td>\n<td>User id assigned by your organization of the user being added<\/td>\n<\/tr>\n<tr>\n<td>userInfo.firstName<br \/>\n(optional)<\/td>\n<td>First name of the user being added<\/td>\n<\/tr>\n<tr>\n<td>userInfo.lastName<br \/>\n(optional)<\/td>\n<td>Last name of the user being added<\/td>\n<\/tr>\n<tr>\n<td>userInfo.companyName<br \/>\n(optional)<\/td>\n<td>Company to which the user being added belongs<\/td>\n<\/tr>\n<tr>\n<td>userInfo.dept<br \/>\n(optional)<\/td>\n<td>Department to which the user being added belongs<\/td>\n<\/tr>\n<tr>\n<td>userInfo.companyContactPhone<br \/>\n(optional)<\/td>\n<td>Contact Phone of the Company to which the user being added belongs<\/td>\n<\/tr>\n<tr>\n<td>userInfo.worknumber<br \/>\n(optional)<\/td>\n<td>Work number of the user being added<\/td>\n<\/tr>\n<tr>\n<td>userInfo.street<br \/>\n(optional)<\/td>\n<td>Street Address of the user being added<\/td>\n<\/tr>\n<tr>\n<td>userInfo.suiteNo<br \/>\n(optional)<\/td>\n<td>Suite No Address of the user being added<\/td>\n<\/tr>\n<tr>\n<td>userInfo.city<br \/>\n(optional)<\/td>\n<td>City Address of the user being added<\/td>\n<\/tr>\n<tr>\n<td>userInfo.zip<br \/>\n(optional)<\/td>\n<td>Zip Address of the user being added<\/td>\n<\/tr>\n<tr>\n<td>userInfo.state<br \/>\n(optional)<\/td>\n<td>State Address of the user being added<\/td>\n<\/tr>\n<tr>\n<td>userInfo.country<br \/>\n(optional)<\/td>\n<td>Country Address of the user being added<\/td>\n<\/tr>\n<tr>\n<td>groups<br \/>\n(optional)<\/td>\n<td>array of group ids to which the user should belong<\/td>\n<\/tr>\n<tr>\n<td>roles<br \/>\n(optional)<\/td>\n<td>array of roleId-botId combinations saying what role the user has on which bot<\/td>\n<\/tr>\n<tr>\n<td>assignBotTasks<br \/>\n(optional)<\/td>\n<td>array of bots that need to be assigned to the user<\/p>\n<table>\n<tbody>\n<tr>\n<td>botId<\/td>\n<td>Id of the Bot to be assigned to the user<\/td>\n<\/tr>\n<tr>\n<td>dialogs<\/td>\n<td>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<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<tr>\n<td>canCreateBot<br \/>\n(optional)<\/td>\n<td>Determines if the specified users can create bots in their Bot Builder accounts. Set to true or false.<br \/>\nDefault value is <em>&#8220;true&#8221;.<\/em><\/td>\n<\/tr>\n<tr>\n<td>isDeveloper<br \/>\n(optional)<\/td>\n<td>Determines if the specified users can have access to Bot Builder. Set to true or false.<br \/>\nDefault value is <em>&#8220;true&#8221;.<\/em><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<tr>\n<td>sendEmail<br \/>\n(optional)<\/td>\n<td>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.<br \/>\nDefault value is <em>&#8220;true&#8221;.<\/em><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Authorization\">Authorization<\/span><\/h3>\n<p>Invoke the API with JWT in the header with the following syntax:<\/p>\n<p><code>auth: {{JWT}}<\/code><\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Response_Content_Type\">Response Content Type<\/span><\/h3>\n<p><code>application\/json<\/code><\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Sample_Request\">Sample Request<\/span><\/h3>\n<pre>curl -X POST \\\r\n  https:\/\/{{host}}\/api\/public\/users \\\r\n  -H 'Content-Type: application\/json' \\\r\n  -H 'auth: YOUR_JWT_ACCESS_TOKEN' \\\r\n  -d '{\r\n    \"users\": [\r\n        {\r\n            \"userInfo\": {\r\n                \"emailId\": \"deskkore1@gmail.com\",\r\n                \"orgUserId\": \"org assigned user id\",\r\n                \"firstName\": \"user1\",\r\n                \"lastName\":\"user1\",\r\n                \"companyName\":\"company_name\",\r\n                \"dept\":\"dept\",\r\n                \"companyContactPhone\":\"12334444\",\r\n                \"worknumber\":\"321\",\r\n                \"street\":\"street\",\r\n                \"suiteNo\":\"suite\",\r\n                \"city\":\"city\",\r\n                \"zip\":\"123123\",\r\n                \"state\":\"state\",\r\n                \"country\":\"country\"\r\n            },\r\n            \"groups\": [\r\n                \"e-06b41cdd-7678-5394-b958-40ca5662f502\"\r\n            ],\r\n            \"roles\": [\r\n                {\r\n                    \"roleId\": \"5d9d8db30d54920a8df1e68b\",\r\n                    \"botId\": \"st-b8525f88-6dd3-54a7-8a97-734ecb748733\"\r\n                },\r\n                {\r\n                    \"roleId\": \"5d9d920dabdc1e6e8ec99342\",\r\n                    \"botId\": \"st-16511425-15c5-5cdf-b652-a796db7d134b\"\r\n                },\r\n                {\r\n                    \"roleId\": \"5bbcb20c8bfd33db440ec1d1\"\r\n                },\r\n                {\r\n                    \"roleId\": \"5d9d8d930d54920a8df1e689\"\r\n                }         \r\n            ],\r\n            \"assignBotTasks\": [\r\n              {\r\n                \"botId\": \"st-xxx-xx-xxx-xxx-xxxx\",\r\n                \"dialogs\": [\"dg-xxxx-xx-xx-xx-xxxx\"]\r\n               } \r\n            ],\r\n            \"canCreateBot\": true,\r\n            \"isDeveloper\": true\r\n        }\r\n]\r\n}'<\/pre>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Sample_Response\">Sample Response<\/span><\/h3>\n<ul>\n<li>For success case:\n<pre>{\r\n        \"msg\": \"Users are created Successfully\"\r\n    };<\/pre>\n<\/li>\n<li>Failure case:\n<pre>{\r\n    \"failedUserDetails\": [\r\n        {\r\n            \"userInfo\": {\r\n                \"emailId\": \"deskkore1\",\r\n                \"firstName\": \"user1\",\r\n                \"status\": \"failure\",\r\n                \"reason\": {\r\n                    \"statusCode\": 400,\r\n                    \"status\": 400,\r\n                    \"customCode\": 400,\r\n                    \"errors\": [\r\n                        {\r\n                            \"msg\": \"INVALID_EMAIL\",\r\n                            \"code\": 400\r\n                        }\r\n                    ],\r\n                    \"_headers\": {},\r\n                    \"message\": \"INVALID_EMAIL\",\r\n                    \"name\": \"BadRequest\"\r\n                }\r\n            }\r\n        }\r\n]\r\n}\r\n<\/pre>\n<\/li>\n<\/ul>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div><\/div><\/div><\/div><\/div><\/div><\/section>\n","protected":false},"excerpt":{"rendered":"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 &amp; Control. POST https:\/\/{{host}}\/api\/public\/users NOTE: This feature was introduced in ver7.1 of the platform. Query Parameters Parameter Description host Environment...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-22685","post","type-post","status-publish","format-standard","hentry","category-api-guide"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/posts\/22685","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/comments?post=22685"}],"version-history":[{"count":10,"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/posts\/22685\/revisions"}],"predecessor-version":[{"id":23416,"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/posts\/22685\/revisions\/23416"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/media?parent=22685"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/categories?post=22685"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/tags?post=22685"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}