Creating an API key
You can create an API key by following these steps:1
Go to settings
Go to Settings > API keys.

2
Create an API key
Click “Create API key” and give it a descriptive name.

3
Store your API key
Once your API key is created, make sure to copy and store it in a safe place. You won’t be able to see it again for security reasons. If it gets lost, you can create a new one.

Your API key grants full access to your Passport account. Keep it secure and never share it publicly.
4
Use your API key
Now that you have your API key, you can use it to access your account’s resources programmatically via any API request using the api-key header.
Example Usage
Include your API key in theapi-key header:
Example with a Real Request
Authentication Errors
If your API key is missing, invalid, or malformed, you’ll receive authentication errors:Missing API Key (401 Unauthorized)
Missing API Key (401 Unauthorized)
Invalid API Key (403 Forbidden)
Invalid API Key (403 Forbidden)
When an invalid or malformed API key is provided, you’ll receive a 403 Forbidden response indicating that access is denied.
The exact error message may vary depending on the endpoint.
Best Practices
Secure Storage
- Use environment variables in production
- Never commit API keys to version control
- Use different keys for development and production
- Rotate keys regularly for security
Rate Limiting
- API requests are rate limited to prevent abuse
- Include proper error handling for
429responses - Implement exponential backoff for retries
- Cache responses when possible
Environment Setup Examples
When you remove a user from your organization (or they leave your organization), all API keys associated with that user will stop working as well. Keep this in mind when managing users.