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

# Retrieve all batches on a ledger

> Lists all batches for a specific ledger with filtering and sorting capabilities.



## OpenAPI

````yaml GET /ledgers/{ledger_id}/batches
openapi: 3.1.0
info:
  title: Mangrove - API
  version: 1.1.0
servers:
  - url: https://app.gomangrove.com/api/v1
security:
  - sec0: []
paths:
  /ledgers/{ledger_id}/batches:
    get:
      summary: List all batches on a ledger
      description: >-
        Lists all batches for a specific ledger with filtering and sorting
        capabilities.
      operationId: list-all-ledger-batches
      parameters:
        - name: ledger_id
          in: path
          description: Ledger friendly ID (e.g., lgr_abc123def456)
          schema:
            type: string
          required: true
        - name: page
          in: query
          schema:
            type: integer
            format: int32
            default: 1
        - name: page_size
          in: query
          schema:
            type: integer
            format: int32
            default: 10
        - name: sort
          in: query
          description: >-
            Comma-separated list of fields to sort by. Prefix with - for
            descending. Available fields: id, start_time, end_time, created_at,
            updated_at, tracking_id, friendly_id
          schema:
            type: string
            example: '-start_time,created_at'
        - name: filter[id][eq]
          in: query
          description: Filter by exact batch ID (friendly_id)
          schema:
            type: string
        - name: filter[state][eq]
          in: query
          schema:
            type: string
        - name: filter[tracking_id][eq]
          in: query
          schema:
            type: string
        - name: filter[friendly_id][eq]
          in: query
          schema:
            type: string
        - name: filter[start_time][geq]
          in: query
          schema:
            type: string
            format: date-time
        - name: filter[start_time][leq]
          in: query
          schema:
            type: string
            format: date-time
        - name: filter[end_time][geq]
          in: query
          schema:
            type: string
            format: date-time
        - name: filter[end_time][leq]
          in: query
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value:
                    data:
                      - id: bat_abc123def456
                        tracking_id: Q1-2025-001
                        start_time: '2025-01-01T00:00:00.000Z'
                        end_time: '2025-03-31T23:59:59.000Z'
                        state: complete
                        created_at: '2025-01-15T10:00:00.000Z'
                        updated_at: '2025-01-15T10:00:00.000Z'
                        primary_output:
                          id: 1
                          name: Net Carbon Removal
                          unit: t
                          data_point_type_id: 5
                          value: 100.5
                        ledger_balance: 50.25
                        allocations: []
                        model_run:
                          id: 1
                          start_time: '2025-01-01T00:00:00.000Z'
                          end_time: '2025-03-31T23:59:59.000Z'
                          state: complete
                          error_message: null
                          created_at: '2025-01-15T10:00:00.000Z'
                          updated_at: '2025-01-15T10:00:00.000Z'
                          calculations: []
                          output_data_points: []
                        feedstocks: []
                    info:
                      items: 1
                      page_size: 10
                      total_items: 1
                      current_page: 1
                      next_page: null
                      previous_page: null
                      total_pages: 1
                      sort: []
                      filter: []
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: bat_abc123def456
                        tracking_id:
                          type: string
                          nullable: true
                        start_time:
                          type: string
                          format: date-time
                        end_time:
                          type: string
                          format: date-time
                        state:
                          type: string
                        created_at:
                          type: string
                          format: date-time
                        updated_at:
                          type: string
                          format: date-time
                        primary_output:
                          type: object
                          nullable: true
                        ledger_balance:
                          type: number
                          nullable: true
                        allocations:
                          type: array
                          items:
                            type: object
                        model_run:
                          type: object
                          nullable: true
                        feedstocks:
                          type: array
                          items:
                            type: object
                  info:
                    type: object
                    properties:
                      items:
                        type: integer
                      page_size:
                        type: integer
                      total_items:
                        type: integer
                      current_page:
                        type: integer
                      next_page:
                        type: integer
                        nullable: true
                      previous_page:
                        type: integer
                        nullable: true
                      total_pages:
                        type: integer
                      sort:
                        type: array
                        items: {}
                      filter:
                        type: array
                        items: {}
        '404':
          description: '404'
          content:
            application/json:
              examples:
                Result:
                  value:
                    status: error
                    statusCode: 404
                    errors:
                      - message: record not found
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: error
                  statusCode:
                    type: integer
                    example: 404
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                          example: record not found
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: Authorization
      x-bearer-format: ''

````