Customize Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorized as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.

Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.

Skip to main content

Use the API to close an account

If the account's legal representative requests account closure, start the process with the API.

Suspended accounts

Only Swan can act on Suspended accounts. If the status is Suspended, you can't use the API to close the account.

Guide​

  1. Call the closeAccount mutation with the legal representative's user access token.
  2. The API returns a consentUrl.
  3. Send the consentUrl to the account's legal representative so they can complete Strong Customer Authentication.
  4. As soon as the legal representative consents, the account status changes to Closing.
Account statuses

Refer to the account statuses section for an overview of what happens while an account is Closing.

Mutation​

Open in API Explorer
Mutation
mutation closeAccount {
closeAccount(
input: {
accountId: "$YOUR_ACCOUNT_ID"
reason: { type: ClosingRequested }
consentRedirectUrl: "$YOUR_REDIRECT_URL"
}
) {
... on CloseAccountSuccessPayload {
__typename
consent {
consentUrl
}
}
}
}

Payload​

Payload
{
"data": {
"closeAccount": {
"__typename": "CloseAccountSuccessPayload",
"consent": {
"consentUrl": "https://identity.swan.io/consent?consentId=$YOUR_CONSENT_ID&env=Sandbox"
}
}
}
}