> ## 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.

# List available batches for scoring

> Returns batches available for carbon intensity scoring: batches in the source ledgers of the given model(s), ordered by start time, optionally narrowed to a date range. Use this to discover which batches can be passed to the create score set endpoint. With no model, the list is empty. Requires carbon intensity to be enabled for your account (`feature_carbon_intensity` in `GET /feature_flags`); otherwise returns 403 "Carbon intensity feature is not enabled". Requires the `read:ledger` token scope.



## OpenAPI

````yaml GET /ledgers/{ledger_id}/score_sets/available_batches
openapi: 3.1.0
info:
  title: Mangrove - API
  version: 1.1.0
  description: >
    ## Filtering and sorting


    List endpoints that accept `filter` take one query parameter per condition,
    written `filter[field][comparator]=value`, for example
    `filter[name][contains]=North`. The comparators are `eq`, `neq`, `gt`,
    `geq`, `lt`, `leq` and `contains`, and `filter[field]=value` is short for
    `eq`. Conditions combine with AND. `contains` matches part of the value, is
    case-sensitive, and applies only to text fields. An unknown field or
    comparator, a value that doesn't fit the field's type, or a list or object
    as the value returns 400 with a message naming the problem. Each list
    operation names its filterable fields; some take only `eq`, and say so.


    `sort` takes a comma-separated list of fields, for example
    `sort=-created_at,name`. Each field sorts ascending, or descending with a
    `-` prefix. Unknown sort fields are ignored. Sorting by `id` orders by the
    record's internal ID, not its friendly ID. Each list operation names its
    sortable fields.
servers:
  - url: https://app.gomangrove.com/api/v1
security:
  - sec0: []
