Web User Edit
Purpose: Edit Web User
Permissions Required: Edit Web Users & Edit Access API's
Authentication: For more information, please review https://dimagi.atlassian.net/wiki/x/LwXKfw.
URL: https://www.commcarehq.org/a/[domain]/api/web-user/[version]/[id]/
Method: PATCH
Input Parameters:
Name | Description | Example
|
---|---|---|
role | Role of user | App Editor |
primary_location_id | The location id of the primary location, it must be one of the assigned locations | 26fc44e2792b4f2fa8ef86178f0a958e |
assigned_location_ids | A list of location_ids that the web user will be assigned to. Location id can be acquired by Location API. | ["26fc44e2792b4f2fa8ef86178f0a958e", "c1b029932ed442a6a846a4ea10e46a78"] |
profile | Profile to assign to the user | Facility User |
user_data | Any additional custom data associated with the user | (see examples) |
tableau_role | Tableau Role of the user Options are: “Explorer”, “ExplorerCanPublish”, “SiteAdministratorExplorer”, “Viewer”, and “Unlicensed” | Viewer |
tableau_groups | List of Tableau Groups the user is assigned to | [“city”, “county”] |
Sample input:
JSON Format
{
"role":"App Editor",
"primary_location_id":"26fc44e2792b4f2fa8ef86178f0a958e",
"assigned_location_ids":["26fc44e2792b4f2fa8ef86178f0a958e", "c1b029932ed442a6a846a4ea10e46a78"],
"profile": "Facility User",
"user_data":{
"Can Edit Client":"yes",
"Can View Data": "yes",
"Can Edit Data": ""
},
"tableau_role":"Viewer",
"tableau_groups":[“city”, “county”]
}
Sample output:
JSON Format
{
"assigned_location_ids": [
"26fc44e2792b4f2fa8ef86178f0a958e",
"c1b029932ed442a6a846a4ea10e46a78"
],
"default_phone_number": null,
"email": "test@gmail.com",
"eulas": "[LicenseAgreement(date=datetime.datetime(2024, 5, 14, 18, 39, 51, 495449), doc_type='LicenseAgreement', signed=True, type='End User License Agreement', user_id=None, user_ip=None, version='3.0')]",
"first_name": "Test",
"id": "ce3ebe5e2a3f4b238cc36ebad68a1a70",
"is_admin": false,
"last_name": "",
"permissions": {
"access_all_locations": true,
"access_api": false,
"access_default_login_as_user": false,
"access_mobile_endpoints": false,
"access_release_management": false,
"access_web_apps": true,
"commcare_analytics_roles": false,
"commcare_analytics_roles_list": [],
"doc_type": "HqPermissions",
"download_reports": false,
"edit_apps": false,
"edit_billing": false,
"edit_commcare_analytics": false,
"edit_commcare_users": false,
"edit_data": false,
"edit_data_dict": false,
"edit_file_dropzone": false,
"edit_groups": false,
"edit_linked_configurations": false,
"edit_locations": false,
"edit_messaging": false,
"edit_motech": false,
"edit_reports": false,
"edit_shared_exports": false,
"edit_ucrs": false,
"edit_user_profile": true,
"edit_user_profile_list": [],
"edit_user_tableau_config": false,
"edit_users_in_groups": false,
"edit_users_in_locations": false,
"edit_web_users": false,
"limited_login_as": false,
"login_as_all_users": false,
"manage_attendance_tracking": false,
"manage_data_registry": false,
"manage_data_registry_list": [],
"manage_domain_alerts": false,
"report_an_issue": true,
"view_apps": false,
"view_commcare_analytics": false,
"view_commcare_users": false,
"view_data_dict": false,
"view_data_registry_contents": false,
"view_data_registry_contents_list": [],
"view_file_dropzone": true,
"view_groups": false,
"view_locations": false,
"view_report_list": [],
"view_reports": false,
"view_roles": false,
"view_tableau": false,
"view_tableau_list": [],
"view_user_tableau_config": true,
"view_web_users": true,
"web_apps_list": []
},
"phone_numbers": [],
"primary_location_id": "26fc44e2792b4f2fa8ef86178f0a958e",
"profile": "Blue",
"resource_uri": "/a/jonathanlocal/api/web-user/v1/ce3ebe5e2a3f4b238cc36ebad68a1a70/",
"role": "App Editor",
"tableau_groups": ["city, county"],
"tableau_role": "Viewer",
"user_data": {
"commcare_profile": 9,
"Can Edit Client":"yes",
"Can View Data": "yes",
"Can Edit Data": ""
},
"username": "test@gmail.com"
}