List all personal access tokens (PATs). If you're a site admin, list PATs of a user when you are the site admin on all sites that the PATÂ owner is a member of.
This method is not available for Tableau Server.
URIGET /api/api-version/sites/site-luid/users/user-luid/personal-access-tokens
URI Parameter Values api-version The version of the API to use, such as3.26
. For more information, see REST API and Resource Versions. site-luid The LUID for the site. user-luid The LUID of the user. The user LUID is returned after you successfully authenticate to the Tableau RESTÂ API. Request Body
None
cURL Request Examplecurl "http://myco/api/3.26/sites/9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d/users/d5704762-603a-42b2-a9a7-f9cd2b2c4253/personal-access-tokens" -X GET -H "X-Tableau-Auth:12ab34cd56ef78ab90cd12ef34ab56cd"
200
Response Body Copy<tsResponse>
    <personalAccessTokens>
        <personalAccessToken tokenName="user_pat1" tokenGuid="011b6267-a067-473a-9d16-b34cc58f90df" lastUsedAt="2023-06-13T16:55:46Z" expiresAt="2024-06-12T16:55:46Z"/>
        <personalAccessToken tokenName="user_pat4" tokenGuid="0fb30637-b638-4ce2-bbac-ac6611104ed9" lastUsedAt="2023-06-13T16:55:51Z" expiresAt="2024-06-12T16:55:51Z"/>
        <personalAccessToken tokenName="user_pat5" tokenGuid="db8c0b5d-5946-4f7c-a966-af334a3d10a5" lastUsedAt="2023-06-13T16:55:56Z" expiresAt="2024-06-12T16:55:56Z"/>
    </personalAccessTokens>
