Troubleshooting Unauthorized Errors in Dagster GraphQL API Calls

Last updated: October 23, 2025

When making GraphQL API calls to Dagster Cloud, ensure your endpoint includes the deployment name (e.g., '/prod') in the URL: https://[organization].dagster.cloud/prod/graphql

Verify your repository selector parameters match exactly with your Dagster+ deployment settings:

repositorySelector: { 
  repositoryName: "your_repository_name", 
  repositoryLocationName: "your_location_name" 
} 

Common causes of UnauthorizedError include:

  • Incorrect endpoint URL

  • Mismatched repository selector parameters

  • Invalid or expired user token

  • Insufficient token permissions

For more information, refer to:

Example of a correctly formatted API call using the Python GQL client:

  import gql
  from gql.transport.requests import RequestsHTTPTransport

  transport = RequestsHTTPTransport(
      url="https://your-org.dagster.cloud/prod/graphql",
      headers={"Dagster-Cloud-Api-Token": YOUR_USER_TOKEN}
  )

  gql_client = gql.Client(transport=transport)