{
  "info": {
    "name": "Cronitorex API",
    "description": "Cronitorex monitoring API — cron job, HTTP and SSL monitoring.\n\nSet the `base_url` and `api_key` variables before use.",
    "version": "1.0.0",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://api.cronitorex.com",
      "description": "API base URL"
    },
    {
      "key": "api_key",
      "value": "",
      "description": "Your API key (Profile → API Key)"
    }
  ],
  "auth": {
    "type": "bearer",
    "bearer": [{ "key": "token", "value": "{{api_key}}", "type": "string" }]
  },
  "item": [
    {
      "name": "Health",
      "item": [
        {
          "name": "GET /health",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/health",
            "description": "API health check. No authentication required."
          }
        }
      ]
    },
    {
      "name": "Ping",
      "item": [
        {
          "name": "Job started",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/ping",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"event_type\": \"ping\",\n  \"monitor\": \"db-backup\",\n  \"state\": \"start\",\n  \"host\": \"server-01\"\n}"
            },
            "description": "Send when a job begins execution."
          }
        },
        {
          "name": "Job completed",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/ping",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"event_type\": \"ping\",\n  \"monitor\": \"db-backup\",\n  \"state\": \"complete\",\n  \"duration\": 47.3,\n  \"exit_code\": 0\n}"
            },
            "description": "Send when a job finishes successfully."
          }
        },
        {
          "name": "Job failed",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/ping",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"event_type\": \"ping\",\n  \"monitor\": \"db-backup\",\n  \"state\": \"fail\",\n  \"exit_code\": 1,\n  \"message\": \"pg_dump: connection refused\"\n}"
            },
            "description": "Send when a job fails."
          }
        },
        {
          "name": "Heartbeat / OK",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/ping",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"event_type\": \"ping\",\n  \"monitor\": \"payment-service\",\n  \"state\": \"ok\"\n}"
            },
            "description": "Heartbeat — confirm a service is healthy."
          }
        }
      ]
    }
  ]
}
