Authentication
Learn how to authenticate with the Mirra SDK using API keys
The Mirra SDK uses API keys for authentication. All API requests must include your API key in the X-API-Key header.
Getting your API Key
You can generate an API key from either the web portal or the mobile app:
Option 1: Web Portal
- Visit store.getmirra.app/developer/api-keys
- Sign in with your Mirra account
- Click Generate API Key
- Copy the key immediately
Option 2: Mobile App
- Open the Mirra app on your phone
- Go to Settings → Developer
- Tap Generate API Key
- Copy the key immediately
Your API key is only displayed once when generated. Store it securely. If you lose it, you'll need to revoke it and generate a new one.
API Key Format
Mirra API keys start with the mirra_ prefix:
Using your API Key
Include your API key in the X-API-Key header for API requests:
With the SDK
The SDK handles authentication automatically when initialized with your API key:
In application code
Always load your API key from environment variables:
Python:
Managing API Keys
Revoking a key
If your API key is compromised or no longer needed, revoke it from the web portal or mobile app (Settings → Developer).
Any applications using the revoked key will immediately stop working.
Security best practices
- Use environment variables: Never hardcode API keys in source code
- Don't commit keys: Add
.envto your.gitignore - Rotate regularly: Periodically revoke and regenerate keys
- Limit exposure: Only share keys with systems that need them
- Monitor usage: Check the Developer page for last-used timestamps
Troubleshooting
401 Unauthorized
Your API key is missing or invalid.
Check that:
- The
X-API-Keyheader is included in your request - Your API key starts with
mirra_ - The key hasn't been revoked
Invalid API key format
API keys must:
- Start with
mirra_ - Be the complete key (not truncated)
If your key appears malformed, generate a new one from the Mirra app.
See also
- Environment Setup: Install the SDK and configure your project
- Quickstart: Build your first automation