API update: Sessions, pages and Customers

| 3 min. (539 words)

Today, we’re excited to roll out 6 new endpoints for the Raygun API, making it simpler than ever to query Sessions, Pages, and Customers.

Raygun’s Real User Monitoring helps you track and enhance your front-end and mobile page speed performance. It analyzes user sessions and page views to calculate your overall page speed. Previously, this required someone to log into Raygun, find the right application, and manually inspect sessions and page views in Real User Monitoring.

With the new Session and Page API endpoints, this process is now much faster and easier. Your team can quickly retrieve a list of sessions and pages for an application, or fetch individual sessions or pages via the API. If you’re familiar with Sessions in Raygun, Pages will be a breeze—think of a Page as a URI in your web app or a view in your mobile app, where multiple pageviews make up a Session.

We’ve also added the ability to retrieve customer data through the Raygun API. You can now get a list of customers for an application or pull up a single customer’s details effortlessly. Please note you do not need an active subscription to Real User Monitoring to be able to use the Customers endpoints.

How it works

  • Query session data: Team members can retrieve session data via the API by sending a request for a specific application.
  • Fetch page details: Easily get page details by requesting a list of pages or individual page data for an application through the API.
  • Access customer information: Obtain customer data by sending a request for a list of customers or specific customer details for an application.

New endpoints

List sessions: Get a list of all the sessions for an application.

GET https://api.raygun.com/v3/applications/{app-id}/sessions

Get session by identifier: Retrieve a single session by its identifier.

GET https://api.raygun.com/v3/applications/{app-id}/sessions/{session-id}

List pages: Get a list of all the pages for an application.

GET https://api.raygun.com/v3/applications/{app-id}/pages

Get page by identifier: Retrieve a single page by its identifier.

GET https://api.raygun.com/v3/applications/{app-id}/pages/{page-id}

List customers: Get a list of all customers for an application.

GET https://api.raygun.com/v3/applications/{app-id}/customers

Get customer by identifier: Retrieve a single customer by its identifier.

GET https://api.raygun.com/v3/applications/{app-id}/customers/{customer-id}

Filtering query string parameters

All list endpoints support the filtering query string parameters available on our other endpoints:

  • count: The number of items to return on each page. Max 500.
  • offset: The number of items to skip before returning results
  • orderby: The property to sort the results by. The sortable properties can be found in our API spec.

Please note: Access to these new endpoints requires updated scopes on your Personal Access Tokens (PATs). Make sure to update or create a new PAT to use them.

Example request

curl -X GET 'https://api.raygun.com/v3/applications/abc123/sessions?count=50&offset=150&orderby=startedAt%20desc' \
-H 'Authorization: Bearer YOUR_PERSONAL_ACCESS_TOKEN'

This query will get the 4th page of sessions for the application with the identifier abc123 and return the results in order of the startedAt property descending.

Other helpful Raygun API endpoints to explore

Got an endpoint you’d like to see in the Raygun API? Submit your interest here.

See more details on the Raygun API in our documentation. For instructions on how to get started with the API, please visit the beta launch blog, or reach out to our team at support@raygun.com.