Purpose methods: update, delete
The Purpose Verbs update, delete as typed SDK methods, with inputs, result, refusals and an example.
Reference for Purpose, one group of Purpose methods.
Purpose.update
Changes the given properties of a Purpose. Verb page.
interface PurposeVerbs {
update(input: PurposeUpdateInput, options?: SB.CallOptions): SB.Call<Purpose>
}Emits Purpose.updated.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
id | string | required | The id of the Purpose. |
name | string | The reason, such as marketing email or call recording. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
purpose | Purpose | required | The Purpose. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
import { $ } from 'startup-builder'
const purpose = await $.Purpose.update({ id: 'purpose_Aoz9nBatRR', name: 'Leaseline' })Purpose.delete
Deletes a Purpose: a soft delete that keeps its history, undone by Thing.restore. Verb page.
interface PurposeVerbs {
delete(input: PurposeDeleteInput, options?: SB.CallOptions): SB.Call<Purpose>
}Emits Purpose.deleted.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
id | string | required | The id of the Purpose. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
purpose | Purpose | required | The Purpose. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
import { $ } from 'startup-builder'
const purpose = await $.Purpose.delete({ id: 'purpose_Aoz9nBatRR' })