Skip to content

Update a watch

PATCH
/api/v1/watches/{watchId}
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" } }'
watchId
required
string

The watch to update

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

Media typeapplication/json

The body of PATCH /watches/{watchId}; a field left out or null keeps that setting as it is.

object
clearCron
required

True removes the schedule, so the watch runs only on request; ignored when cron is also given

boolean
clearDelivery
required

True removes delivery, so diffs are kept in history only; ignored when delivery is also given

boolean
cron

Replacement cron expression, in the form create takes; blank removes the schedule. Null keeps the current schedule unless clearCron is true

string
delivery

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
channel
required

The adapter: notification (the inbox, the default), signal (the bus, for agents) or webhook (a URL). A lowercase adapter id

string
format
required

A webhook’s body: json (the whole diff, the default) or slack (a text summary an incoming webhook shows as-is)

string
headers
required

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
key
additional properties
string
secret

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

string
tier
required

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

string
url

The http(s) URL a webhook delivery is POSTed to. Required for webhook; unused otherwise

string
diffSpec

Comparison policy replacing the whole current one; null keeps it

object
compareFields
required

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

Array<string>
unique items
ignoreFields
required

Fields removed before comparing, so a change to one is never a change. May not overlap compareFields

Array<string>
unique items
keyPath

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

string
keyedListFields
required

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
key
additional properties
string
resultMode
required

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

string
Allowed values: AUTO ENTITIES STRUCTURED
setFields
required

Array fields compared as unordered sets, so a reordering is not a change

Array<string>
unique items
transitions
required

Named transitions to recognise among an updated item’s field changes

Array<object>

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
crossesAbove

Matches a numeric field going from at or below this value to above it

number format: double
crossesBelow

Matches a numeric field going from at or above this value to below it

number format: double
field
required

The dotted path of the field watched. Must be in compareFields, or one of an entity’s own source, id, name, description or labels

string
from

The JSON value the field must have changed from. Absent matches any

object
name
required

What to call the transition; reported as the kind of each one detected

string
to

The JSON value the field must have changed to. Absent matches any

object
enabled

True switches the watch on, false switches it off; null leaves it as it is

boolean
firstRunPolicy

Replacement first-run policy; null keeps the current one

string
Allowed values: ESTABLISH_BASELINE EMIT_CURRENT
name

New label; null or blank keeps the current one

string
params

Lens arguments replacing the whole current map; null keeps the current ones

object
key
additional properties

OK

Media typeapplication/json
object

Example generated

{}