</tsResponse>
Copy
{
  "personalAccessTokens": [
    {
      "tokenName": "user_pat1",
      "tokenGuid": "011b6267-a067-473a-9d16-b34cc58f90df",
      "lastUsedAt": "2023-06-13T16:55:46Z",
      "expiresAt": "2024-06-12T16:55:46Z"
    },
    {
      "tokenName": "user_pat4",
      "tokenGuid": "0fb30637-b638-4ce2-bbac-ac6611104ed9",
      "lastUsedAt": "2023-06-13T16:55:51Z",
      "expiresAt": "2024-06-12T16:55:51Z"
    },
    {
      "tokenName": "user_pat5",
      "tokenGuid": "db8c0b5d-5946-4f7c-a966-af334a3d10a5",
      "lastUsedAt": "2023-06-13T16:55:56Z",
      "expiresAt": "2024-06-12T16:55:56Z"
    }
  ]
}
Errors HTTP status error
Code Condition Details 400 400000 Bad Request The content of the request body is missing or incomplete, or contains malformed XML. 401 401002 Unauthorized Access The authentication token provided in the request header was invalid or has expired. 403 403004 Forbidden You can only list PATs that are yours. 403 403010 Cross-site access is forbidden You're a site admin and can't list PATs when you're not the site admin for all sites the PATÂ owner is a member of.
For more information, see Handling Errors.
Revoke Administrator Personal Access TokensRevokes all personal access tokens(Link opens in a new window) (PATs) created by server administrators. This method is not available for Tableau Cloud.
URIDELETE /api/api-version/auth/serverAdminAccessTokens
Parameter Values Request BodyNone
PermissionsOnly Tableau Server users with server administrator permissions can use this method.
Response Code204
Response BodyNone
VersionVersion 3.11 and later. For more information, see REST API and Resource Versions.
Errors HTTP statuserror
Code Condition Details 403 403004 Revoke server admin tokens forbidden, The user does not have the server administrator permissions required to call this method. 404 404000 Server not found The Tableau Server in the URI doesn't correspond to an existing server. 405 405000 Invalid request method Request type was not DELETE.
For more information, see Handling Errors.
Revoke Personal Access TokenRevoke a personal access token (PAT). If you're a site admin, you can revoke a users PAT owhen you are the site admin on all sites that the PATÂ owner is a member of.
This method is not available for Tableau Server.
URIDELETE /api/api-version/sites/site-luid/users/user-luid/personal-access-tokens/pat-name
URI Parameter Values api-version The version of the API to use, such as3.26
. For more information, see REST API and Resource Versions. site-luid The LUID for the site. user-luid The LUID of the user. The user LUID is returned after you successfully authenticate to the Tableau RESTÂ API. pat-name The name of the PAT you want to revoke. Request Body
None
cURL Request Examplecurl "http://myco/api/3.26/sites/9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d/users/d5704762-603a-42b2-a9a7-f9cd2b2c4253/personal-access-tokens/my_pat" -X DELETE -H "X-Tableau-Auth:12ab34cd56ef78ab90cd12ef34ab56cd"
204
Response BodyNone
Errors HTTP statuserror
Code Condition Details 401 401002 Unauthorized Access The credentials token provided in the request header was invalid or has expired. 403 403004 Forbidden You can only revoke PATs that are yours. 403 403010 Cross-site access is forbidden You're a site admin and can't revoke a PAT when you're not the site admin for all sites the PATÂ owner is a member of. 404 404051 Personal access token not found The PAT couldn't be revoked because it does not exist. 405 405000 Not supported This error can occur for the following reasons:
For more information, see Handling Errors.
Sign InSigns you in as a user on the specified site on Tableau Server or Tableau Cloud.
This call returns a credentials token that you use in subsequent calls to Tableau Server or Tableau Cloud. Typically, a credentials token is valid for 240 minutes on Tableau Server, and 120 minutes on Tableau Cloud. With administrator permissions on Tableau Server, you can change this timeout by using the tsm configuration set(Link opens in a new window) command and setting the wgserver.session.idle_limit option.
In addition, if you are a Tableau Server administrator, you can use your username and password to sign in and impersonate a specific user. You might use impersonation in order to double check or troubleshoot the impact of permissions settings for that user.
For more information about authentication, see Signing In and Signing Out (Authentication).
Notes:
SAML single sign on(Link opens in a new window) (SSO) authentication does not validate REST API requests. For a scenario where you want to integrate Tableau authentication into a SSO environment you will need to incorporate a REST sign in request, and then use the credentials token from its response in the header of subsequent requests.
The credentials token is valid for REST API calls and Tableau Metadata API (GraphQL) queries. You cannot use the credentials token as authentication for other operations with Tableau Server. In addition, the credentials token is good only for operations in the site that you're signed in to. You cannot sign in to one site and then use the credentials token you get back to send requests to a different site. If you do, the server returns an HTTP 403 (Forbidden)Â error.
(Tableau Cloud only) If multi-factor authentication (MFA) is enabled with Tableau authentication, PATs are required. You must use a PAT, instead of user name and password, to make a REST API sign in request to Tableau Cloud.
POST /api/api-version/auth/signin
Note: For Tableau Cloud, the server address in the URI must contain the pod name, such as 10az, 10ay, or us-east-1. For example, the URI to sign in to a site in the 10ay pod would be:
https://10ay.online.tableau.com/api/api-version/auth/signin
Parameter Values Request Body PATSigning in with a user's personal access token (PAT):Â
<tsRequest>
<credentials personalAccessTokenName="personal-access-token-name"
personalAccessTokenSecret="personal-access-token-secret" >
<site contentUrl="content-url" />
</credentials>
</tsRequest>
User name and password
Signing in with a user's user name and password:
<tsRequest>
<credentials name="username" password="password" >
<site contentUrl="content-url" />
</credentials>
</tsRequest>
Impersonating user using username and password
Signing in with server administrator's username and password to impersonate a user (not available for Tableau Cloud):
<tsRequest>
<credentials name="username" password="password" >
<site contentUrl="content-url" />
<user id="user-to-impersonate" />
</credentials>
</tsRequest>
Impersonating user using PAT
Signing in with server administrator's personal access token(Link opens in a new window) (PAT) to impersonate a user (not available for Tableau Cloud):
<tsRequest>
<credentials personalAccessTokenName="personal-access-token-name"
personalAccessTokenSecret="personal-access-token-secret" >
<site contentUrl="content-url" />
<user id="user-to-impersonate" />
</credentials>
</tsRequest>
JWT
Signing in with a JSON Web Token (JWT), from a connected app(Link opens in a new window) (Introduced in Tableau Cloud June 2022 (API 3.16); Tableau Server 2022.3 (API 3.17)):
<tsRequest>
<credentials jwt="json-web-token"
<site contentUrl="content-url" />
</credentials>
</tsRequest>
When a JWT sign-in is used, the JWT must be configured with the scopes of the REST API methods the connected app can access. You can find the scope for a JWT-supported method in a method's properties block or references details under the Access scope section. These sections show the scope declaration to use in the JWT that calls that method. You can also see a full list of JWT-supported scopes in REST API methods that support JWT authorization(Link opens in a new window) (Tableau Cloud Help) or REST API methods that support JWT authorization(Link opens in a new window) (Tableau Server Help).
Note:Â Beginning in APIÂ 3.20 (June 2023) for Tableau Cloud and API 3.21 (Tableau 2023.3) for Tableau Server, the Sign In (and Sign Out) method is supported by JWTÂ authorization but does not require a scope to use.
If you encounter issues with signing in with a JWT, the response body is appended with an additional error code that you can reference in Troubleshoot scopes(Link opens in a new window) (Tableau Cloud Help) or Troubleshoot scopes(Link opens in a new window) (Tableau Server Help). For example, in the following response body, you can reference â10084â to help troubleshoot issues with signing in to Tableau Cloud or Tableau Server using a JWT for REST API authorization.
<error code="401001"> "summary": "Signin Error", "detail": "Error signing in to Tableau Cloud (10084)" </error>Attribute Values personal-access-token-name
The name of the personal access token when signing in with a personal access token. The token name is available on a userâs account page on Tableau server or online.
personal-access-token-secretThe secret value of the personal access token when signing in with a personal access token. The value of the secret is available only in the dialog that appears when a user creates a personal access token(Link opens in a new window) as described in the Tableau Help.
username The name of the user when signing in with username and password. The name and password in the <credentials> element can represent any user in the specified site. If the user is not an administrator, they might have limited permissions to perform subsequent operations.Note: If the server is configured to use Active Directory authentication, and if the user name is not unique across domains, you must include the domain as part of the user name (for example, domain_name\Adam).
password The password when signing in with username and password. json-web-tokenA JSONÂ Web Token (JWT), uses a shared secret provided by the Tableau connected app(Link opens in a new window) and signed by your external application. Depending on the method used to create the connected app, a JWT can be generated by the connected app as part of the external app's call to sign in to Tableau. The JWT must include access scopes(Link opens in a new window) that determine which REST methods the external app can call.
content-urlThe permanent name of the site to sign in to. The content URL appears in the URL path of Tableau content in your browser address bar after the Tableau Server URL.
mySite
is the content URL in the following example:
http://<server or cloud URL>/#/site/mySite/explore
For Tableau Server, to specify the default site, omit contentUrl
from the site
element, or make the contentUrl
value an empty string (contentUrl=""
).
For Tableau Cloud, a sign-in request must have a site
element containing a contentUrl
with the value of an existing site. If these are missing, the sign-in request will fail.
Any Tableau user can sign in through the REST API. A user that does not have administrator permissions will have limited permissions to perform subsequent operations. Only server administrators can sign in with username and password in order to impersonate other Tableau Server users.
Response Code200
Response Body<tsResponse>
<credentials token="authentication-token"
estimatedTimeToExpiration="time-to-expiration" >
<site id="site-id" contentUrl="content-url" />
<user id="user-id-of-signed-in-user"
</credentials>
</tsResponse>
An estimatedTimeToExpiration
value is returned when you sign in using a PAT. The value represents the approximate time until the token returned from the PAT sign in will expire and need to be refreshed. The estimated time is based on regular usage of the token for authenticating calls, but actual time may be shorter if the token is unused for an extended length of time.
Version 1.0 and later. For more information, see REST API and Resource Versions.
Errors HTTP statuserror
Code Condition Details 400 400000 Bad request The content of the request body is missing or incomplete, or contains both username/password and a personal access token, or contains malformed XML. 401 401001 Login error The credentials (name or password, or personal access token name or secret) are invalid for the specified site, or the site contentURL is invalid. 401 401001 Login error Login is blocked because several requests with invalid credentials were made. 401 401001 Login error The Administrator requires the user to update their password. 401 401001 Login error The password has expired. 401 401009 Login error The request body is missing or empty. 405 405000 Invalid request method Request type was not POST.
If you are signing in to a Tableau Cloud site, this error may be caused by leaving the pod name out of the server address in the URI.
The error can also be caused by attempting to make a request to a SSL-protected server using HTTP, rather than HTTPS.
For more information, see Handling Errors.
Examplecurl "https://MY-SERVER/api/3.26/auth/signin" -X POST -d @signin.xml
Content of signin.xml:
<tsRequest>
<credentials personalAccessTokenName="MY_PAT_NAME"
personalAccessTokenSecret="vFel4qtGTZ2+Po0ZWT7YWg==:nMmSHnQ5kJBP17ZtsBgPtuVWdYJFAbBG" >
<site contentUrl="MarketingSite" />
</credentials>
</tsRequest>
Example response:
<tsResponse version-and-namespace-settings>
<credentials token="HvZMqFFfQQmOM4L-AZNIQA|5fI6T54OPK1Gn1p4w0RtHv6EkojWRTwq|a946d998-2ead-4894-bb50-1054a91dcab3">
<site id="9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d"
contentUrl="MarketingSite"/>
</credentials>
</tsResponse>
Sign Out
Signs you out of the current session. This call invalidates the authentication token that is created by a call to Sign In.
Note: Beginning in API 3.20 (June 2023) for Tableau Cloud and API 3.21 (Tableau 2023.3) for Tableau Server, the Sign Out (and Sign In) method is supported by JWTÂ authorization but does not require a scope to use. For more information, see JWT.
URIPOST /api/api-version/auth/signout
Parameter Values Request BodyNone
PermissionsAny user can call this method.
Response Code204
Response BodyNone
VersionVersion 1.0 and later. For more information, see REST API and Resource Versions.
Errors HTTP statuserror
Code Condition Details 405 405000 Invalid request method Request type was not POST.
For more information, see Handling Errors.
Examplecurl "http://MY-SERVER/api/3.26/auth/signout" -X POST -H "X-Tableau-Auth:12ab34cd56ef78ab90cd12ef34ab56cd"
Switches you onto another site without having to provide a user name and password again.
This method allows an authenticated user to switch sites that they have access to. When you call this method, you must provide the current authorization token as the value of the X-Tableau-Auth header. Using the current authentication token, the method signs you in as a user on the site specified in the request payload. The method returns a new authentication token and invalidates the old one. You have the permissions of the user associated with the authorization token. By default, the token is good for 240 minutes. (You can specify a different timeout value for the token by calling the tsm configuration set
command to change the wgserver.session.idle_limit setting.)
Note This method is not available on Tableau Cloud.
URIPOST /api/api-version/auth/switchSite
Parameter Values Request Body<tsRequest>
<site contentUrl="content-url" />
</tsRequest>
Attribute Values content-url
The permanent name of the site to sign in to. The content URL appears in the URL path of Tableau content in your browser address bar after the Tableau Server URL.
mySite
is the content URL in the following example:
http://<server or cloud URL>/#/site/mySite/explore
For Tableau Server, to specify the default site, omit contentUrl
from the site
element, or make the contentUrl
value an empty string (contentUrl=""
).
For Tableau Cloud, a sign-in request must have a site
element containing a contentUrl
with the value of an existing site. If these are missing, the sign-in request will fail.
Tableau Server users who are not server administrators can switch sites, provided that they have access to the destination site.
Response Code200
Response Body<tsResponse>
<credentials token="authentication-token" >
<site id="site-id" contentUrl="content-url" />
<user id="user-id-of-signed-in-user" />
</credentials>
</tsResponse>
Version
Version 2.6 and later. For more information, see REST API and Resource Versions.
Errors HTTP statuserror
Code Condition Details 400 400000 Bad request The content of the request body is missing or incomplete, or contains malformed XML. 401 401000 Unauthorized access No authentication credentials were provided. 401 401002 Unauthorized access Invalid authentication credentials were provided. 401 401003 Switch site error There was a problem switching sites. The site might be unavailable or is not found. 403 403070 Cannot switch to the same site The site specified as the destination site is also the current site. 405 405000 Invalid request method Request type was not POST.
For more information, see Handling Errors.
Examplecurl "https://MY-SERVER/api/3.26/auth/switchSite" -X POST -H "X-Tableau-Auth:12ab34cd56ef78ab90cd12ef34ab56cd"-d @switch_site.xml
Content of switch_site.xml:
<tsRequest>
<site contentUrl="MarketingSite" />
</tsRequest>
Example response:
<tsResponse version-and-namespace-settings>
<credentials token="HvZMqFFfQQmOM4L-AZNIQA|5fI6T54OPK1Gn1p4w0RtHv6EkojWRTwq|a946d998-2ead-4894-bb50-1054a91dcab3">
<site id="9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d"
contentUrl="MarketingSite"/>
</credentials>
</tsResponse>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4