# List RUM groups

List a RUM application's user groups seen in a time range, most recently seen first. Needs a role with **View users and groups** under **Applications**.

[endpoint]
method = "GET"
base_url = "https://errors.betterstack.com"
path = "/api/v4/applications/{application_id}/groups"

[[path_param]]
name = "application_id"
required = true
type = "string"
description = "The RUM application to list groups of."

[[query_param]]
name = "from"
type = "datetime"
description = "Start of the time range in ISO 8601. Defaults to 14 days before `to`. RUM data is kept for 90 days, so an earlier `from` counts from 90 days ago."

[[query_param]]
name = "to"
type = "datetime"
description = "End of the time range in ISO 8601. Defaults to now. Must be after `from` and within the last 90 days."

[[query_param]]
name = "query"
type = "string"
description = "Only groups whose ID or name contains this text, ignoring letter case."

[[query_param]]
name = "order_by"
type = "string"
description = "Sort order. Defaults to `last_seen`.<br/>Valid values:<br/>`last_seen`: Puts the most recently seen groups first.<br/>`first_seen`: Puts the newest groups first.<br/>`user_count`: Puts the groups with the most users first.<br/>`session_count`: Puts the groups with the most sessions with a session replay first."

[[query_param]]
name = "page"
type = "integer"
description = "Page to return, starting at 1."

[[query_param]]
name = "per_page"
default = "50"
type = "integer"
description = "Results per page. Maximum 250."

[[query_param]]
name = "team_id"
type = "string"
description = "Team to use, such as `t123`. Get the ID via [List teams](/docs/uptime/api/teams/list/). Required when you can access more than one team."

[[header]]
name = "Authorization"
description = "Bearer `$TOKEN`"
required = true
type = "string"
[/endpoint]

[info]
#### Results are paginated
Use `pagination.next` and `pagination.prev` to move through pages or jump to a specific one using `page` and `per_page`. See [Pagination](/docs/getting-started/integrations/api/#pagination).
[/info]

[responses]
[[response]]
status = 200
description = "Returns the list of RUM groups."
body = '''
{
  "data": [
    {
      "id": "456",
      "type": "rum_group",
      "attributes": {
        "application_id": "123456",
        "group_id": "456",
        "name": "Acme Inc.",
        "first_seen_at": "2026-11-10T08:12:44.000Z",
        "last_seen_at": "2026-11-23T17:03:56.000Z",
        "user_count": 12,
        "session_count": 40,
        "error_count": 7,
        "replay_count": 44,
        "users_url": "https://rum.betterstack.com/team/t12345/users#/?q=user.group_id%3D%22456%22&s=123456",
        "sessions_url": "https://rum.betterstack.com/team/t12345/sessions#/?q=user.group_id%3D%22456%22&s=123456"
      }
    }
  ],
  "pagination": {
    "first": "https://errors.betterstack.com/api/v4/applications/123456/groups?page=1",
    "last": "https://errors.betterstack.com/api/v4/applications/123456/groups?page=1",
    "prev": null,
    "next": null,
    "total_count": 1
  }
}
'''

[[response]]
status = 401
description = "The API token is missing or invalid."
body = '''
{
  "errors": "Invalid Team API token. How to find your Team API token: https://betterstack.com/docs/logs/api/getting-started/#obtaining-a-logtail-api-token"
}
'''

[[response]]
status = 403
description = "Your role doesn't allow viewing this, or the token can't be used for this API."

[[response]]
status = 404
description = "No application with that ID, or the application doesn't collect web events."
body = '''
{
  "errors": "Resource with the provided ID was not found"
}
'''

[[response]]
status = 422
description = "An unknown query parameter, a `from` or `to` that isn't ISO 8601, a `to` that isn't after `from` or is more than 90 days ago, or an `order_by` outside the allowed values. `invalid_values` names the attribute."
body = '''
{
  "errors": "Sorry, some values are incorrect",
  "invalid_values": {
    "order_by": "order_by must be one of last_seen, first_seen, user_count, session_count."
  }
}
'''
[/responses]

[params]
title = "Response attributes"

[[param]]
name = "id"
type = "string"
description = "The ID of the RUM group, such as `456`."

[[param]]
name = "type"
type = "string"
description = "Always `rum_group`."

[[param]]
name = "application_id"
type = "string"
description = "The application the group was seen in."

[[param]]
name = "group_id"
type = "string or null"
description = "The group's ID as the application sent it. `null` for a group sent with a name only."

[[param]]
name = "name"
type = "string or null"
description = "The group's latest name. `null` when the application sent none."

[[param]]
name = "first_seen_at"
type = "datetime or null"
description = "When the group was first seen in the time range. In ISO 8601 format, such as `2026-07-01T12:00:00Z`."

[[param]]
name = "last_seen_at"
type = "datetime or null"
description = "When the group was last seen in the time range. In ISO 8601 format, such as `2026-07-01T12:00:00Z`."

[[param]]
name = "user_count"
type = "integer"
description = "Number of the group's users seen in the time range."

[[param]]
name = "session_count"
type = "integer"
description = "Number of the group's sessions with a session replay in the time range."

[[param]]
name = "error_count"
type = "integer"
description = "Number of errors the group's users ran into in the time range."

[[param]]
name = "replay_count"
type = "integer"
description = "Number of session replays recorded for the group in the time range."

[[param]]
name = "users_url"
type = "string"
description = "Link to the Users page in the Better Stack web app, filtered to this group."

[[param]]
name = "sessions_url"
type = "string"
description = "Link to the Sessions page in the Better Stack web app, filtered to this group."

[[param]]
name = "pagination.first"
type = "string"
description = "The URL of the first page of results."

[[param]]
name = "pagination.last"
type = "string"
description = "The URL of the last page of results."

[[param]]
name = "pagination.prev"
type = "string or null"
description = "The URL of the previous page, or `null` on the first page."

[[param]]
name = "pagination.next"
type = "string or null"
description = "The URL of the next page, or `null` on the last page."

[[param]]
name = "pagination.total_count"
type = "integer"
description = "How many results the whole list holds, across every page."
[/params]

#### Example cURL

```shell
[label List groups]
curl --request GET \
  --url "https://errors.betterstack.com/api/v4/applications/123456/groups?order_by=user_count" \
  --header "Authorization: Bearer $TOKEN"
```
