Workspaces

Workspaces are project containers scoped to a single target domain. They hold audits, scheduled audits, and custom domain configurations.

Create a workspace

POST /api/workspaces Body
{
  "name": "Acme Production",
  "domain": "acme.example.com"
}
Response (201)
{
  "success": true,
  "data": {
    "workspace": {
      "id": "ws_abc123",
      "name": "Acme Production",
      "domain": "acme.example.com",
      "createdAt": "2026-05-18T12:00:00.000Z"
    }
  }
}

List workspaces

GET /api/workspaces Response (200)
{
  "success": true,
  "data": {
    "workspaces": [
      {
        "id": "ws_abc123",
        "name": "Acme Production",
        "domain": "acme.example.com",
        "auditCount": 47,
        "lastAuditAt": "2026-05-18T14:02:00.000Z",
        "createdAt": "2026-05-01T00:00:00.000Z"
      }
    ]
  }
}

Get a workspace

GET /api/workspaces/{id} Response (200)
{
  "success": true,
  "data": {
    "workspace": {
      "id": "ws_abc123",
      "name": "Acme Production",
      "domain": "acme.example.com",
      "auditCount": 47,
      "customDomain": "audits.acme.com",
      "averageScore": 78,
      "createdAt": "2026-05-01T00:00:00.000Z"
    }
  }
}

Update a workspace

PUT /api/workspaces/{id} Body
{
  "name": "Acme Production (renamed)",
  "customDomain": "reports.acme.com"
}
Only name and customDomain are updatable. The domain field is immutable once the workspace is created. Response (200)
{
  "success": true,
  "data": {
    "workspace": { ... }
  }
}

Delete a workspace

Permanently removes the workspace and all audits, findings, schedules, and reports within it. DELETE /api/workspaces/{id} Response (200)
{
  "success": true,
  "message": "Workspace deleted"
}
This cannot be undone. Running audits in the workspace are immediately terminated. Stored PDFs and recordings are purged.