SHOW USER PROGRAMMATIC ACCESS TOKENS

statementsupportedAccounts, users, sessions, warehouses

docs.snowflake.com ↗

Lists the programmatic access tokens associated with a user. Note The list includes programmatic access tokens that have expired within the past 30 days. To view information about tokens that have expired more than 30 days ago, query the CREDENTIALS view.

Syntax

supportedpartialnot supportednot scored

SHOW USER { PROGRAMMATIC ACCESS TOKENS | PATS } [ FOR USER <username> ]

Parameters

NameRequiredDescription
FOR USER usernameLists the programmatic access tokens for the specified user. Default: Lists the programmatic access tokens for the current user.

Usage notes

Output

The output of the command includes the following columns, which describe the properties and metadata of the object: The command output includes the following columns, which provide properties and metadata for each programmatic access token: Column | Description name | The name of the programmatic access token. user_name | The username associated with the programmatic access token. If the user associated with the programmatic access token was removed from the account, then Snowflake returns the user ID instead of the username. You can find information about a removed user by using the USERS view in the ACCOUNT_USAGE schema. role_restriction | The name of the role that the programmatic access token inherits privileges from. expires_at | The timestamp when the programmatic access token expires. status | The status of the programmatic access token. This column can be one of the following values: ACTIVE: The programmatic access token can be used to authenticate and has not expired yet. EXPIRED: The programmatic access token cannot be used to authenticate because the expiration date has passed. DISABLED: The programmatic access token is disabled because user login access is disabled or the user is locked out of logging in. comment | A user-provided comment about the programmatic access token. created_on | The date when the programmatic access token was created. created_by | The username or user ID of the user who created the programmatic access token. mins_to_bypass_required_network_policy | The number of minutes during which a user can use this token to access Snowflake without being subject to an active network policy.

Access control requirements

A role used to execute this operation must have the following privileges at a minimum: Privilege | Object | Notes MODIFY | User | Required only when displaying programmatic access tokens for a human user other than yourself or a service user. For instructions on creating a custom role with a specified set of privileges, see Creating custom roles. For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.

See also