Get started with Incidents API

uptime.png

How Incidents API works

Our API follows the JSON:API specification.

API requests to the Incidents API are authorized using the Bearer Authentication standard. Simply include an Authorization: Bearer $TOKEN header in your requests.

Get a global API token

A global API token is a token valid across all your teams, for managing anything within Better Stack.

Global API Token

Get an Incidents API token

An Incidents API token is a team-scoped token for managing your Incidents resources. You can get a separate API token for each of your teams.

Screenshot of Incidents API tokens

Terraform support

You can manage your Better Stack resources using Terraform.

Pagination

Lists come in pages, with a pagination object in the response body. To go through every page, request the URL in pagination.next until it's null. To get a specific page, pass the page query parameter.

Query parameters

Parameter Type Value
page Integer The page number to return, starting with 1.
per_page Integer Number of results per page. Defaults to 50, maximum 250, unless the endpoint says otherwise.

Response attributes

Attribute Type Value
pagination.first String The URL of the first page.
pagination.last String The URL of the last page.
pagination.prev String or null The URL of the previous page, or null on the first page.
pagination.next String or null The URL of the next page, or null on the last page.

Example

Example cURL to list monitors
curl --request GET \
  --url "https://incidents.betterstack.com/api/v2/monitors?page=3&per_page=20" \
  --header "Authorization: Bearer $TOKEN"


Example response body listing monitors
{
  "data": [
    {
      "id": "41",
      "type": "monitor",
      "attributes": {
        monitor's attributes omitted...
      }
    },
    {
      "id": "42",
      "type": "monitor",
      "attributes": {
        monitor's attributes omitted...
      }
    }
  ],
  "pagination": {
    "first": "https://incidents.betterstack.com/api/v2/monitors?page=1&per_page=20",
    "last": "https://incidents.betterstack.com/api/v2/monitors?page=3&per_page=20",
    "prev": "https://incidents.betterstack.com/api/v2/monitors?page=2&per_page=20",
    "next": null
  }
}

Have any questions?

Check out our easy-to-navigate Frequently Asked Questions.

Haven't found what you were looking for?

Reach out to us at hello@betterstack.com.
We’ll get back to you as soon as we can, typically within a few hours. πŸ™
Thank you!