# List RUM users

List a RUM application's signed-in users 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}/users"

[[path_param]]
name = "application_id"
required = true
type = "string"
description = "The RUM application to list users 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 users whose identifier or name contains this text, ignoring letter case."

[[query_param]]
name = "group_id"
type = "string"
description = "Only users of this group, by its ID, or by its name for a group sent without an ID."

[[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 users first.<br/>`first_seen`: Puts the newest users first.<br/>`error_count`: Puts the users with the most errors first.<br/>`session_count`: Puts the users 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 users."
body = '''
{
  "data": [
    {
      "id": "user_123",
      "type": "rum_user",
      "attributes": {
        "application_id": "123456",
        "name": "jane@example.com",
        "group_id": "456",
        "group_name": "Acme Inc.",
        "country": "Czechia",
        "city": "Prague",
        "referrer": "google",
        "utm": {
          "source": "newsletter",
          "campaign": "launch"
        },
        "first_seen_at": "2026-11-10T08:12:44.000Z",
        "last_seen_at": "2026-11-23T17:03:56.000Z",
        "error_count": 3,
        "session_count": 5,
        "sessions_url": "https://rum.betterstack.com/team/t12345/sessions#/?q=user.identifier%3D%22user_123%22&s=123456"
      }
    }
  ],
  "pagination": {
    "first": "https://errors.betterstack.com/api/v4/applications/123456/users?page=1",
    "last": "https://errors.betterstack.com/api/v4/applications/123456/users?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, error_count, session_count."
  }
}
'''
[/responses]

[params]
title = "Response attributes"

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

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

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

[[param]]
name = "name"
type = "string or null"
description = "The user's latest `email`, or their `username` or IP address when there's no e-mail, as the Users page shows it. `null` when the application sent none of them."

[[param]]
name = "group_id"
type = "string or null"
description = "The ID of the user's latest group, such as their company. `null` when the application sent none."

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

[[param]]
name = "country"
type = "string or null"
description = "The country the user was last seen in. `null` when it isn't known."

[[param]]
name = "city"
type = "string or null"
description = "The city the user was last seen in. `null` when it isn't known."

[[param]]
name = "referrer"
type = "string or null"
description = "Where the user's latest visit came from. `null` when it isn't known."

[[param]]
name = "utm"
type = "object"
description = "The `utm_` campaign parameters of the user's latest visit, keyed without the prefix as `source`, `medium`, `campaign`, `term` and `content`. Holds only the ones sent. Each value is a string."

[[param]]
name = "first_seen_at"
type = "datetime or null"
description = "When the user 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 user was last seen in the time range. In ISO 8601 format, such as `2026-07-01T12:00:00Z`."

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

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

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

[[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 users]
curl --request GET \
  --url "https://errors.betterstack.com/api/v4/applications/123456/users?order_by=error_count" \
  --header "Authorization: Bearer $TOKEN"
```
