API Documentation
SiteHalo provides a REST API to manage sites, trigger scans, retrieve reports, and handle billing. All endpoints require authentication via session cookies (NextAuth.js).
Authentication
All API endpoints (except webhooks) require a valid session cookie obtained by signing in via /auth/signin or registering at /auth/signup. Unauthenticated requests receive a 401 status.
Sites API
/api/sitesList all monitored sites for the authenticated user's organization.
[
{
"id": "cuid...",
"name": "My Website",
"url": "https://example.com",
"status": "ACTIVE",
"checkInterval": 86400,
"healthScore": 87,
"lastScanAt": "2026-07-19T12:00:00.000Z",
"createdAt": "2026-07-01T00:00:00.000Z"
}
]/api/sitesAdd a new site to monitor. Subject to plan limits.
{
"name": "My Website",
"url": "https://example.com",
"checkInterval": 86400 // optional, default: daily
}{
"id": "cuid...",
"name": "My Website",
"url": "https://example.com",
"status": "ACTIVE",
"healthScore": null,
"createdAt": "2026-07-19T12:00:00.000Z"
}/api/sites/:idGet details for a specific site, including recent scans.
{
"id": "cuid...",
"name": "My Website",
"url": "https://example.com",
"status": "ACTIVE",
"scans": [...]
}/api/sites/:idRemove a site and all associated scans and reports.
{ "success": true }Scans API
/api/scansList all scans for the authenticated user's organization.
[
{
"id": "cuid...",
"siteId": "cuid...",
"status": "COMPLETED",
"summary": { "SEO": 85, "PERFORMANCE": 72, ... },
"createdAt": "2026-07-19T12:00:00.000Z",
"completedAt": "2026-07-19T12:00:30.000Z"
}
]/api/scans/triggerTrigger a new scan for a specific site.
{
"siteId": "cuid..."
}{
"id": "cuid...",
"status": "COMPLETED",
"summary": { "SEO": 85, "PERFORMANCE": 72, ... },
"results": [
{
"dimension": "SEO",
"score": 85,
"status": "PASS",
"issues": [...]
}
]
}/api/scans/:idGet full details for a scan, including all dimension results.
{
"id": "cuid...",
"status": "COMPLETED",
"results": [
{
"dimension": "SSL",
"score": 100,
"status": "PASS",
"issues": []
},
...
]
}Reports API
/api/reportsList all generated reports for the authenticated user's organization.
[
{
"id": "cuid...",
"scanId": "cuid...",
"title": "Site Health Report: My Website",
"status": "READY",
"createdAt": "2026-07-19T12:00:30.000Z"
}
]/api/reports/:idGet the full AI-generated report with recommendations.
{
"id": "cuid...",
"title": "Site Health Report: My Website",
"summary": "Overall score: 82% ...",
"fullReport": "# Site Health Report ...",
"status": "READY"
}Billing API
/api/billingGet current subscription details and site usage for the authenticated organization.
{
"plan": { "name": "Starter", "price": 49, "sites": 1 },
"status": "ACTIVE",
"currentPeriodStart": "2026-07-01T00:00:00.000Z",
"currentPeriodEnd": "2026-08-01T00:00:00.000Z",
"cancelAtPeriodEnd": false,
"siteUsage": { "current": 1, "max": 1 }
}/api/stripe/checkoutCreate a Stripe Checkout session to subscribe to a plan.
{
"planId": "PRO"
}{
"url": "https://checkout.stripe.com/..."
}/api/stripe/portalCreate a Stripe Customer Portal session to manage billing.
{
"url": "https://billing.stripe.com/..."
}Need help? Contact us or visit the SiteHalo homepage.