From 490ca0a6630bb89ee4752362eadb96f95e1505a1 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Fri, 13 Feb 2026 11:41:55 +0100 Subject: [PATCH] WIP --- changedetectionio/tests/test_api.py | 3 +++ docs/api-spec.yaml | 26 ++++++++++++++++++++------ docs/api_v1/index.html | 22 +++++++++++----------- 3 files changed, 34 insertions(+), 17 deletions(-) diff --git a/changedetectionio/tests/test_api.py b/changedetectionio/tests/test_api.py index 826f4939d..3ed6265d7 100644 --- a/changedetectionio/tests/test_api.py +++ b/changedetectionio/tests/test_api.py @@ -463,6 +463,9 @@ def test_api_watch_PUT_update(client, live_server, measure_memory_usage, datasto follow_redirects=True ) + if res.status_code != 201: + print(f"\n=== POST createwatch failed with {res.status_code} ===") + print(f"Response: {res.data}") assert res.status_code == 201 wait_for_all_checks(client) diff --git a/docs/api-spec.yaml b/docs/api-spec.yaml index 8b5cefbc8..20d1fdda2 100644 --- a/docs/api-spec.yaml +++ b/docs/api-spec.yaml @@ -400,13 +400,27 @@ components: # Conditions (advanced logic) conditions: - type: object - description: Custom conditions for change detection logic + type: array + items: + type: object + properties: + field: + type: string + description: Field to check (e.g., 'page_filtered_text', 'page_title') + operator: + type: string + description: Comparison operator (e.g., 'contains_regex', 'equals', 'not_equals') + value: + type: string + description: Value to compare against + required: [field, operator, value] + maxItems: 100 + description: Array of condition rules for change detection logic conditions_match_logic: type: string enum: ['ALL', 'ANY'] default: 'ALL' - description: Logic operator for multiple conditions + description: Logic operator - ALL (match all conditions) or ANY (match any condition) DaySchedule: type: object @@ -528,15 +542,15 @@ components: UpdateWatch: allOf: - - $ref: '#/components/schemas/WatchBase' + - $ref: '#/components/schemas/Watch' # Extends Watch (includes WatchBase + readOnly fields) - type: object properties: last_viewed: type: integer description: Unix timestamp in seconds of the last time the watch was viewed. Setting it to a value higher than `last_changed` in the "Update watch" endpoint marks the watch as viewed. minimum: 0 - # Allow readOnly fields in request body (they will be ignored) to support roundtrip GET/PUT workflows - # unevaluatedProperties: false + # ReadOnly fields are now evaluated (from Watch schema), so we can safely reject unknown fields + unevaluatedProperties: false Tag: type: object diff --git a/docs/api_v1/index.html b/docs/api_v1/index.html index 25b701cc5..4a08d868c 100644 --- a/docs/api_v1/index.html +++ b/docs/api_v1/index.html @@ -613,10 +613,10 @@ notification preferences, and content filtering options.

" class="sc-eVqvcJ sc-fszimp kIppRw drqpJr">

Maximum number of history snapshots to keep (null = use system default)

object

Weekly schedule limiting when checks can run

-
conditions
object

Custom conditions for change detection logic

-
conditions_match_logic
string
Default: "ALL"
Enum: "ALL" "ANY"

Logic operator for multiple conditions

+
Array of objects <= 100 items

Array of condition rules for change detection logic

+
conditions_match_logic
string
Default: "ALL"
Enum: "ALL" "ANY"

Logic operator - ALL (match all conditions) or ANY (match any condition)

Responses

Request samples

curl -X GET "http://localhost:5000/api/v1/watch/095be615-a8ad-4c33-8e9c-c7612fbf6c9f" \
   -H "x-api-key: YOUR_API_KEY"
-

Response samples

