Skip to main content

Setup

Put them in your environment or .env; Data APIs covers the other ways.

Notes

  • Every read needs both keys: the API key identifies the organization, the application key the user whose permissions apply. A scoped application key without the endpoint’s permission answers 403.
  • Time units differ by API: v1 metric queries take epoch SECONDS and answer in epoch MILLISECONDS; v2 logs and events take date math (‘now-15m’) or millisecond timestamps.
  • Pagination differs by API: v2 endpoints return meta.page.after (or links.next) as a cursor to send back as page[cursor]; v1 endpoints page by number.
  • Datadog also accepts ‘Authorization: Bearer’ personal or service access tokens; this entry uses the API and application key pair, which every endpoint accepts.

Endpoints

Check that the API key is valid

Query a metric’s timeseries points

  • Points come back as [epoch_milliseconds, value] pairs in series[].pointlist, at a resolution Datadog picks from the window length.
  • Needs the timeseries_query permission on the application key.

List metrics that reported since a time

  • A read over POST: the search is in the body.
  • Needs the logs_read_data permission. Logs outside your retention window are not searchable.

List events

  • Needs the events_read permission.
  • Needs the monitors_read permission.

List monitors

Get one monitor

List dashboards

Get one dashboard

List hosts

List incidents

  • Needs the incident_read permission. Datadog marks parts of the incidents API as preview.

List service level objectives