> 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.

# Onboarding analytics

GET https://api.rydhm.ai/v1/agents/{id}/onboarding/analytics

Active users, engine sessions, a funnel per guide with step drop-off, announcement reach, top pages and missing targets.

Needs the experts:read scope. A key without it gets 403 insufficient_scope. Routes not in this reference cannot be called with a key at all (403 not_available_to_api_keys).

Reference: https://docs.rydhm.ai/api-reference/onboarding/analytics

## Authentication

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

## Request

### Path parameters

- `id` (string, required) — The expert id.

### Query parameters

- `days` (enum, optional) — 7, 30 (default) or 90.
  - Allowed values: `7`, `30`, `90`

## Response

### 200

OK

- `days` (integer, optional)
- `from` (datetime, optional)
- `to` (datetime, optional)
- `users` (OnboardingAnalyticsUsers, optional)
- `sessions` (OnboardingAnalyticsSessions, optional)
- `guides` (list of OnboardingAnalyticsGuidesItems, optional)
- `announcements` (list of OnboardingAnalyticsAnnouncementsItems, optional)
- `topPages` (list of OnboardingAnalyticsTopPagesItems, optional)
- `missingTargets` (list of OnboardingAnalyticsMissingTargetsItems, optional)

## Errors

### 401 Unauthorized Error

The key is missing, not valid, disabled or expired (error: invalid_api_key, api_key_disabled, api_key_expired).

- `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

The key lacks a scope (insufficient_scope), may not use this expert (expert_not_allowed), or the route is session-only (not_available_to_api_keys).

- `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

Rate limited; wait Retry-After seconds.

- `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

### OnboardingAnalyticsUsers

- `active` (integer, optional)
- `new` (integer, optional)
- `signed` (integer, optional)

### OnboardingAnalyticsSessions

- `voice` (integer, optional)
- `text` (integer, optional)
- `voiceMinutes` (double, optional)

### OnboardingAnalyticsGuidesItems

- `guideId` (string, optional) — A UUID.
- `name` (string, optional)
- `offered` (integer, optional)
- `started` (integer, optional)
- `completed` (integer, optional)
- `dismissed` (integer, optional)
- `completionRate` (double, optional, nullable)
- `steps` (list of OnboardingAnalyticsGuidesItemsStepsItems, optional)

### OnboardingAnalyticsAnnouncementsItems

- `announcementId` (string, optional) — A UUID.
- `title` (string, optional)
- `shown` (integer, optional)
- `clicked` (integer, optional)
- `dismissed` (integer, optional)
- `clickRate` (double, optional, nullable)

### OnboardingAnalyticsTopPagesItems

- `path` (string, optional)
- `views` (integer, optional)
- `users` (integer, optional)

### OnboardingAnalyticsMissingTargetsItems

- `name` (string, optional)
- `count` (integer, optional)

### 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.

### OnboardingAnalyticsGuidesItemsStepsItems

- `stepId` (string, optional)
- `title` (string, optional)
- `completed` (integer, optional)

## Examples

**Response**

```json
{
  "days": 1,
  "from": "2024-01-15T09:30:00Z",
  "to": "2024-01-15T09:30:00Z",
  "users": {
    "active": 1,
    "new": 1,
    "signed": 1
  },
  "sessions": {
    "voice": 1,
    "text": 1,
    "voiceMinutes": 1.1
  },
  "guides": [
    {
      "guideId": "string",
      "name": "string",
      "offered": 1,
      "started": 1,
      "completed": 1,
      "dismissed": 1,
      "completionRate": 1.1,
      "steps": [
        {
          "stepId": "string",
          "title": "string",
          "completed": 1
        }
      ]
    }
  ],
  "announcements": [
    {
      "announcementId": "string",
      "title": "string",
      "shown": 1,
      "clicked": 1,
      "dismissed": 1,
      "clickRate": 1.1
    }
  ],
  "topPages": [
    {
      "path": "string",
      "views": 1,
      "users": 1
    }
  ],
  "missingTargets": [
    {
      "name": "string",
      "count": 1
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.rydhm.ai/v1/agents/id/onboarding/analytics"

headers = {"Authorization": "Bearer <apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.rydhm.ai/v1/agents/id/onboarding/analytics';
const options = {method: 'GET', headers: {Authorization: 'Bearer <apiKey>'}};

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