curl --request PATCH \
--url https://api.newscatcherapi.com/agent/monitors/{monitor_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"companies": [
{
"domain": "<string>",
"name": "<string>"
}
],
"schedule": {
"every": "day",
"at": "09:00",
"tz": "UTC",
"weekday": 3,
"hours": 12
},
"settings": {
"include_market_activity": false
},
"enabled": true,
"fill_gap": true,
"query": "<string>"
}
'import requests
url = "https://api.newscatcherapi.com/agent/monitors/{monitor_id}"
payload = {
"name": "<string>",
"companies": [
{
"domain": "<string>",
"name": "<string>"
}
],
"schedule": {
"every": "day",
"at": "09:00",
"tz": "UTC",
"weekday": 3,
"hours": 12
},
"settings": { "include_market_activity": False },
"enabled": True,
"fill_gap": True,
"query": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
companies: [{domain: '<string>', name: '<string>'}],
schedule: {every: 'day', at: '09:00', tz: 'UTC', weekday: 3, hours: 12},
settings: {include_market_activity: false},
enabled: true,
fill_gap: true,
query: '<string>'
})
};
fetch('https://api.newscatcherapi.com/agent/monitors/{monitor_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.newscatcherapi.com/agent/monitors/{monitor_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'companies' => [
[
'domain' => '<string>',
'name' => '<string>'
]
],
'schedule' => [
'every' => 'day',
'at' => '09:00',
'tz' => 'UTC',
'weekday' => 3,
'hours' => 12
],
'settings' => [
'include_market_activity' => false
],
'enabled' => true,
'fill_gap' => true,
'query' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.newscatcherapi.com/agent/monitors/{monitor_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"companies\": [\n {\n \"domain\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"schedule\": {\n \"every\": \"day\",\n \"at\": \"09:00\",\n \"tz\": \"UTC\",\n \"weekday\": 3,\n \"hours\": 12\n },\n \"settings\": {\n \"include_market_activity\": false\n },\n \"enabled\": true,\n \"fill_gap\": true,\n \"query\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.newscatcherapi.com/agent/monitors/{monitor_id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"companies\": [\n {\n \"domain\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"schedule\": {\n \"every\": \"day\",\n \"at\": \"09:00\",\n \"tz\": \"UTC\",\n \"weekday\": 3,\n \"hours\": 12\n },\n \"settings\": {\n \"include_market_activity\": false\n },\n \"enabled\": true,\n \"fill_gap\": true,\n \"query\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.newscatcherapi.com/agent/monitors/{monitor_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"companies\": [\n {\n \"domain\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"schedule\": {\n \"every\": \"day\",\n \"at\": \"09:00\",\n \"tz\": \"UTC\",\n \"weekday\": 3,\n \"hours\": 12\n },\n \"settings\": {\n \"include_market_activity\": false\n },\n \"enabled\": true,\n \"fill_gap\": true,\n \"query\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"monitor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"companies": [
{}
],
"schedule": {},
"settings": {},
"enabled": true,
"kind": "companies",
"dataset": {},
"list_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"query": "<string>",
"paused_reason": "<string>",
"last_opened_at": "2023-11-07T05:31:56Z",
"next_run_at": "2023-11-07T05:31:56Z",
"last_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}Update Monitor
Change a monitor: name, companies, schedule, settings, or pause and resume it.
curl --request PATCH \
--url https://api.newscatcherapi.com/agent/monitors/{monitor_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"companies": [
{
"domain": "<string>",
"name": "<string>"
}
],
"schedule": {
"every": "day",
"at": "09:00",
"tz": "UTC",
"weekday": 3,
"hours": 12
},
"settings": {
"include_market_activity": false
},
"enabled": true,
"fill_gap": true,
"query": "<string>"
}
'import requests
url = "https://api.newscatcherapi.com/agent/monitors/{monitor_id}"
payload = {
"name": "<string>",
"companies": [
{
"domain": "<string>",
"name": "<string>"
}
],
"schedule": {
"every": "day",
"at": "09:00",
"tz": "UTC",
"weekday": 3,
"hours": 12
},
"settings": { "include_market_activity": False },
"enabled": True,
"fill_gap": True,
"query": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
companies: [{domain: '<string>', name: '<string>'}],
schedule: {every: 'day', at: '09:00', tz: 'UTC', weekday: 3, hours: 12},
settings: {include_market_activity: false},
enabled: true,
fill_gap: true,
query: '<string>'
})
};
fetch('https://api.newscatcherapi.com/agent/monitors/{monitor_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.newscatcherapi.com/agent/monitors/{monitor_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'companies' => [
[
'domain' => '<string>',
'name' => '<string>'
]
],
'schedule' => [
'every' => 'day',
'at' => '09:00',
'tz' => 'UTC',
'weekday' => 3,
'hours' => 12
],
'settings' => [
'include_market_activity' => false
],
'enabled' => true,
'fill_gap' => true,
'query' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.newscatcherapi.com/agent/monitors/{monitor_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"companies\": [\n {\n \"domain\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"schedule\": {\n \"every\": \"day\",\n \"at\": \"09:00\",\n \"tz\": \"UTC\",\n \"weekday\": 3,\n \"hours\": 12\n },\n \"settings\": {\n \"include_market_activity\": false\n },\n \"enabled\": true,\n \"fill_gap\": true,\n \"query\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.newscatcherapi.com/agent/monitors/{monitor_id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"companies\": [\n {\n \"domain\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"schedule\": {\n \"every\": \"day\",\n \"at\": \"09:00\",\n \"tz\": \"UTC\",\n \"weekday\": 3,\n \"hours\": 12\n },\n \"settings\": {\n \"include_market_activity\": false\n },\n \"enabled\": true,\n \"fill_gap\": true,\n \"query\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.newscatcherapi.com/agent/monitors/{monitor_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"companies\": [\n {\n \"domain\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"schedule\": {\n \"every\": \"day\",\n \"at\": \"09:00\",\n \"tz\": \"UTC\",\n \"weekday\": 3,\n \"hours\": 12\n },\n \"settings\": {\n \"include_market_activity\": false\n },\n \"enabled\": true,\n \"fill_gap\": true,\n \"query\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"monitor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"companies": [
{}
],
"schedule": {},
"settings": {},
"enabled": true,
"kind": "companies",
"dataset": {},
"list_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"query": "<string>",
"paused_reason": "<string>",
"last_opened_at": "2023-11-07T05:31:56Z",
"next_run_at": "2023-11-07T05:31:56Z",
"last_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}Authorizations
Path Parameters
Body
PATCH /monitors/{id}: only the fields given change.
120Replaces its companies.
1Show child attributes
Show child attributes
When the monitor runs: daily (default) or weekly at a local time in a timezone, or every few hours from that time when your plan allows runs more often than daily.
Show child attributes
Show child attributes
What the monitor delivers.
Show child attributes
Show child attributes
false pauses it, true resumes it.
With enabled true on a paused monitor: true covers the days it was paused (its next delivery brings what it missed, up to 30 days); false starts from today (only what is new from now).
A company monitor's query ("" for every story); a dataset monitor's research request.
5000Response
Successful Response
A monitor.
Its companies now (a list monitor: its list's).
Show child attributes
Show child attributes
companies or dataset.
Dataset monitors: topic, columns, mode, max_rows, source_run_id, window_to (where the last complete run ended).
The company list it follows (companies added to or removed from the list are monitored from the next run on).
What it watches for: a company monitor's query (null: every story), a dataset monitor's research request.
Why the service paused it: "out_of_credits" (its organization's credits no longer cover it; top up, then resume) or "idle" (the organization's free monitor, its results not opened for 14 days; resume it). Null when running or paused by its user.
When its owner last opened its runs, stories or rows (the free monitor pauses after 14 days without).
Next scheduled run (UTC).
The run it was made from ("Keep updated", "Monitor this"): its first run.
Was this page helpful?

