API Authentication

The State Tool API requires either a JWT and/or an API key, depending on your use case. This article will help you generate those authentication credentials.

Authentication requires the following:

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

Never share or publicly display sensitive authentication credentials to protect your account.

Generate a JWT

state export jwt

Generate an API Key

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

Authenticate in the GraphQL Console

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

{
  "Authorization": "Bearer <token-here>"
}

For complete schema documentation, visit our API Reference guide.