> ## Documentation Index
> Fetch the complete documentation index at: https://docs.teal.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete multiple ledgers in bulk

> Deletes multiple Ledgers in bulk and optionally their associated journal entries.  By default, ledgers with line entries cannot be deleted. Set delete_journal_entries=true to delete each ledger along with: - All journal entries that have line entries on that ledger - All line entries in those journal entries - All reconciliations for that ledger - The source account for that ledger (if not linked to Plaid) - Historical ledger balances  Returns a list of results for each ledger in the request, indicating success or failure for each individual deletion. Special ledgers cannot be deleted.  Note: This operation is irreversible.



## OpenAPI

````yaml DELETE /v0/bulk/ledgers
openapi: 3.1.0
info:
  title: Teal API
  version: '0.1'
servers:
  - url: https://api.sandbox.teal.dev
    description: Sandbox
  - url: https://api.teal.dev
    description: Production
security: []
paths:
  /v0/bulk/ledgers:
    delete:
      tags:
        - Ledgers
      summary: Delete multiple ledgers in bulk
      description: >-
        Deletes multiple Ledgers in bulk and optionally their associated journal
        entries.


        By default, ledgers with line entries cannot be deleted. Set
        delete_journal_entries=true

        to delete each ledger along with:

        - All journal entries that have line entries on that ledger

        - All line entries in those journal entries

        - All reconciliations for that ledger

        - The source account for that ledger (if not linked to Plaid)

        - Historical ledger balances


        Returns a list of results for each ledger in the request, indicating
        success or failure

        for each individual deletion. Special ledgers cannot be deleted.


        Note: This operation is irreversible.
      operationId: delete_ledgers_bulk_v0_bulk_ledgers_delete
      parameters:
        - name: ledger_ids
          in: query
          required: true
          schema:
            type: array
            items:
              type: string
            description: A comma separated list of ledger IDs.
            teal_explode: false
            title: Ledger Ids
          description: A comma separated list of ledger IDs.
        - name: delete_journal_entries
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              Whether to delete journal entries associated with these ledgers.
              When true, deletes all journal entries containing line entries on
              these ledgers, along with reconciliations and source accounts (if
              not linked to Plaid)This operation is irreversible.
            default: false
            title: Delete Journal Entries
          description: >-
            Whether to delete journal entries associated with these ledgers.
            When true, deletes all journal entries containing line entries on
            these ledgers, along with reconciliations and source accounts (if
            not linked to Plaid)This operation is irreversible.
        - name: teal-instance-id
          in: header
          required: true
          schema:
            type: string
            description: The Teal instance ID
            title: Teal-Instance-Id
          description: The Teal instance ID
      responses:
        '207':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LedgerDeleteResult'
                title: Response Delete Ledgers Bulk V0 Bulk Ledgers Delete
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TealErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TealErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TealErrorResponse'
          description: Unprocessable Content
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TealErrorResponse'
          description: Service Unavailable
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    LedgerDeleteResult:
      properties:
        success:
          type: boolean
          title: Success
          description: Whether the ledger deletion was successful.
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: The error message if deletion failed
      type: object
      required:
        - success
      title: LedgerDeleteResult
    TealErrorResponse:
      properties:
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
          description: A description of the error for API developers.
        data:
          title: Data
          description: Data associated with the error.
        display_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Display Message
          description: A description of the error for end users.
        error_code:
          anyOf:
            - $ref: '#/components/schemas/TealErrorCode'
            - type: 'null'
          description: Error code associated with the error.
      type: object
      required:
        - message
      title: TealErrorResponse
    TealErrorCode:
      type: string
      enum:
        - invalid_date
        - invalid_ledger
        - missing_parameters
        - duplicate_name
        - duplicate_sort_code
        - invalid_ledger_type
        - invalid_ledger_report_cash_flow
        - deleting_required_ledger
        - repeated_tag_group
        - deleting_transaction_line
        - modifying_read_only_ledger
        - debits_credits_not_equal
        - modifying_datetime_opening_balance
        - modifying_accrual_journal_entry
        - modifying_payment_application_journal_entry
        - reconciliation_in_progress
        - reconciled_balance_does_not_match
        - journal_entry_outside_reconciliation_period
        - entries_start_date_after_transactions
        - entries_start_date_after_reconciliations
        - entries_start_date_after_journal_entries
      title: TealErrorCode
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      description: >-
        Bearer authentication header of the form Bearer <token>, where <token>
        is your auth token.
      flows:
        password:
          scopes: {}
          tokenUrl: https://developer.teal.dev

````