Skip to content

Policy methods: update, delete

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

Reference for Policy, one group of Policy methods.

Policy.update

Changes the given properties of a Policy. Verb page.

TypeScript
interface PolicyVerbs {
  update(input: PolicyUpdateInput, options?: SB.CallOptions): SB.Call<Policy>
}

Emits Policy.updated.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Policy.
ruletextThe ruling, stated so code can apply it.

Returns

OutputTypeRequiredDescription
policyPolicyrequiredThe Policy.

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 policy = await $.Policy.update({ id: 'policy_rTYxr62HGB', rule: 'Example rule' })

Policy.delete

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

TypeScript
interface PolicyVerbs {
  delete(input: PolicyDeleteInput, options?: SB.CallOptions): SB.Call<Policy>
}

Emits Policy.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Policy.

Returns

OutputTypeRequiredDescription
policyPolicyrequiredThe Policy.

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 policy = await $.Policy.delete({ id: 'policy_rTYxr62HGB' })