Skip to main content

Authentication

The neuroflash API uses OAuth2 client credentials for authentication, powered by Zitadel. You exchange a client ID and secret for an access token, then include that token in all API requests.

Getting Your Credentials

  1. Log in to the neuroflash app
  2. Create a new service account
  3. Copy the client_id and client_secret
caution

Store your credentials securely. Never commit them to version control or expose them in client-side code.

Obtaining an Access Token

Exchange your credentials for an access token by sending a POST request to the Zitadel token endpoint:

POST https://id.neuroflash.com/oauth/v2/token
curl -X POST https://id.neuroflash.com/oauth/v2/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=YOUR_CLIENT_ID" \
-d "client_secret=YOUR_CLIENT_SECRET" \
-d "scope=openid"

Token Response

{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 14399
}
FieldDescription
access_tokenThe Bearer token to include in API requests
token_typeAlways Bearer
expires_inToken lifetime in seconds (approximately 4 hours)

Using the Token

Include the access token in the Authorization header of every API request:

curl https://app.neuroflash.com/api/digital-twin-service/v1/static-groups \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Token Expiration

Access tokens expire after approximately 4 hours (expires_in: 14399 seconds). When your token expires, the API returns a 401 Unauthorized response. Request a new token using the same client credentials flow.

tip

Cache your access token and reuse it until it expires. There is no need to request a new token for every API call.

Scopes

The required scope for the neuroflash API is:

openid

This scope grants access to all neuroflash API services that your service account has been provisioned for.