I’ll be honest — the Tableau REST API was something I’d been avoiding for a while. Every time I opened the documentation I felt like I needed a computer science degree just to get through the first page. But a few months ago I hit a wall with some repetitive admin tasks on Tableau Server and finally decided to just sit down and figure it out. I’m really glad I did.
This post isn’t a comprehensive guide — Tableau’s own docs cover that. It’s more of a “here’s what finally clicked for me” walkthrough, with the examples I wish I’d had when I was starting out.
What Even Is the REST API?
At its core, the Tableau REST API is a way to talk to your Tableau Server or Tableau Cloud programmatically. Instead of clicking around in the browser to do things like publish a workbook, manage users, or refresh an extract, you send HTTP requests and Tableau does it for you. Automate the boring stuff, basically.
I do most of my scripting in Python, so I leaned heavily on the Tableau Server Client (TSC) library — it’s an open-source Python wrapper that handles a lot of the raw REST call plumbing so you don’t have to.
pip install tableauserverclient
Step 1: Authenticating
The first thing you need to do is sign in and get a token. I’d strongly recommend using a Personal Access Token (PAT) rather than your username and password — it’s more secure and honestly easier to manage.
import tableauserverclient as TSC# Set up your connectiontableau_auth = TSC.PersonalAccessTokenAuth( token_name='MY_TOKEN_NAME', personal_access_token='MY_TOKEN_VALUE', site_id='my-site-name' # leave blank for Default site)server = TSC.Server('https://your-tableau-server.com', use_server_version=True)with server.auth.sign_in(tableau_auth): print("Signed in successfully!") # Everything you want to do goes inside this block
The with block is key — it handles signing out automatically when you’re done, which is good practice.
Step 2: Listing Workbooks on a Site
Once you’re in, one of the most useful things you can do is pull a list of all the workbooks on your site. I use this constantly to audit what’s published and who owns what.
with server.auth.sign_in(tableau_auth): all_workbooks, pagination_item = server.workbooks.get() for workbook in all_workbooks: print(f"Name: {workbook.name} | Owner ID: {workbook.owner_id} | Project: {workbook.project_name}")
You can also filter down to just workbooks a specific user has access to, or workbooks within a particular project — the TSC docs have good examples of that.
Step 3: Triggering an Extract Refresh
This is the one that saved me the most time. I had a handful of extracts that needed refreshing on a schedule that didn’t fit neatly into Tableau’s built-in options. Rather than babysitting them manually, I set up a script.
with server.auth.sign_in(tableau_auth): # Get all workbooks and find the one you want all_workbooks, _ = server.workbooks.get() target = next((wb for wb in all_workbooks if wb.name == "My Important Dashboard"), None) if target: server.workbooks.refresh(target.id) print(f"Refresh triggered for: {target.name}") else: print("Workbook not found.")
Swap server.workbooks for server.datasources if you want to refresh a published data source instead — same pattern.
Step 4: Getting a List of Users
Useful for audits, user management, and making sure your licensing is clean:
with server.auth.sign_in(tableau_auth): all_users, _ = server.users.get() for user in all_users: print(f"{user.name} | Role: {user.site_role} | Last login: {user.last_login}")
Seeing last login dates was genuinely eye-opening for me. We had a surprising number of licensed users who hadn’t touched Tableau in over a year.
A Few Things I Wish I’d Known Sooner
Use use_server_version=True when initializing the server object. It automatically matches the API version to your server version and saves a lot of headaches.
Pagination is real. The default page size for most endpoints is 100 items. If you have more than that, you need to handle pagination or you’ll silently miss records. TSC has a RequestOptions object for this.
Test on a dev site first. Some of these operations — especially anything involving permissions or publishing — are hard to undo. Don’t learn that lesson the way I did.
Where to Go From Here
If this sparked your interest, I’d recommend Tableau’s REST API documentation and the TSC library docs — they’re actually pretty readable once you have a basic mental model of how the API works.
I’m planning to put together some more advanced examples around permissions management and publishing workbooks programmatically, so stay tuned for that. And as always, drop me a note if you’ve got questions or your own favorite use cases.

Leave a comment