{
  "info": {
    "name": "CronPeek API",
    "description": "Cron Job Monitoring API. Dead man's switch monitoring — ping a URL when your cron runs, get alerted if it doesn't.\n\nBase URL: https://cronpeek.web.app\nDocs: https://cronpeek.web.app/docs\nPricing: https://cronpeek.web.app/pricing\n\nFree: 5 monitors, 7-day history\nStarter: $9/mo — 50 monitors, 90-day history\nPro: $29/mo — unlimited monitors, unlimited history",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "version": "1.0.0"
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://cronpeek.web.app",
      "type": "string"
    },
    {
      "key": "apiKey",
      "value": "YOUR_API_KEY",
      "type": "string"
    },
    {
      "key": "pingToken",
      "value": "YOUR_PING_TOKEN",
      "type": "string"
    },
    {
      "key": "monitorId",
      "value": "YOUR_MONITOR_ID",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "Health Check",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/api/health",
          "host": ["{{baseUrl}}"],
          "path": ["api", "health"]
        },
        "description": "Check API status."
      },
      "response": [
        {
          "name": "Success",
          "status": "OK",
          "code": 200,
          "body": "{\"status\":\"ok\",\"service\":\"cronpeek\",\"version\":\"1.0.0\"}"
        }
      ]
    },
    {
      "name": "Create Account",
      "request": {
        "method": "POST",
        "header": [
          { "key": "Content-Type", "value": "application/json", "type": "text" }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"email\": \"you@example.com\"\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/api/v1/accounts",
          "host": ["{{baseUrl}}"],
          "path": ["api", "v1", "accounts"]
        },
        "description": "Create a free account and get your API key. If account exists, returns existing key."
      },
      "response": [
        {
          "name": "Created",
          "status": "Created",
          "code": 201,
          "body": "{\"apiKey\":\"cpk_abc123...\",\"plan\":\"free\",\"monitors\":5}"
        }
      ]
    },
    {
      "name": "Create Monitor",
      "request": {
        "method": "POST",
        "header": [
          { "key": "x-api-key", "value": "{{apiKey}}", "type": "text" },
          { "key": "Content-Type", "value": "application/json", "type": "text" }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"name\": \"Nightly Backup Job\",\n  \"schedule\": 86400,\n  \"grace\": 3600,\n  \"alertEmail\": \"alerts@example.com\",\n  \"alertWebhook\": \"https://hooks.slack.com/services/xxx\"\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/api/v1/monitors",
          "host": ["{{baseUrl}}"],
          "path": ["api", "v1", "monitors"]
        },
        "description": "Create a new cron monitor. Schedule is in seconds between expected pings (min 60s). Grace is the extra time before alerting. Returns a unique ping URL."
      },
      "response": [
        {
          "name": "Created",
          "status": "Created",
          "code": 201,
          "body": "{\"monitorId\":\"abc123def456\",\"name\":\"Nightly Backup Job\",\"pingUrl\":\"https://cronpeek.web.app/api/v1/ping/unique-token-here\",\"schedule\":86400,\"grace\":3600,\"status\":\"new\"}"
        }
      ]
    },
    {
      "name": "List Monitors",
      "request": {
        "method": "GET",
        "header": [
          { "key": "x-api-key", "value": "{{apiKey}}", "type": "text" }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/v1/monitors",
          "host": ["{{baseUrl}}"],
          "path": ["api", "v1", "monitors"]
        },
        "description": "List all monitors on your account."
      },
      "response": [
        {
          "name": "Success",
          "status": "OK",
          "code": 200,
          "body": "{\"monitors\":[{\"monitorId\":\"abc123\",\"name\":\"Nightly Backup\",\"status\":\"up\",\"schedule\":86400,\"grace\":3600,\"lastPing\":\"2026-03-28T12:00:00.000Z\",\"pingCount\":42}],\"count\":1}"
        }
      ]
    },
    {
      "name": "Get Monitor Status",
      "request": {
        "method": "GET",
        "header": [
          { "key": "x-api-key", "value": "{{apiKey}}", "type": "text" }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/v1/monitors/{{monitorId}}/status",
          "host": ["{{baseUrl}}"],
          "path": ["api", "v1", "monitors", "{{monitorId}}", "status"]
        },
        "description": "Get detailed status of a specific monitor."
      }
    },
    {
      "name": "Delete Monitor",
      "request": {
        "method": "DELETE",
        "header": [
          { "key": "x-api-key", "value": "{{apiKey}}", "type": "text" }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/v1/monitors/{{monitorId}}",
          "host": ["{{baseUrl}}"],
          "path": ["api", "v1", "monitors", "{{monitorId}}"]
        },
        "description": "Delete a monitor. This is permanent."
      }
    },
    {
      "name": "Send Ping (GET)",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/api/v1/ping/{{pingToken}}",
          "host": ["{{baseUrl}}"],
          "path": ["api", "v1", "ping", "{{pingToken}}"]
        },
        "description": "Ping a monitor to confirm your cron job ran. Supports GET, POST, and HEAD methods. Add this URL to your crontab."
      },
      "response": [
        {
          "name": "Success",
          "status": "OK",
          "code": 200,
          "body": "{\"ok\":true,\"monitor\":\"Nightly Backup Job\",\"status\":\"up\"}"
        }
      ]
    },
    {
      "name": "Send Ping (POST)",
      "request": {
        "method": "POST",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/api/v1/ping/{{pingToken}}",
          "host": ["{{baseUrl}}"],
          "path": ["api", "v1", "ping", "{{pingToken}}"]
        },
        "description": "Ping via POST (useful for scripts that prefer POST)."
      }
    },
    {
      "name": "Create Checkout Session",
      "request": {
        "method": "POST",
        "header": [
          { "key": "Content-Type", "value": "application/json", "type": "text" }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"plan\": \"starter\",\n  \"email\": \"you@example.com\"\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/api/v1/checkout",
          "host": ["{{baseUrl}}"],
          "path": ["api", "v1", "checkout"]
        },
        "description": "Create a Stripe checkout session. Plans: starter ($9/mo, 50 monitors), pro ($29/mo, unlimited)."
      }
    }
  ]
}
