{
  "openapi": "3.1.0",
  "info": {
    "title": "7DOTS Agent Readiness Scan API",
    "version": "1.0.0",
    "description": "Run agent readiness scans and read reports. 67 checks across four layers, plus the 7DOTS Confidence score (Presence, Clarity, Proof, Ease). Free, no authentication, rate limited per client.",
    "contact": {
      "name": "7DOTS",
      "email": "hello@7dots.co.uk",
      "url": "https://www.7dots.com/contact-us/"
    }
  },
  "servers": [
    {
      "url": "https://agentready.7dots.com"
    }
  ],
  "paths": {
    "/api/scan": {
      "post": {
        "operationId": "scanSite",
        "summary": "Scan a website",
        "description": "Scans the site, or returns its stored report if it was scanned in the last 6 hours. With Accept: application/x-ndjson the response streams one JSON event per line as checks finish.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Domain or URL, e.g. example.com",
                    "examples": [
                      "example.com"
                    ]
                  },
                  "force": {
                    "type": "boolean",
                    "description": "Ignore a recent stored report and scan again.",
                    "default": false
                  },
                  "profile": {
                    "type": "string",
                    "enum": [
                      "content",
                      "saas",
                      "commerce"
                    ],
                    "description": "Score as this profile instead of the detected one."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Scored report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Summary"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/api/report/{id}": {
      "get": {
        "operationId": "getReport",
        "summary": "Get a report by id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "content",
                "saas",
                "commerce"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Scored report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Summary"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/domain/{domain}": {
      "get": {
        "operationId": "getLatestReport",
        "summary": "Get the latest report for a domain",
        "parameters": [
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Scored report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Summary"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "hint": {
            "type": "string"
          }
        }
      },
      "Summary": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string"
          },
          "brand": {
            "type": "string"
          },
          "reportUrl": {
            "type": "string",
            "format": "uri"
          },
          "scannedAt": {
            "type": "string",
            "format": "date-time"
          },
          "profile": {
            "type": "string",
            "enum": [
              "content",
              "saas",
              "commerce"
            ]
          },
          "detectedProfile": {
            "type": "string",
            "enum": [
              "content",
              "saas",
              "commerce"
            ]
          },
          "agentReadiness": {
            "type": "object",
            "properties": {
              "score": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100
              },
              "grade": {
                "type": "string"
              },
              "label": {
                "type": "string"
              },
              "layers": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              }
            }
          },
          "confidence": {
            "type": [
              "object",
              "null"
            ]
          },
          "topFixes": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "checks": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      }
    }
  }
}