Remove External Account
This endpoint removes a linked external bank account from a specified customer profile. Before processing the closure, the API validates that all prerequisites are met — such as no pending transactions and a zero account balance — to ensure a clean and complete removal. Upon successful validation, the external account is unlinked from the profile and any associated services are terminated.
Endpoint
POST /netevia/externalAccount/close/{profileId}
Authentication
Bearer token required. Obtain via:
POST https://api.banking.netevia.dev/api/auth/v2
Include in header: Authorization: Bearer {token}
Token lifetime: 10 minutes. Refresh via POST /api/auth/refresh.
When to use
Use this endpoint when a customer wishes to disconnect a previously linked external bank account (connected via Finicity or Plaid) from their profile. This is appropriate when a customer wants to remove an outdated or unneeded external account, or when closing their relationship with a particular external institution. Ensure all pending transactions have cleared and the account balance is zero before calling this endpoint to avoid validation errors.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| profileId | integer (int32) | Yes | The unique identifier of the customer profile whose external account is to be removed. |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| financialAccountId | string | No | The identifier of the specific financial account to close. If omitted, the default linked external account for the profile is targeted. |
Response
200 OK
The response may return one of two schemas depending on context:
boardingresponse (base response):
| Field | Type | Description |
|---|---|---|
| profileId | integer (int32) | The profile ID associated with the request. |
| errors | string or null | Error message if the operation encountered an issue; null on success. |
| success | boolean | Indicates whether the external account was successfully removed. |
| changeLog | array or null | List of change log entries describing what was modified during the operation. |
changeLog item fields:
| Field | Type | Description |
|---|---|---|
| requestType | integer (int32) | Enum value indicating the type of banking request performed. |
| changes | string or null | Description of the specific change recorded in this log entry. |
openfinancialaccountresponse (extended response, includes all boardingresponse fields plus):
| Field | Type | Description |
|---|---|---|
| financialAccountId | string or null | The identifier of the financial account that was affected by this operation. |
{
"profileId": 100234,
"errors": null,
"success": true,
"changeLog": [
{
"requestType": 5,
"changes": "External account unlinked from profile."
}
]
}Error Codes
| Code | When it happens |
|---|---|
| 400 | Missing required fields, validation error, pending transactions exist, or account balance is not zero |
| 401 | Token missing, expired, or invalid |
| 403 | Insufficient permissions to remove external account for this profile |
| 404 | Profile ID not found or no external account linked to the specified profile |
| 500 | Internal server error |
Common Mistakes
- Calling this endpoint while the external account still has a non-zero balance or pending transactions; ensure the account is fully settled before requesting closure.
- Omitting
financialAccountIdwhen a profile has multiple external accounts linked, which may result in an ambiguous or unexpected account being targeted. - Using an expired or invalid Bearer token; tokens expire after 10 minutes and must be refreshed via
POST /api/auth/refreshbefore retrying. - Passing a
profileIdthat belongs to a profile type that does not support external accounts, or using a profile ID from a different partner context.
Related Endpoints
POST /netevia/externalAccount/add/{profileId}— Link a new external bank account to a customer profileGET /netevia/externalAccount/{profileId}— Retrieve linked external accounts for a customer profilePOST https://api.banking.netevia.dev/api/auth/v2— Obtain a Bearer authentication tokenPOST /api/auth/refresh— Refresh an existing Bearer token
Example
curl -X POST "https://api.banking.netevia.dev/netevia/externalAccount/close/100234?financialAccountId=fa-XXXXXXXXXX" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json"