Create a new monitoring
curl --request POST \
--url https://api.godiligent.ai/monitorings \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"website": "https://example.com",
"checks": [
"non_operational_website",
"high_risk_diligent_classification"
],
"frequency": "weekly",
"run_now": true,
"expires_at": "2024-12-31T23:59:59.000Z",
"skip_duplicate": false
}
'import requests
url = "https://api.godiligent.ai/monitorings"
payload = {
"website": "https://example.com",
"checks": ["non_operational_website", "high_risk_diligent_classification"],
"frequency": "weekly",
"run_now": True,
"expires_at": "2024-12-31T23:59:59.000Z",
"skip_duplicate": False
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
website: 'https://example.com',
checks: ['non_operational_website', 'high_risk_diligent_classification'],
frequency: 'weekly',
run_now: true,
expires_at: '2024-12-31T23:59:59.000Z',
skip_duplicate: false
})
};
fetch('https://api.godiligent.ai/monitorings', 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.godiligent.ai/monitorings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'website' => 'https://example.com',
'checks' => [
'non_operational_website',
'high_risk_diligent_classification'
],
'frequency' => 'weekly',
'run_now' => true,
'expires_at' => '2024-12-31T23:59:59.000Z',
'skip_duplicate' => false
]),
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.godiligent.ai/monitorings"
payload := strings.NewReader("{\n \"website\": \"https://example.com\",\n \"checks\": [\n \"non_operational_website\",\n \"high_risk_diligent_classification\"\n ],\n \"frequency\": \"weekly\",\n \"run_now\": true,\n \"expires_at\": \"2024-12-31T23:59:59.000Z\",\n \"skip_duplicate\": false\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.godiligent.ai/monitorings")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"website\": \"https://example.com\",\n \"checks\": [\n \"non_operational_website\",\n \"high_risk_diligent_classification\"\n ],\n \"frequency\": \"weekly\",\n \"run_now\": true,\n \"expires_at\": \"2024-12-31T23:59:59.000Z\",\n \"skip_duplicate\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.godiligent.ai/monitorings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"website\": \"https://example.com\",\n \"checks\": [\n \"non_operational_website\",\n \"high_risk_diligent_classification\"\n ],\n \"frequency\": \"weekly\",\n \"run_now\": true,\n \"expires_at\": \"2024-12-31T23:59:59.000Z\",\n \"skip_duplicate\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "d6e3b214-30b1-4401-a1b8-a1bd3c6a84e4",
"website": "https://example.com",
"customer_id": "<string>",
"checks": [
"non_operational_website"
],
"frequency": "weekly",
"is_active": true,
"running_state": "IDLE",
"next_run_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"last_execution": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"execution_results": [
{}
],
"external_id": "<string>"
}{
"errors": [
{
"path": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
]
}Monitoring
Create Monitoring
Create a single monitoring configuration for a customer to receive alerts about website changes and risks.
POST
/
monitorings
Create a new monitoring
curl --request POST \
--url https://api.godiligent.ai/monitorings \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"website": "https://example.com",
"checks": [
"non_operational_website",
"high_risk_diligent_classification"
],
"frequency": "weekly",
"run_now": true,
"expires_at": "2024-12-31T23:59:59.000Z",
"skip_duplicate": false
}
'import requests
url = "https://api.godiligent.ai/monitorings"
payload = {
"website": "https://example.com",
"checks": ["non_operational_website", "high_risk_diligent_classification"],
"frequency": "weekly",
"run_now": True,
"expires_at": "2024-12-31T23:59:59.000Z",
"skip_duplicate": False
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
website: 'https://example.com',
checks: ['non_operational_website', 'high_risk_diligent_classification'],
frequency: 'weekly',
run_now: true,
expires_at: '2024-12-31T23:59:59.000Z',
skip_duplicate: false
})
};
fetch('https://api.godiligent.ai/monitorings', 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.godiligent.ai/monitorings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'website' => 'https://example.com',
'checks' => [
'non_operational_website',
'high_risk_diligent_classification'
],
'frequency' => 'weekly',
'run_now' => true,
'expires_at' => '2024-12-31T23:59:59.000Z',
'skip_duplicate' => false
]),
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.godiligent.ai/monitorings"
payload := strings.NewReader("{\n \"website\": \"https://example.com\",\n \"checks\": [\n \"non_operational_website\",\n \"high_risk_diligent_classification\"\n ],\n \"frequency\": \"weekly\",\n \"run_now\": true,\n \"expires_at\": \"2024-12-31T23:59:59.000Z\",\n \"skip_duplicate\": false\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.godiligent.ai/monitorings")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"website\": \"https://example.com\",\n \"checks\": [\n \"non_operational_website\",\n \"high_risk_diligent_classification\"\n ],\n \"frequency\": \"weekly\",\n \"run_now\": true,\n \"expires_at\": \"2024-12-31T23:59:59.000Z\",\n \"skip_duplicate\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.godiligent.ai/monitorings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"website\": \"https://example.com\",\n \"checks\": [\n \"non_operational_website\",\n \"high_risk_diligent_classification\"\n ],\n \"frequency\": \"weekly\",\n \"run_now\": true,\n \"expires_at\": \"2024-12-31T23:59:59.000Z\",\n \"skip_duplicate\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "d6e3b214-30b1-4401-a1b8-a1bd3c6a84e4",
"website": "https://example.com",
"customer_id": "<string>",
"checks": [
"non_operational_website"
],
"frequency": "weekly",
"is_active": true,
"running_state": "IDLE",
"next_run_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"last_execution": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"execution_results": [
{}
],
"external_id": "<string>"
}{
"errors": [
{
"path": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
]
}Overview
Create a new monitoring configuration for a customer’s website. The monitoring will continuously check the specified website for various risk factors and operational status according to the configured frequency.Request
- Method:
POST - Path:
/monitorings - Body: JSON object with monitoring configuration
Request Body
website(string, required) - The URL to monitor (will be validated and sanitized)checks(array, required) - Array of monitoring checks to perform:"non_operational_website"- Check if website is operational"high_risk_mcc"- Check for high-risk MCC"high_risk_diligent_classification"- Check for high-risk classification"catalog_contain_loan_flipping_indicators"- Check for loan flipping indicators
frequency(string, required, case-insensitive) - How often to run checks:"weekly"- Every 7 days"every_2_weeks"- Every 14 days (default)"every_3_weeks"- Every 21 days"every_4_weeks"- Every 28 days
expires_at(ISO8601 string, optional) - When monitoring expires (defaults to 6 months from creation)- Must be a future date
- Must be at least N days ahead where N equals the frequency period
run_now(boolean, optional) - Execute immediately after creation (defaults to true)external_id(string, optional) - External ID for the monitoringskip_duplicate(boolean, optional) - If an existing, active monitoring exist with the same site skip don’t fail
Example Request
{
"website": "https://example.com",
"checks": ["non_operational_website", "high_risk_diligent_classification"],
"frequency": "weekly",
"run_now": true,
"expires_at": "2024-12-31T23:59:59.000Z",
"external_id": "external_id_123",
"skip_duplicate":false
}
Success Response
- Status: 201 Created
{
"id": "d6e3b214-30b1-4401-a1b8-a1bd3c6a84e4",
"website": "https://example.com",
"customer_id": "customer_123",
"checks": ["non_operational_website", "high_risk_diligent_classification"],
"frequency": "weekly",
"expires_at": "2024-12-31T23:59:59.000Z",
"is_active": true,
"running_state": "IDLE",
"next_run_at": "2024-06-10T10:46:00.000Z",
"last_execution": null,
"execution_results": [],
"created_at": "2024-06-03T10:46:00.000Z",
"updated_at": "2024-06-03T10:46:00.000Z",
"external_id": "external_id_123"
}
Error Handling
- 400 Bad Request
- Schema validation errors:
{ "error": [{"code": "custom", "message": "Invalid check name(s)", "path": ["checks"]}] } - Monitor already exists:
{ "error": "Monitor already exists" } - URL validation failed:
{ "error": [{"code": "custom", "message": "URL is disallowed or invalid", "path": ["website"]}] }
- Schema validation errors:
- 401 Unauthorized
- Missing or invalid customer authentication
- 500 Internal Server Error
- Unexpected server error during creation or execution
Validation Rules
- Website URL: Must be a valid, allowed URL that passes security validation
- Unique Checks: Each monitoring must have unique check names (no duplicates)
- Frequency: Case-insensitive input, normalized to lowercase
- Expiration Date: Must be future date, at least N days ahead based on frequency
- Duplicate Prevention: Cannot create monitoring for website that already exists for this customer
Notes
- If
run_nowis true, the monitoring will be queued for immediate execution via SQS - Frequency input is case-insensitive and normalized to lowercase
- All URLs are validated and sanitized for security before storage
- Default expiration is 6 months from creation if not specified
Body
application/json
Response
Created
⌘I