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

# Create batch generation

> Triggers an async batch generation job for the given time range.



## OpenAPI

````yaml POST /ledgers/{ledger_id}/batch_generations
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}/batch_generations:
    post:
      summary: Create batch generation
      description: Triggers an async batch generation job for the given time range.
      operationId: create-batch-generation
      parameters:
        - name: ledger_id
          in: path
          description: Ledger friendly ID (e.g., lgr_abc123def456)
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - start_time
                - end_time
              properties:
                start_time:
                  type: string
                  format: date-time
                  description: Start of the time range
                end_time:
                  type: string
                  format: date-time
                  description: End of the time range
                data_point_ids:
                  type: array
                  description: Optional array of data point friendly IDs
                  items:
                    type: string
                batch_amounts:
                  type: array
                  description: Optional batch amount overrides
                  items:
                    type: object
                    properties:
                      batch_id:
                        type: string
                        description: Batch friendly ID
                      primary_output_amount:
                        type: number
                      allocation_group:
                        type: string
                skipped_data_point_type_ids:
                  type: array
                  description: Optional data point type IDs to skip
                  items:
                    type: integer
            examples:
              Request Example:
                value:
                  start_time: '2025-01-01T00:00:00.000Z'
                  end_time: '2025-03-31T23:59:59.000Z'
      responses:
        '202':
          description: '202'
          content:
            application/json:
              examples:
                Result:
                  value:
                    id: 1
                    type: batch_generation
                    state: processing
                    progress: 0
                    created_at: '2025-01-15T10:00:00.000Z'
              schema:
                type: object
                properties:
                  id:
                    type: integer
                  type:
                    type: string
                  state:
                    type: string
                  progress:
                    type: integer
                  created_at:
                    type: string
                    format: date-time
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: Authorization
      x-bearer-format: ''

````