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

# Eliminar un Ledger

> Utilice este endpoint para eliminar un Ledger. El Ledger permanecerá en nuestros registros y aparecerá en las respuestas de los endpoints [Listar Ledgers](/es/reference/midaz/list-ledgers) y [Recuperar un Ledger](/es/reference/midaz/retrieve-a-ledger), con el campo `deletedAt` mostrando la fecha de eliminación.



## OpenAPI

````yaml es/openapi/v3-current/ledger.yaml delete /v1/organizations/{organization_id}/ledgers/{ledger_id}
openapi: 3.1.0
info:
  title: API de Midaz Ledger
  description: >-
    Referencia completa de la API para los servicios de Midaz Ledger, incluyendo
    gestión de organizaciones, operaciones de ledger, activos, segmentos,
    portafolios, cuentas, tipos de cuenta, transacciones, operaciones, saldos,
    rutas de operación, rutas de transacción e índices de metadatos.
  version: 3.7.8
servers:
  - url: https://ledger.sandbox.lerian.net
security: []
tags:
  - name: Organizations API
  - name: Ledgers API
  - name: Assets API
  - name: Segments API
  - name: Portfolios API
  - name: Account Types API
  - name: Accounts API
  - name: Balances API
  - name: Transactions API
  - name: Operations API
  - name: Operation Routes API
  - name: Transaction Routes API
  - name: Metadata Indexes API
  - name: Holders API
  - name: Instruments API
  - name: Billing Packages API
  - name: Packages API
  - name: Billing Calculation API
  - name: Estimation API
  - name: Encryption API
  - name: Protection API
  - name: Asset Rates API
paths:
  /v1/organizations/{organization_id}/ledgers/{ledger_id}:
    delete:
      tags:
        - Ledgers API
      summary: Eliminar un Ledger
      description: >-
        Utilice este endpoint para eliminar un Ledger. El Ledger permanecerá en
        nuestros registros y aparecerá en las respuestas de los endpoints
        [Listar Ledgers](/es/reference/midaz/list-ledgers) y [Recuperar un
        Ledger](/es/reference/midaz/retrieve-a-ledger), con el campo `deletedAt`
        mostrando la fecha de eliminación.
      parameters:
        - $ref: '#/components/parameters/OrganizationId'
        - $ref: '#/components/parameters/LedgerId'
        - $ref: '#/components/parameters/ContentType'
        - $ref: '#/components/parameters/XRequestId'
        - $ref: '#/components/parameters/Authorization'
      responses:
        '204':
          description: Indica que el recurso fue eliminado exitosamente.
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                Error0008:
                  $ref: '#/components/examples/Error0008'
                Error0037:
                  $ref: '#/components/examples/Error0037'
                Error0065:
                  $ref: '#/components/examples/Error0065'
        '401':
          description: No autorizado
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                Error0041:
                  $ref: '#/components/examples/Error0041'
                Error0042:
                  $ref: '#/components/examples/Error0042'
        '403':
          description: Prohibido
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                Error0043:
                  $ref: '#/components/examples/Error0043'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                Error0007:
                  $ref: '#/components/examples/Error0007'
        '409':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                Error0002:
                  $ref: '#/components/examples/Error0002'
        '500':
          description: Error Interno del Servidor
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                Error0046:
                  $ref: '#/components/examples/Error0046'
components:
  parameters:
    OrganizationId:
      name: organization_id
      in: path
      description: El identificador único de la Organización asociada al Ledger.
      required: true
      example: 019c96a0-0a98-7287-9a31-786e0809c769
      schema:
        type: string
        format: uuid
    LedgerId:
      name: ledger_id
      in: path
      description: El identificador único del Ledger asociado.
      required: true
      example: 019c96a0-0ac0-7de9-9f53-9cf842a2ee5a
      schema:
        type: string
        format: uuid
    ContentType:
      name: Content-Type
      in: header
      description: >-
        El tipo de medio del recurso. El valor recomendado es
        `application/json`.
      required: false
      example: application/json
      schema:
        type: string
    XRequestId:
      name: X-Request-Id
      in: header
      description: Un identificador único utilizado para rastrear y seguir cada solicitud.
      required: false
      example: 019c96a0-0a98-7287-9a31-786e0809c769
      schema:
        type: string
        format: uuid
    Authorization:
      name: Authorization
      in: header
      required: false
      schema:
        type: string
      description: >
        Token JWT bearer para autenticación.

        Requerido cuando `PLUGIN_AUTH_ENABLED=true` (obligatorio en despliegues
        multiinquilino).

        Opcional en el modo OSS de inquilino único predeterminado.

        Formato: `Bearer <token>`
  schemas:
    ErrorFormat:
      type: object
      description: El mensaje de error de respuesta.
      required:
        - code
        - title
        - message
      properties:
        code:
          type: string
          description: Un identificador único y estable para el error.
        title:
          type: string
          description: Un breve resumen del problema.
        message:
          type: string
          description: Orientación detallada para resolver el error.
        entityType:
          type: string
          description: >-
            El tipo de entidad a la que se refiere el error (p. ej.
            organization, ledger, account, transaction). Opcional.
        fields:
          type: object
          additionalProperties: true
          description: Información adicional sobre los campos que causaron el error.
  examples:
    Error0008:
      summary: Action Not Permitted
      value:
        code: 8
        title: Action Not Permitted
        message: >-
          This action is not permitted in the current environment. Contact an
          administrator if you believe this is an error.
    Error0037:
      summary: Ledger ID Not Found
      value:
        code: '0037'
        title: Ledger ID Not Found
        message: >-
          The provided ledger ID does not exist in our records. Please verify
          the ledger ID and try again.
    Error0065:
      value:
        code: '0065'
        title: Invalid Path Parameter
        message: >-
          The provided path parameter {{parameter_name}} is not in the expected
          format. Please ensure the parameter adheres to the required format and
          try again.
      summary: Invalid Path Parameter
    Error0041:
      summary: Token Missing
      value:
        code: '0041'
        title: Token Missing
        message: >-
          A valid token must be provided in the request header. Please include a
          token and try again.
    Error0042:
      summary: Invalid Token
      value:
        code: '0042'
        title: Invalid Token
        message: >-
          The provided token is expired, invalid or malformed. Please provide a
          valid token and try again.
    Error0043:
      summary: Insufficient Privileges
      value:
        code: '0043'
        title: Insufficient Privileges
        message: >-
          You do not have the necessary permissions to perform this action.
          Please contact your administrator if you believe this is an error.
    Error0007:
      value:
        code: '0007'
        title: Entity Not Found
        message: >-
          No entity was found for the given ID. Please make sure to use the
          correct ID for the entity you are trying to manage.
      summary: Entity Not Found
    Error0002:
      summary: Ledger Name Conflict
      value:
        code: '0002'
        title: Ledger Name Conflict
        message: >-
          A ledger named {{name}} already exists in your organization. Please
          rename the ledger, or if you want to use the same name, consider
          creating a new ledger for a different division.
    Error0046:
      summary: Internal Server Error
      value:
        code: '0046'
        title: Internal Server Error
        message: >-
          The server encountered an unexpected error. Please try again later or
          contact support.

````