Skip to content

Mandate.authorize

Let an agent act as you inside one Limit, until a date you set.

Action class
None
Approval
Runs on its own
Emits
Mandate.authorized
Price
Free
POST https://api.sb/{your-domain}/mandates/authorize

Gives your agent a standing approval: one Verb, inside one Limit, until the date you set. The hub’s definition of Mandate.authorize.

Inputs

NameTypeDefaultMeaning
agentAgentRequiredThe agent that receives your standing approval.
verbstringRequiredThe Verb it covers, as Noun.verb.
limitLimitRequiredThe bound your standing approval holds to.
forPartynullThe person the agent acts for, under delegation: the principal and author of record. Unset: the caller is the principal.
channelsChannel[][]The Channels it may send through. Empty: the Channels the Agent’s Permissions already allow.
topicsstring[][]What it may send about; a send outside them becomes an Approval. Empty: no send becomes an Approval for its topic.
approvejsonnullThe approval rule for one-way sends, such as the first 20 waiting for an Approval. Unset: the approval rule by action class on the hub’s approvals page applies.
windowstringnullThe delay window each one-way send waits, as a duration. Unset: each Verb’s own delay window.
expiresAtdatetimenow + 60dWhen your standing approval lapses. Unset: 60 days after it is authorized.

Outputs

FieldTypeWhat null means
mandateMandateNever null.
mandate.statusstringNever null: active once authorized; in try mode, the status it would take.
mandate.limitLimitNever null: the Limit every Action under it is checked against before it runs.
mandate.expiresAtdatetimeNever null: a standing approval always lapses, at the date sent or 60 days out.

Effects

Action class

None: no approval rule names it, so it runs within its seat’s Permissions and Limits

Modes
  • try: Checks the Limit against the authorizer’s own Permissions and returns your standing approval as it would stand; nothing is granted.
  • send: Returns a pending Action while its delay window runs; the Agent acts under your standing approval once Mandate.authorized fires.
  • do: Holds the call for the Mode’s hold time, then returns 202 with the pending Action if the window is still open.
Idempotency

Only with a key: the same Idempotency-Key and input return the first Action, and the same key with other input returns 409. A repeat without a key grants a second standing approval; every Action names the one it ran under.

Saved or shared

The standing approval keeps its principal, so every Action under it records whom it acted for. Mandate.revoke ends it at once.

Emits

Mandate.authorized with { mandate, agent, verb, limit, expiresAt }

Performed by

Treasurer

Price

Free on your own account: the platform charges nothing for the call.

On each Venue

None.

What try does

None.

Refuses when

This call has no refusals of its own. Every call through an account can also meet the shared account refusals: grant-missing, needs-reauth, account-not-connected, over-mandate, quota-reached, venue-rejected.

When it waits

FactValue
send returnsA pending Action, reason: 'awaitingTime', while its delay window runs.
Delivered byMandate.authorized

Example

Text
Let my paid media agent open the LinkedIn test without asking me, up to
$100 of spend, until November 30.

To retry, send the same Idempotency-Key: the retry returns the first answer for $0. A new key reads again.

Test values

A sk_test_ key answers these the same way every time, at $0 (every test value).

Test valueAlways returnsWhat it is for
limit: { amount: { amount: 1000000, currency: 'USD' } }{"status":"active","limit":{"amount":{"amount":5000,"currency":"USD"}}}A test authorizer holds a $5,000 spend Permission, so a wider Limit comes back narrowed to it: a standing approval never widens a Permission.
maxCost: 0.0001Refuses with max-costAny priced call with a maxCost of 0.0001 is refused before it spends: the price is above the cap.
rate-limited.testRefuses with rate-limitedAny call naming this hostname answers 429 with Retry-After, so your retry logic runs.
sources-busy.testRefuses with sources-busyAny call naming this hostname answers 503 as if every route were busy, and nothing is spent.

Used by