Delete business

DELETE/api/v1/businesses/{business_id}

Delete a business and all associated resources (async via Temporal).

Safety: requires a JSON body with confirm_name matching the business's name (case-insensitive, trimmed) and confirm_password holding the caller's own account password, which is verified against Clerk. Guards against single-click muscle-memory deletes and against an unattended session — this endpoint wipes ~80 related tables via a Temporal workflow and is irreversible.

Cleanup Process:

  1. For each Plaid connection:
    • Teal API cleanup (transactions, journal entries, source accounts, ledgers)
    • Local DB cleanup (Transactions → Line Entries → Journal Entries → Ledgers)
    • PlaidItem deletion
    • Plaid token revocation
  2. Teal instance deletion
  3. User associations cleanup
  4. Business record deletion

Notes:

  • Deletion runs asynchronously via Temporal workflow
  • Returns immediately with workflow_id for status polling
  • This action is irreversible
Operation ID: delete_business_api_v1_businesses__business_id__delete·View as markdown·OpenAPI slice

Authentication

Bearer token authentication. Pass your DayZero API token in the Authorization header and the target business UUID in x-business-id.

Parameters

Path

business_idstringrequired

Request body

confirm_passwordstring · passwordrequired

The calling user's own account password, retyped at the moment of the request. Verified against Clerk before anything is deleted; a wrong password rejects the request with 403 and changes nothing.

business_idstring
confirm_namestringrequired

Exact business name as a typed confirmation. Must match the persisted business name (case-insensitive, trimmed). Required.

preserve_teal_instanceboolean
preserve_dz_usersboolean

Responses

202Successful Response

successboolean
messagestring
codestring

422Validation Error

detailarray · ValidationErrorValidationError
5 fields
locarray · string | integerrequired
msgstringrequired
typestringrequired
inputobject
ctxobject