Docs
WebsiteLoginFree Trial
  • Getting Started
    • OnCall Users
    • Team Admins
    • Account Admins
  • Architecture Guide
  • Common UI Design Patterns
  • Alerts
  • Teams
  • Schedules
  • Escalation Policies
  • Integrations
  • Broadcasts
  • Users
  • Notifications
  • Reports
  • Billing
  • Accounts
  • Stakeholders
  • Maintenance Windows
  • Routers
  • Notification Rules
  • Single Sign On (SSO)
  • Integration Guides
    • Introduction
    • 66uptime
    • Apex Ping
    • AppDynamics
    • Auvik
    • AWS CloudWatch
    • Azure Monitor
    • Cloudflare
    • Cronitor
    • Datadog
    • Dead Man's Snitch
    • Echoes HQ
    • ElastAlert
    • Email
    • Form
    • Freshdesk
    • Freshservice
    • Google Hangouts Chat
    • Grafana
    • Healthchecks.io
    • HetrixTools
    • Honeybadger
    • Hydrozen
    • Jira Server
    • JotForm
    • Kapacitor
    • LogicMonitor
    • Mattermost
      • Outgoing Webhook
      • Post to Channel
    • Meta Workplace
    • Microsoft Teams
    • New Relic
    • Outgoing Webhook
    • Pingdom
    • Prometheus
    • PRTG Network Monitor
    • Pulsetic
    • Sentry
    • ServerGuard24
    • Site24x7
    • Slack
      • Notifications
      • Outgoing Webhook
      • Post to Channel
    • SolarWinds
    • Stackdriver
    • StatusCake
    • Twilio
      • Incoming SMS
      • Live Call Routing
    • Typeform
    • Uptime
    • Uptime Kuma
    • UptimeRobot
    • Webhook
    • Zendesk
  • API
    • Introduction
    • Authentication
    • Errors
    • Pagination and Filters
    • Common Model Attributes
    • Account Users
    • Alerts
    • Broadcasts
    • Comments
    • Escalation Policies
    • Events
    • Integrations
    • Logs
    • Maintenance Windows
    • Notification Rules
    • Routers
    • Schedules
    • Teams
    • Users
  • Command Line Interface (CLI)
    • PagerTree CLI: Command Line Interface
Powered by GitBook
On this page
  • Pagination Parameters
  • Response Format
  • Filter Parameters
  • Operators
  • Sorting

Was this helpful?

  1. API

Pagination and Filters

All top-level API resources have support for bulk fetches via the "list" API methods. These list API methods share a common structure, taking at least these two parameters: limit and offset.

Alternatively you may request pages by providing these two parameters: limit and page.

Pagination Parameters

Parameter
Default
Description

limit

10

A limit on the number of objects to be returned, between 1 and 100

offset

0

A cursor to use in pagination. The number of elements to skip.

page

1

A cursor to use in pagination. Uses the limit to calculate current offset.

Response Format

Parameter
Type
Description

data

array

The array of objects requested.

has_more

boolean

Whether or not there are more elements available after this request. If false, this list comprises the end of the set.

total_count

number

Number of total elements that exist.

Filter Parameters

For any resource you are querying via the top-level API you can pass any attributes of those objects to filter on.

An example query url might look like the following:

GET https://api.pagertree.com/api/v4/alerts?title=test

You can also pass modifiers to modify the filters. The modifiers must be in the query parameter ops and have the format <attribute_name>:<operation>, where operation is any of the following:

Operators

Name
Type
Comparison

equals

===

attribute === value

ne

!==

attribute !== value

lt

<

attribute < value

lte

<=

attribute <= value

gt

>

attribute > value

gte

>=

attribute >= value

beginsWith

string begins with

attribute.beginsWith(value)

contains

string or array contains

attribute.contains(value)

Multiple operators can be applied by separating each token with a comma: <attribute_name1>:<operation1>,<attribute_name2>:<operation2>

An example query url might look like the following:

# Single operation
GET https://api.pagertree.com/api/v4/alerts?title=test&ops=title:beginsWith

# Combining operations
GET https://api.pagertree.com/api/v4/schedules/:id/events?ops=start_datetime:gte,end_datetime:lte&start_datetime=2022-10-12 07:00:00&end_datetime=2022-10-13 07:00:00

Sorting

For any resource you are querying via the top-level API you can pass the sort and direction parameters.

An example query url might look like the following:

GET https://api.pagertree.com/api/v4/alerts?sort=created_at&direction=asc

The direction query parameter can be either asc or desc.

PreviousErrorsNextCommon Model Attributes

Last updated 2 years ago

Was this helpful?