Skip to content

Watch

A Watch is an outbound subscription that delivers the Events a selector matches to a URL, signed, retried, and replayable.

Properties

PropertyTypeRequiredDescription
selectorstringrequiredThe Event selector, such as Order.placed.
urlurlrequiredWhere deliveries go.
payloadstringOne of full, or thin: the record as the Action left it, or only its versioned address. The default is full.

Object

JSON
{
  "$id": "https://api.sb/patentpad.com/watches/watch_1",
  "$type": "Watch",
  "selector": "Example selector",
  "url": "https://patentpad.com",
  "payload": "full"
}

Relationships

  • A Watch delivers many Events: a Watch delivers each matching Event to its URL, signed, retried and replayable. delivers, inverse deliveredBy.

Verbs

  1. createCreates a Watch.
    POST /{namespace}/watchesdoWatch.created
  2. getReturns one Watch by id.
    GET /{namespace}/watches/{id}readNo Event
  3. listReturns Watches, newest first, one page at a time.
    GET /{namespace}/watchesreadNo Event
  4. updateChanges the given properties of a Watch.
    PATCH /{namespace}/watches/{id}doWatch.updated
  5. deleteDeletes a Watch; its history is kept.
    DELETE /{namespace}/watches/{id}doWatch.deleted
  6. pausePause stops a Watch delivering while its Events keep queuing; the platform pauses a Watch whose deliveries fail for three days.
    POST /{namespace}/watches/{watch}/pausedoWatch.paused
  7. replayReplay redelivers a Watch’s Events from a chosen point, signed as they were the first time.
    POST /{namespace}/watches/{watch}/replaydoWatch.replayed
  8. resumeResume restarts a paused Watch and delivers the Events it held, oldest first.
    POST /{namespace}/watches/{watch}/resumedoWatch.resumed
  9. rotateRotate issues a new signing secret for a Watch and signs with both secrets until the old one expires.
    POST /{namespace}/watches/{watch}/rotatedoWatch.rotated

Permissions

Which Access level may call each Verb. One-way Verbs wait their delay window.

Operationowneradminmemberviewer
Watch.createYesYesYesNo
Watch.getYesYesYesYes
Watch.listYesYesYesYes
Watch.updateYesYesYesNo
Watch.deleteYesYesYesNo
Watch.pauseYesYesYesNo
Watch.replayYesYesYesNo
Watch.resumeYesYesYesNo
Watch.rotateYesYesYesNo

Call it

Text
Replay the latest watch.

Example

A dental group registers a Watch for Reminder.confirmed Events to https://hooks.brightsmiles.dental/reminders. Each delivery is signed, retried on failure, and replayable after an outage.