Authentication
The Pinger API uses API keys to authenticate requests. You can view and manage your API keys in the Pinger Dashboard under Settings > API Keys.
Security Warning: Your API keys carry many privileges. Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, or public forums.
Bearer Token Authentication
Authentication to the API is performed via HTTP Bearer Auth. Provide your API key as the bearer token value in the Authorization header of every request.
Authentication Example
curl https://api.pingr.site/api/v1/monitors \
-H "Authorization: Bearer pinger_xxxxxxxxxxxxxxxxx"Authentication Errors
If you fail to authenticate, or if your API key lacks the necessary scopes, you will receive one of the following error responses:
| Status Code | Meaning | Common Cause |
|---|---|---|
401 Unauthorized | Invalid or missing API key | The Authorization header is missing, malformed, or the key was revoked/deleted. |
403 Forbidden | Insufficient Scopes | The provided API key is valid but does not have the required scopes (e.g., trying to create a monitor with a read-only key). |
Secure Key Storage
We strongly recommend injecting your API keys into your application at runtime using environment variables.
Node.js Example
const response = await fetch('https://api.pingr.site/api/v1/monitors', {
headers: {
'Authorization': `Bearer ${process.env.PINGER_API_KEY}`
}
});