Retrieve Release Health Session Statistics

GET /api/0/organizations/{organization_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_slug (string)
REQUIRED

The 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(integer))

The IDs of projects to filter by. -1 means all available projects. For example the following are valid parameters:

  • /?project=1234&project=56789
  • /?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 (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)

The search filter for your query, read more about query syntax here.

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

Scopes

<auth_token> requires one of the following scopes:
  • org:admin
  • org:read
  • org:write
curl https://sentry.io/api/0/organizations/{organization_slug}/sessions/ \
 -H 'Authorization: Bearer <auth_token>'
RESPONSESCHEMA
{
  "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": ""
}