{
  "openapi": "3.1.0",
  "info": {
    "title": "WebAuditOS website audit API",
    "version": "1",
    "description": "Endpoint and authentication reference. Operation limits and response details are documented at https://webauditos.com/api."
  },
  "servers": [
    {
      "url": "https://webauditos.com/api"
    }
  ],
  "paths": {
    "/v1/scans": {
      "get": {
        "description": "List the workspace's scans, newest first.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation. Refer to the website audit API documentation for response fields."
          },
          "401": {
            "description": "Invalid or absent bearer API key"
          },
          "403": {
            "description": "The key or plan does not permit this operation"
          },
          "429": {
            "description": "Workspace API rate limit reached"
          }
        }
      },
      "post": {
        "description": "Start a scan from a URL. Returns a scan id immediately; the run is asynchronous. Needs a key with the write scope.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["url"],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "maxLength": 2048
                  },
                  "mode": {
                    "type": "string",
                    "description": "Scan mode supported by the API; see the API reference."
                  },
                  "depth": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 6
                  },
                  "page_budget": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 20000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful operation. Refer to the website audit API documentation for response fields."
          },
          "401": {
            "description": "Invalid or absent bearer API key"
          },
          "403": {
            "description": "The key or plan does not permit this operation"
          },
          "429": {
            "description": "Workspace API rate limit reached"
          }
        }
      }
    },
    "/v1/scans/batch": {
      "post": {
        "description": "Start several scans in one request. Body: { scans: [ { url, mode?, depth?, page_budget? } ] }. Each item reports its own outcome, because a batch that runs out of allowance halfway really did start the first half. How many items you may send is bounded by your plan.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["scans"],
                "properties": {
                  "scans": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "object",
                      "required": ["url"],
                      "properties": {
                        "url": {
                          "type": "string",
                          "format": "uri",
                          "maxLength": 2048
                        },
                        "mode": {
                          "type": "string",
                          "description": "Scan mode supported by the API; see the API reference."
                        },
                        "depth": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 6
                        },
                        "page_budget": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 20000
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Batch with per-item outcomes; some items may not have started."
          },
          "201": {
            "description": "Successful operation. Refer to the website audit API documentation for response fields."
          },
          "401": {
            "description": "Invalid or absent bearer API key"
          },
          "403": {
            "description": "The key or plan does not permit this operation"
          },
          "429": {
            "description": "Workspace API rate limit reached"
          }
        }
      }
    },
    "/v1/scans/{id}": {
      "get": {
        "description": "Run status, progress, category scores and overall score.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation. Refer to the website audit API documentation for response fields."
          },
          "401": {
            "description": "Invalid or absent bearer API key"
          },
          "403": {
            "description": "The key or plan does not permit this operation"
          },
          "429": {
            "description": "Workspace API rate limit reached"
          }
        }
      }
    },
    "/v1/scans/{id}/findings": {
      "get": {
        "description": "Findings with severity, evidence, fix and affected URLs. Filter with ?severity= and ?category=.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation. Refer to the website audit API documentation for response fields."
          },
          "401": {
            "description": "Invalid or absent bearer API key"
          },
          "403": {
            "description": "The key or plan does not permit this operation"
          },
          "429": {
            "description": "Workspace API rate limit reached"
          }
        }
      }
    },
    "/v1/scans/{id}/pages": {
      "get": {
        "description": "Crawled URL inventory with status, depth, weight, vitals and per-page score.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation. Refer to the website audit API documentation for response fields."
          },
          "401": {
            "description": "Invalid or absent bearer API key"
          },
          "403": {
            "description": "The key or plan does not permit this operation"
          },
          "429": {
            "description": "Workspace API rate limit reached"
          }
        }
      }
    },
    "/v1/projects": {
      "get": {
        "description": "List projects with their domain, environment and monitoring state.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation. Refer to the website audit API documentation for response fields."
          },
          "401": {
            "description": "Invalid or absent bearer API key"
          },
          "403": {
            "description": "The key or plan does not permit this operation"
          },
          "429": {
            "description": "Workspace API rate limit reached"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}