Content type
{
  • "title": "string",
  • "tag": "string",
  • "tags": [
    ],
  • "paused": true,
  • "notification_muted": true,
  • "method": "GET",
  • "fetch_backend": "system",
  • "headers": {
    },
  • "body": "string",
  • "proxy": "string",
  • "webdriver_delay": 0,
  • "webdriver_js_execute_code": "string",
  • "time_between_check": {
    },
  • "time_between_check_use_default": true,
  • "notification_urls": [
    ],
  • "notification_title": "string",
  • "notification_body": "string",
  • "notification_format": "text",
  • "track_ldjson_price_data": true,
  • "browser_steps": [
    ],
  • "processor": "restock_diff",
  • "include_filters": [
    ],
  • "subtractive_selectors": [
    ],
  • "ignore_text": [
    ],
  • "trigger_text": [
    ],
  • "text_should_not_be_present": [
    ],
  • "extract_text": [
    ],
  • "trim_text_whitespace": false,
  • "sort_text_alphabetically": false,
  • "remove_duplicate_lines": false,
  • "check_unique_lines": false,
  • "strip_ignored_lines": true,
  • "filter_text_added": true,
  • "filter_text_removed": true,
  • "filter_text_replaced": true,
  • "in_stock_only": true,
  • "follow_price_changes": true,
  • "price_change_threshold_percent": 0,
  • "has_ldjson_price_data": true,
  • "notification_screenshot": false,
  • "filter_failure_notification_send": true,
  • "use_page_title_in_list": true,
  • "history_snapshot_max_length": 1,
  • "time_schedule_limit": {
    },
  • "conditions": { },
  • "conditions_match_logic": "ALL",
  • "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
  • "last_checked": 0,
  • "last_changed": 0,
  • "last_error": "string",
  • "last_viewed": 0,
  • "link": "string",
  • "page_title": "string",
  • "check_count": 0,
  • "fetch_time": 0,
  • "previous_md5": "string",
  • "previous_md5_before_filters": "string",
  • "consecutive_filter_failures": 0,
  • "last_notification_error": "string",
  • "notification_alert_count": 0,
  • "date_created": 0,
  • "content-type": "string",
  • "remote_server_reply": "string",
  • "browser_steps_last_error_step": 0,
  • "viewed": 0,
  • "history_n": { }
}

Update watch

Response samples

Content type
{
  • "title": "string",
  • "tag": "string",
  • "tags": [
    ],
  • "paused": true,
  • "notification_muted": true,
  • "method": "GET",
  • "fetch_backend": "system",
  • "headers": {
    },
  • "body": "string",
  • "proxy": "string",
  • "webdriver_delay": 0,
  • "webdriver_js_execute_code": "string",
  • "time_between_check": {
    },
  • "time_between_check_use_default": true,
  • "notification_urls": [
    ],
  • "notification_title": "string",
  • "notification_body": "string",
  • "notification_format": "text",
  • "track_ldjson_price_data": true,
  • "browser_steps": [
    ],
  • "processor": "restock_diff",
  • "include_filters": [
    ],
  • "subtractive_selectors": [
    ],
  • "ignore_text": [
    ],
  • "trigger_text": [
    ],
  • "text_should_not_be_present": [
    ],
  • "extract_text": [
    ],
  • "trim_text_whitespace": false,
  • "sort_text_alphabetically": false,
  • "remove_duplicate_lines": false,
  • "check_unique_lines": false,
  • "strip_ignored_lines": true,
  • "filter_text_added": true,
  • "filter_text_removed": true,
  • "filter_text_replaced": true,
  • "in_stock_only": true,
  • "follow_price_changes": true,
  • "price_change_threshold_percent": 0,
  • "has_ldjson_price_data": true,
  • "notification_screenshot": false,
  • "filter_failure_notification_send": true,
  • "use_page_title_in_list": true,
  • "history_snapshot_max_length": 1,
  • "time_schedule_limit": {
    },
  • "conditions": [
    ],
  • "conditions_match_logic": "ALL",
  • "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
  • "last_checked": 0,
  • "last_changed": 0,
  • "last_error": "string",
  • "last_viewed": 0,
  • "link": "string",
  • "page_title": "string",
  • "check_count": 0,
  • "fetch_time": 0,
  • "previous_md5": "string",
  • "previous_md5_before_filters": "string",
  • "consecutive_filter_failures": 0,
  • "last_notification_error": "string",
  • "notification_alert_count": 0,
  • "date_created": 0,
  • "content-type": "string",
  • "remote_server_reply": "string",
  • "browser_steps_last_error_step": 0,
  • "viewed": 0,
  • "history_n": { }
}

Update watch

Update an existing web page change monitor (watch) using JSON. Accepts the same structure as returned in get single watch information.

Authorizations:
ApiKeyAuth
path Parameters
uuid
required
string <uuid>

Web page change monitor (watch) unique ID

@@ -755,10 +755,10 @@ notification preferences, and content filtering options.

" class="sc-eVqvcJ sc-fszimp kIppRw drqpJr">

Maximum number of history snapshots to keep (null = use system default)

object

Weekly schedule limiting when checks can run

-
conditions
object

Custom conditions for change detection logic

-
conditions_match_logic
string
Default: "ALL"
Enum: "ALL" "ANY"

