Close account

POST
/accounts/{accountId}/close

Requests 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

accountId

string (uuid)

required

ID of the account to close, returned by GET /accounts or POST /accounts.

Headers

flex-version

string

pattern ^\d{4}-\d{2}-\d{2}$

Request body

Idempotency key for the account closure request.

idempotencyKey

string

required

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

200

Closure request evaluated. Check status to determine whether the account was closed or closure was blocked.

application/json

Result of the account closure request.

accountId

string (uuid)

required

ID of the account requested for closure.

status

string

required

Closure outcome: closed means the account was closed; blocked means closure was prevented and no changes were made.

blockedclosed
blockers

array of string

required

Reasons preventing closure. Each entry describes an issue that must be resolved. Empty when status is closed.

blockedByFundsHold

boolean

required

Whether a funds hold is preventing closure. If true, contact Flex support to resolve it.

400

The account ID or request body is invalid, or the account is not a banking account.

application/json

Details of a failed request.

statusCode

integer

required

HTTP status code for the error.

message

string

required

Summary of the error.

errors

map of string

Additional details about invalid fields or the reason the request failed.

flexErrorCode

string

Machine-readable error code, when provided.

403

Your API key has no accounts:close permission in any organization.

application/json

Details of a failed request.

statusCode

integer

required

HTTP status code for the error.

message

string

required

Summary of the error.

errors

map of string

Additional details about invalid fields or the reason the request failed.

flexErrorCode

string

Machine-readable error code, when provided.

404

No account with that ID exists in an organization your API key has permission to close accounts in.

409

The idempotency key was used with different request data, or a request with the same key is still running.

application/json

Details of a failed request.

statusCode

integer

required

HTTP status code for the error.

message

string

required

Summary of the error.

errors

map of string

Additional details about invalid fields or the reason the request failed.

flexErrorCode

string

Machine-readable error code, when provided.

429

Rate limit exceeded. The Retry-After response header specifies how many seconds to wait before retrying.

500

Account closure could not be completed and may have partially succeeded. Contact Flex support before retrying.

application/json

Details of a failed request.

statusCode

integer

required

HTTP status code for the error.

message

string

required

Summary of the error.

errors

map of string

Additional details about invalid fields or the reason the request failed.

flexErrorCode

string

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
}