Topolo Docs Topolo Platform
Open workspace

Erase organization data

Erase Books-held organization data after literal ERASE confirmation. Posted ledger events and audit rows are retained as redacted integrity records; everything else is deleted and re-counted, failing closed on any survivor.

Outcome

Erase Books-held organization data after literal ERASE confirmation. Posted ledger events and audit rows are retained as redacted integrity records; everything else is deleted and re-counted, failing closed on any survivor.

Before you start

  • Verify the intended environment, authenticated identity and specifically approved organization context.
  • The published application permission is privacy:write. Privacy export/erasure is organization-wide; a workspace header does not narrow its effects.
  • Approve the actual mutation, accounting inputs and any provider/recipient effects before CLI --confirm or MCP confirm:true. Fixture identifiers and simulated provider responses authorize no live operation.

Discover the target

topolo whoami --json
topolo actions get app_topolo_books.organizations.data.erase --detail --json
  • organizationId: Exact approved organization id from whoami. Privacy export and erasure cover that whole organization.

Request

DELETE /api/organizations/{organizationId}/data

Inspect and test this action. Save the reviewed input as payload.json; supply credential/resource context separately.

Input fields

FieldRequiredMeaningSchema and constraints
organizationIdRequiredExact approved organization id from whoami. Privacy export and erasure cover that whole organization.{"type":"string","minLength":1}
confirmationRequiredLiteral confirmation required by this schema, such as ERASE or REPAIR; obtain approval for the actual effects first.{"type":"string","const":"ERASE"}

Inspect nested fields and the complete input schema.

Effects

  • Deletes every erasable Books row for the organization, disconnecting any bank or migration credential in Nexus first. Posted ledger events and audit rows are retained as redacted integrity records.

Interpret the response

Read $.data.organization_id for the returned organization identifier. Empty collections and nullable fields do not discover a target.

Call app_topolo_books.organizations.data.export and confirm only the retained integrity records remain.

Inspect the success schema. CLI/MCP add their own transport envelope; CLI --detail requests the full result.

Worked examples

Actual Books route handlers and the exported Worker were exercised against five local SQLite D1 concern databases with all committed migrations, the real posting Durable Object and local R2. Route captures use synthetic verified Auth; Worker captures use synthetic Auth transports. Nexus, Brand, Notify, Pay, Mercury and Xero responses are explicitly simulated at the provider transport boundary. Captures prove local request/response behavior and canonical SDK projection, not live bank access, payment movement, email delivery, provider eligibility, tax compliance, encrypted custody, scheduled execution, deployment or production completion. Fixture identities, credentials, addresses and records authorize no live operation.

Run a reviewed request

Save the input from the selected worked example as payload.json. Validate and inspect the plan before calling the action; refused examples demonstrate errors and are not instructions to execute.

CLI:

topolo actions validate app_topolo_books.organizations.data.erase --data @payload.json --json
topolo actions plan app_topolo_books.organizations.data.erase --data @payload.json --json
topolo actions call app_topolo_books.organizations.data.erase --data @payload.json --confirm --detail --json

MCP tool and arguments for the first successful example:

{
  "tool": "topolo_call_action",
  "arguments": {
    "actionId": "app_topolo_books.organizations.data.erase",
    "input": {
      "organizationId": "org_e2e_muvnp7qn2",
      "confirmation": "ERASE"
    },
    "confirm": true,
    "detail": true
  }
}

Refused response · auth_error

Input · payload.json:

{
  "organizationId": "org_topolo_platform",
  "confirmation": "ERASE"
}

Captured response · HTTP 401

{
  "error": "API key validation failed"
}

HTTP 401. SDK error code auth_error. Authenticate in the intended organization again. Verify whoami and the exact Books application/workspace binding before retrying; do not switch identity to work around a refusal.

Successful response · HTTP 200

Input · payload.json:

{
  "organizationId": "org_e2e_muvnp7qn2",
  "confirmation": "ERASE"
}

Captured response · HTTP 200

{
  "success": true,
  "data": {
    "organization_id": "org_e2e_muvnp7qn2",
    "erased": true,
    "verification": {
      "core": {
        "books_report_views": 0,
        "books_period_checklist": 0,
        "books_oauth_states": 0,
        "books_migration_sources": 0,
        "books_dimension_values": 0,
        "books_dimensions": 0,
        "books_tax_rate_components": 0,
        "books_tax_rates": 0,
        "books_periods": 0,
        "books_accounts": 0,
        "books_settings": 0,
        "books_workspaces": 0
      },
      "ledger": {
        "books_journal_attachments": 0,
        "books_recurring_journal_lines": 0,
        "books_recurring_journals": 0,
        "books_journal_draft_lines": 0,
        "books_journal_drafts": 0
      },
      "documents": {
        "books_invoice_public_share_views": 0,
        "books_invoice_public_shares": 0,
        "books_invoice_payment_sessions": 0,
        "books_recurring_invoices": 0,
        "books_document_write_offs": 0,
        "books_document_payments": 0,
        "books_document_lines": 0,
        "books_documents": 0,
        "books_contact_people": 0,
        "books_contacts": 0,
        "books_workspaces": 0
      },
      "banking": {
        "books_bank_rules": 0,
        "books_bank_reconciliations": 0,
        "books_bank_lines": 0,
        "books_bank_accounts": 0,
        "books_bank_connections": 0,
        "books_workspaces": 0
      },
      "audit": {}
    },
    "retained_for_integrity": {
      "core": {},
      "ledger": {
        "books_scheduled_reversals": 0,
        "books_journal_lines": 2,
        "books_journal_events": 1,
        "books_account_balances": 2,
        "books_ledger_cursors": 1,
        "books_workspaces": 1
      },
      "documents": {},
      "banking": {},
      "audit": {
        "books_audit_events": 2,
        "books_workspaces": 1
      }
    },
    "deleted_nexus_connections": 0,
    "deleted_attachment_objects": 0,
    "retained": {
      "topolo_auth_identity": true,
      "posted_ledger_records_redacted": true,
      "encrypted_backups_until_retention_expiry": true
    }
  }
}

HTTP 200. Call app_topolo_books.organizations.data.export and confirm only the retained integrity records remain.

Verify the result

  • Call app_topolo_books.organizations.data.export and confirm only the retained integrity records remain.

Errors and recovery

  • auth_error (HTTP 401): Authenticate in the intended organization again. Verify whoami and the exact Books application/workspace binding before retrying; do not switch identity to work around a refusal.

These are observed local refusals. Shared authentication, schema validation and resource authorization can also refuse before the route. Preserve the actual error, details and request id.

Recovery boundary

Erasure is final. Take organizations.data.export first if the data may be needed.

Evidence

Actual Books route handlers and the exported Worker were exercised against five local SQLite D1 concern databases with all committed migrations, the real posting Durable Object and local R2. Route captures use synthetic verified Auth; Worker captures use synthetic Auth transports. Nexus, Brand, Notify, Pay, Mercury and Xero responses are explicitly simulated at the provider transport boundary. Captures prove local request/response behavior and canonical SDK projection, not live bank access, payment movement, email delivery, provider eligibility, tax compliance, encrypted custody, scheduled execution, deployment or production completion. Fixture identities, credentials, addresses and records authorize no live operation.