Skip to main content

Watchers

RevOps rules that fire on entity conditions. Each watcher watches one field on one entity; evaluating it records a fire row per matching record.

All endpoints require a Bearer JWT in the Authorization header plus an X-Workspace-Id header selecting the workspace.

Watchable fields

deal:    value, stage, probability
company: employees, tier, lifecycle_stage
contact: score, stage
issue:   priority, status, story_points

operators: equals | not_equals | over | under | contains
GET/api/watchersAuth required

List watchers with their fire counts.

Query Parameters

FieldTypeRequiredNote
enabledbooleanNo—

Response

[
  {
    "id": 1,
    "workspace_id": 1,
    "name": "Big deals stalling",
    "entity": "deal",
    "field": "value",
    "operator": "over",
    "value": "100000",
    "action": "flag",
    "enabled": true,
    "fires": 3
  }
]
POST/api/watchersAuth required

Create a watcher. Returns 422 for an unknown entity, operator, or non-watchable field.

Request Body

FieldTypeRequiredNote
namestringYesRequired
entitystringYesdeal | company | contact | issue
fieldstringYesMust be watchable on the entity
operatorstringYesequals | not_equals | over | under | contains
valuestringNoCompared against the field
actionstringNoDefault 'flag'
enabledbooleanNoDefault true

Response

{
  "id": 2,
  "name": "Whale companies",
  "entity": "company",
  "field": "employees",
  "operator": "over",
  "value": "1000",
  "enabled": true,
  "fires": 0
}
GET/api/watchers/firesAuth required

List fire history across watchers, newest first.

Query Parameters

FieldTypeRequiredNote
watcher_idnumberNo—
limitnumberNoDefault 50, max 200

Response

[
  {
    "id": 4,
    "workspace_id": 1,
    "watcher_id": 1,
    "watcher_name": "Big deals stalling",
    "entity": "deal",
    "entity_id": 7,
    "summary": "Big deals stalling: deal #7 matched value over 100000"
  }
]
GET/api/watchers/{watcher_id}Auth required

Get a watcher with its fire count.

Response

{
  "id": 1,
  "name": "Big deals stalling",
  "entity": "deal",
  "field": "value",
  "operator": "over",
  "value": "100000",
  "enabled": true,
  "fires": 3
}
PATCH/api/watchers/{watcher_id}Auth required

Update a watcher. All fields optional; returns 400 when no fields are provided.

Request Body

FieldTypeRequiredNote
namestringNo—
entitystringNo—
fieldstringNo—
operatorstringNo—
valuestringNo—
actionstringNo—
enabledbooleanNo—

Response

{ "id": 1, "name": "Big deals stalling", "enabled": false, "fires": 3 }
DELETE/api/watchers/{watcher_id}Auth required

Delete a watcher and its fire history.

Response

{ "deleted": 1 }
POST/api/watchers/{watcher_id}/evaluateAuth required

Run the watcher's condition against live rows and record one fire per match. Disabled watchers return zero matches.

Response

{ "watcher_id": 1, "matches": [7, 12], "fires_recorded": 2 }