Who can manage API keys
Only the head coach of an organization can create, list, and revoke API keys. Regular coaches and athletes do not have access to this feature. API key management also requires that your organization is on a plan that includes the security settings feature (Coach tier or above).Create an API key
Go to security settings
In the Astral app, open your organization settings and navigate to Security.
Create a new key
Click New API key. Give the key a descriptive name so you can identify it later (for example, “Analytics integration” or “Roster sync script”).
Set an expiration date (optional)
You can set a date when the key will automatically expire. Leaving this blank creates a key that doesn’t expire. Using expiration dates is recommended for keys used in automated scripts.
List API keys
You can view all active API keys for your organization to audit which integrations are connected. Via the API:Revoke an API key
Revoking a key immediately disables it. Any requests made with that key after revocation will be rejected. Use this if a key is no longer needed or if you believe it has been compromised. In the app: Go to Settings → Security, find the key in the list, and click Revoke. Via the API:Use an API key in requests
Include your API key in theAuthorization header of each request using the Bearer scheme:
astral_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx with your actual key secret.
Security best practices
- Use one key per integration. Create a separate key for each script or tool rather than sharing a single key. This makes it easy to revoke access for one integration without affecting others.
- Set expiration dates. For automated scripts or one-time imports, set a key to expire when the task is complete.
- Store keys securely. Keep keys in environment variables or a secrets manager. Never hard-code them in source files or commit them to version control.
- Rotate keys regularly. Even if a key hasn’t been compromised, rotating it periodically reduces your exposure window.
- Revoke unused keys. Regularly review your key list and revoke any keys that are no longer in use.