Automate Tableau operations with REST API and Hyper API
✓Works with OpenClaudeYou are a Tableau API integration specialist. The user wants to automate Tableau operations using the REST API and Hyper API for workbook management, data refresh, and content extraction.
What to check first
- Verify Tableau Server/Online version and API compatibility (REST API 2.0+)
- Confirm API token or personal access token is generated in Tableau Server admin settings
- Check that
tableauserver-client(TSC) library is installed:pip list | grep tableau - Validate network connectivity to Tableau Server base URL (e.g.,
https://tableau.company.com)
Steps
- Install required libraries:
pip install tableauserver-client pandas tableauhyperapi requests - Generate a personal access token in Tableau Server under Account Settings > My Account > Settings
- Create a TSC server authentication session using
TableauAuthwith username/token or username/password - Connect to the Tableau Server instance using
Server()and the authentication object - Query workbooks, datasources, or views using query methods like
server.workbooks.get()orserver.datasources.get() - Trigger workbook refresh using
server.workbooks.refresh(workbook_item)or datasource withserver.datasources.refresh(datasource_item) - Download extracts or views as CSV/PDF using
server.views.download()orserver.workbooks.download() - For advanced data operations, use Hyper API to create optimized
.hyperfiles and publish them as datasources
Code
import tableauserverclient as TSC
import pandas as pd
from tableauhyperapi import HyperProcess, Connection, CreateMode, SqlType, TableDefinition, Inserter
import os
# Authenticate with Tableau Server
tableau_auth = TSC.PersonalAccessTokenAuth(
token_name="your_token_name",
personal_access_token="your_personal_access_token",
site_id="your_site_id" # Leave empty for default site
)
server = TSC.Server("https://your-tableau-server.com")
with server.auth.sign_in(tableau_auth):
# Query all workbooks
all_workbooks, pagination = server.workbooks.get()
print(f"Found {pagination.total_visible} workbooks")
# Get specific workbook and trigger refresh
for workbook in all_workbooks:
if workbook.name == "Sales Dashboard":
server.workbooks.refresh(workbook)
print(f"Refreshed: {workbook.name}")
break
# Download a view as CSV
all_views, _ = server.views.get()
for view in all_views:
if view.name == "Sales Summary":
content = server.views.download(view, TSC.RequestOptions(pagenumber=0))
with open("view_export.
Note: this example was truncated in the source. See the GitHub repo for the latest full version.
Common Pitfalls
- Treating this skill as a one-shot solution — most workflows need iteration and verification
- Skipping the verification steps — you don't know it worked until you measure
- Applying this skill without understanding the underlying problem — read the related docs first
When NOT to Use This Skill
- When a simpler manual approach would take less than 10 minutes
- On critical production systems without testing in staging first
- When you don't have permission or authorization to make these changes
How to Verify It Worked
- Run the verification steps documented above
- Compare the output against your expected baseline
- Check logs for any warnings or errors — silent failures are the worst kind
Production Considerations
- Test in staging before deploying to production
- Have a rollback plan — every change should be reversible
- Monitor the affected systems for at least 24 hours after the change
Related Tableau Skills
Other Claude Code skills in the same category — free to download.
Tableau Dashboard
Build interactive dashboards with filters, parameters, and actions
Tableau Calculated Fields
Write calculated fields with LOD expressions, table calcs, and sets
Tableau Data Prep
Clean and transform data with Tableau Prep Builder flows
Tableau Server Admin
Administer Tableau Server with sites, projects, and permissions
Tableau Extensions
Build dashboard extensions with Tableau Extensions API
Tableau Dashboard Performance Tuning
Speed up slow Tableau dashboards by fixing the most common performance killers
Tableau Extract Best Practices
Configure Tableau extracts for fast queries and efficient refresh
Want a Tableau skill personalized to YOUR project?
This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.