Sites API

Manage your AI Search sites programmatically. Create sites, update settings, and configure public access.

List Sites

GET /organisations/{orgId}/ai-search/sites

Returns all sites in your organization.

Response:

{
  "sites": [
    {
      "siteId": "site_abc123",
      "name": "Documentation",
      "baseUrl": "https://docs.example.com",
      "status": "ready",
      "pageCount": 150,
      "lastCrawledAt": 1702500000,
      "createdAt": 1702400000
    }
  ]
}

Get Site

GET /organisations/{orgId}/ai-search/sites/{siteId}

Returns details for a specific site, including configuration and statistics.

Create Site

POST /organisations/{orgId}/ai-search/sites

{
  "name": "Documentation",
  "baseUrl": "https://docs.example.com",
  "crawlerConfig": {
    "maxPages": 1000,
    "maxDepth": 5,
    "respectRobotsTxt": true
  }
}

Parameters

FieldTypeRequiredDescription
namestringYesDisplay name for the site
baseUrlstringYesRoot URL to crawl
crawlerConfigobjectNoCrawler configuration (see below)

Crawler Config

FieldTypeDefaultDescription
maxPagesinteger100Maximum pages to crawl
maxDepthinteger3Maximum link depth
respectRobotsTxtbooleantrueHonor robots.txt rules
excludePatternsstring[][]URL patterns to skip
includePatternsstring[][]Only crawl matching URLs
javascriptEnabledbooleanfalseRender JavaScript (for SPAs)

Response:

{
  "siteId": "site_abc123",
  "name": "Documentation",
  "baseUrl": "https://docs.example.com",
  "status": "pending",
  "pageCount": 0,
  "createdAt": 1702500000
}

Update Site

PUT /organisations/{orgId}/ai-search/sites/{siteId}

{
  "name": "Updated Name",
  "publicAccess": {
    "enabled": true,
    "searchEnabled": true,
    "chatEnabled": true,
    "allowedDomains": ["example.com", "*.example.com"]
  },
  "rateLimits": {
    "searchPerMinute": 100,
    "chatPerMinute": 30,
    "perIpPerMinute": 20
  }
}

Update site name, public access settings, or rate limits. Only include fields you want to change.

The PUT body also accepts metadataSchema (custom fields for facets/filters),tagBoosts and urlBoosts (query-time score multipliers — seeResult Boosts). Pass an empty array to clear.

Delete Site

DELETE /organisations/{orgId}/ai-search/sites/{siteId}

Permanently deletes a site and all its indexed content. This action cannot be undone.

Site Status

StatusDescription
pendingSite created, no content indexed yet
readyContent indexed and searchable
errorLast crawl failed (check lastError)