# Tableau

> Browse Tableau workbooks, views, datasources and projects, and query view data, using a Personal Access Token.

Lets an agent read your Tableau Server or Tableau Cloud content through the REST API: list workbooks, views, published data sources and projects, fetch a single workbook, and pull a view's underlying data as CSV. The connector signs in with a Personal Access Token, then reuses the resulting session for the rest of the run.

## What it can do

| Method | What it does |
| --- | --- |
| `tableau_workbooks_list` | List workbooks on the site (optional page size, page number, filter). |
| `tableau_workbook_get` | Get a single workbook by LUID. |
| `tableau_views_list` | List views on the site. |
| `tableau_view_data` | Query a view's underlying data as CSV (optional view filters). |
| `tableau_datasources_list` | List published data sources. |
| `tableau_projects_list` | List projects. |
| `tableau_request` | Generic passthrough to any REST endpoint (site-scoped or absolute) for full API coverage. |

## How to get your token

Tableau authenticates server-side calls with a **Personal Access Token (PAT)**: a token name plus a one-time secret.

1. Sign in to your Tableau Server or Tableau Cloud site.
2. Open **My Account Settings** -> **Personal Access Tokens** ([PAT docs](https://help.tableau.com/current/server/en-us/security_personal_access_tokens.htm)).
3. Enter a token name, click **Create new token**, and copy the **secret** - it is shown only once.
4. Note your **server URL** from the browser address bar, e.g. `https://10ax.online.tableau.com` (no trailing `/api`).
5. If you work on a non-default site, note the **site content URL** - the `/site/<contentUrl>/...` segment in the address bar. Leave it empty to target the Default site.

## Fields to fill

| FlyMyAI field | Where it comes from |
| --- | --- |
| `TABLEAU_SERVER_URL` | Your Tableau Server / Cloud base URL, e.g. `https://10ax.online.tableau.com` |
| `TABLEAU_PAT_NAME` | My Account Settings -> Personal Access Tokens -> the token name |
| `TABLEAU_PAT_SECRET` | The secret shown once when you create the PAT (kept private) |
| `TABLEAU_SITE_CONTENT_URL` | Optional - the site's contentUrl; empty targets the Default site |

## Troubleshooting

- **`401001` / sign-in error** - the PAT name or secret is wrong, expired, or revoked. PATs expire after a period of inactivity; create a fresh one and re-copy both values.
- **Sign in to the wrong site** - set `TABLEAU_SITE_CONTENT_URL` to the contentUrl of the site you want (the `/site/<contentUrl>/` segment). Empty means the Default site.
- **`404`** - the workbook, view, or data source LUID does not exist on the signed-in site, or the server URL points at the wrong pod. List first, then use the returned LUIDs.
- **Empty `tableau_view_data`** - the view filters removed all rows, or your token's user lacks permission on that view. Try without filters first.

## Links

- [Tableau REST API reference](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api.htm)
- [Personal Access Tokens](https://help.tableau.com/current/server/en-us/security_personal_access_tokens.htm)
