Trigger a monitor run
curl --request POST \
--url https://api.octen.ai/monitors/{id}/trigger \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.octen.ai/monitors/{id}/trigger"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.octen.ai/monitors/{id}/trigger', 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.octen.ai/monitors/{id}/trigger",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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.octen.ai/monitors/{id}/trigger"
req, _ := http.NewRequest("POST", 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.post("https://api.octen.ai/monitors/{id}/trigger")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.octen.ai/monitors/{id}/trigger")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"code": 0,
"msg": "success",
"request_id": "req_abc123def456",
"data": {
"run_id": "run_791",
"status": "queued"
}
}{
"code": 401,
"msg": "Invalid API Key",
"request_id": "req_abc123def456"
}{
"code": 403,
"msg": "Insufficient balance in account",
"request_id": "req_abc123def456"
}{
"code": 404,
"msg": "Monitor not found",
"request_id": "req_abc123def456"
}{
"code": 409101,
"msg": "Previous run still in progress",
"request_id": "req_abc123def456"
}{
"code": 429,
"msg": "Exceeding the rate limit",
"request_id": "req_abc123def456"
}{
"code": 500,
"msg": "Internal error",
"request_id": "req_abc123def456"
}Monitor
Trigger Monitor Run API Reference
Runs a monitor once, outside its schedule. A manual run always fetches fresh pages and doesn’t change the schedule. Get the result from Get Monitor Run with the returned run_id.
The run isn’t triggered when:
- The previous run is still
queuedorprocessing: returns409101. - The monitor is paused: returns
409103. Resume it first by sendingstatus: activewith Update Monitor, then trigger. - Less than 3 seconds have passed since the last manual trigger: returns
429.
POST
/
monitors
/
{id}
/
trigger
Trigger a monitor run
curl --request POST \
--url https://api.octen.ai/monitors/{id}/trigger \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.octen.ai/monitors/{id}/trigger"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.octen.ai/monitors/{id}/trigger', 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.octen.ai/monitors/{id}/trigger",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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.octen.ai/monitors/{id}/trigger"
req, _ := http.NewRequest("POST", 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.post("https://api.octen.ai/monitors/{id}/trigger")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.octen.ai/monitors/{id}/trigger")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"code": 0,
"msg": "success",
"request_id": "req_abc123def456",
"data": {
"run_id": "run_791",
"status": "queued"
}
}{
"code": 401,
"msg": "Invalid API Key",
"request_id": "req_abc123def456"
}{
"code": 403,
"msg": "Insufficient balance in account",
"request_id": "req_abc123def456"
}{
"code": 404,
"msg": "Monitor not found",
"request_id": "req_abc123def456"
}{
"code": 409101,
"msg": "Previous run still in progress",
"request_id": "req_abc123def456"
}{
"code": 429,
"msg": "Exceeding the rate limit",
"request_id": "req_abc123def456"
}{
"code": 500,
"msg": "Internal error",
"request_id": "req_abc123def456"
}Authorizations
bearerAuthapiKeyAuth
Was this page helpful?