API Authentication

Quick Links:

Both authentication methods require the State Tool CLI to be installed and your account to be authenticated with the state auth command.

If you have not authenticated using state auth, your browser will open prompting you to authorize your State Tool. If the prompt does not appear, paste the link from the state auth output into your browser and click Authorize.

After authenticating with the State Tool CLI, you can authenticate with the GraphQL console using either:

  • JSON Web Tokens (JWTs) - Temporarily issued tokens that expire after a set period
  • API keys - Persistent credentials that do not expire

Protect your account by never sharing or publicly displaying your API key.

Generate a JWT

state export jwt

Generate an API Key

state export new-api-key <orgname/projectname>

Add Authentication to GraphQL Console

In the “Header” section of the GraphQL console, enter your token:

{
  "Authorization": "Bearer "
}