Close account
/accounts/{accountId}/closeRequests closure of a banking account. Credit, crypto, and investment
accounts cannot be closed through this endpoint and return 400.
Requires accounts:close in the
organization the account belongs to. The accounts:write permission
is not required.
Closing an account can also close associated cards. Closed accounts retain their history and can still be retrieved.
The response indicates whether the account was closed or closure was
blocked. Both outcomes return 200, so check the response’s status.
If status is blocked, review blockers for the reasons. Resolve them
before retrying. If blockedByFundsHold is true, contact Flex support.
Include an idempotencyKey with every request. A blocked request can be
retried with the same key after its blockers are resolved. After a
successful closure, repeating the request with the same API key and
idempotency key returns closed without repeating the operation.
Reusing the key for a different account returns 409.
Path parameters
accountIdstring (uuid)
ID of the account to close, returned by GET /accounts or POST /accounts.
Headers
flex-versionstring
pattern ^\d{4}-\d{2}-\d{2}$
Request body
Idempotency key for the account closure request.
idempotencyKeystring
Unique value identifying this closure request, between 1 and 255 characters. Reuse it when retrying the same request, including after resolving blockers.
min length 1
max length 255
Responses
Closure request evaluated. Check status to determine whether the account was closed or closure was blocked.
application/jsonResult of the account closure request.
accountIdstring (uuid)
ID of the account requested for closure.
statusstring
Closure outcome: closed means the account was closed; blocked means closure was prevented and no changes were made.
blockedclosedblockersarray of string
Reasons preventing closure. Each entry describes an issue that must be resolved. Empty when status is closed.
blockedByFundsHoldboolean
Whether a funds hold is preventing closure. If true, contact Flex support to resolve it.
The account ID or request body is invalid, or the account is not a banking account.
application/jsonDetails of a failed request.
statusCodeinteger
HTTP status code for the error.
messagestring
Summary of the error.
errorsmap of string
Additional details about invalid fields or the reason the request failed.
flexErrorCodestring
Machine-readable error code, when provided.
Your API key has no accounts:close permission in any organization.
application/jsonDetails of a failed request.
statusCodeinteger
HTTP status code for the error.
messagestring
Summary of the error.
errorsmap of string
Additional details about invalid fields or the reason the request failed.
flexErrorCodestring
Machine-readable error code, when provided.
No account with that ID exists in an organization your API key has permission to close accounts in.
The idempotency key was used with different request data, or a request with the same key is still running.
application/jsonDetails of a failed request.
statusCodeinteger
HTTP status code for the error.
messagestring
Summary of the error.
errorsmap of string
Additional details about invalid fields or the reason the request failed.
flexErrorCodestring
Machine-readable error code, when provided.
Rate limit exceeded. The Retry-After response header specifies how many seconds to wait before retrying.
Account closure could not be completed and may have partially succeeded. Contact Flex support before retrying.
application/jsonDetails of a failed request.
statusCodeinteger
HTTP status code for the error.
messagestring
Summary of the error.
errorsmap of string
Additional details about invalid fields or the reason the request failed.
flexErrorCodestring
Machine-readable error code, when provided.
Request template
curl -X POST 'https://api.flex.one/accounts/<accountId>/close' \
-H "Authorization: Bearer $FLEX_API_KEY" \
-H 'flex-version: 2026-10-23' \
-H 'Content-Type: application/json' \
-d '{
"idempotencyKey": "21c0099e-64f4-4215-a3bd-61b2eb896c02"
}'Response 200
{
"accountId": "470195c7-4cf3-4df3-9f92-80848be0a3ad",
"status": "closed",
"blockers": [],
"blockedByFundsHold": false
}