Skip to main content

Update a membership

You can update the permissions for an existing account membership, as well as the account member's personal information, with the API. You can also update the membership to fix user binding errors.

If you use Swan's Web Banking interface, your users can also update account memberships from their Web Banking accounts.

Prerequisites
  • You have the canManageAccountMembership permission.
  • The account membership status isn't ConsentPending or Disabled.
  • You're not updating the legal representative's membership (unless you're the legal representative).
  • If you're granting a permission to another account member, you have that permission already. You can't grant permissions you don't have.

Update a membership​

  1. Call the updateAccountMembership mutation.
  2. Add the account membership ID and your redirect URL.
  3. Add any information or permissions you'd like to update.
  4. Add the success payload with the consentUrl.
  5. Add rejections (not shown).
  6. Get the consentUrl from the payload and send it to the user updating the account membership. Their consent finalizes the update.

🔎 Open the mutation in API Explorer

mutation UpdateMembership {
updateAccountMembership(
input: {
accountMembershipId: "$YOUR_MEMBERSHIP_ID"
canViewAccount: true
canManageAccountMembership: false
canManageBeneficiaries: false
canManageCards: false
canInitiatePayments: false
consentRedirectUrl: "$YOUR_REDIRECT_URL"
email: "$MEMBER_EMAIL"
taxIdentificationNumber: "$MEMBER_TAX_ID"
}
) {
... on UpdateAccountMembershipSuccessPayload {
__typename
consent {
consentUrl
}
}
}
}

Payload
{
"data": {
"updateAccountMembership": {
"__typename": "UpdateAccountMembershipSuccessPayload",
"consent": {
"consentUrl": "https://identity.swan.io/consent?consentId=$YOUR_CONSENT_ID&env=Sandbox"
}
}
}
}

Fix a user binding error​

  1. Call the updateAccountMembership mutation.
  2. Add the account membership ID and your redirect URL.
  3. Add the invited account member's information that caused the error to the restrictedTo object.
  4. Add the success payload with the consentUrl.
  5. Add any rejections you'd like (not shown).
  6. Get the consentUrl from the payload and send it to the invited account member. Their consent finalizes the update.

🔎 Open the mutation in API Explorer

mutation FixBindingError {
updateAccountMembership(
input: {
accountMembershipId: "$ACCOUNT_MEMBERSHIP_ID"
consentRedirectUrl: "$YOUR_CONSENT_REDIRECT_URL"
restrictedTo: {
birthDate: "$CORRECT_BIRTH_DATE"
firstName: "$CORRECT_FIRST_NAME"
lastName: "$CORRECT_LAST_NAME"
phoneNumber: "$CORRECT_PHONE_NUMBER"
}
}
) {
... on UpdateAccountMembershipSuccessPayload {
__typename
consent {
consentUrl
}
}
}
}