> 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-tasks.md). Agents can also search and read this documentation through its [MCP server](https://docs.userlane.com/~gitbook/mcp).

# Getting started with the Tasks API

This page will help you get started with the Tasks 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).

The Tasks API gives you task adoption data for your application in JSON, so you can pull it into your BI tool of choice (Power BI, Tableau, Looker, etc.) and track completion trends alongside your own KPIs.

There are two endpoints, serving two levels of detail:

* **Aggregated task progress** — per-user, per-day summary of starts, completions, and time to complete, across all tasks in a property. Use this for completion rates and trends.
* **Task actions** — the raw, step-by-step event stream for a single task. Use this to see exactly where users progress or drop off within one task.

Most reporting starts with the aggregated endpoint to find the tasks worth investigating, then uses the actions endpoint to understand the drop-off inside a specific task.

## Aggregated task progress

`GET /public/tasks/property_id/{propertyId}/aggregated`

Each row represents one user, one task, on one day:

* **starts** — how many times the user started the task that day
* **completions** — how many times the user completed it that day
* **totalTimeToComplete** — total seconds spent on completions that day, or null if the task was not completed

Each row also carries the `date`, the `taskId`, and the user's `id` and `applicationUserId`.

Typical use cases:

* **Completion rates over time** — Track how many users finish a task versus how many start it.
* **Drop-off detection** — Spot tasks with high starts but low completions, the ones costing users the most effort.
* **Time-to-complete analysis** — See which tasks take longest to finish and prioritise the friction.
* **Cross-application benchmarking** — Compare task adoption across multiple properties or business units in one view.

### Calculating metrics

To reproduce the figures shown in the Userlane Portal, aggregate the rows and use these formulas.

Completion rate is total completions divided by total starts:

`Completion Rate = sum(completions) / sum(starts)`

This is an event-based rate, not a per-user rate. The two differ when users start a task several times before finishing.

Average time to complete is total completion time divided by the number of completions:

`Avg Time to Complete = sum(totalTimeToComplete) / sum(completions)`

Divide by total completions, not by the number of rows, because `totalTimeToComplete` already holds the combined time when a user completes a task more than once in a day.

## Task actions

`GET /public/tasks/property_id/{propertyId}/task/{taskId}/actions`

This endpoint returns the raw action events for a single task, identified by `taskId` in the path. Each event is one action a user took, in sequence, so you can reconstruct the funnel through a task.

Each event carries:

* **actionId** and **actionIndex** — which action it is, and its position in the task definition
* **actionType** — the kind of action (for example `page_load`, `click`, `input`)
* **taskActionsMaxIndex** — the highest action index defined for the task, useful for measuring how far through a user reached
* **taskVersion** — the version of the task definition the event belongs to
* **serverTime** — when the action was recorded (UTC, millisecond precision)
* **appSessionId** and **url** — the in-app session and the page where it happened
* the user's `id` and `applicationUserId`

Typical use cases:

* **Funnel analysis** — Count users at each `actionIndex` to see exactly which step they abandon.
* **Step timing** — Use `serverTime` to measure how long users spend between actions.
* **Version comparison** — Compare behaviour across task versions using `taskVersion`.

This endpoint covers one task at a time. To analyse several tasks, call it once per `taskId`.

## Date handling

For both endpoints, `start` and `end` are treated as inclusive UTC calendar dates. The time-of-day portion of the timestamp is ignored, so `end=2026-06-18T00:00:00Z` and `end=2026-06-18T23:59:59Z` return the same data: all of 18 June. To include a given day, set `end` to that day. Days with no activity simply do not appear in the response.

For **task actions**, the window must start no more than 31 days in the past. The aggregated endpoint has no such limit.

## Pagination

Both endpoints use cursor-based pagination. This differs from the page-based model used by some other Userlane APIs; there is no `page` parameter.

1. Send the first request without a `cursor`.
2. Read `pagination.nextCursor` from the response.
3. Send the next request with that value as the `cursor` parameter.
4. Repeat until `nextCursor` is `null`, which marks the final page.

The cursor is opaque: do not build, parse, or modify it, pass back exactly what you received, and always use the most recent value. Page size is controlled by `limit` (default 1,000, maximum 5,000).

## Limitations

* Pagination: Up to 1,000 records per page by default (maximum 5,000). Paginate for longer ranges using the cursor.
* Task names: Not included in either endpoint. Join `taskId` to a task export from the Userlane Portal to add readable names.
* Internal accounts: Internal and test accounts are included in the data, matching the Portal. Filter them in your BI tool for customer-only figures, noting this will make your totals differ from the Portal.
* Pull cadence: Once every 24 hours is recommended. Pulling the same window more than once in 24 hours can produce duplicate events, and may trigger rate limiting.
* Rate limiting: Userlane can limit the frequency of calls to ensure a certain Quality of Service by rate limiting.

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

## Next steps

* To understand overall product experience health, see [Getting started with HEART API](https://docs.userlane.com/developers/analytics-api/getting-started-with-heart.md)
* To understand which features are being used, see [Getting started with Tags](https://docs.userlane.com/developers/analytics-api/getting-started-with-tags.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-tasks.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.
