SYSTEM$START_USER_OAUTH_FLOW

Initiates the OAuth client flow, returning a URL that you use in a browser to complete the OAuth consent process. This process is scoped to the executing Snowflake user only.

Syntax

SELECT SYSTEM$START_USER_OAUTH_FLOW('<API_INTEGRATION_NAME>');

Arguments

'<API_INTEGRATION_NAME>'

The name of the API integration specifying authentication information for the API to access with OAuth.

Usage notes

  • This function only supports API integrations with API_PROVIDER set as EXTERNAL_MCP.

  • Begin the OAuth flow with this function to obtain an OAuth refresh token, which is then added to the specified API integration.

  • This function initially provides an authorization URL. You must open this URL in a browser to complete the required OAuth consent process.

  • After using the URL returned by this function, you must immediately execute SYSTEM$FINISH_OAUTH_FLOW in the same session. This action allows Snowflake to update the API integration with a refresh token.

  • The OAuth refresh token, after being added to the API integration, is restricted solely to the Snowflake user who initiates and completes the flow. It cannot be accessed by any other user within your account.