For the complete documentation index, see llms.txt. This page is also available as Markdown.

Metrics

Metrics endpoints

Get the metrics

get
/status_pages/{subdomain}/metrics
Authorizations
AuthorizationstringRequired
Path parameters
subdomainstringRequired

The subdomain of your status page.

You can find this under your status page settings, the Subdomain field is found under the "Domain name" section. Alternatively find it in the URL of your admin dashboard (e.g. statuspal.io/admin/subdomain).

Query parameters
beforestringOptional

Used as a cursor for pagination.

afterstringOptional

Used as a cursor for pagination.

limitintegerOptional

Set the number of metrics to return in the response. This defaults to 20 items, and can be a maximum of 100.

Responses
200

A status page's metrics

application/json
get/status_pages/{subdomain}/metrics
GET /api/v2/status_pages/{subdomain}/metrics HTTP/1.1
Host: statuspal.io
Authorization: YOUR_API_KEY
Accept: */*
{
  "metrics": [
    {
      "id": 1,
      "title": "Website Response Time",
      "unit": "ms",
      "type": "up",
      "enabled": true,
      "visible": true,
      "remote_id": "9dd9dee9-bf3d-4f2a-9cb6-c8e623b7df5a",
      "remote_name": "StatusPal",
      "status": "connect_timeout",
      "latest_entry_time": 1679314774,
      "threshold": 10,
      "featured_number": "avg",
      "order": 1,
      "integration_id": "text"
    }
  ],
  "links": {
    "next": "{STATUSPAL_HOST}/api/v2/status_pages/subdomain/metrics?after=cUrSoR",
    "prev": "{STATUSPAL_HOST}/api/v2/status_pages/subdomain/metrics?before=cUrSoR"
  },
  "meta": {
    "total_count": 100
  }
}

Adds a new metric

post
/status_pages/{subdomain}/metrics
Authorizations
AuthorizationstringRequired
Path parameters
subdomainstringRequired

The subdomain of your status page.

You can find this under your status page settings, the Subdomain field is found under the "Domain name" section. Alternatively find it in the URL of your admin dashboard (e.g. statuspal.io/admin/subdomain).

Body
Responses
201

The metric created

application/json
post/status_pages/{subdomain}/metrics
POST /api/v2/status_pages/{subdomain}/metrics HTTP/1.1
Host: statuspal.io
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 238

{
  "metric": {
    "title": "Website Response Time",
    "unit": "ms",
    "type": "up",
    "enabled": true,
    "visible": true,
    "remote_id": "9dd9dee9-bf3d-4f2a-9cb6-c8e623b7df5a",
    "remote_name": "StatusPal",
    "threshold": 10,
    "featured_number": "avg",
    "integration_id": "text"
  }
}
{
  "metric": {
    "id": 1,
    "title": "Website Response Time",
    "unit": "ms",
    "type": "up",
    "enabled": true,
    "visible": true,
    "remote_id": "9dd9dee9-bf3d-4f2a-9cb6-c8e623b7df5a",
    "remote_name": "StatusPal",
    "status": "connect_timeout",
    "latest_entry_time": 1679314774,
    "threshold": 10,
    "featured_number": "avg",
    "order": 1,
    "integration_id": "text"
  }
}

Get metric against given metric id

get
/status_pages/{subdomain}/metrics/{metricId}
Authorizations
AuthorizationstringRequired
Path parameters
subdomainstringRequired

The subdomain of your status page.

You can find this under your status page settings, the Subdomain field is found under the "Domain name" section. Alternatively find it in the URL of your admin dashboard (e.g. statuspal.io/admin/subdomain).

metricIdintegerRequired

The ID of a custom metric

Responses
200

The metric

application/json
get/status_pages/{subdomain}/metrics/{metricId}
GET /api/v2/status_pages/{subdomain}/metrics/{metricId} HTTP/1.1
Host: statuspal.io
Authorization: YOUR_API_KEY
Accept: */*
{
  "metric": {
    "id": 1,
    "title": "Website Response Time",
    "unit": "ms",
    "type": "up",
    "enabled": true,
    "visible": true,
    "remote_id": "9dd9dee9-bf3d-4f2a-9cb6-c8e623b7df5a",
    "remote_name": "StatusPal",
    "status": "connect_timeout",
    "latest_entry_time": 1679314774,
    "threshold": 10,
    "featured_number": "avg",
    "order": 1,
    "integration_id": "text"
  }
}

Updates existing metric

put
/status_pages/{subdomain}/metrics/{metricId}
Authorizations
AuthorizationstringRequired
Path parameters
metricIdintegerRequired

The ID of a custom metric

subdomainstringRequired

The subdomain of your status page.

You can find this under your status page settings, the Subdomain field is found under the "Domain name" section. Alternatively find it in the URL of your admin dashboard (e.g. statuspal.io/admin/subdomain).

Body
Responses
200

The metric updated

application/json
put/status_pages/{subdomain}/metrics/{metricId}
PUT /api/v2/status_pages/{subdomain}/metrics/{metricId} HTTP/1.1
Host: statuspal.io
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 238

{
  "metric": {
    "title": "Website Response Time",
    "unit": "ms",
    "type": "up",
    "enabled": true,
    "visible": true,
    "remote_id": "9dd9dee9-bf3d-4f2a-9cb6-c8e623b7df5a",
    "remote_name": "StatusPal",
    "threshold": 10,
    "featured_number": "avg",
    "integration_id": "text"
  }
}
{
  "metric": {
    "id": 1,
    "title": "Website Response Time",
    "unit": "ms",
    "type": "up",
    "enabled": true,
    "visible": true,
    "remote_id": "9dd9dee9-bf3d-4f2a-9cb6-c8e623b7df5a",
    "remote_name": "StatusPal",
    "status": "connect_timeout",
    "latest_entry_time": 1679314774,
    "threshold": 10,
    "featured_number": "avg",
    "order": 1,
    "integration_id": "text"
  }
}

Deletes metric permanently

delete
/status_pages/{subdomain}/metrics/{metricId}
Authorizations
AuthorizationstringRequired
Path parameters
subdomainstringRequired

The subdomain of your status page.

You can find this under your status page settings, the Subdomain field is found under the "Domain name" section. Alternatively find it in the URL of your admin dashboard (e.g. statuspal.io/admin/subdomain).

metricIdintegerRequired

The ID of a custom metric

Responses
200

Metric deleted successfully

delete/status_pages/{subdomain}/metrics/{metricId}
DELETE /api/v2/status_pages/{subdomain}/metrics/{metricId} HTTP/1.1
Host: statuspal.io
Authorization: YOUR_API_KEY
Accept: */*

No content

Adds a metric data point to a custom metric

post
/status_pages/{subdomain}/metrics/{metricId}/entries
Authorizations
AuthorizationstringRequired
Path parameters
subdomainstringRequired

The subdomain of your status page.

You can find this under your status page settings, the Subdomain field is found under the "Domain name" section. Alternatively find it in the URL of your admin dashboard (e.g. statuspal.io/admin/subdomain).

metricIdintegerRequired

The ID of a custom metric

Body
Responses
200

The metric data point was created

application/json
post/status_pages/{subdomain}/metrics/{metricId}/entries
POST /api/v2/status_pages/{subdomain}/metrics/{metricId}/entries HTTP/1.1
Host: statuspal.io
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 41

{
  "entry": {
    "time": 1561318904,
    "value": 130
  }
}
{
  "entry": {
    "time": 1561318904,
    "value": 130
  }
}

Last updated