Skip to main content
The Parquet API uses Control user authentication. Access depends on workspace membership and whether Parquet exports are enabled for the workspace; there are no per-dataset OAuth scopes.

Discover the authorization server

Start from the production API’s protected-resource metadata:
The response contains the authorization_servers and scopes_supported values for the current environment. Discover these values at runtime instead of hard-coding the Clerk host.

Authorization flow

Use the OAuth 2.0 authorization-code flow with Proof Key for Code Exchange (PKCE). PKCE binds the one-time authorization code to the client that started the sign-in. Use the S256 challenge method:
  1. Register a public OAuth client with the discovered authorization server. Dynamic Client Registration is supported for compatible clients.
  2. Use a loopback redirect URI such as http://127.0.0.1:<port>/callback.
  3. Generate a PKCE verifier and challenge.
  4. Open the authorization URL in the user’s browser.
  5. The user signs in to Control and is redirected to the loopback callback with a one-time code.
  6. Exchange the code and verifier at the discovered token endpoint.
  7. Send the access token as Authorization: Bearer <token>.
  8. Use the refresh token before the access token expires.
OAuth-capable Model Context Protocol (MCP) clients perform the redirect, PKCE, token exchange, and refresh automatically. The user should not copy an access token into chat or application settings.

Verify the token

  • 401 means the token is missing, invalid, or expired.
  • 403 means the signed-in user lacks workspace access or Parquet exports are not enabled.
Continue with the Parquet API quickstart.