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

# API reference

> Reference for Momentic's external analytics endpoints.

Use this reference to read external analytics data from Momentic. These
endpoints are read-only, scoped to the org that owns the API key, and return
completed runs only.

## Base URL

| Environment | URL                       |
| ----------- | ------------------------- |
| Production  | `https://api.momentic.ai` |

## Authentication

Send the API key in an `Authorization` header on every request.

```bash theme={null}
Authorization: Bearer $MOMENTIC_API_KEY
```

Create or manage keys in [API keys and team](/account/api-keys-and-team).

## Shared request rules

* All endpoints in this reference use `GET`.
* All endpoints return completed runs only.
* Multi-value query params are comma-separated. Whitespace around commas is
  trimmed.
* `startDate` and `endDate` are optional ISO-8601 datetimes. The window may not
  exceed 92 days; wider windows return
  `400 {"error": "Date window must not exceed 92 days."}`.
* Invalid query params return `400 {"error": "Invalid query: <detail>"}`.
* If `startDate >= endDate`, the API returns
  `400 {"error": "Start date must be before end date."}`.

## Pagination

List endpoints use cursor (keyset) pagination, which stays fast on deep pages.

* Pass `pageSize` (max 100, default 20) to size each page.

* Each response includes a `pagination` object:

  ```json theme={null}
  {
    "pageSize": 20,
    "hasMore": true,
    "nextCursor": "eyJmIjoxLi4ufQ",
    "total": null
  }
  ```

* To fetch the next page, pass the returned `nextCursor` back as the `cursor`
  query param. When `hasMore` is `false`, `nextCursor` is `null`.

* `total` is `null` unless you pass `includeTotal=true`, which adds an exact
  match count at the cost of an extra aggregation. Use `hasMore` for simple "is
  there more?" checks instead.

* Cursors are opaque; do not construct or parse them. An invalid cursor returns
  `400 {"error": "Invalid cursor."}`.

## Enum values

| Field           | Values                             |
| --------------- | ---------------------------------- |
| `status`        | `PASSED`, `FAILED`, `CANCELLED`    |
| `trigger`       | `WEBHOOK`, `CRON`, `MANUAL`, `CLI` |
| `executionType` | `WEB`, `IOS`, `ANDROID`            |

## Platform filtering

`executionType` matches the run platform stored on each completed run. For run
groups, a group matches when at least one run in the group matches the requested
platform. For example, `executionType=IOS,ANDROID` returns mobile run groups.

## Endpoints

Use the Analytics API section in the sidebar for the endpoint reference.
