Skip to main content

Configure consent notifications

You can declare a preferred notification channel for your users and configure how your consent notifications appear.

Please note that if you're using Swan's Web Banking interface, Swan sends a text message to your users for one-time passwords, logins, and consents, regardless of preferred channel and configuration.

Timeout

Your integration has three seconds to respond to a consent notification. If your response is anything other than a 200 OK HTTP, or there's no response at all, Swan cancels the consent and redirects your user.

Declare preferred notification channel​

You can specify how your user would like to receive consent notifications, referred to as their preferred channel.

  1. Call the updateUserConsentSettings mutation with a project access token.
  2. Enter the user's userId.
  3. Choose the preferred channel:
    1. Sms (default value): Swan sends a text message to the user with the SCA link to open on their mobile device.
    2. App: You receive a notification, then send the SCA link to your user yourself.

Mutation​

🔎 Open the mutation in API Explorer

mutation PreferredChannel {
updateUserConsentSettings(
input: {
userId: "$YOUR_USER_ID"
preferredNotificationChannel: Sms
}
) {
... on UpdateUserConsentSettingsSuccessPayload {
__typename
userConsentSettings {
preferredNotificationChannel
}
}
... on UpdateUserConsentSettingsTokenRejection {
__typename
message
}
}
}

Payload​

Notice the preferred channel Sms (line 6).

{
"data": {
"updateUserConsentSettings": {
"__typename": "UpdateUserConsentSettingsSuccessPayload",
"userConsentSettings": {
"preferredNotificationChannel": "Sms"
}
}
}
}

Configure consent notification​

Configure your consent notification on your Dashboard.

  1. Go to Dashboard > Developers > Consent notification.
  2. Enter your endpoint, secret key, accent color, and logo.
  3. Click Save.

Image of Dashboard consent notification

Along with a notification, you'll receive an authorizationUrl and the consent object to display to your user on their mobile. On desktop, Swan displays the consentUrl.

While consent is ongoing, the user's mobile plays a repeated image with your accent color and logo.