{"id":22687,"date":"2019-11-01T11:30:55","date_gmt":"2019-11-01T11:30:55","guid":{"rendered":"https:\/\/developer.kore.ai\/v10-1\/?p=22687"},"modified":"2023-07-19T13:20:26","modified_gmt":"2023-07-19T12:20:26","slug":"update-user-api","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/api-guide\/update-user-api\/","title":{"rendered":"Update 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 update the user details.<\/p>\n<p class=\"note\">This API requires JWT generated by an application created only from the Bot Admin Console.<br \/> This feature was introduced in ver7.1 of the platform.<\/p>\n<table>\n<tbody>\n<tr>\n<td><strong>Method<\/strong><\/td>\n<td>PUT<\/td>\n<\/tr>\n<tr>\n<td><strong>Endpoint<\/strong><\/td>\n<td><code>https:\/\/{{host}}\/api\/public\/users<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Content Type<\/strong><\/td>\n<td><code>application\/json<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Authorization<\/strong><\/td>\n<td>\n<p><code>auth: {{JWT}}<\/code><\/p>\n<p>See <a href=\"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/api-guide\/apis\/#Generating_the_JWT_Token\" rel=\"noopener noreferrer\" target=\"_blank\">How to generate the JWT Token.<\/a><\/td>\n<\/tr>\n<tr>\n<td><strong>API Scope<\/strong><\/td>\n<td>\n<ul>\n<li>Bot Builder: Not Applicable<\/li>\n<li>Admin Console: User Management > User Management<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp; <\/p>\n<h2><span class=\"ez-toc-section\" id=\"Path_Parameters\">Path Parameters<\/span><\/h2>\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<p>&nbsp; <\/p>\n<h2><span class=\"ez-toc-section\" id=\"Sample_Request\">Sample Request<\/span><\/h2>\n<pre class=\"code-limit-400px\">curl -X PUT \\\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\": \"publicuser2@gmail.com\" \/\/ or \"<span style=\"font-weight: 400\">orgUserId<\/span>\": &lt;<span style=\"font-weight: 400\">orgUserId&gt;<\/span>,\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                \"addTo\": [\r\n                    \"e-f9c09c08-9310-52ff-b672-570ec7325215\"\r\n                ]\r\n            },\r\n            \"roles\": {\r\n                \"addTo\": [\r\n                    {\r\n                        \"roleId\": \"5d9d8db3x0d54920a8df1e68b\",\r\n                        \"botId\": \"st-b8525f88-6dd3-54a7-8a97-734ecb748733\"\r\n                    }\r\n                ],\r\n                \"removeFrom\": [\r\n                    {\r\n                        \"roleId\": \"5d9d920dabdc1e6e8ec99342\",\r\n                        \"botId\": \"st-16511425-15c5-5cdf-b652-a796db7d134b\"\r\n                    }\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      \t       ],\r\n            \"canCreateBot\": true,\r\n            \"isDeveloper\": true\r\n        }\r\n\t]\r\n}\r\n'<\/pre>\n<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Body_Parameters\">Body Parameters<\/span><\/h2>\n<table>\n<tbody>\n<tr>\n<th>Parameter<\/th>\n<th>Required\/Optional<\/th>\n<th>Description<\/th>\n<\/tr>\n<table>\n<tbody>\n<tr>\n<td>users<\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td>Required<\/td>\n<td>The array of details for each user that need to be updated.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table>\n<tbody>\n<tr>\n<th>Sub-parameters<\/th>\n<th><\/th>\n<th><\/th>\n<\/tr>\n<tr>\n<td>\n<p>userInfo.emailId<\/p>\n<p>or userInfo.<span style=\"font-weight: 400\">orgUserId<\/span><\/p>\n<\/td>\n<td>Required<\/td>\n<td>Email Ids or the org user id of the user being updated<\/td>\n<\/tr>\n<tr>\n<td>userInfo.firstName<\/td>\n<td>Optional<\/td>\n<td>First name of the user if needs to be updated<\/td>\n<\/tr>\n<tr>\n<td>userInfo.lastName<\/td>\n<td>Optional<\/td>\n<td>Last name of the user if needs to be updated<\/td>\n<\/tr>\n<tr>\n<td>userInfo.companyName<\/td>\n<td>Optional<\/td>\n<td>Company to which the user if needs to be updated<\/td>\n<\/tr>\n<tr>\n<td>userInfo.dept<\/td>\n<td>Optional<\/td>\n<td>Department to which the user if needs to be updated<\/td>\n<\/tr>\n<tr>\n<td>userInfo.companyContactPhone<\/td>\n<td>Optional<\/td>\n<td>Contact Phone of the Company to which the user belongs if needs to be updated<\/td>\n<\/tr>\n<tr>\n<td>userInfo.worknumber<\/td>\n<td>Optional<\/td>\n<td>Work number of the user if needs to be updated<\/td>\n<\/tr>\n<tr>\n<td>userInfo.street<\/td>\n<td>Optional<\/td>\n<td>Street Address of the user if needs to be updated<\/td>\n<\/tr>\n<tr>\n<td>userInfo.suiteNo<\/td>\n<td>Optional<\/td>\n<td>Suite No Address of the user if needs to be updated<\/td>\n<\/tr>\n<tr>\n<td>userInfo.city<\/td>\n<td>Optional<\/td>\n<td>City Address of the user if needs to be updated<\/td>\n<\/tr>\n<tr>\n<td>userInfo.zip<\/td>\n<td>Optional<\/td>\n<td>Zip Address of the user if needs to be updated<\/td>\n<\/tr>\n<tr>\n<td>userInfo.state<\/td>\n<td>Optional<\/td>\n<td>State Address of the user if needs to be updated<\/td>\n<\/tr>\n<tr>\n<td>userInfo.country<\/td>\n<td>Optional<\/td>\n<td>Country Address of the user if needs to be updated<\/td>\n<\/tr>\n<tr>\n<td>groups<\/td>\n<td>Optional<\/td>\n<td>array of group ids to which the user needs to be\u00a0<em>addTo<\/em> or\u00a0<em>removeFrom<\/em><\/td>\n<\/tr>\n<tr>\n<td>roles<\/td>\n<td>Optional<\/td>\n<td>array of roleId-botId combinations to which the user needs to be\u00a0<em>addTo<\/em> or\u00a0<em>removeFrom<\/em><\/td>\n<\/tr>\n<tr>\n<td>assignBotTasks<\/td>\n<td>Optional<\/td>\n<td>\n<p>array of bots that have to be assigned to the user. If not present, the current assignment will be retained.<\/p>\n<table>\n<tbody>\n<tr>\n<td>botId<\/td>\n<td>Id of the Bot to be assigned to the user. If not given, all the previous assigned bots will be unassigned. That is, an entry for &#8220;assignBotTasks&#8221; without &#8220;botId&#8221; entry can be used to unassign the Bot tasks 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<\/td>\n<td>Optional<\/td>\n<td>Determines if the specified users can create bots in their Bot Builder accounts. Set to true or false.<br \/>Default value is <em>&#8220;true&#8221;.<\/em><\/td>\n<\/tr>\n<tr>\n<td>isDeveloper<\/td>\n<td>Optional<\/td>\n<td>Determines if the specified users can have access to Bot Builder. Set to true or false.<br \/>Default value is <em>&#8220;true&#8221;.<\/em><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp; <\/p>\n<h2><span class=\"ez-toc-section\" id=\"Sample_Response\">Sample Response<\/span><\/h2>\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li>For success case:\n<pre>{\r\n        \"msg\": \"Users are updated Successfully\"\r\n    }<\/pre>\n<\/li>\n<\/ul>\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 update the user details. This API requires JWT generated by an application created only from the Bot Admin Console. This feature was introduced in ver7.1 of the platform. Method PUT Endpoint https:\/\/{{host}}\/api\/public\/users Content Type application\/json Authorization auth: {{JWT}} See How to generate the JWT Token. API Scope Bot Builder: Not Applicable Admin Console: User...","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-22687","post","type-post","status-publish","format-standard","hentry","category-api-guide"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/22687","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/comments?post=22687"}],"version-history":[{"count":49,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/22687\/revisions"}],"predecessor-version":[{"id":57979,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/22687\/revisions\/57979"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/media?parent=22687"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/categories?post=22687"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/tags?post=22687"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}