Skip to content
Analytics
Visit Analytics on GitHub
Set theme to dark (⇧+D)

Authenticate with a Cloudflare API key

API keys are unique to each Cloudflare user and used only for authentication. An API key does not authorize access to accounts or zones. To ensure that the GraphQL Analytics API authenticates your queries, retrieve your Cloudflare Global API Key.

Edit HTTP headers for GraphiQL authentication

  1. Launch GraphiQL

  2. Click Edit HTTP Headers  The Edit HTTP Headers window appears.

  3. Click Add Header

  4. Enter X-AUTH-EMAIL in the Header name field and your email address registered with Cloudflare in the Header value field, and click Save

  5. Click Add Header

  6. Enter X-AUTH-KEY in the Header Name field, then paste your Global API Key in the Header value field, and click Save

  7. Click anywhere outside the Edit HTTP Headers window in GraphiQL to return to the Untitled Query 1 tab

  8. Enter https://api.cloudflare.com/client/v4/graphql in the GraphQL Endpoint field

Now that you have configured authentication with a Cloudflare API key, you are ready to run queries using GraphiQL.