{"id":22687,"date":"2019-11-01T11:30:55","date_gmt":"2019-11-01T11:30:55","guid":{"rendered":"https:\/\/developer.kore.ai\/v8-1\/?p=22687"},"modified":"2021-03-18T11:39:51","modified_gmt":"2021-03-18T11:39:51","slug":"update-user-api","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v8-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 user details.<\/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>PUT <\/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 that need to be updated<\/p>\n<table>\n<tbody>\n<tr>\n<td>userInfo.emailId<\/p>\n<p>or userInfo.<span style=\"font-weight: 400\">orgUserId<\/span><\/p>\n<p>(mandatory)<\/td>\n<td>Email Ids or the org user id of the user being updated<\/td>\n<\/tr>\n<tr>\n<td>userInfo.firstName<br \/>\n(optional)<\/td>\n<td>First name of the user if needs to be updated<\/td>\n<\/tr>\n<tr>\n<td>userInfo.lastName<br \/>\n(optional)<\/td>\n<td>Last name of the user if needs to be updated<\/td>\n<\/tr>\n<tr>\n<td>userInfo.companyName<br \/>\n(optional)<\/td>\n<td>Company to which the user if needs to be updated<\/td>\n<\/tr>\n<tr>\n<td>userInfo.dept<br \/>\n(optional)<\/td>\n<td>Department to which the user if needs to be updated<\/td>\n<\/tr>\n<tr>\n<td>userInfo.companyContactPhone<br \/>\n(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<br \/>\n(optional)<\/td>\n<td>Work number of the user if needs to be updated<\/td>\n<\/tr>\n<tr>\n<td>userInfo.street<br \/>\n(optional)<\/td>\n<td>Street Address of the user if needs to be updated<\/td>\n<\/tr>\n<tr>\n<td>userInfo.suiteNo<br \/>\n(optional)<\/td>\n<td>Suite No Address of the user if needs to be updated<\/td>\n<\/tr>\n<tr>\n<td>userInfo.city<br \/>\n(optional)<\/td>\n<td>City Address of the user if needs to be updated<\/td>\n<\/tr>\n<tr>\n<td>userInfo.zip<br \/>\n(optional)<\/td>\n<td>Zip Address of the user if needs to be updated<\/td>\n<\/tr>\n<tr>\n<td>userInfo.state<br \/>\n(optional)<\/td>\n<td>State Address of the user if needs to be updated<\/td>\n<\/tr>\n<tr>\n<td>userInfo.country<br \/>\n(optional)<\/td>\n<td>Country Address of the user if needs to be updated<\/td>\n<\/tr>\n<tr>\n<td>groups<br \/>\n(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<br \/>\n(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<br \/>\n(optional)<\/td>\n<td>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<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<\/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 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\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 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 user details. 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. PUT https:\/\/{{host}}\/api\/public\/users NOTE: This feature was introduced in ver7.1 of the platform. Query Parameters Parameter Description host Environment URL, for...","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\/v8-1\/wp-json\/wp\/v2\/posts\/22687","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/comments?post=22687"}],"version-history":[{"count":9,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/posts\/22687\/revisions"}],"predecessor-version":[{"id":23417,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/posts\/22687\/revisions\/23417"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/media?parent=22687"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/categories?post=22687"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/tags?post=22687"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}