{
	"info": {
		"title": "openaudit HTTP API (self-hosted)",
		"version": "0.5.0",
		"description": "The HTTP API in apps/server and packages/api: run URL audits and read the auditor and playbook catalogue. You run it yourself; openaudit.se does not host it, so the server below is a local default. It has no authentication. URL audits are rate limited per client and server-wide, and refuse private, loopback and link-local targets unless the server is started with ALLOW_PRIVATE_TARGETS.",
		"license": {
			"name": "MIT",
			"url": "https://opensource.org/licenses/MIT"
		}
	},
	"servers": [
		{
			"url": "http://localhost:3000/api-reference",
			"description": "Self-hosted: your own apps/server, which is also your sandbox (`bun run dev:server`, port 3000 unless PORT is set; see https://openaudit.se/docs/sandbox/)"
		}
	],
	"externalDocs": {
		"description": "Source and setup",
		"url": "https://github.com/wezter96/openaudit/tree/main/apps/server"
	},
	"openapi": "3.1.1",
	"paths": {
		"/healthCheck": {
			"get": {
				"operationId": "healthCheck",
				"tags": [
					"Meta"
				],
				"responses": {
					"200": {
						"description": "OK",
						"content": {
							"application/json": {
								"schema": {
									"type": "string"
								}
							}
						}
					}
				}
			}
		},
		"/auditors": {
			"get": {
				"operationId": "auditors.list",
				"summary": "List auditors",
				"description": "Built-in, external-tool and agentic auditors with the categories and target kinds they cover.",
				"tags": [
					"Catalog"
				],
				"responses": {
					"200": {
						"description": "OK",
						"content": {
							"application/json": {
								"schema": {
									"type": "array",
									"items": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string"
											},
											"title": {
												"type": "string"
											},
											"description": {
												"type": "string"
											},
											"engine": {
												"enum": [
													"builtin",
													"external",
													"agentic"
												],
												"type": "string"
											},
											"categories": {
												"type": "array",
												"items": {
													"enum": [
														"security",
														"accessibility",
														"performance",
														"seo",
														"privacy",
														"best-practices",
														"reliability",
														"maintainability",
														"supply-chain",
														"compliance"
													],
													"type": "string"
												}
											},
											"targets": {
												"type": "array",
												"items": {
													"enum": [
														"codebase",
														"url",
														"webapp",
														"container",
														"iac",
														"mobile",
														"cloud"
													],
													"type": "string"
												}
											},
											"tool": {
												"type": "string"
											},
											"network": {
												"type": "boolean"
											},
											"defaultEnabled": {
												"type": "boolean"
											}
										},
										"required": [
											"id",
											"title",
											"description",
											"engine",
											"categories",
											"targets",
											"network",
											"defaultEnabled"
										]
									}
								}
							}
						}
					}
				}
			}
		},
		"/playbooks": {
			"get": {
				"operationId": "playbooks.list",
				"summary": "List playbooks",
				"description": "Judgment-heavy audit procedures that agents execute (via MCP or the agentic auditors).",
				"tags": [
					"Catalog"
				],
				"responses": {
					"200": {
						"description": "OK",
						"content": {
							"application/json": {
								"schema": {
									"type": "array",
									"items": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string"
											},
											"title": {
												"type": "string"
											},
											"summary": {
												"type": "string"
											},
											"categories": {
												"type": "array",
												"items": {
													"enum": [
														"security",
														"accessibility",
														"performance",
														"seo",
														"privacy",
														"best-practices",
														"reliability",
														"maintainability",
														"supply-chain",
														"compliance"
													],
													"type": "string"
												}
											},
											"targets": {
												"type": "array",
												"items": {
													"enum": [
														"codebase",
														"url",
														"webapp",
														"container",
														"iac",
														"mobile",
														"cloud"
													],
													"type": "string"
												}
											},
											"needs": {
												"type": "array",
												"items": {
													"enum": [
														"code",
														"browser",
														"shell",
														"network"
													],
													"type": "string"
												}
											},
											"checklist": {
												"type": "array",
												"items": {
													"type": "string"
												}
											}
										},
										"required": [
											"id",
											"title",
											"summary",
											"categories",
											"targets",
											"needs",
											"checklist"
										]
									}
								}
							}
						}
					}
				}
			}
		},
		"/playbooks/{id}": {
			"get": {
				"operationId": "playbooks.get",
				"summary": "Get a playbook",
				"description": "A playbook including its full Markdown instructions.",
				"tags": [
					"Catalog"
				],
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string",
							"minLength": 1,
							"maxLength": 100
						}
					}
				],
				"responses": {
					"200": {
						"description": "OK",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"id": {
											"type": "string"
										},
										"title": {
											"type": "string"
										},
										"summary": {
											"type": "string"
										},
										"categories": {
											"type": "array",
											"items": {
												"enum": [
													"security",
													"accessibility",
													"performance",
													"seo",
													"privacy",
													"best-practices",
													"reliability",
													"maintainability",
													"supply-chain",
													"compliance"
												],
												"type": "string"
											}
										},
										"targets": {
											"type": "array",
											"items": {
												"enum": [
													"codebase",
													"url",
													"webapp",
													"container",
													"iac",
													"mobile",
													"cloud"
												],
												"type": "string"
											}
										},
										"needs": {
											"type": "array",
											"items": {
												"enum": [
													"code",
													"browser",
													"shell",
													"network"
												],
												"type": "string"
											}
										},
										"checklist": {
											"type": "array",
											"items": {
												"type": "string"
											}
										},
										"instructions": {
											"type": "string"
										}
									},
									"required": [
										"id",
										"title",
										"summary",
										"categories",
										"targets",
										"needs",
										"checklist",
										"instructions"
									]
								}
							}
						}
					}
				}
			}
		},
		"/audit/url": {
			"post": {
				"operationId": "audit.url",
				"summary": "Audit a URL",
				"description": "Runs the built-in web auditors (security headers, TLS, SEO, accessibility markup, privacy…) against a public URL without a browser. Crawls at most 5 pages and stops after 60s. Private, loopback and link-local targets are refused. Rate limited to 10 requests per minute per client.",
				"tags": [
					"Audit"
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"url": {
										"type": "string",
										"minLength": 1,
										"maxLength": 2048,
										"description": "http(s) URL of a site you own or are authorised to test"
									},
									"maxPages": {
										"type": "integer",
										"minimum": 1,
										"maximum": 5,
										"description": "Pages to crawl, 1–5 (default 5)"
									}
								},
								"required": [
									"url"
								]
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "OK",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"schemaVersion": {
											"const": "1"
										},
										"tool": {
											"type": "object",
											"properties": {
												"name": {
													"type": "string"
												},
												"version": {
													"type": "string"
												}
											},
											"required": [
												"name",
												"version"
											]
										},
										"target": {
											"type": "object",
											"properties": {
												"input": {
													"type": "string"
												},
												"type": {
													"enum": [
														"directory",
														"file",
														"url",
														"image",
														"cloud"
													],
													"type": "string"
												},
												"kinds": {
													"type": "array",
													"items": {
														"enum": [
															"codebase",
															"url",
															"webapp",
															"container",
															"iac",
															"mobile",
															"cloud"
														],
														"type": "string"
													}
												},
												"root": {
													"type": "string"
												},
												"url": {
													"type": "string"
												},
												"file": {
													"type": "string"
												},
												"image": {
													"type": "string"
												},
												"cloud": {
													"type": "string"
												},
												"technologies": {
													"type": "array",
													"items": {
														"type": "string"
													}
												}
											},
											"required": [
												"input",
												"type",
												"kinds",
												"technologies"
											]
										},
										"startedAt": {
											"type": "string"
										},
										"finishedAt": {
											"type": "string"
										},
										"durationMs": {
											"type": "number"
										},
										"summary": {
											"type": "object",
											"properties": {
												"score": {
													"type": "number"
												},
												"grade": {
													"enum": [
														"A",
														"B",
														"C",
														"D",
														"F"
													],
													"type": "string"
												},
												"counts": {
													"type": "object",
													"properties": {
														"critical": {
															"type": "number"
														},
														"high": {
															"type": "number"
														},
														"medium": {
															"type": "number"
														},
														"low": {
															"type": "number"
														},
														"info": {
															"type": "number"
														}
													},
													"required": [
														"critical",
														"high",
														"medium",
														"low",
														"info"
													]
												},
												"categories": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"category": {
																"enum": [
																	"security",
																	"accessibility",
																	"performance",
																	"seo",
																	"privacy",
																	"best-practices",
																	"reliability",
																	"maintainability",
																	"supply-chain",
																	"compliance"
																],
																"type": "string"
															},
															"score": {
																"type": "number"
															},
															"grade": {
																"enum": [
																	"A",
																	"B",
																	"C",
																	"D",
																	"F"
																],
																"type": "string"
															},
															"counts": {
																"type": "object",
																"properties": {
																	"critical": {
																		"type": "number"
																	},
																	"high": {
																		"type": "number"
																	},
																	"medium": {
																		"type": "number"
																	},
																	"low": {
																		"type": "number"
																	},
																	"info": {
																		"type": "number"
																	}
																},
																"required": [
																	"critical",
																	"high",
																	"medium",
																	"low",
																	"info"
																]
															}
														},
														"required": [
															"category",
															"score",
															"grade",
															"counts"
														]
													}
												},
												"auditors": {
													"type": "object",
													"properties": {
														"passed": {
															"type": "number"
														},
														"failed": {
															"type": "number"
														},
														"skipped": {
															"type": "number"
														},
														"error": {
															"type": "number"
														}
													},
													"required": [
														"passed",
														"failed",
														"skipped",
														"error"
													]
												}
											},
											"required": [
												"score",
												"grade",
												"counts",
												"categories",
												"auditors"
											]
										},
										"results": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"auditor": {
														"type": "string"
													},
													"title": {
														"type": "string"
													},
													"engine": {
														"enum": [
															"builtin",
															"external",
															"agentic"
														],
														"type": "string"
													},
													"categories": {
														"type": "array",
														"items": {
															"enum": [
																"security",
																"accessibility",
																"performance",
																"seo",
																"privacy",
																"best-practices",
																"reliability",
																"maintainability",
																"supply-chain",
																"compliance"
															],
															"type": "string"
														}
													},
													"status": {
														"enum": [
															"passed",
															"failed",
															"skipped",
															"error"
														],
														"type": "string"
													},
													"message": {
														"type": "string"
													},
													"durationMs": {
														"type": "number"
													},
													"findings": {
														"type": "array",
														"items": {
															"type": "object",
															"properties": {
																"ruleId": {
																	"type": "string"
																},
																"title": {
																	"type": "string"
																},
																"severity": {
																	"enum": [
																		"critical",
																		"high",
																		"medium",
																		"low",
																		"info"
																	],
																	"type": "string"
																},
																"category": {
																	"enum": [
																		"security",
																		"accessibility",
																		"performance",
																		"seo",
																		"privacy",
																		"best-practices",
																		"reliability",
																		"maintainability",
																		"supply-chain",
																		"compliance"
																	],
																	"type": "string"
																},
																"message": {
																	"type": "string"
																},
																"location": {
																	"type": "object",
																	"properties": {
																		"file": {
																			"type": "string"
																		},
																		"line": {
																			"type": "number"
																		},
																		"column": {
																			"type": "number"
																		},
																		"url": {
																			"type": "string"
																		},
																		"selector": {
																			"type": "string"
																		}
																	}
																},
																"evidence": {
																	"type": "string"
																},
																"remediation": {
																	"type": "string"
																},
																"references": {
																	"type": "array",
																	"items": {
																		"type": "string"
																	}
																},
																"confidence": {
																	"enum": [
																		"high",
																		"medium",
																		"low"
																	],
																	"type": "string"
																},
																"tags": {
																	"type": "array",
																	"items": {
																		"type": "string"
																	}
																},
																"auditor": {
																	"type": "string"
																},
																"fingerprint": {
																	"type": "string"
																},
																"alsoReportedBy": {
																	"type": "array",
																	"items": {
																		"type": "string"
																	}
																},
																"duplicateOf": {
																	"type": "string"
																}
															},
															"required": [
																"ruleId",
																"title",
																"severity",
																"category",
																"message",
																"auditor",
																"fingerprint"
															]
														}
													}
												},
												"required": [
													"auditor",
													"title",
													"engine",
													"categories",
													"status",
													"durationMs",
													"findings"
												]
											}
										},
										"ai": {
											"type": "object",
											"properties": {
												"model": {
													"type": "string"
												},
												"summary": {
													"type": "string"
												},
												"priorities": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"title": {
																"type": "string"
															},
															"why": {
																"type": "string"
															},
															"fix": {
																"type": "string"
															},
															"fingerprints": {
																"type": "array",
																"items": {
																	"type": "string"
																}
															}
														},
														"required": [
															"title",
															"why",
															"fix",
															"fingerprints"
														]
													}
												}
											},
											"required": [
												"model",
												"summary",
												"priorities"
											]
										}
									},
									"required": [
										"schemaVersion",
										"tool",
										"target",
										"startedAt",
										"finishedAt",
										"durationMs",
										"summary",
										"results"
									],
									"description": "An openaudit report (schemaVersion 1)"
								}
							}
						}
					}
				}
			}
		}
	}
}
