Consent routes: withdraw
The Consent Verbs withdraw as api.sb routes, with inputs, result, refusals and an example.
Reference for Consent, one group of Consent routes.
Consent.withdraw
Withdraw ends a Consent at once: processing for its Purpose stops, and the record is kept. Verb page.
POST /{namespace}/ consents/ {consent}/ withdrawPath: consent. Emits Consent.withdrawn.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
consent | Consent | required | The Consent to end. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
consent | Consent | required | The withdrawn Consent. |
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. |
| The record is not in a state that allows this Verb, so the call is refused. | refused | Read the record, run the Verb that moves it to an allowed state, then retry. | None. |
Example
curl -X POST https: //api.sb/ leaseline.app/ consents/ consent_lMkrg7nUGY/ withdraw \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"{
"api": "https: //api.sb/ leaseline.app",
"consent": {
"$id": "https: //api.sb/ leaseline.app/ consents/ consent_lMkrg7nUGY",
"$type": "Consent",
"basis": "Example basis"
},
"action": {
"$id": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG",
"operation": "Consent.withdraw",
"status": "done"
},
"links": {
"self": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG"
}
}