Audience:
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.
- You must authenticate with a user access token associated with an existing account member who has the
canManageAccountMembershippermission. 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.
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"
}
}
}
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:
| Rejection | Reason |
|---|---|
AccountMembershipNotFoundRejection | The account membership ID doesn't exist. |
AccountMembershipStatusNotEligibleRejection | The account membership status must be InvitationSent to send an invitation notification. |
AccountMembershipCustomInvitationCannotBeCreatedRejection | The invitation link can't be created for this account membership. |
MaximumDailyInvitationsReachedRejection | You've reached the maximum of five invitation emails per day for this membership. |
UserNotAllowedToManageAccountMembershipRejection | The authenticated user doesn't have the canManageAccountMembership permission. |
UserNotAllowedToSendAccountMembershipInvitationRejection | The user's account membership status must be Enabled to send invitations. |
InternalErrorRejection | An unexpected server error occurred on Swan's side. |
ForbiddenRejection | The operation is forbidden in the current context. |
ValidationRejection | The 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.