> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.rydhm.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.rydhm.ai/_mcp/server.

# Report what a page shows, for the app map

POST https://api.rydhm.ai/v1/engine/page-inventory
Content-Type: application/json

Sent by the SDK when bootstrap says learnPages: headings, navigation, buttons, tabs, same-site links and form-field labels, names only. 202. Refused (403 app_map_off) when the expert does not learn an app map. Like the events beacon, the key may come as ?key= or a body key, with a text/plain body.

A publishable key (Authorization: Bearer rydhm_pk_…), from one of the key’s allowed websites: the Origin header must be on its list. Never a secret API key (401 secret_key_not_allowed). Rate limited per visitor and per key.

Reference: https://docs.rydhm.ai/api-reference/engine/post-page-inventory

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Body (application/json)

This endpoint expects an EnginePageInventoryRequest.

- `path` (string, required) — The page’s path; ids are generalised by the server (/projects/42 → /projects/*).
- `items` (list of EnginePageInventoryRequestItemsItems, required)
- `title` (string, optional, nullable)
- `key` (string, optional) — The publishable key, when sent as a beacon (text/plain body; also accepted as ?key=).
- `teach` (string, optional) — Teach mode: the teach token (rydhm_pv_…). Not throttled; refused (403 teach_token_invalid) when the token or its session is no longer valid.
- `text` (list of string, optional) — Teach mode only: the screen’s own words, one line each (# Heading, [Button], plain text of at most 300 characters). Checked again with the app map’s privacy filters; at most 3000 characters are kept, and on a record’s page only headings and actions.

## Response

### 202

OK

- `accepted` (boolean, optional)
- `screens` (integer, optional) — Teach mode: the screens this teach session has learned so far.

## Errors

### 401 Unauthorized Error

The publishable key is missing, not valid or revoked (invalid_publishable_key), or a secret API key was sent (secret_key_not_allowed).

- `statusCode` (integer, required)
- `message` (string, required)
- `error` (string, optional) — A stable code such as insufficient_scope, expert_not_allowed, rate_limited, plan_limit, payment_required.
- `code` (string, optional) — The stable code on the refusals that carry it here instead of in `error`: stale_edit (409 on an expert save).
- `requestId` (string, optional) — The X-Request-Id of the call, to quote to support.
- `upgradeHint` (ErrorUpgradeHint, optional) — On 402 payment_required and 403 plan_limit: what fixes it.
- `requiredScopes` (list of string, optional) — On 403 insufficient_scope: what the route needs.
- `missingScopes` (list of string, optional)
- `retryAfterSeconds` (integer, optional) — On 429: how long to wait.
- `retryAt` (datetime, optional, nullable)
- `timeZone` (string, optional, nullable)
- `localTime` (string, optional, nullable)
- `state` (string, optional, nullable)
- `exceptionsAllowed` (boolean, optional) — On 400 outside_calling_hours: whether `callingHoursException` may be sent.

### 403 Forbidden Error

app_map_off: this expert does not learn an app map. teach_token_invalid: the teach link is no longer valid.

- `statusCode` (integer, required)
- `message` (string, required)
- `error` (string, optional) — A stable code such as insufficient_scope, expert_not_allowed, rate_limited, plan_limit, payment_required.
- `code` (string, optional) — The stable code on the refusals that carry it here instead of in `error`: stale_edit (409 on an expert save).
- `requestId` (string, optional) — The X-Request-Id of the call, to quote to support.
- `upgradeHint` (ErrorUpgradeHint, optional) — On 402 payment_required and 403 plan_limit: what fixes it.
- `requiredScopes` (list of string, optional) — On 403 insufficient_scope: what the route needs.
- `missingScopes` (list of string, optional)
- `retryAfterSeconds` (integer, optional) — On 429: how long to wait.
- `retryAt` (datetime, optional, nullable)
- `timeZone` (string, optional, nullable)
- `localTime` (string, optional, nullable)
- `state` (string, optional, nullable)
- `exceptionsAllowed` (boolean, optional) — On 400 outside_calling_hours: whether `callingHoursException` may be sent.

### 429 Too Many Requests Error

Teach mode: too many screens from one teach link at once.

- `statusCode` (integer, required)
- `message` (string, required)
- `error` (string, optional) — A stable code such as insufficient_scope, expert_not_allowed, rate_limited, plan_limit, payment_required.
- `code` (string, optional) — The stable code on the refusals that carry it here instead of in `error`: stale_edit (409 on an expert save).
- `requestId` (string, optional) — The X-Request-Id of the call, to quote to support.
- `upgradeHint` (ErrorUpgradeHint, optional) — On 402 payment_required and 403 plan_limit: what fixes it.
- `requiredScopes` (list of string, optional) — On 403 insufficient_scope: what the route needs.
- `missingScopes` (list of string, optional)
- `retryAfterSeconds` (integer, optional) — On 429: how long to wait.
- `retryAt` (datetime, optional, nullable)
- `timeZone` (string, optional, nullable)
- `localTime` (string, optional, nullable)
- `state` (string, optional, nullable)
- `exceptionsAllowed` (boolean, optional) — On 400 outside_calling_hours: whether `callingHoursException` may be sent.

## Types

### EnginePageInventoryRequestItemsItems

- `kind` (enum, required)
  - Allowed values: `heading`, `nav`, `button`, `tab`, `link`, `field`
- `name` (string, required) — The visible or accessible name; a form field by its label only.
- `selector` (string, optional, nullable)
- `path` (string, optional, nullable)

### ErrorUpgradeHint

On 402 payment_required and 403 plan_limit: what fixes it.

- `action` (enum, optional)
  - Allowed values: `top_up`, `upgrade`, `contact`
- `planCode` (string, optional) — The smallest plan that allows it, when action is upgrade.
- `href` (string, optional) — Where to go in the app.

## Examples

**Request**

```json
{
  "path": "string",
  "items": [
    {
      "kind": "heading",
      "name": "string"
    }
  ]
}
```

**Response**

```json
{
  "accepted": true,
  "screens": 1
}
```

**SDK Code**

```python
import requests

url = "https://api.rydhm.ai/v1/engine/page-inventory"

payload = {
    "path": "string",
    "items": [
        {
            "kind": "heading",
            "name": "string"
        }
    ]
}
headers = {
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.rydhm.ai/v1/engine/page-inventory';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: '{"path":"string","items":[{"kind":"heading","name":"string"}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```