JavaScript
import ContextDev from 'context.dev';
const client = new ContextDev({
apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted
});
const response = await client.monitors.listRuns('mon_123');
console.log(response.data);import os
from context.dev import ContextDev
client = ContextDev(
api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted
)
response = client.monitors.list_runs(
monitor_id="mon_123",
)
print(response.data)package main
import (
"context"
"fmt"
"github.com/context-dot-dev/context-go-sdk"
"github.com/context-dot-dev/context-go-sdk/option"
)
func main() {
client := contextdev.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Monitors.ListRuns(
context.TODO(),
"mon_123",
contextdev.MonitorListRunsParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}require "context_dev"
context_dev = ContextDev::Client.new(api_key: "My API Key")
response = context_dev.monitors.list_runs("mon_123")
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use ContextDev\Client;
use ContextDev\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');
try {
$response = $client->monitors->listRuns(
'mon_123', cursor: 'cursor', limit: 1, status: 'queued'
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}context-dev monitors list-runs \
--api-key 'My API Key' \
--monitor-id mon_123curl --request GET \
--url https://api.context.dev/v1/monitors/{monitor_id}/runs \
--header 'Authorization: Bearer <token>'HttpResponse<String> response = Unirest.get("https://api.context.dev/v1/monitors/{monitor_id}/runs")
.header("Authorization", "Bearer <token>")
.asString();{
"data": [
{
"id": "run_123",
"monitor_id": "mon_123",
"change_detected": true,
"baseline_created": true,
"credits_charged": 1,
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"change_id": "chg_123",
"error": {
"code": "fetch_failed",
"message": "The target URL could not be fetched."
}
}
],
"has_more": true,
"next_cursor": "<string>"
}{
"message": "<string>",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"message": "<string>",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}Monitors
List Monitor Runs
List a monitor’s run history with status, timing, credits charged, and any detected change per run.
GET
/
monitors
/
{monitor_id}
/
runs
JavaScript
import ContextDev from 'context.dev';
const client = new ContextDev({
apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted
});
const response = await client.monitors.listRuns('mon_123');
console.log(response.data);import os
from context.dev import ContextDev
client = ContextDev(
api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted
)
response = client.monitors.list_runs(
monitor_id="mon_123",
)
print(response.data)package main
import (
"context"
"fmt"
"github.com/context-dot-dev/context-go-sdk"
"github.com/context-dot-dev/context-go-sdk/option"
)
func main() {
client := contextdev.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Monitors.ListRuns(
context.TODO(),
"mon_123",
contextdev.MonitorListRunsParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}require "context_dev"
context_dev = ContextDev::Client.new(api_key: "My API Key")
response = context_dev.monitors.list_runs("mon_123")
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use ContextDev\Client;
use ContextDev\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');
try {
$response = $client->monitors->listRuns(
'mon_123', cursor: 'cursor', limit: 1, status: 'queued'
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}context-dev monitors list-runs \
--api-key 'My API Key' \
--monitor-id mon_123curl --request GET \
--url https://api.context.dev/v1/monitors/{monitor_id}/runs \
--header 'Authorization: Bearer <token>'HttpResponse<String> response = Unirest.get("https://api.context.dev/v1/monitors/{monitor_id}/runs")
.header("Authorization", "Bearer <token>")
.asString();{
"data": [
{
"id": "run_123",
"monitor_id": "mon_123",
"change_detected": true,
"baseline_created": true,
"credits_charged": 1,
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"change_id": "chg_123",
"error": {
"code": "fetch_failed",
"message": "The target URL could not be fetched."
}
}
],
"has_more": true,
"next_cursor": "<string>"
}{
"message": "<string>",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"message": "<string>",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}0 Credits
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Query Parameters
Lifecycle status of a run. skipped runs never executed — see skip_reason (insufficient credits, monitor paused, or superseded by a concurrent run).
Available options:
queued, running, completed, failed, skipped Required range:
1 <= x <= 100Was this page helpful?
⌘I