Checks
Check Model
Fields
Field | Type | Description |
|---|---|---|
object | "check" | |
id | string | |
project_id | string | |
team_id | string | |
name | string | |
source_id | string | The source that observations are written to. Nothing else is stored. |
source_name | string | null | |
collection_slug | string | The collection within the source that observations land in. Give several checks the same slug to chart them together, one strip per check under a worst-of overall row. |
endpoint_url | string | The HTTPS URL requested on every run. |
method | | |
headers_configured | string[] | Names of the headers sent with every request. The values are stored encrypted and are never returned, so this shows what was configured without revealing the secrets. |
request_body | string | null | The request body sent when the method is post. Null for get. |
schedule_cron | string | Cron expression setting when the endpoint is requested, evaluated in UTC. |
check_retry_seconds | number | null | How long to wait before one confirming request settles a failed run. Null records the first result as it stands, which turns a single flake into a minute of recorded downtime. |
status | | The current state. A check is only ever stopped by you pausing it or by the team falling out of good standing. A failing endpoint never stops it, because the outage is the thing it is there to record. |
next_fetch_at | | null | When the next run is due. Null while the check is paused or disabled. |
missed_slot_count | number | How many scheduled slots have elapsed without a run, since the check was created or last resumed. Almost always because the project had no healthy server at the time. Missed slots are counted rather than run late: a slot describes the endpoint at one moment, so a late request would report the wrong minute. These are gaps in the uptime record, not downtime. |
last_up | boolean | null | Whether the most recent run found the endpoint up, meaning it answered with a 2xx. Null until the first run settles, and null again after a resume, which is what separates a check nothing has measured yet from one measured to be down. |
results_hourly | CheckHourlyResults[] | The last 24 hours of results, oldest first. Always 24 entries, so an hour with no runs reads as
zeros rather than being absent, and a check that has never run still returns a full window. up
/ (up + down) over the window is the uptime for that period. |
last_checked_at | | null | When the endpoint was last requested, whether or not it answered. Cleared by a resume. |
last_success_at | | null | When the endpoint last returned a 2xx. Survives a pause, so it dates an ongoing outage. |
last_failure_at | | null | When the endpoint last failed to return a 2xx. Survives a pause. |
consecutive_failure_count | number | How many runs have failed in a row. Resets on the next success. Reporting only: the count never stops the check, however high it climbs. |
last_error | string | null | The error from the most recent failed run. |
last_error_stage | | null | Which step of the most recent failed run went wrong. |
last_http_status | number | null | The HTTP status returned by the most recent run. Null when nothing answered. |
last_response_time_ms | number | null | How long the most recent run took, in milliseconds. |
created_at | | |
updated_at | |
Check Test Result
Fields
Field | Type | Description |
|---|---|---|
ok | boolean | Whether the endpoint answered with a 2xx. |
status | number | The HTTP status the endpoint returned. Zero when no response was received at all. |
status_text | string | |
response_time_ms | number | How long the request took, in milliseconds. |
byte_length | number | How many bytes the endpoint returned. |
body_preview | string | The first 2 KB of the response body, for confirming you reached the endpoint you meant to. |
error_stage | | null | Which step went wrong. Null when the test succeeded. |
error | string | null | What went wrong. Null when the test succeeded. |
List Checks
Endpoint
Retrieve a list of checks.
/v1/projects/:project_id/checks Path Parameters
Field | Type | Description |
|---|---|---|
project_id | string | Unique identifier of the project. |
Query Parameters
Field | Type | Description |
|---|---|---|
order_by | string | Field the results are ordered by. Defaults to "created_at". Accepted values: "name","created_at". |
status | string | Return only checks in this state. Accepted values: "active","paused","disabled". |
source_id | string | Return only checks that write their observations to this source. |
limit | number | Maximum number of items to return. Defaults to 25. Minimum: 1. Maximum: 200. |
after | string | Cursor from pagination.next_cursor of a previous response. Returns the resources after that page. |
before | string | Cursor from pagination.prev_cursor of a previous response. Returns the resources before that page. |
sort | string | Sort direction for the result set. Defaults to "desc". Accepted values: "asc","desc". |
Response
{
message: string;
data: Check[];
status: 200;
error: null;
pagination: Pagination;
endpoint: string;
} Retrieve Check
Endpoint
Retrieve a single check.
/v1/projects/:project_id/checks/:check_id Path Parameters
Field | Type | Description |
|---|---|---|
project_id | string | Unique identifier of the project. |
check_id | string | Unique identifier of the check. |
Response
{
message: string;
data: Check;
status: 200;
error: null;
pagination: null;
endpoint: string;
} Create Check
Endpoint
Create a scheduled check in a project.
/v1/projects/:project_id/checks Path Parameters
Field | Type | Description |
|---|---|---|
project_id | string | Unique identifier of the project. |
Request Body
Field | Type | Requirement | Description |
|---|---|---|---|
name | string | Required | Name shown for this check. Minimum length: 2. Maximum length: 128. |
source_id | string | Required | Source that observations are written to. Nothing else about the response is stored. Minimum length: 1. |
collection_slug | string | Required | Collection within the source that observations land in. Give several checks the same slug to chart them together, one strip per check under a worst-of overall row. Minimum length: 1. Maximum length: 64. |
endpoint_url | string | Required | HTTPS URL requested on every run. Must resolve to a public address. Minimum length: 1. Maximum length: 2048. |
method | string | Optional | HTTP method used to request the endpoint. Defaults to "get". Accepted values: "get","post". |
headers | object | null | Optional | Headers sent with every request, for authenticating to the endpoint. Stored encrypted and never returned; responses list only the header names, as headers_configured. |
request_body | string | null | Optional | Body sent with every request. Only valid when method is post, for health endpoints that answer queries over POST. |
schedule_cron | string | Optional | Cron expression setting when the endpoint is requested, evaluated in UTC. Defaults to every minute, which is also the shortest supported gap. Defaults to "* * * * *". Minimum length: 1. Maximum length: 128. |
check_retry_seconds | integer | null | Optional | Seconds to wait before one confirming request settles a failed run. Send null to record the first result as it stands. Defaults to 10. |
Response
{
message: string;
data: Check;
status: 201;
error: null;
pagination: null;
endpoint: string;
} Update Check
Endpoint
Update a check.
/v1/projects/:project_id/checks/:check_id Path Parameters
Field | Type | Description |
|---|---|---|
project_id | string | Unique identifier of the project. |
check_id | string | Unique identifier of the check. |
Request Body
Field | Type | Requirement | Description |
|---|---|---|---|
name | string | Optional | Name shown for this check. Minimum length: 2. Maximum length: 128. |
collection_slug | string | null | Optional | Collection within the source that observations land in. Give several checks the same slug to chart them together, one strip per check under a worst-of overall row. |
endpoint_url | string | Optional | HTTPS URL requested on every run. Must resolve to a public address. Minimum length: 1. Maximum length: 2048. |
method | string | Optional | HTTP method used to request the endpoint. Accepted values: "get","post". |
headers | object | null | Optional | Headers sent with every request, for authenticating to the endpoint. Stored encrypted and never returned; responses list only the header names, as headers_configured. |
request_body | string | null | Optional | Body sent with every request. Only valid when method is post, for health endpoints that answer queries over POST. |
schedule_cron | string | Optional | Cron expression setting when the endpoint is requested, evaluated in UTC. Defaults to every minute, which is also the shortest supported gap. Minimum length: 1. Maximum length: 128. |
check_retry_seconds | integer | null | Optional | Seconds to wait before one confirming request settles a failed run. Send null to record the first result as it stands. |
Response
{
message: string;
data: Check;
status: 200;
error: null;
pagination: null;
endpoint: string;
} Delete Check
Endpoint
Delete a check.
/v1/projects/:project_id/checks/:check_id Path Parameters
Field | Type | Description |
|---|---|---|
project_id | string | Unique identifier of the project. |
check_id | string | Unique identifier of the check. |
Response
{
message: string;
data: null;
status: 200;
error: null;
pagination: null;
endpoint: string;
} Pause Check
Endpoint
Pause a check so it stops running.
/v1/projects/:project_id/checks/:check_id/pause Path Parameters
Field | Type | Description |
|---|---|---|
project_id | string | Unique identifier of the project. |
check_id | string | Unique identifier of the check. |
Response
{
message: string;
data: Check;
status: 200;
error: null;
pagination: null;
endpoint: string;
} Resume Check
Endpoint
Resume a paused check.
/v1/projects/:project_id/checks/:check_id/resume Path Parameters
Field | Type | Description |
|---|---|---|
project_id | string | Unique identifier of the project. |
check_id | string | Unique identifier of the check. |
Response
{
message: string;
data: Check;
status: 200;
error: null;
pagination: null;
endpoint: string;
} Test Check
Endpoint
Request the endpoint once without recording anything.
/v1/projects/:project_id/checks/:check_id/test Path Parameters
Field | Type | Description |
|---|---|---|
project_id | string | Unique identifier of the project. |
check_id | string | Unique identifier of the check. |
Response
{
message: string;
data: CheckTestResult;
status: 200;
error: null;
pagination: null;
endpoint: string;
} Referenced Types
ISODateString
An ISO 8601 date-time string returned at the JSON API boundary.
CheckMethod
Stored as plain strings rather than Postgres enums: nothing queries by either, so a database enum
would only buy DDL on every added value. CheckStatus stays an enum because it IS queried, and
backs the dispatch index.