Suspend or resume a membership
You might need to block an account member from accessing the account temporarily, referred to as suspend in the API. You can also resume, or restore, access for an account member who was temporarily blocked. Note that resuming a membership requires consent, while suspending one does not.
If you use Swan's Web Banking interface, your users can also block and resume account memberships from their Web Banking accounts.
To block account members permanently, follow the guide to disable an account membership.
- You have the
canManageAccountMembership
permission. - You're not suspending yourself or the legal representative's membership.
Suspend a membership​
- Call the
suspendAccountMembership
mutation. - Add the account membership ID.
- Add the success payload with the status.
- Add any rejections you'd like.
🔎 Open the mutation in API Explorer
mutation SuspendMembership {
suspendAccountMembership(
input: { accountMembershipId: "$ACCOUNT_MEMBERSHIP_ID" }
) {
... on SuspendAccountMembershipSuccessPayload {
__typename
accountMembership {
statusInfo {
status
... on AccountMembershipSuspendedStatusInfo {
__typename
reason
status
}
}
}
}
... on InternalErrorRejection {
__typename
message
}
... on LegalRepresentativeAccountMembershipCannotBeSuspendedRejection {
id
message
}
... on UserNotAllowedToManageAccountMembershipRejection {
__typename
message
}
... on UserNotAllowedToSuspendItsOwnAccountMembershipRejection {
__typename
accountMembershipId
message
}
... on ValidationRejection {
__typename
message
fields {
code
message
path
}
}
}
}
{
"data": {
"suspendAccountMembership": {
"__typename": "SuspendAccountMembershipSuccessPayload",
"accountMembership": {
"id": "$YOUR_MEMBERSHIP_ID"
}
}
}
}
Resume a membership​
You can only resume a membership if the account membership's status was Suspended
, or temporarily blocked.
You can't resume Disabled
, or permanently blocked, memberships.
Only account members with the canManageAccountMembership
permission can resume an account membership, which requires consent.
- Call the
resumeAccountMembership
mutation. - Add the account membership ID.
- Add the success payload with the
consentUrl
. - Add any rejections you'd like.
🔎 Open the mutation in API Explorer
mutation ResumeMembership {
resumeAccountMembership(
input: {
accountMembershipId: "$ACCOUNT_MEMBERSHIP_ID"
consentRedirectUrl: "$YOUR_CONSENT_REDIRECT_URL"
}
) {
... on ResumeAccountMembershipSuccessPayload {
__typename
consent {
consentUrl
}
}
... on ForbiddenRejection {
__typename
message
}
... on UserNotAllowedToManageAccountMembershipRejection {
__typename
message
}
... on ValidationRejection {
__typename
message
fields {
code
message
path
}
}
}
}
The account holder, legal representative of the account, or account member with canManageAccountMembership
permissions must consents to resuming the membership.
{
"data": {
"resumeAccountMembership": {
"__typename": "ResumeAccountMembershipSuccessPayload",
"consent": {
"status": "Created",
"consentUrl": "https://identity.swan.io/consent?consentId=$CONSENT_ID&env=Sandbox"
"user": {
"id": "$YOUR_USER_ID",
"identificationLevels": {
"PVID": false,
"QES": false,
"expert": false
}
}
}
}
}
}