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.
Suspend a membership​
- You have the
canManageAccountMembershippermission. - You're not suspending yourself or the legal representative's membership.
- Suspending a membership does not require consent.
- You can use either a user access token or a project access token.
- Call the
suspendAccountMembershipmutation. - Add the account membership ID.
- Add the success payload with the status.
- Add any rejections you'd like.
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 have the
canManageAccountMembershippermission. - Resuming a membership requires consent.
- You must use a user access token. Project access tokens cannot be used to resume account memberships.
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
resumeAccountMembershipmutation. - Add the account membership ID.
- Add the success payload with the
consentUrl. - Add any rejections you'd like.
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 consent 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
}
}
}
}
}
}