Skip to main content

Audience:

Developers

Send or resend a membership invitation notification

Send the invitation notification email to an invited account member with the sendAccountMembershipInviteNotification mutation.

With Swan's Web Banking, the invitation email is sent automatically when the membership is created. Use this mutation to send the invitation yourself with an API-only integration, or to resend it if the invited member didn't receive their email.

Prerequisites
  • You must authenticate with a user access token associated with an existing account member who has the canManageAccountMembership permission. Only account members with that permission can send invitation notifications.
  • The account membership status must be InvitationSent.
  • You can send up to five invitation emails per day per membership.

Guide

Step 1: Call the mutation

Call the sendAccountMembershipInviteNotification mutation with the accountMembershipId of the membership for which you want to send the invitation.

You can optionally include a redirectUrl parameter. When the end user completes the OAuth flow, Swan redirects them to your redirect URL with an authorization code and state. If you include a redirectUrl, it must be registered in your Dashboard. If you don't include one, the user is redirected to Swan's Web Banking.

Open in API Explorer
mutation ResendInvitation {
sendAccountMembershipInviteNotification(
# redirectUrl is optional; if provided, it must be registered in your Dashboard
input: { accountMembershipId: "$YOUR_ACCOUNT_MEMBERSHIP_ID", redirectUrl: "$YOUR_REDIRECT_URL" }
) {
... on SendAccountMembershipInviteNotificationSuccessPayload {
__typename
notificationRequestId
}
... on AccountMembershipNotFoundRejection {
id
message
}
... on AccountMembershipStatusNotEligibleRejection {
message
}
... on MaximumDailyInvitationsReachedRejection {
message
}
... on UserNotAllowedToManageAccountMembershipRejection {
message
}
... on UserNotAllowedToSendAccountMembershipInvitationRejection {
message
}
... on AccountMembershipCustomInvitationCannotBeCreatedRejection {
projectId
message
}
... on ForbiddenRejection {
message
}
... on ValidationRejection {
fields {
code
message
path
}
message
}
}
}

Step 2: Receive the confirmation

The API returns a notificationRequestId that you can use to track the email delivery if needed.

If a user reports problems with email delivery, give this ID to Swan Support to help investigate the issue.

{
"data": {
"sendAccountMembershipInviteNotification": {
"__typename": "SendAccountMembershipInviteNotificationSuccessPayload",
"notificationRequestId": "3f5a787a-5709-43a2-90dd-7508b71cdf7b"
}
}
}
Delivery status

The API currently does not display the delivery status of notifications. Contact Swan Support if you encounter any issues with email delivery.

Rejection reasons

The mutation can return several rejection reasons if the request can't be completed:

RejectionReason
AccountMembershipNotFoundRejectionThe account membership ID doesn't exist.
AccountMembershipStatusNotEligibleRejectionThe account membership status must be InvitationSent to send an invitation notification.
AccountMembershipCustomInvitationCannotBeCreatedRejectionThe invitation link can't be created for this account membership.
MaximumDailyInvitationsReachedRejectionYou've reached the maximum of five invitation emails per day for this membership.
UserNotAllowedToManageAccountMembershipRejectionThe authenticated user doesn't have the canManageAccountMembership permission.
UserNotAllowedToSendAccountMembershipInvitationRejectionThe user's account membership status must be Enabled to send invitations.
InternalErrorRejectionAn unexpected server error occurred on Swan's side.
ForbiddenRejectionThe operation is forbidden in the current context.
ValidationRejectionThe request contains validation errors.

Notification details

The invitation email's recipient, language, branding, and translations are described in the membership notifications concept. The inviting members concept covers how the invited member accepts the invitation and binds their Swan user to the membership.