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

# Public Agent Pages

> Unauthenticated endpoints for loading and requesting access to Agent Pages.

<Warning>
  Agent Pages are deprecated. Use [Public Genies](/api-reference/public-genies) for new integrations.
</Warning>

These routes use `resource: "agent-pages"` and require **no API key**. They serve the legacy Agent Page embed and access-request flow.

***

## Actions

### `url`

Loads an Agent Page by its URL slug. Returns the full page record with the joined Genie data. Validates access for private Genies via an access token header.

**Parameters**

| Field      | Type   | Required | Description                |
| ---------- | ------ | -------- | -------------------------- |
| `url_name` | string | Yes      | URL slug of the Agent Page |

**Headers**

| Header                 | Description                                                                 |
| ---------------------- | --------------------------------------------------------------------------- |
| `X-Agent-Access-Token` | Access grant token for private Genies. Required if the Genie is not public. |

**Response**

```json theme={null}
{
  "agentPage": {
    "id": "page-uuid",
    "url_name": "support-bot",
    "welcome_message": "How can I help you today?",
    "info_links": [ ],
    "agents": {
      "id": "agent-uuid",
      "name": "Support Genie",
      "elevenlabs_id": "el-agent-id",
      "settings": { },
      "branding": { },
      "is_active": true,
      "is_public": true
    }
  }
}
```

**Private Genie error** (when Genie is not public and no valid token):

```json theme={null}
{
  "success": false,
  "error": {
    "code": "GENIE_PRIVATE",
    "message": "This Genie is private",
    "status": 403,
    "genieName": "Support Genie"
  }
}
```

Access tokens are validated against `agent_access_grants`. Each valid use increments the grant's `use_count`.

***

### `request-access`

Submits an access request for a private Agent Page. Notifies the Genie owner by email. If the requester does not have a HelpGenie account, one is created automatically with a welcome email and set-password link.

**Parameters**

| Field      | Type   | Required | Description                |
| ---------- | ------ | -------- | -------------------------- |
| `url_name` | string | Yes      | URL slug of the Agent Page |
| `email`    | string | Yes      | Requester's email address  |

**Response**

```json theme={null}
{ "success": true }
```

Only valid for private Genies (`is_public: false`). Returns `VALIDATION_ERROR` if the Genie is already public.

***

## Error codes

| Code               | Meaning                                                 |
| ------------------ | ------------------------------------------------------- |
| `VALIDATION_ERROR` | Missing required parameter or Genie is already public   |
| `NOT_FOUND`        | Agent Page not found                                    |
| `GENIE_PRIVATE`    | Genie is private and no valid access token was provided |
| `FORBIDDEN`        | Access denied                                           |
| `INTERNAL_ERROR`   | Unexpected server error                                 |
