Skip to main content

Audience:

Developers

Create a multi-consent

The createMultiConsent mutation combines up to 100 individual consents for sensitive operations into a single multi-consent, so your users can approve several sensitive operations at once with fewer consent prompts.

Prerequisites
  • All child consents must be from the same user, represented by a user access token or the same project access token impersonating that user.
  • All child consents must have the status Created.

Guide

  1. For each sensitive operation the user initiates, retrieve the consentId.
  2. Confirm that all child consents have the status Created. Otherwise, the API returns a ConsentsNotAllInCreatedStatusRejection rejection.
  3. Call the createMultiConsent mutation.
  4. Send the consentUrl to your user so they can grant the multi-consent.
  5. Your end user now needs to perform Strong Customer Authentication.

Mutation

Open in API Explorer
mutation MultipleConsent {
createMultiConsent(
input: {
redirectUrl: "$YOUR_REDIRECT_URL"
orderedConsentIds: [
{ consentId: "$CONSENT_ID_1" }
{ consentId: "$CONSENT_ID_2" }
{ consentId: "$CONSENT_ID_3" }
]
}
) {
... on CreateMultiConsentSuccessPayload {
__typename
consent {
consentUrl
}
}
}
}

Payload

Make sure to send the consentUrl (line 6) to your user.

{
"data": {
"createMultiConsent": {
"__typename": "CreateMultiConsentSuccessPayload",
"consent": {
"consentUrl": "$YOUR_CONSENT_URL"
}
}
}
}

Choose order of consents

You can choose the order in which to perform child consents with the order parameter. The order begins with 0 and continues 1, 2, and so forth. Consents are granted in ascending order, and child consents with the same order can be granted in parallel.

Open in API Explorer
mutation ChooseOrder {
createMultiConsent(
input: {
orderedConsentIds: [
{ consentId: "$CONSENT_ID_1", order: 1 }
{ consentId: "$CONSENT_ID_2", order: 1 }
{ consentId: "$CONSENT_ID_3", order: 1 }
{ consentId: "$CONSENT_ID_4", order: 1 }
{ consentId: "$CONSENT_ID_5", order: 1 }
{ consentId: "$CONSENT_ID_6", order: 0 }
{ consentId: "$CONSENT_ID_7", order: 2 }
{ consentId: "$CONSENT_ID_8", order: 1 }
{ consentId: "$CONSENT_ID_9", order: 1 }
]
redirectUrl: "$YOUR_REDIRECT_URL"
}
) {
... on CreateMultiConsentSuccessPayload {
__typename
consent {
consentUrl
}
}
... on ConsentsNotAllInCreatedStatusRejection {
__typename
consentIds
message
}
... on ConsentsNotFoundRejection {
__typename
ids
message
}
... on TooManyChildConsentsRejection {
__typename
message
}
... on ConsentsAlreadyLinkedToMultiConsentRejection {
__typename
consentIds
message
}
}
}