---
title: "Retrieve Release Health Session Statistics"
url: https://docs.sentry.io/api/releases/retrieve-release-health-session-statistics/
---

# Retrieve Release Health Session Statistics | Sentry Docs

GET /api/0/organizations/{organization\_id\_or\_slug}/sessions/

Returns a time series of release health session statistics for projects bound to an organization.

The interval and date range are subject to certain restrictions and rounding rules.

The date range is rounded to align with the interval, and is rounded to at least one hour. The interval can at most be one day and at least one hour currently. It has to cleanly divide one day, for rounding reasons.

Because of technical limitations, this endpoint returns at most 10000 data points. For example, if you select a 90 day window grouped by releases, you will see at most `floor(10k / (90 + 1)) = 109` releases. To get more results, reduce the `statsPeriod`.

### Path Parameters

* `organization_id_or_slug` *(string)*

  REQUIRED

  The ID or slug of the organization the resource belongs to.

### Query Parameters:

* `field` *(array(string))*

  REQUIRED

  The list of fields to query.

  The available fields are

  * `sum(session)`
  * `count_unique(user)`
  * `avg`, `p50`, `p75`, `p90`, `p95`, `p99`, `max` applied to `session.duration`. For example, `p99(session.duration)`. Session duration is [no longer being recorded](https://github.com/getsentry/sentry/discussions/42716) as of on Jan 12, 2023. Returned data may be incomplete.
  * `crash_rate`, `crash_free_rate` applied to `user` or `session`. For example, `crash_free_rate(user)`

* `start` *(string)*

  The start of the period of time for the query, expected in ISO-8601 format. For example, `2001-12-14T12:34:56.7890`.

* `end` *(string)*

  The end of the period of time for the query, expected in ISO-8601 format. For example, `2001-12-14T12:34:56.7890`.

* `environment` *(array(string))*

  The name of environments to filter by.

* `statsPeriod` *(string)*

  The period of time for the query, will override the start & end parameters, a number followed by one of:

  * `d` for days
  * `h` for hours
  * `m` for minutes
  * `s` for seconds
  * `w` for weeks

  For example, `24h`, to mean query data starting from 24 hours ago to now.

* `project` *(array(undefined))*

  The IDs or slugs of projects to filter by. Project slugs are unique within each organization. Omit this parameter to include all accessible projects. `-1` is also accepted to include all accessible projects. For example, the following are valid parameters:

  * `/?project=1234&project=56789`
  * `/?project=android&project=javascript-react`
  * `/?project=-1`

* `per_page` *(integer)*

  The number of groups to return per request.

* `interval` *(string)*

  Resolution of the time series, given in the same format as `statsPeriod`.

  The default and the minimum interval is `1h`.

* `groupBy` *(array(string))*

  The list of properties to group by.

  The available groupBy conditions are `project`, `release`, `environment` and `session.status`.

* `orderBy` *(string)*

  An optional field to order by, which must be one of the fields provided in `field`. Use `-` for descending order, for example, `-sum(session)`

* `includeTotals` *(integer)*

  Specify `0` to exclude totals from the response. The default is `1`

* `includeSeries` *(integer)*

  Specify `0` to exclude series from the response. The default is `1`

* `query` *(string)*

  Filters results by using [query syntax](https://docs.sentry.io/product/sentry-basics/search.md).

  Example: `query=(transaction:foo AND release:abc) OR (transaction:[bar,baz] AND release:def)`

### Scopes

You need to [authenticate via bearer auth token.](https://docs.sentry.io/api/auth.md)

`<auth_token>` requires one of the following scopes:

* `org:admin`
* `org:read`
* `org:write`

```
curl https://sentry.io/api/0/organizations/{organization_id_or_slug}/sessions/ \
 -H 'Authorization: Bearer <auth_token>'
```

RESPONSESCHEMA

```
Copied
{
  "groups": [
    {
      "by": {
        "session.status": "errored"
      },
      "totals": {
        "sum(session)": 1000
      },
      "series": {
        "sum(session)": [
          368,
          392,
          240
        ]
      }
    },
    {
      "by": {
        "session.status": "healthy"
      },
      "totals": {
        "sum(session)": 17905998
      },
      "series": {
        "sum(session)": [
          6230841,
          6923689,
          4751465
        ]
      }
    }
  ],
  "start": "2024-01-29T07:30:00Z",
  "end": "2024-01-29T09:00:00Z",
  "intervals": [
    "2024-01-29T07:30:00Z",
    "2024-01-29T08:00:00Z",
    "2024-01-29T08:30:00Z"
  ],
  "query": ""
}
```

---

Find other pages: [Sitemap](https://docs.sentry.io/sitemap.md) lists every page with a one-line summary, and [llms.txt](https://docs.sentry.io/llms.txt) gives an overview with guidance for agents.