paths:
  /ledgers/{ledger_id}/score_sets/available_batches:
    get:
      summary: List available batches for scoring
      description: >-
        Returns batches available for carbon intensity scoring: batches in the
        source ledgers of the given model(s), ordered by start time, optionally
        narrowed to a date range. Use this to discover which batches can be
        passed to the create score set endpoint. With no model, the list is
        empty. Requires carbon intensity to be enabled for your account
        (`feature_carbon_intensity` in `GET /feature_flags`); otherwise returns
        403 "Carbon intensity feature is not enabled". Requires the
        `read:ledger` token scope.
      operationId: list-available-score-set-batches
      parameters:
        - $ref: '#/components/parameters/LedgerId'
        - name: model_ids[]
          in: query
          description: >-
            One or more score-producing model friendly IDs to filter by. Repeat
            the parameter for multiple values (e.g.
            `model_ids[]=mod_aBcD1234eFgH5678&model_ids[]=mod_xYzW7890aBcD1234`).
            A single `model_id` parameter is also accepted. Unknown IDs are
            ignored.
          schema:
            type: array
            items:
              type: string
          style: form
          explode: true
        - name: start_date
          in: query
          description: >-
            Only batches whose window overlaps the range — here, batches that
            end after the start of this date (in the account's time zone). Must
            be YYYY-MM-DD.
          schema:
            type: string
            format: date
            example: '2025-01-01'
        - name: end_date
          in: query
          description: >-
            Only batches whose window overlaps the range — here, batches that
            start before the end of this date (in the account's time zone). Must
            be YYYY-MM-DD.
          schema:
            type: string
            format: date
            example: '2025-03-31'
        - $ref: '#/components/parameters/Page'
        - name: page_size
          in: query
          description: >-
            Values below 1 are clamped to 1 and values above 200 to 200. A
            non-numeric value falls back to the default.
          schema:
            type: integer
            format: int32
            default: 50
            minimum: 1
            maximum: 200
      responses:
        '200':
          description: A page of batches available for scoring.
          content:
            application/json:
              example:
                data:
                  - id: ba_aBcD1234eFgH5678
                    tracking_id: Q1-2025-001
                    start_time: '2025-01-01T00:00:00.000Z'
                    end_time: '2025-03-31T23:59:59.000Z'
                    ledger_id: led_aBcD1234eFgH5678
                    ledger_name: Feedstock Ledger
                    ledger_type: actual
                    quantity: 1500
                    unit: t
                    data_points:
                      - name: Mass of Feedstock
                        data_point_type_id: 5
                        value: 1500
                        unit: t
                info:
                  items: 1
                  page_size: 50
                  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: ba_aBcD1234eFgH5678
                        tracking_id:
                          type:
                            - string
                            - 'null'
                        start_time:
                          type: string
                          format: date-time
                        end_time:
                          type: string
                          format: date-time
                        ledger_id:
                          type:
                            - string
                            - 'null'
                          example: led_aBcD1234eFgH5678
                        ledger_name:
                          type: string
                        ledger_type:
                          type:
                            - string
                            - 'null'
                          description: >-
                            Whether the batch's ledger is the carbon intensity
                            ledger's actual or forecast source; null for any
                            other source ledger.
                          enum:
                            - actual
                            - forecast
                            - null
                        quantity:
                          type:
                            - number
                            - 'null'
                        unit:
                          type:
                            - string
                            - 'null'
                        data_points:
                          type: array
                          items:
                            type: object
                            properties:
                              name:
                                type: string
                              data_point_type_id:
                                type:
                                  - integer
                                  - 'null'
                              value:
                                type:
                                  - number
                                  - 'null'
                              unit:
                                type:
                                  - string
                                  - 'null'
                  info:
                    $ref: '#/components/schemas/PaginationInfo'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: >-
            Carbon intensity is not enabled for your account, or the token lacks
            the `read:ledger` scope.
          content:
            application/json:
              example:
                errors:
                  - message: Carbon intensity feature is not enabled
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: >-
            The ledger does not exist in the account, or is not a carbon
            intensity ledger.
          content:
            application/json:
              examples:
                Unknown ledger:
                  value:
                    errors:
                      - message: Record not found
                Not a carbon intensity ledger:
                  value:
                    errors:
                      - message: Carbon intensity ledger configuration not found
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: A `start_date` or `end_date` that is not a YYYY-MM-DD date.
          content:
            application/json:
              example:
                errors:
                  - message: Invalid date format
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    LedgerId:
      name: ledger_id
      in: path
      required: true
      description: The ledger's friendly ID (e.g. `led_aBcD1234eFgH5678`).
      schema:
        type: string
    Page:
      name: page
      in: query
      description: >-
        The page to return, starting at 1. A value below 1 or a non-numeric
        value returns 400.
      schema:
        type: integer
        format: int32
        default: 1
        minimum: 1
  schemas:
    PaginationInfo:
      type: object
      description: >-
        Where this page sits in the full result, and the sort, filters and
        fields the request applied.
      properties:
        items:
          type: integer
          description: Rows on this page.
          example: 2
        page_size:
          type: integer
          description: Rows per page.
          example: 20
        total_items:
          type: integer
          description: Rows matching the request across all pages.
          example: 2
        current_page:
          type: integer
          description: This page's number, starting at 1.
          example: 1
        next_page:
          type:
            - integer
            - 'null'
          description: The next page's number, or null on the last page.
        previous_page:
          type:
            - integer
            - 'null'
          description: The previous page's number, or null on the first page.
        total_pages:
          type: integer
          description: Pages in the full result.
          example: 1
        sort:
          type: array
          description: >-
            The sort applied, one entry per field, in order. Present on list
            endpoints that accept `sort`.
          items:
            type: object
            properties:
              field:
                type: string
              direction:
                type: string
                enum:
                  - asc
                  - desc
        filter:
          type: array
          description: >-
            The filters applied, one entry per field and comparator. Present on
            list endpoints that accept `filter`.
          items:
            type: object
            properties:
              field:
                type: string
              comparator:
                type: string
                enum:
                  - eq
                  - neq
                  - gt
                  - geq
                  - lt
                  - leq
                  - contains
              value: {}
        fields:
          type:
            - array
            - 'null'
          description: >-
            The requested `fields`, or null when none were requested. Present on
            list endpoints that accept `fields`.
          items:
            type: string
    ErrorResponse:
      type: object
      required:
        - errors
      properties:
        errors:
          type: array
          items:
            type: object
            required:
              - message
            properties:
              message:
                type: string
                description: Human-readable error message
              field:
                type: string
                description: Attribute the error applies to (validation errors only)
              code:
                type: string
                description: Machine-readable error code (validation errors only)
              blocking:
                type: array
                description: >-
                  Bounded preview of the records blocking a destroy
                  (blocked-destroy errors only)
                items:
                  $ref: '#/components/schemas/DeletionBlockingRecord'
              blocking_count:
                type: integer
                description: >-
                  Total count of records blocking a destroy (blocked-destroy
                  errors only)
              config_key:
                type: string
                description: >-
                  The data feed source config setting to fix, when the error is
                  on `config` (data feed source validation errors only)
              count:
                type: number
                description: >-
                  The limit or comparison value the failed validation checked
                  against, e.g. a maximum length or a numeric bound (validation
                  errors only, when the validation has one)
              value:
                description: >-
                  The rejected value, e.g. on an inclusion or uniqueness failure
                  (validation errors only, when the validation reports one)
    DeletionBlockingRecord:
      type: object
      required:
        - type
      properties:
        type:
          type: string
        friendly_id:
          type: string
        name:
          type:
            - string
            - 'null'
          description: >-
            Display label, and the only identifier for records that have no
            friendly_id
  responses:
    Unauthorized:
      description: >-
        The API token is missing, invalid or expired. The body is empty, except
        for an expired token, which returns the error below.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            errors:
              - message: API token has expired
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: Authorization
      x-bearer-format: ''

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.