Skip to content

Watch methods: update, delete

The Watch Verbs update, delete as typed SDK methods, with inputs, result, refusals and an example.

Reference for Watch, one group of Watch methods.

Watch.update

Changes the given properties of a Watch. Verb page.

TypeScript
interface WatchVerbs {
  update(input: WatchUpdateInput, options?: SB.CallOptions): SB.Call<Watch>
}

Emits Watch.updated.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Watch.
selectorstringThe Event selector, such as Order.placed.
urlurlWhere deliveries go.
payloadstringOne of full, or thin: the record as the Action left it, or only its versioned address. The default is full.

Returns

OutputTypeRequiredDescription
watchWatchrequiredThe Watch.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const watch = await $.Watch.update({ id: 'watch_9o4vCuR17L', url: 'https://leaseline.app' })

Watch.delete

Deletes a Watch: a soft delete that keeps its history, undone by Thing.restore. Verb page.

TypeScript
interface WatchVerbs {
  delete(input: WatchDeleteInput, options?: SB.CallOptions): SB.Call<Watch>
}

Emits Watch.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Watch.

Returns

OutputTypeRequiredDescription
watchWatchrequiredThe Watch.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const watch = await $.Watch.delete({ id: 'watch_9o4vCuR17L' })