API Authentication¶
Flow APIs use Bearer token authentication.
Getting a Token¶
Option 1: OAuth2 (Recommended)¶
Use the OIDC flow to obtain an access token:
- Redirect to Zitadel authorization endpoint
- User authenticates
- Exchange code for token
- Use token in API requests
Option 2: Personal Access Token¶
Request a personal access token from your administrator.
Using the Token¶
Include the token in the Authorization header:
Token Expiration¶
Access tokens expire after 1 hour. Use refresh tokens to obtain new access tokens without re-authenticating.
Error Responses¶
| Status | Description |
|---|---|
| 401 | Missing or invalid token |
| 403 | Token valid but insufficient permissions |