{
  "openapi": "3.1.0",
  "info": {
    "title": "Linesman status API",
    "version": "1.0.0",
    "summary": "Public, read-only health checks for Linesman, the Shopify bot-checkout blocker.",
    "description": "Unauthenticated, read-only endpoints for uptime monitors. They return no store or customer data. Linesman has no other public API: merchants use it inside the Shopify admin.",
    "contact": {
      "url": "https://linesman.app/docs#status-api"
    }
  },
  "externalDocs": {
    "url": "https://linesman.app/docs#status-api"
  },
  "servers": [
    {
      "url": "https://linesman.app"
    }
  ],
  "paths": {
    "/healthz": {
      "get": {
        "operationId": "getHealth",
        "summary": "Web service health",
        "description": "200 when the web service is up and its database is reachable, 503 otherwise.",
        "security": [],
        "responses": {
          "200": {
            "description": "Healthy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "db"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok",
                        "degraded"
                      ]
                    },
                    "db": {
                      "type": "string",
                      "enum": [
                        "up",
                        "down"
                      ]
                    }
                  }
                },
                "example": {
                  "status": "ok",
                  "db": "up"
                }
              }
            }
          },
          "503": {
            "description": "Database unreachable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "db"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok",
                        "degraded"
                      ]
                    },
                    "db": {
                      "type": "string",
                      "enum": [
                        "up",
                        "down"
                      ]
                    }
                  }
                },
                "example": {
                  "status": "degraded",
                  "db": "down"
                }
              }
            }
          }
        }
      }
    },
    "/healthz/worker": {
      "get": {
        "operationId": "getWorkerHealth",
        "summary": "Background worker liveness",
        "description": "200 only when the background worker sent a recent heartbeat; 503 for stale, missing or unknown.",
        "security": [],
        "responses": {
          "200": {
            "description": "Worker is live",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok",
                        "stale",
                        "missing",
                        "unknown"
                      ]
                    },
                    "ageSeconds": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Seconds since the worker's last heartbeat (ok and stale only)."
                    },
                    "reason": {
                      "type": "string",
                      "description": "Why liveness couldn't be read (unknown only)."
                    }
                  }
                },
                "example": {
                  "status": "ok",
                  "ageSeconds": 12
                }
              }
            }
          },
          "503": {
            "description": "Worker is stale, missing or unknown",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok",
                        "stale",
                        "missing",
                        "unknown"
                      ]
                    },
                    "ageSeconds": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Seconds since the worker's last heartbeat (ok and stale only)."
                    },
                    "reason": {
                      "type": "string",
                      "description": "Why liveness couldn't be read (unknown only)."
                    }
                  }
                },
                "example": {
                  "status": "stale",
                  "ageSeconds": 600
                }
              }
            }
          }
        }
      }
    }
  }
}