Skip to main content

Audience:

Developers

Suspend a membership

You might need to block an account member from accessing the account temporarily, referred to as suspend in the API. Suspending a membership doesn't require consent; resuming it does.

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

To block account members permanently, follow the guide to disable an account membership.

Prerequisites
  • You have the canManageAccountMembership permission.
  • You're not suspending yourself or the legal representative's membership.
  • You can use either a user access token or a project access token.

Guide

  1. Call the suspendAccountMembership mutation.
  2. Add the account membership ID.
  3. Add the success payload with the status.
  4. Add any rejections you'd like.

Mutation

Open 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
}
}
}
}

Payload

Suspend payload
{
"data": {
"suspendAccountMembership": {
"__typename": "SuspendAccountMembershipSuccessPayload",
"accountMembership": {
"statusInfo": {
"status": "Suspended",
"__typename": "AccountMembershipSuspendedStatusInfo",
"reason": "$SUSPENSION_REASON"
}
}
}
}
}