Update a watch
const url = 'http://localhost:11044/api/v1/watches/example';const options = { method: 'PATCH', headers: {'X-Embabel-Api-Key': '<X-Embabel-Api-Key>', 'Content-Type': 'application/json'}, body: '{"clearCron":true,"clearDelivery":true,"cron":"example","delivery":{"channel":"example","format":"example","headers":{"additionalProperty":"example"},"secret":"example","tier":"example","url":"example"},"diffSpec":{"compareFields":["example"],"ignoreFields":["example"],"keyPath":"example","keyedListFields":{"additionalProperty":"example"},"resultMode":"AUTO","setFields":["example"],"transitions":[{"crossesAbove":1,"crossesBelow":1,"field":"example","from":{},"name":"example","to":{}}]},"enabled":true,"firstRunPolicy":"ESTABLISH_BASELINE","name":"example","params":{"additionalProperty":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url http://localhost:11044/api/v1/watches/example \ --header 'Content-Type: application/json' \ --header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>' \ --data '{ "clearCron": true, "clearDelivery": true, "cron": "example", "delivery": { "channel": "example", "format": "example", "headers": { "additionalProperty": "example" }, "secret": "example", "tier": "example", "url": "example" }, "diffSpec": { "compareFields": [ "example" ], "ignoreFields": [ "example" ], "keyPath": "example", "keyedListFields": { "additionalProperty": "example" }, "resultMode": "AUTO", "setFields": [ "example" ], "transitions": [ { "crossesAbove": 1, "crossesBelow": 1, "field": "example", "from": {}, "name": "example", "to": {} } ] }, "enabled": true, "firstRunPolicy": "ESTABLISH_BASELINE", "name": "example", "params": { "additionalProperty": "example" } }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The watch to update
Request Bodyrequired
Section titled “Request Bodyrequired”A partial update: every field omitted or null keeps its current value, and a blank name is ignored. A cron replaces the schedule, and clearCron=true with no cron removes it; a delivery replaces the delivery, clearDelivery=true with no delivery removes it, and a masked secret or header value in it keeps the stored one. params and diffSpec replace the stored values whole. The schedule is reconciled with the result
The body of PATCH /watches/{watchId}; a field left out or null keeps that setting as it is.
object
True removes the schedule, so the watch runs only on request; ignored when cron is also given
True removes delivery, so diffs are kept in history only; ignored when delivery is also given
Replacement cron expression, in the form create takes; blank removes the schedule. Null keeps the current schedule unless clearCron is true
Delivery replacing the whole current one; a masked secret or header value sent back keeps the stored value. Null keeps the current delivery unless clearDelivery is true
object
The adapter: notification (the inbox, the default), signal (the bus, for agents) or webhook (a URL). A lowercase adapter id
A webhook’s body: json (the whole diff, the default) or slack (a text summary an incoming webhook shows as-is)
Extra headers sent on every webhook delivery, e.g. an Authorization. At most 16; X-World-* and Content-Type cannot be set. Values are write-only: a read masks each, and an update that sends a mask back keeps that value
object
When set, a webhook body is signed with HMAC-SHA256 under it, sent as X-World-Signature: sha256=<hex>. Write-only: a read returns ••••••••, and an update that sends that back keeps the stored secret
The inbox tier a notification delivery is filed at: AMBIENT (the default), DEFERRED, TIMELY, INTERRUPTIVE, ACTING or ESCALATING, case-insensitive; anything else files as AMBIENT. Read by no other channel
The http(s) URL a webhook delivery is POSTed to. Required for webhook; unused otherwise
Comparison policy replacing the whole current one; null keeps it
object
The fields compared. Empty compares a structured item whole; an entity always compares source, id, name, description and labels, and these are added to them
Fields removed before comparing, so a change to one is never a change. May not overlap compareFields
The path to each item’s key in a structured result. Required when the result is an array; for a single object it is optional. Unused for entities, which are keyed by source and id
Array fields of objects, each mapped to the path of the key within an element: elements are ordered by that key before comparing, so a reordering is not a change
object
ENTITIES compares the lens’s graph entities, STRUCTURED its structured data, and AUTO (the default) picks STRUCTURED only when the lens returned no entities but did return data
Array fields compared as unordered sets, so a reordering is not a change
Named transitions to recognise among an updated item’s field changes
A named domain transition: matched when one field of an updated item changes in the stated way. Every condition given must hold, and at least one must be given
object
Matches a numeric field going from at or below this value to above it
Matches a numeric field going from at or above this value to below it
The dotted path of the field watched. Must be in compareFields, or one of an entity’s own source, id, name, description or labels
The JSON value the field must have changed from. Absent matches any
object
What to call the transition; reported as the kind of each one detected
The JSON value the field must have changed to. Absent matches any
object
True switches the watch on, false switches it off; null leaves it as it is
Replacement first-run policy; null keeps the current one
New label; null or blank keeps the current one
Lens arguments replacing the whole current map; null keeps the current ones
object
Responses
Section titled “Responses”OK
object
Example generated
{}
