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

# Registering a Sequencing Batch

You can let One Codex know about sequencing samples that are inbound to our lab by registering them as part of a Sequencing Batch. A Batch can have one or more samples associated with it, and lets you associate the tube barcodes for the Reformatting or Sample Collection tubes you have with `Sample` objects in One Codex.

The response from this endpoint will give you a list of Samples, each with an identifier and the tube barcode it is associated with. You should store this identifier so that you can [update Sample metadata](/api-reference/metadata-resource-patch) or retrieve the Sample later on.


## OpenAPI

````yaml POST /api/v1/sequencing/batches/register
openapi: 3.0.0
info:
  title: One Codex API (v1)
  description: >-
    The One Codex API (v1) -- programmatic access to One Codex's suite of
    microbial genomics data storage, analysis, and query tools.
  version: v1
servers:
  - url: https://app.onecodex.com
security:
  - apiKeyAuth: []
paths:
  /api/v1/sequencing/batches/register:
    post:
      summary: POST sequencing/batches register
      operationId: post_sequencing/batches_register
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                batch_name:
                  type: string
                  minLength: 1
                  maxLength: 100
                  description: A human-readable name for the sequencing batch.
                return_tracking_numbers:
                  type: array
                  description: >-
                    One or more tracking numbers associated with the sample
                    shipment(s) to the lab.
                  items:
                    type: string
                    pattern: ^[a-zA-Z0-9 \-]{1,255}$
                samples:
                  type: array
                  description: >-
                    The tube barcodes, specimen type, and sequencing depth for
                    each sample to be sequenced.
                  items:
                    type: object
                    properties:
                      sequencing_depth:
                        type: string
                        enum:
                          - Standard
                          - Deep
                      specimen_type:
                        type: string
                        enum:
                          - Human stool
                          - Microbial cell culture
                      tube_barcode:
                        type: string
                        pattern: ^[a-zA-Z0-9]{10}$|^[0-9]{14}$
              required:
                - samples
                - batch_name
                - return_tracking_numbers
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  batch:
                    $ref: '#/components/schemas/sequencing_batches'
                  samples:
                    type: array
                    items:
                      type: object
                      properties:
                        sample:
                          type: object
                          description: >-
                            The sample object associated with the tube barcode.
                            This will be in an `awaiting_data` state until the
                            lab has finished processing the physical sample.
                          properties:
                            $ref: 7c8fbd69-96f8-4ce9-8e30-81194d66562c
                        tube_barcode:
                          type: string
                          description: The tube barcode for the sample sent to the lab.
components:
  schemas:
    sequencing_batches:
      type: object
      properties:
        $uri:
          type: string
          pattern: ^/api/v1/sequencing/batches\/[^/]+$
          example: /api/v1/sequencing/a1b2c3d4e5f67890
        batch_number:
          type: string
          description: A unique batch number.
        created_at:
          type: string
          format: date-time
          description: >-
            Timestamp for when the object was created on the One Codex platform,
            encoded as a [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt)
            timestamp.
        name:
          type: string
          description: A human-readable name for the sequencing batch.
        owner:
          type: object
          description: The user that created the sequencing batch.
          properties:
            $ref: 6ec8a0ff-b0d5-484b-a176-b24889099d61
        status:
          type: string
          enum:
            - registered
            - shipped_to_lab
            - received_at_lab
            - extracting
            - preparing_library
            - done
            - canceled
          description: The current status of the sequencing batch.
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````