You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[docs/defensive code] 400003: Bad Request if you skip the authSetting attribute when creating a user #1137
Describe the bug
I try to add user to a site and receive error from API responsen, but fact user being added to the server. Unfortunately discussion from issue #990 does't help to resole the problem. More then that I sent request to server directly without using TSC library and got the same error response.
Versions
Details of your environment, including:
Tableau Server version 2022.1.7 (20221.22.0916.0328) 64-bit Linux
Python version 3.8
TSC library version 0.23
To Reproduce
Here's my code:
import tableauserverclient as TSC
import logging
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
filename="tsc.log", level="DEBUG")
tableau_auth = TSC.PersonalAccessTokenAuth('debug', '<TOKEN>')
server = TSC.Server('https://tableau.<DOMAIN>.com', use_server_version=True)
server.auth.sign_in(tableau_auth)
newU = TSC.UserItem('test@<DOMAIN>.com', 'Viewer')
# add the new user to the site
newU = server.users.add(newU)
server.auth.sign_out()
Results
File ~/Documents/tsc_roject/env8/lib/python3.8/site-packages/tableauserverclient/server/endpoint/endpoint.py:147, in Endpoint.post_request(self, url, xml_request, content_type, parameters)
146 def post_request(self, url, xml_request, content_type=XML_CONTENT_TYPE, parameters=None):
--> 147 return self._make_request(
...
ServerResponseError:
400003: Bad Request
Payload is either malformed or incomplete
Direct request:
curl "https://tableau.<DOMAIN>.com/api/3.15/sites/abea43f7-3d3a-4c4a-adcf-2007aa48c888/users/" -X POST -H "X-Tableau-Auth:<TOKEN>" -d @add-user-to-site.xml
<?xml version='1.0' encoding='UTF-8'?><tsResponse xmlns="http://tableau.com/api" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tableau.com/api https://help.tableau.com/samples/en-us/rest_api/ts-api_3_15.xsd"><error code="400003"><summary>Bad Request</summary><detail>Payload is either malformed or incomplete</detail></error></tsResponse>
bcantoni I suppose misunderstanding from my side was because of documentation marks auth-setting attribute as an optional and TSC library doesn't raise the error also.
changed the title [-]400003: Bad Request Payload is either malformed or incomplete[/-][+][docs/defensive code] 400003: Bad Request if you skip the authSetting attribute when creating a user[/+]on Feb 15, 2023
I had the same issue, had to pass TableauIDWithMFA in auth_setting . Not sure if this helps anyone, but it seems to be required for Tableau Cloud instance.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. If this is still relevant, please comment to keep it open.
Closing — the docs clarification promised in this thread has landed. Users.add() docstring now spells out that auth_setting is required for Tableau Cloud and documents the 400003 payload error with the TableauIDWithMFA remediation (tableauserverclient/server/endpoint/users_endpoint.py:256-292). TSC can't Python-side reject a missing auth_setting without knowing the target is Cloud, so the doc fix is the delivered resolution here. Please open a fresh issue if you hit this on a current TSC version.
Activity
dev-mkc19 commentedon Oct 28, 2022
Found the clue! In my case attribute
auth_settingis required. So the code should looks likenewU = TSC.UserItem('test@.com', 'Viewer', auth_setting='ServerDefault')
bcantoni I suppose misunderstanding from my side was because of documentation marks auth-setting attribute as an optional and TSC library doesn't raise the error also.
bcantoni commentedon Oct 28, 2022
Thanks for the detailed report. I'll double-check that and update the documentation to be more clear.
[-]400003: Bad Request Payload is either malformed or incomplete[/-][+][docs/defensive code] 400003: Bad Request if you skip the authSetting attribute when creating a user[/+]mohitbhandari37 commentedon Mar 20, 2023
@bcantoni Adding serverDefault to the request header does not work, we received the same error i.e.
while adding the user.
Below is the request -
Do we need to add any more details in request ?
Note - we are logged in as Server Admin while creating user.
jacalata commentedon Mar 25, 2023
What kind of user management/auth does the server have? Local users, or Active Directory, or something else?
keidikapllani commentedon May 18, 2023
I had the same issue, had to pass
TableauIDWithMFAinauth_setting. Not sure if this helps anyone, but it seems to be required for Tableau Cloud instance.github-actions commentedon Aug 18, 2026
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. If this is still relevant, please comment to keep it open.
jacalata commentedon Aug 25, 2026
Closing — the docs clarification promised in this thread has landed.
Users.add()docstring now spells out thatauth_settingis required for Tableau Cloud and documents the 400003 payload error with theTableauIDWithMFAremediation (tableauserverclient/server/endpoint/users_endpoint.py:256-292). TSC can't Python-side reject a missingauth_settingwithout knowing the target is Cloud, so the doc fix is the delivered resolution here. Please open a fresh issue if you hit this on a current TSC version.