Logic operator for multiple conditions

+
Array of objects <= 100 items

Array of condition rules for change detection logic

+
conditions_match_logic
string
Default: "ALL"
Enum: "ALL" "ANY"

Logic operator - ALL (match all conditions) or ANY (match any condition)

last_viewed
integer >= 0

Unix timestamp in seconds of the last time the watch was viewed. Setting it to a value higher than last_changed in the "Update watch" endpoint marks the watch as viewed.

Responses

Custom server

-
{protocol}://{host}/api/v1/watch/{uuid}

Request samples

Content type
application/json
{
  • "title": "string",
  • "tag": "string",
  • "tags": [
    ],
  • "paused": true,
  • "notification_muted": true,
  • "method": "GET",
  • "fetch_backend": "system",
  • "headers": {
    },
  • "body": "string",
  • "proxy": "string",
  • "webdriver_delay": 0,
  • "webdriver_js_execute_code": "string",
  • "time_between_check": {
    },
  • "time_between_check_use_default": true,
  • "notification_urls": [
    ],
  • "notification_title": "string",
  • "notification_body": "string",
  • "notification_format": "text",
  • "track_ldjson_price_data": true,
  • "browser_steps": [
    ],
  • "processor": "restock_diff",
  • "include_filters": [
    ],
  • "subtractive_selectors": [
    ],
  • "ignore_text": [
    ],
  • "trigger_text": [
    ],
  • "text_should_not_be_present": [
    ],
  • "extract_text": [
    ],
  • "trim_text_whitespace": false,
  • "sort_text_alphabetically": false,
  • "remove_duplicate_lines": false,
  • "check_unique_lines": false,
  • "strip_ignored_lines": true,
  • "filter_text_added": true,
  • "filter_text_removed": true,
  • "filter_text_replaced": true,
  • "in_stock_only": true,
  • "follow_price_changes": true,
  • "price_change_threshold_percent": 0,
  • "notification_screenshot": false,
  • "filter_failure_notification_send": true,
  • "use_page_title_in_list": true,
  • "history_snapshot_max_length": 1,
  • "time_schedule_limit": {
    },
  • "conditions": { },
  • "conditions_match_logic": "ALL",
  • "last_viewed": 0
}

Delete watch

{protocol}://{host}/api/v1/watch/{uuid}

Request samples

Content type
application/json
{
  • "title": "string",
  • "tag": "string",
  • "tags": [
    ],
  • "paused": true,
  • "notification_muted": true,
  • "method": "GET",
  • "fetch_backend": "system",
  • "headers": {
    },
  • "body": "string",
  • "proxy": "string",
  • "webdriver_delay": 0,
  • "webdriver_js_execute_code": "string",
  • "time_between_check": {
    },
  • "time_between_check_use_default": true,
  • "notification_urls": [
    ],
  • "notification_title": "string",
  • "notification_body": "string",
  • "notification_format": "text",
  • "track_ldjson_price_data": true,
  • "browser_steps": [
    ],
  • "processor": "restock_diff",
  • "include_filters": [
    ],
  • "subtractive_selectors": [
    ],
  • "ignore_text": [
    ],
  • "trigger_text": [
    ],
  • "text_should_not_be_present": [
    ],
  • "extract_text": [
    ],
  • "trim_text_whitespace": false,
  • "sort_text_alphabetically": false,
  • "remove_duplicate_lines": false,
  • "check_unique_lines": false,
  • "strip_ignored_lines": true,
  • "filter_text_added": true,
  • "filter_text_removed": true,
  • "filter_text_replaced": true,
  • "in_stock_only": true,
  • "follow_price_changes": true,
  • "price_change_threshold_percent": 0,
  • "notification_screenshot": false,
  • "filter_failure_notification_send": true,
  • "use_page_title_in_list": true,
  • "history_snapshot_max_length": 1,
  • "time_schedule_limit": {
    },
  • "conditions": [
    ],
  • "conditions_match_logic": "ALL",
  • "last_viewed": 0
}

Delete watch

Delete a web page change monitor (watch) and all related history

Authorizations:
ApiKeyAuth
path Parameters
uuid
required
string <uuid>

Web page change monitor (watch) unique ID

@@ -1268,7 +1268,7 @@ counts, uptime information, and version details.

-H "x-api-key: YOUR_API_KEY"

Response samples

Content type
application/json
{
  • "watch_count": 42,
  • "tag_count": 5,
  • "uptime": "2 days, 3:45:12",
  • "version": "0.50.10"
}