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:
- The State Tool CLI is installed
- You have authenticated the State Tool by running the
state authcommand.
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
caution
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 <JWT-here>"
}
For complete schema documentation, visit our API Reference guide.