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

# Get Manifest

> Fetch the full manifest JSON for a discovered site.

## `GET /api/sites/:slug/manifest`

Returns the complete manifest for a site — the typed state machine with all states, views, and actions. This is the source of truth for everything the AI discovered.

## Path parameters

<ParamField path="slug" type="string" required>
  The site identifier (e.g., `example-com`). Use `GET /api/sites` to list available slugs.
</ParamField>

## Example

<CodeGroup>
  ```bash Request theme={null}
  curl http://127.0.0.1:8787/api/sites/example-com/manifest
  ```

  ```json Response theme={null}
  {
    "id": "mf_abc123",
    "domain": "example.com",
    "origin": "https://example.com",
    "slug": "example-com",
    "states": [
      {
        "id": "state_1",
        "name": "HomePage",
        "url_pattern": "https://example.com/",
        "views": [
          { "name": "featured_products", "code": "..." }
        ],
        "actions": [
          { "name": "click_login", "inputs": [], "code": "..." }
        ]
      },
      {
        "id": "state_2",
        "name": "LoginPage",
        "url_pattern": "https://example.com/login",
        "views": [],
        "actions": [
          {
            "name": "submit_login",
            "inputs": [
              { "name": "email", "type": "string" },
              { "name": "password", "type": "string" }
            ],
            "code": "..."
          }
        ]
      }
    ]
  }
  ```
</CodeGroup>

## Manifest structure

| Field    | Type     | Description                              |
| -------- | -------- | ---------------------------------------- |
| `id`     | `string` | Unique manifest identifier               |
| `domain` | `string` | Website domain                           |
| `origin` | `string` | Full origin URL                          |
| `slug`   | `string` | URL-safe site identifier                 |
| `states` | `array`  | Page states, each with views and actions |

Each state contains:

| Field         | Type     | Description                                        |
| ------------- | -------- | -------------------------------------------------- |
| `id`          | `string` | Unique state identifier                            |
| `name`        | `string` | Semantic name (e.g., `HomePage`, `LoginPage`)      |
| `url_pattern` | `string` | RFC 6570 URI template for navigating to this state |
| `views`       | `array`  | Data extraction functions (name + code)            |
| `actions`     | `array`  | Interaction functions (name + inputs + code)       |

## Error responses

| Status | Body                       |
| ------ | -------------------------- |
| `404`  | `{ "error": "Not found" }` |

<Note>
  If you receive a 404, the site hasn't been trained yet or the slug is incorrect. Check `GET /api/sites` for available slugs.
</Note>
