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

# Create a batch (manufacturing lot) for a cell specification

> Create a batch under a cell specification.

The batch inherits the specification's project. Names are unique per
specification, ignoring case; a duplicate answers 409 with
``detail.existing_id`` set to the batch that holds the name.

Parameters
----------
cell_spec_id : str
    Specification the batch is a production run of.
body : CreateCellBatchBody
    Batch fields.

Returns
-------
CellBatch
    The created batch.



## OpenAPI

````yaml https://api.ionworks.com/openapi.json post /cell_specifications/{cell_spec_id}/cell_batches
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.ionworks.com
    description: Production
security: []
paths:
  /cell_specifications/{cell_spec_id}/cell_batches:
    post:
      tags:
        - Cell Specifications
        - Cell Batches
      summary: Create a batch (manufacturing lot) for a cell specification
      description: |-
        Create a batch under a cell specification.

        The batch inherits the specification's project. Names are unique per
        specification, ignoring case; a duplicate answers 409 with
        ``detail.existing_id`` set to the batch that holds the name.

        Parameters
        ----------
        cell_spec_id : str
            Specification the batch is a production run of.
        body : CreateCellBatchBody
            Batch fields.

        Returns
        -------
        CellBatch
            The created batch.
      operationId: create_cell_batch_cell_specifications__cell_spec_id__cell_batches_post
      parameters:
        - name: cell_spec_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Cell Spec Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCellBatchBody'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CellBatch'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CreateCellBatchBody:
      properties:
        name:
          type: string
          title: Name
          description: Lot name or number, unique (case-insensitively) per spec
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
          description: Free-text notes about the batch
        date_manufactured:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Date Manufactured
          description: Manufacture date
        properties:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Properties
          description: Free-form lot metadata
      type: object
      required:
        - name
      title: CreateCellBatchBody
      description: Request body for creating a cell batch under a specification.
    CellBatch:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the batch
        organization_id:
          type: string
          title: Organization Id
          description: ID of the organization that owns this batch
        project_id:
          type: string
          title: Project Id
          description: ID of the project that owns this batch
        cell_specification_id:
          type: string
          title: Cell Specification Id
          description: Cell specification this batch is a production run of
        name:
          type: string
          title: Name
          description: Lot name or number, unique (case-insensitively) per specification
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
          description: Free-text notes about the batch
        date_manufactured:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Date Manufactured
          description: Manufacture date of the batch
        properties:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Properties
          description: >-
            Free-form lot metadata (datasheet lot number, QC results). Numeric
            values use the Quantity format.
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By
          description: User ID of the user who created this batch
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When the batch was created
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: When the batch was last updated
        instance_count:
          type: integer
          title: Instance Count
          description: Number of cell instances filed under this batch
          default: 0
      type: object
      required:
        - id
        - organization_id
        - project_id
        - cell_specification_id
        - name
        - created_at
        - updated_at
      title: CellBatch
      description: A manufacturing lot of one cell specification, as returned by the API.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````

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