Mandate methods: authorize, pause, resume
The Mandate Verbs authorize, pause, resume as typed SDK methods, with inputs, result, refusals and an example.
Reference for Mandate, one group of Mandate methods.
Mandate.authorize
Authorize grants an Agent a standing Mandate to perform a Verb within a Limit, without asking each time. Verb page.
interface MandateVerbs {
authorize(input: MandateAuthorizeInput, options?: SB.CallOptions): SB.Call<Mandate>
}Emits Mandate.authorized.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
agent | Agent | required | The agent that receives the Mandate. |
verb | string | required | The Verb it covers, as Noun.verb. |
limit | Limit | required | The bound the Mandate holds to. |
for | Party | The person the agent acts for, under delegation: the principal and author of record. | |
channels | list of Channel | The Channels it may send through. | |
topics | string[] | What it may send about; a send outside them becomes an Approval. | |
approve | json | The approval rule for one-way sends, such as the first 20 waiting for an Approval. | |
window | string | The delay window each one-way send waits, as a duration. | |
expiresAt | datetime | When the Mandate lapses. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
mandate | Mandate | required | The active Mandate. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The input does not match the schema of the operation. | invalid-input | Read the schema of the operation, then send every required field with the right type. | None. |
| 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 mandate = await $.Mandate.authorize({ agent: 'agent_tCzKDMorKn', verb: 'Example verb', limit: 'limit_UWHXYVKsJB' })Mandate.pause
Pause stops every new Action under a Mandate at once and keeps its scope, so it can resume unchanged. Verb page.
interface MandateVerbs {
pause(input: MandatePauseInput, options?: SB.CallOptions): SB.Call<Mandate>
}Emits Mandate.paused.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
mandate | Mandate | required | The Mandate to hold. |
reason | text | Why the Mandate stops. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
mandate | Mandate | required | The paused Mandate. |
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 mandate = await $.Mandate.pause({ mandate: 'mandate_mKKPrmFQYD' })Mandate.resume
Resume restarts a paused Mandate with its scope, Limits and approval rule unchanged. Verb page.
interface MandateVerbs {
resume(input: MandateResumeInput, options?: SB.CallOptions): SB.Call<Mandate>
}Emits Mandate.resumed.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
mandate | Mandate | required | The paused Mandate. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
mandate | Mandate | required | The active Mandate. |
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 mandate = await $.Mandate.resume({ mandate: 'mandate_mKKPrmFQYD' })