Pagination

Pagination is applied for some domains of Opsgenie Rest API, meaning that only a certain number of resources will be returned within each response. Specification of page details to return is determined according to following parameters:

Field NamesDescriptionValue Definition
offsetStarting point for the result setSee the related section for each request
directionPage direction to apply for the given offsetnext:Greater than the given offset (Default Value)
prev: Less than the given offset
limitMaximum number of items to provide in the resultMust be a positive integer value. Default value is 20 and maximum value is 100.
sortName of the field that result set will be sorted bySee the related section for each request
orderSorting order of the result setdesc: Sort result set in descending order (Default Value)
asc: Sort result set in ascending order

Paging URL Information in Response

If paging information is available for the given filters/queries, exact link of any available next, first and last pages including query parameters are provided within response.

Next Page URL

  1. Within X-Paging-Next header
  2. Within paging section of the response body. An example paging section within response body is available below.

First Page URL

  1. Within X-Paging-First header
  2. Within paging section of the response body. An example paging section within response body is available below.

Last Page URL

  1. Within X-Paging-Last header
  2. Within paging section of the response body. An example paging section within response body is available below.
section within response body is available below.
{
    "data":[
        ...
    ],
    "took": 0.266,
    "requestId": "37daec35-2d65-4612-b568-711068e806a4",
    "paging":{
        "next":"https://api.opsgenie.com/v2/alerts?query=status%3Aopen&offset=20&limit=10&sort=createdAt&order=desc",
        "first":"https://api.opsgenie.com/v2/alerts?query=status%3Aopen&offset=0&limit=10&sort=createdAt&order=desc",
        "last":"https://api.opsgenie.com/v2/alerts?query=status%3Aopen&offset=100&limit=10&sort=createdAt&order=desc"
    }
}