Skip to main content
POST
Create a new monitoring

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 monitoring
  • skip_duplicate (boolean, optional) - If an existing, active monitoring exist with the same site skip don’t fail

Example Request

Success Response

  • Status: 201 Created

Error Handling

  • 400 Bad Request
    • Schema validation errors:
    • Monitor already exists:
    • URL validation failed:
  • 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_now is 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

Authorizations

X-API-KEY
string
header
required

Body

application/json
website
string<uri>
required

The website URL to monitor

Example:

"https://example.com"

checks
enum<string>[]
required

Array of monitoring checks to perform

Minimum array length: 1
Available options:
non_operational_website,
high_risk_mcc,
high_risk_diligent_classification,
catalog_contain_loan_flipping_indicators
Example:
frequency
enum<string>
default:every_2_weeks
required

How often to run the monitoring checks

Available options:
weekly,
every_2_weeks,
every_3_weeks,
every_4_weeks
Example:

"weekly"

run_now
boolean
default:true

Whether to execute the monitoring immediately after creation

expires_at
string<date-time>

Optional expiration date for the monitoring (defaults to 6 months from creation)

Example:

"2024-12-31T23:59:59.000Z"

skip_duplicate
boolean

If an existing, active monitoring exist with the same site skip don't fail

Example:

false

Response

Created

id
string<uuid>

Unique monitoring identifier

Example:

"d6e3b214-30b1-4401-a1b8-a1bd3c6a84e4"

website
string<uri>

The monitored website URL

Example:

"https://example.com"

customer_id
string

Customer identifier

checks
enum<string>[]

Active monitoring checks

Available options:
non_operational_website,
high_risk_diligent_classification,
catalog_contain_loan_flipping_indicators
frequency
enum<string>

Monitoring frequency

Available options:
weekly,
every_2_weeks,
every_3_weeks,
every_4_weeks
is_active
boolean

Whether monitoring is active

running_state
enum<string>

Current execution state

Available options:
IDLE,
RUNNING,
FAILED
next_run_at
string<date-time>

Next scheduled execution time

expires_at
string<date-time>

Monitoring expiration date

last_execution
string<date-time> | null

Timestamp of last execution, null if never executed

created_at
string<date-time>

Creation timestamp

updated_at
string<date-time>

Last update timestamp

execution_results
object[]

Results from the latest monitoring execution

external_id
string

External identifier for this monitoring