> ## Documentation Index
> Fetch the complete documentation index at: https://developer.lofty.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Website

> Read your Lofty website's traffic and audit facts, add Feature Areas, and change page SEO through the API.

The Website API works on the agent's own Lofty website. It has four parts: a read-only site audit, the traffic report shown in the CRM, Feature Areas (AI-generated community pages) and page SEO.

## Who can call it

Only two kinds of callers can use these endpoints:

* Website-only (Lofty Front) agents
* Sites on the Hyperlocal Website package

Every other caller gets HTTP 403 with code `403001`. A caller with no primary website gets `404001`.

Every endpoint works on the caller's **primary website**. The analytics endpoints also accept a `siteId`, for agents with more than one site. The site must belong to the caller, or the call fails with `403002`.

## How the parts fit together

| Part | Endpoints | Use it to |
| - | - | - |
| Site audit | `GET /v2.0/website/audit/*` (7 sections) | Read facts about the site: pages and their SEO fields, navigation, robots/sitemap/llms files, integrations |
| Traffic analytics | `GET /v2.0/website/analytics/*` (8 charts) | Measure visitors, page views and sources, the same numbers as the CRM Traffic Report |
| Page SEO | `PUT /v2.0/website/pages/seo` | Change the SEO title, meta description and keywords of up to 10 pages |
| Feature Areas | `/v2.0/website/featureAreas` | List, read and create neighborhood or city pages |

A typical flow:

1. Find problems with the audit.
2. Use analytics to see how much traffic the affected pages get.
3. Fix the pages with page SEO, or add Feature Areas.
4. Check the result in analytics later.

## Site audit

The audit reports facts and doesn't score them. Drawing conclusions is up to you.

Every section returns the same wrapper:

```json theme={null}
{
  "section": "pages",
  "siteId": 123456,
  "generatedAt": 1780000000000,
  "partial": false,
  "data": { }
}
```

`partial` is `true` when part of the section could not be fetched, such as a technical file or a page whose live fetch failed. The affected item carries `fetchError` with the reason.

> [!WARNING]
>
> On a page item, `null` means "not checked this time", not "none". If the live page could not be fetched, `h1`, `h1Count`, `hasSchema` and `schemaTypes` are `null`. Only `0`, `false` or `[]` mean the live page really has none.

A `fetchError` starting with `redirected to another domain` means the page's URL redirects off the site. Treat that as a problem in itself, and don't read the other site's content as this site's.

[Audit pages](https://developer.lofty.com/api-reference/website/audit-pages.md) lists only the site's menu pages, the same pages as the CMS **SEO → Page SEO** table, up to 100. Feature Area pages, landing pages and blog posts aren't listed. [Audit structure](https://developer.lofty.com/api-reference/website/audit-structure.md) has the site-wide page counts.

## Raw templates and rendered values

SEO fields can contain template variables such as `{{Company Name}}` or `{{Brand Name}}`. An audit page item carries both versions:

| Field | Holds |
| - | - |
| `title`, `description` | The value shown on the live page, with variables filled in |
| `rawTitle`, `rawDescription`, `rawKeywords` | The saved template, with variables as they are |

A variable that is still in braces in `title` or `description` is one the audit could not fill. The live page may show the same text or a fallback value.

> [!WARNING]
>
> [Update page SEO](https://developer.lofty.com/api-reference/website/update-page-seo.md) takes **raw templates**. Start from `rawTitle` / `rawDescription` / `rawKeywords`, and keep every variable exactly as it is. If you write back the rendered text, the variable is replaced by fixed text for good.

To change a value that comes from a variable, change its source instead, for example the company name in the CRM.

## Page SEO

`PUT /v2.0/website/pages/seo` changes 1–10 pages per call. Each page is listed once by its `pageId`, the `pageId` of an item from [Audit pages](https://developer.lofty.com/api-reference/website/audit-pages.md).

* Send only the fields you want to change. An empty string clears a field.
* Limits: `title` up to 255 characters, `description` up to 1000, `keywords` up to 500 (comma separated).
* Values must not contain `<`, `>` or `"`.

```json theme={null}
{
  "pages": [
    { "pageId": 123456, "title": "{{Brand Name}} | Homes for Sale in Austin" }
  ]
}
```

Each page gets its own result, and pages are not rolled back together:

| `status` | Meaning |
| - | - |
| `updated` | Changed. `before` and `after` hold the raw values. |
| `not_found` | No such page on the site |
| `not_supported` | A shared neighborhood template page, which can't be changed here |
| `failed` | The change failed |

## Feature Areas

A Feature Area is a neighborhood or city community page that Lofty writes with AI. Each one has three sub-pages: intro, listing search and market.

When you [create a Feature Area](https://developer.lofty.com/api-reference/website/create-a-feature-area.md), Lofty generates the intro (this takes several seconds) and publishes the three pages. Detail and FAQ content and the cover picture are generated afterwards in the background.

| `type` | Area | Needs `neighborhood` |
| - | - | - |
| `0` | City | No |
| `1` | Subdivision | Yes |
| `2` | Community | Yes |
| `4` | Neighborhood | Yes |
| `5` | SubArea | Yes |

`city` and `type` are always required. `displayName` replaces the neighborhood name on the website.

> [!NOTE]
>
> Creating a Feature Area publishes pages on a public website. The call fails with `422001` when the same area already exists or the site has reached its Feature Area limit. The `message` says which.

## Traffic analytics

All eight charts take the same optional query parameters:

| Parameter | Default | Notes |
| - | - | - |
| `startDate` | 29 days before `endDate` | `yyyy-MM-dd`, in the agent's CRM time zone |
| `endDate` | Today | `yyyy-MM-dd` |
| `siteId` | The primary website | Must be a site the caller owns |

The period is at most 365 days. [Website traffic overview](https://developer.lofty.com/api-reference/website/website-traffic-overview.md) returns the change rate against the previous period. The previous value itself isn't available yet and is `null`.

## Errors

| Code | Meaning |
| - | - |
| `400001` | A parameter is missing or invalid. `message` names it. |
| `403001` | The caller is neither a website-only agent nor on a Hyperlocal site (HTTP 403) |
| `403002` | The `siteId` doesn't belong to the caller |
| `404001` | The caller has no primary website |
| `404002` | The Feature Area doesn't exist on the caller's site |
| `404003` | The page doesn't exist on the caller's site |
| `422001` | The website refused the request, for example the area already exists or the limit is reached. `message` says why. |
| `501001` | The capability isn't available yet |
| `100000` | The website service could not be reached (HTTP 502). Retry later. |
| `502001` | The website service failed unexpectedly (HTTP 502). Retry later. |

## Related resources

> [card] [Website API Reference](https://developer.lofty.com/api-reference/website/audit-overview.md)
>
> Full endpoint documentation with parameters and responses.

> [card] [search\_site\_audit](https://developer.lofty.com/mcp/tools/search-site-audit.md)
>
> The same audit through the Lofty MCP server.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.