Audience:
Developers
Cancel a consent
Cancel a pending consent request before it's completed. Consents can be canceled by you or your user as long as the consent has a non-final status.
Prerequisites
- You need a project access token or user access token.
- The consent must have one of the non-final statuses (
Created,Started, or, for multi-consents,OperationCommitting).
Guide
- Call the
cancelConsentmutation. - Add your consent ID.
- Add the success payload and rejections.
Mutation
Open in API Explorermutation CancelConsent {
cancelConsent(input: { consentId: "$YOUR_CONSENT_ID" }) {
... on CancelConsentSuccessPayload {
__typename
consent {
id
status
}
}
... on ConsentNotFoundRejection {
__typename
consentId
message
}
... on NotReachableConsentStatusRejection {
__typename
currentStatus
unreachableStatus
message
}
}
}
Payload
{
"data": {
"cancelConsent": {
"__typename": "CancelConsentSuccessPayload",
"consent": {
"id": "$YOUR_CONSENT_ID",
"status": "Canceled"
}
}
}
}