Skip to main content

Overview

The PingPilot API uses Bearer token authentication. You must include your API key in the Authorization header of every request.

Getting Your API Key

  1. Log in to your PingPilot dashboard
  2. Navigate to Account Settings
  3. Copy your API key from the API section
Keep your API key secure and never commit it to public repositories. Treat it like a password.

Authentication Header

Include your API key in the Authorization header using the Bearer scheme:
Authorization: Bearer YOUR_API_KEY

Example Request

curl -X POST https://pingpilot.app/api/v1/event \
  -H "Authorization: Bearer pk_1234567890abcdef" \
  -H "Content-Type: application/json" \
  -d '{
    "category": "sale",
    "description": "New purchase completed"
  }'

Authentication Errors

The API returns specific error messages for authentication failures:

Missing Authorization Header

Status Code: 401 Unauthorized
{
  "message": "Unauthorized"
}

Invalid Header Format

If the header doesn’t start with “Bearer ”: Status Code: 401 Unauthorized
{
  "message": "Invalid auth header format. Expected: 'Bearer [API_KEY]'"
}

Invalid API Key

If the API key is empty, invalid, or not found: Status Code: 401 Unauthorized
{
  "message": "Invalid API key"
}

Account Configuration Requirements

After authentication succeeds, PingPilot verifies your account configuration:

Discord ID Required

Status Code: 403 Forbidden
{
  "message": "Please enter your discord ID in your account settings"
}
Configure your Discord ID in account settings to receive Discord notifications.

Telegram Username Required

Status Code: 403 Forbidden
{
  "message": "Telegram username not set. Please set your telegram username in your account settings to receive notifications"
}
Configure your Telegram username in account settings to receive Telegram notifications.

Security Best Practices

  • Store securely: Use environment variables or secret management services
  • Rotate regularly: Generate new API keys periodically
  • Use HTTPS: Always make requests over HTTPS
  • Monitor usage: Check your dashboard for unexpected API activity

Build docs developers (and LLMs) love