Overview
Your API key is a unique identifier that authenticates your requests to the PingPilot API. Every user automatically receives a unique API key upon registration, which is used to send events to your notification channels.Finding Your API Key
You can find your API key in the dashboard:Using Your API Key
Your API key is used to authenticate requests to the PingPilot event API. Include it in theAuthorization header as a Bearer token:
Authentication Format
The API expects theAuthorization header in this exact format:
The word “Bearer” must be followed by a space, then your API key. Incorrect formatting will result in a 401 Unauthorized error.
Authentication Errors
Missing Authorization Header
401 Unauthorized
Solution: Include the Authorization header in your request.
Invalid Header Format
401 Unauthorized
Solution: Ensure your header starts with “Bearer ” followed by your API key.
Invalid API Key
401 Unauthorized
Solution: Verify your API key is correct. You may need to regenerate it if it has been compromised.
API Key Security Best Practices
Store Securely
Store Securely
Never hardcode your API key in your source code. Use environment variables instead:
Never Commit to Git
Never Commit to Git
Add your environment files to
.gitignore to prevent accidentally committing your API key:Use Different Keys for Different Environments
Use Different Keys for Different Environments
Create separate PingPilot accounts for development, staging, and production environments. This way, if a development key is compromised, your production notifications remain secure.
Rotate Keys Regularly
Rotate Keys Regularly
Consider regenerating your API key periodically or immediately if you suspect it has been compromised.
API Key Properties
Each API key in PingPilot:- Is unique to your user account
- Is automatically generated when you create your account
- Is stored securely in the database
- Never expires (unless regenerated)
- Has no rate limiting beyond your plan’s quota
Database Storage
API keys are stored in theUser model:
- Generated using
cuid()for uniqueness - Indexed for fast lookups
- Unique across all users
Regenerating Your API Key
To regenerate your API key:Testing Your API Key
You can quickly test if your API key is working by sending a test event:Next Steps
Sending Events
Learn how to send events using your API key
Creating Categories
Set up event categories for better organization