Get started with Telemetry API

logs.png

How Telemetry API works

Our API follows JSON:API specification.

API requests made to Better Stack API are authorized using a Bearer Authentication standard. That means you'll only need to add a header with Authorization: Bearer $TOKEN to 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 a Telemetry API token

A Telemetry API token is a team-scoped token for managing all your Telemetry resources, including Errors. You can get a separate API token for each of your teams.

Telemetry API Token

Terraform support

You can manage your telemetry 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.

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.
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 cURL to list sources
curl --request GET \
  --url "https://telemetry.betterstack.com/api/v2/sources?page=3&per_page=20" \
  --header "Authorization: Bearer $TOKEN"


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

Have any questions?

Please feel free to message us at hello@betterstack.com.
We'll get back to you as soon as we can, typically within a few hours. πŸ™
Thank you!