curl --request GET \
--url https://api.context.dev/v1/monitors/{monitor_id}/runs/{run_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.context.dev/v1/monitors/{monitor_id}/runs/{run_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.context.dev/v1/monitors/{monitor_id}/runs/{run_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.context.dev/v1/monitors/{monitor_id}/runs/{run_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.context.dev/v1/monitors/{monitor_id}/runs/{run_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.context.dev/v1/monitors/{monitor_id}/runs/{run_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.context.dev/v1/monitors/{monitor_id}/runs/{run_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "run_123",
"monitor_id": "mon_123",
"status": "queued",
"run_type": "baseline",
"target_type": "page",
"change_detection_type": "exact",
"change_detected": true,
"baseline_created": true,
"credits_charged": 1,
"webhook_delivery_ids": [
"<string>"
],
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"change_id": "chg_123",
"skip_reason": "insufficient_credits",
"error": {
"code": "fetch_failed",
"message": "The target URL could not be fetched."
},
"webhook_delivery": {
"event_id": "evt_123",
"event": "change.detected",
"status": "delivered",
"http_status": 200,
"attempted_at": "2023-11-07T05:31:56Z",
"error": {
"code": "fetch_failed",
"message": "The target URL could not be fetched."
},
"delivery_id": "<string>"
},
"webhook_deliveries": [
{
"event_id": "evt_123",
"event": "change.detected",
"status": "delivered",
"http_status": 200,
"attempted_at": "2023-11-07T05:31:56Z",
"error": {
"code": "fetch_failed",
"message": "The target URL could not be fetched."
},
"delivery_id": "<string>"
}
]
}{
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}Retrieve a Monitor Run
Fetch a single run by id, including its lifecycle status, timing, credits charged, and any change detected.
curl --request GET \
--url https://api.context.dev/v1/monitors/{monitor_id}/runs/{run_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.context.dev/v1/monitors/{monitor_id}/runs/{run_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.context.dev/v1/monitors/{monitor_id}/runs/{run_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.context.dev/v1/monitors/{monitor_id}/runs/{run_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.context.dev/v1/monitors/{monitor_id}/runs/{run_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.context.dev/v1/monitors/{monitor_id}/runs/{run_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.context.dev/v1/monitors/{monitor_id}/runs/{run_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "run_123",
"monitor_id": "mon_123",
"status": "queued",
"run_type": "baseline",
"target_type": "page",
"change_detection_type": "exact",
"change_detected": true,
"baseline_created": true,
"credits_charged": 1,
"webhook_delivery_ids": [
"<string>"
],
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"change_id": "chg_123",
"skip_reason": "insufficient_credits",
"error": {
"code": "fetch_failed",
"message": "The target URL could not be fetched."
},
"webhook_delivery": {
"event_id": "evt_123",
"event": "change.detected",
"status": "delivered",
"http_status": 200,
"attempted_at": "2023-11-07T05:31:56Z",
"error": {
"code": "fetch_failed",
"message": "The target URL could not be fetched."
},
"delivery_id": "<string>"
},
"webhook_deliveries": [
{
"event_id": "evt_123",
"event": "change.detected",
"status": "delivered",
"http_status": 200,
"attempted_at": "2023-11-07T05:31:56Z",
"error": {
"code": "fetch_failed",
"message": "The target URL could not be fetched."
},
"delivery_id": "<string>"
}
]
}{
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}run_id returned by Run a Monitor Now — without paging through the monitor’s full history.Authorizations
Bearer authentication header of the form Bearer <API_KEY>, where <API_KEY> is your api key.
Response
The requested monitor run
"run_123"
"mon_123"
Lifecycle status of a run. skipped runs never executed — see skip_reason (insufficient credits, monitor paused, or superseded by a concurrent run).
queued, running, completed, failed, skipped The first run after monitor creation is a baseline run.
baseline, scheduled page, sitemap, extract exact, semantic true
True when this run established the monitor's initial baseline; baseline runs perform no change detection.
Credits charged for this run (0 for skipped/failed runs).
x >= 01
Webhook delivery IDs for this run.
"chg_123"
Why a skipped run never executed; null unless status is skipped.
insufficient_credits, monitor_paused, superseded, null Show child attributes
Show child attributes
Deprecated: use webhook_deliveries, which records every attempt now that a run can deliver multiple events. Omitted when no webhook was attempted, including historical runs created before delivery tracking was added.
Show child attributes
Show child attributes
All webhook deliveries attempted by this run — one per subscribed event that fired. Omitted when no webhook was attempted, including runs created before event selection was added.
Show child attributes
Show child attributes
Was this page helpful?