{
  "openapi": "3.0.3",
  "info": {
    "title": "PingDeck API",
    "version": "1.0.0",
    "description": "Uptime checks, SSL expiry and DNS lookups over HTTP. Free tier: 300 calls/month. Get a key: create a free account at https://getpingdeck.com/app#signup, then Generate API key in the dashboard.",
    "contact": { "email": "support@getpingdeck.com" }
  },
  "servers": [{ "url": "https://getpingdeck.com" }],
  "components": {
    "securitySchemes": { "apiKey": { "type": "http", "scheme": "bearer", "bearerFormat": "pd_live_..." } },
    "schemas": {
      "Quota": { "type": "object", "properties": { "used": { "type": "integer" }, "limit": { "type": "integer" }, "month": { "type": "string" } } }
    }
  },
  "security": [{ "apiKey": [] }],
  "paths": {
    "/v1/signup": {
      "post": {
        "summary": "Create a free account and receive an API key in one call (no browser needed)",
        "security": [],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["email", "password"], "properties": { "email": { "type": "string", "format": "email" }, "password": { "type": "string", "minLength": 8 } } } } } },
        "responses": { "201": { "description": "Account created", "content": { "application/json": { "schema": { "type": "object", "properties": { "api_key": { "type": "string" }, "plan": { "type": "string" }, "monitors_limit": { "type": "integer" }, "api_calls_month": { "type": "integer" } } } } } }, "409": { "description": "Email already registered" } }
      }
    },
    "/v1/check": {
      "get": {
        "summary": "Live up/down check of a public URL",
        "parameters": [{ "name": "url", "in": "query", "required": true, "schema": { "type": "string", "format": "uri" } }],
        "responses": { "200": { "description": "Check result", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean" }, "http_status": { "type": "integer" }, "response_ms": { "type": "integer" }, "error": { "type": "string" }, "quota": { "$ref": "#/components/schemas/Quota" } } } } } }, "400": { "description": "Invalid or non-public URL" }, "401": { "description": "Missing/invalid API key" }, "429": { "description": "Monthly quota exceeded" } }
      }
    },
    "/v1/ssl": {
      "get": {
        "summary": "SSL certificate expiry for a host",
        "parameters": [{ "name": "host", "in": "query", "required": true, "schema": { "type": "string" } }],
        "responses": { "200": { "description": "Expiry info", "content": { "application/json": { "schema": { "type": "object", "properties": { "found": { "type": "boolean" }, "expires": { "type": "string", "format": "date-time" }, "days_left": { "type": "integer" }, "quota": { "$ref": "#/components/schemas/Quota" } } } } } } }
      }
    },
    "/v1/dns": {
      "get": {
        "summary": "DNS records (A, AAAA, CNAME, MX, TXT, NS) for a domain",
        "parameters": [{ "name": "domain", "in": "query", "required": true, "schema": { "type": "string" } }],
        "responses": { "200": { "description": "Records", "content": { "application/json": { "schema": { "type": "object", "properties": { "host": { "type": "string" }, "a": { "type": "array", "items": { "type": "string" } }, "aaaa": { "type": "array", "items": { "type": "string" } }, "cname": { "type": "array", "items": { "type": "string" } }, "mx": { "type": "array", "items": { "type": "string" } }, "txt": { "type": "array", "items": { "type": "string" } }, "ns": { "type": "array", "items": { "type": "string" } }, "quota": { "$ref": "#/components/schemas/Quota" } } } } } } }
      }
    },
    "/v1/monitors": {
      "get": {
        "summary": "List your monitors with live status",
        "responses": { "200": { "description": "Monitors" } }
      },
      "post": {
        "summary": "Create a 24/7 monitor with webhook alerting",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["url"], "properties": { "url": { "type": "string", "format": "uri" }, "name": { "type": "string" } } } } } },
        "responses": { "201": { "description": "Created" }, "402": { "description": "Monitor limit for plan reached" } }
      }
    }
  }
}
