> For the complete documentation index, see [llms.txt](https://docs.userlane.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.userlane.com/developers/analytics-api/getting-started-with-heart.md). Agents can also search and read this documentation through its [MCP server](https://docs.userlane.com/~gitbook/mcp).

# Getting started with HEART API

All requests go to `https://api.userlane.com/analytics`. For pagination, sorting, empty values, and errors that apply to every Analytics API endpoint, see [Using the Analytics API](https://docs.userlane.com/developers/analytics-api/using-the-analytics-api.md).

## Prerequisites

Before your first call you need:

* **An API token.** Generate one under Settings > API Token in the Userlane Portal. See Authentication below for how to send it.
* **The property ID** of the application you want scores for. This is the same ID shown in the Portal.
* **Analytics collection enabled** for that application. If collection is off, no events reach Userlane, so there is nothing to score.
* **At least one completed day of scores.** Scores are calculated once per day, so a newly onboarded application returns an empty series until the first calculation has run. See Limitations for how gaps are represented.

## Response

HEART is Userlane's product experience score, broken into five dimensions:

* **H**appiness — satisfaction, from in-app CSAT feedback
* **E**fficiency — whether users complete tasks at a workable pace
* **A**doption — whether the people who should be using the application are using it
* **R**isk — whether users are entering data correctly
* **T**ask success — whether users complete what they set out to do

The API returns the overall HEART score alongside each individual letter score, so you can see both the headline number and the underlying drivers.

## Required parameters

`GET /public/v2/heart/property_id/{propertyId}`

| Parameter    | In    | Required | Notes                                                                                   |
| ------------ | ----- | -------- | --------------------------------------------------------------------------------------- |
| `propertyId` | path  | Yes      | Lowercase alphanumeric.                                                                 |
| `start`      | query | Yes      | First day of the window, inclusive. ISO date, or an ISO datetime whose time is ignored. |
| `end`        | query | Yes      | Last day of the window, inclusive. Must not be earlier than `start`.                    |
| `page`       | query | No       | Defaults to 1.                                                                          |
| `limit`      | query | No       | Defaults to 1000, maximum 5000.                                                         |

Both dates are required. There is no "all time" default: omitting either one is rejected rather than widened. An `Authorization` header is required on every call.

```
GET https://api.userlane.com/analytics/public/v2/heart/property_id/1234?start=2026-06-01&end=2026-08-30
Authorization: Bearer YOUR_API_TOKEN
```

## Typical use cases

* **Experience health over time** — Track HEART daily or weekly to spot trends before they hit support tickets.
* **Driver analysis** — Which letter (H, E, A, R, T) is moving the overall score? Identify what to fix.
* **Cross-application benchmarking** — Compare HEART across multiple Userlane properties or business units in one view.
* **Release impact** — Correlate HEART movements with releases, campaigns, or onboarding changes.

## How HEART is calculated

All five dimensions are calculated on a rolling **90-day window**. If you request a given day's score, the underlying calculation uses activity from the 90 days ending on that day. This smoothing means HEART is a leading indicator of experience trends, not a real-time metric — it's designed to be checked on a daily or weekly cadence rather than continuously.

Because every day in the response covers its own trailing 90 days, consecutive days overlap heavily and the series moves gradually. Read it as a trend line rather than as daily readings.

### One input is not windowed

Adoption includes License utilisation, which compares the users active in the window against the number of licensed users configured for the application. That licence count is the **current** configured value, not a historical one, because it is not recorded per day.

The practical consequence: if you change the configured licence count, previously exported days keep the value that was in effect when each of those days was calculated. So Adoption is not perfectly reproducible across a licence change, while the other four dimensions are.

### Where a day's data is drawn from

| Dimension    | Calculated from                                                           |
| ------------ | ------------------------------------------------------------------------- |
| Happiness    | CSAT responses in the 90-day window                                       |
| Efficiency   | Task completions in the 90-day window                                     |
| Adoption     | Sessions in the 90-day window, plus the current licence count (see above) |
| Risk         | Monitored data entries in the 90-day window                               |
| Task success | Task starts and completions in the 90-day window                          |
| users        | Distinct users with a session in the 90-day window                        |
| sessions     | Sessions in the 90-day window                                             |

### The overall score is weighted

The overall HEART score is a weighted mean of the five letters, not a straight average:

| Dimension    | Weight |
| ------------ | ------ |
| Happiness    | 10     |
| Efficiency   | 20     |
| Adoption     | 30     |
| Risk         | 15     |
| Task success | 25     |

Every score, including the overall one, is an integer on a 0 to 100 scale, and higher is always better. That includes Risk, which reports the share of monitored data entries that were **compliant**.

### Missing dimensions do not count as zero

A dimension with no input data for the window is returned as `null`, and its weight is spread across the dimensions that do have data. For example, an application with no CSAT responses yet returns `"happiness": null`, and its overall score is the weighted mean of the remaining four dimensions.

This is deliberate. Scoring a missing dimension as zero would make the headline number look like a problem with the application rather than an absence of data.

## Limitations

* **Complete days only.** The current day is still being calculated, so only complete days are returned. If your requested `end` reaches into today, the response comes back with `end` pulled back to yesterday, so it always states the window it actually covered.
* **Gaps are omitted, not null-filled.** A day for which no snapshot was produced is absent from `heartData`. A window reaching back before scores were first calculated for your application therefore returns a shorter series than the window implies, and the earliest available date can differ between applications.
* **Two-year retention.** Days older than two years are not available.
* **Both dates are required.** `start` and `end` must both be supplied, and `start` must not be later than `end`.
* **Pagination.** Up to 5,000 days per page, 1,000 by default. The default already covers the full two-year retention window, so pagination is not normally needed.
* **Pull cadence.** Once every 24 hours is recommended. Pulling more frequently won't give you fresher data and may trigger rate limiting.
* **Rate limiting.** Userlane can limit call frequency to maintain quality of service.

## Error handling

| Status                     | What happened                                                      |
| -------------------------- | ------------------------------------------------------------------ |
| `401 Unauthorized`         | The API token is missing, malformed, expired, or has been revoked. |
| `422 Unprocessable Entity` | One or more parameters failed validation.                          |
| `429 Too Many Requests`    | You exceeded the rate limit. See Retrying below.                   |

A `401` returns a single message:

```json
{ "detail": "Not authenticated" }
```

A `422` returns one entry per parameter that failed, naming the parameter and the reason:

```json
{
  "detail": [
    {
      "type": "missing",
      "loc": ["query", "start"],
      "msg": "Field required",
      "input": null
    }
  ]
}
```

The usual causes of a `422` are an omitted `start` or `end`, a `start` later than the `end`, a date that cannot be parsed, a `propertyId` that is not lowercase alphanumeric, or a `page` or `limit` outside its allowed range.

### An empty result is not an error

Three cases return `200` with an empty `heartData` rather than an error, so check the array rather than relying on the status code:

* The property has no scores in the requested window, or the property ID does not exist.
* The window is entirely in the future, or covers only today. Only complete days are served, so there is nothing to return, and the window is echoed back as you sent it.
* Individual dimensions may be `null` on a row that otherwise has data. That is normal and is described under "Missing dimensions do not count as zero" above.

### Retrying

Exceeding the rate limit returns `429 Too Many Requests` until the limit resets. Because scores only change once a day, a single daily call per application stays well clear of it.

Two things to handle in your client:

* **The `429` body is HTML, not JSON.** It is produced by the gateway before your request reaches the API, so it does not follow the `{"detail": ...}` shape the other errors use. Branch on the status code before attempting to parse the body, or a rate-limited response will surface as a parse error rather than as a rate-limit error.
* **No `Retry-After` header is sent.** Choose your own backoff rather than waiting for a server hint. Exponential backoff starting around a second is appropriate.

Retrying is always safe: requests are read-only and the same window returns the same result.

### Reporting a problem

Responses from the API carry an `x-request-id` header. Quote it when contacting support, since it identifies the specific request in our logs.

## Authentication

This API is protected and requires authentication by a Bearer Token. You can generate your token under Settings > API Token in the Userlane Portal.

## Coming from the earlier HEART API

This is a second, independent version of the HEART API. The earlier one (`/public/heart/property_id/{property_id}`) continues to work and is unchanged.

If you already pull from `/public/heart/property_id/{property_id}`, the v2 endpoint is `/public/v2/heart/property_id/{property_id}`. The response envelope is the same, and two columns are renamed: `engagement` becomes `efficiency`, and `retention` becomes `risk`.

The values are **not** a continuation of your existing series. Four of the five dimensions are measured differently here, and the overall score is weighted where the earlier one was a straight average. Task success is the only dimension whose definition is unchanged.

| Earlier version | This version  | What changed                                                                                                     |
| --------------- | ------------- | ---------------------------------------------------------------------------------------------------------------- |
| `happiness`     | `happiness`   | Was NPS and survey scores combined; now the share of CSAT responses rating 4 or 5                                |
| `engagement`    | `efficiency`  | Was the share of sessions that were engaged; now how consistently users complete tasks close to the typical time |
| `adoption`      | `adoption`    | Was page coverage against a 24-month baseline; now License utilisation, engaged user rate, and user persistence  |
| `retention`     | `risk`        | Was average daily stickiness; now the share of monitored data entries that were compliant                        |
| `taskSuccess`   | `taskSuccess` | Unchanged: task completions over task starts                                                                     |
| `heart`         | `heart`       | Was an unweighted average of the available dimensions; now weighted 10/20/30/15/25                               |

Two practical consequences:

* Expect a step change in reported values on the day you switch.
* Keep any history you have already collected as a separate series, rather than appending v2 rows to it.

## Next steps

* Try a request from the API reference for `/public/v2/heart/property_id/{property_id}`
* To understand which features are being used, see [Getting started with Tags](https://docs.userlane.com/developers/analytics-api/getting-started-with-tags.md)
* To see how users move through your key flows, see [Getting started with the Tasks API](https://docs.userlane.com/developers/analytics-api/getting-started-with-tasks.md)
* For separate feedback channels you run yourself, see [Getting started with NPS responses](https://docs.userlane.com/developers/analytics-api/getting-started-with-nps-responses.md) and [Getting started with Survey responses](https://docs.userlane.com/developers/analytics-api/getting-started-with-survey-responses.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.userlane.com/developers/analytics-api/getting-started-with-heart.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
