Skip to content

Consent methods: withdraw

The Consent Verbs withdraw as typed SDK methods, with inputs, result, refusals and an example.

Reference for Consent, one group of Consent methods.

Consent.withdraw

Withdraw ends a Consent at once: processing for its Purpose stops, and the record is kept. Verb page.

TypeScript
interface ConsentVerbs {
  withdraw(input: ConsentWithdrawInput, options?: SB.CallOptions): SB.Call<Consent>
}

Emits Consent.withdrawn.

Inputs

InputTypeRequiredDescription
consentConsentrequiredThe Consent to end.

Returns

OutputTypeRequiredDescription
consentConsentrequiredThe withdrawn Consent.

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.
The record is not in a state that allows this Verb, so the call is refused.refusedRead the record, run the Verb that moves it to an allowed state, then retry.None.

Example

TypeScript
import { $ } from 'startup-builder'

const consent = await $.Consent.withdraw({ consent: 'consent_lMkrg7nUGY' })