---
title: "Creates a pool event"
method: POST
path: "/api/v1/pool_events"
tags: ["Sample Pooling"]
---

# Creates a pool event

`POST /api/v1/pool_events`

This endpoint facilitates the creation of pool events and allows for the aggregation of stocks based on selected logic.

It supports three methods for pooling:
1. **Fixed Amount Pooling**: Using the `createFixedSamplePoolingEvent` schema, which draws a fixed amount from all listed stocks.

2. **Custom Amount Pooling**: Using the `createCustomSamplePoolingEvent` schema, which allows for drawing custom amounts from each stock.
3. **Total Consumption Pooling**: Using the `createCustomSamplePoolingEvent` schema, which draws and consumes the entire amount from each stock.

Ensure the request body matches the structure defined in the referenced schemas for successful operation.

## Request body

- union
  - CreateFixedSamplePoolingEvent — draw a fixed amount from all stocks.
    - `token` string, required
    - `item` object
      - `name` string, required — The description of pool purpose
      - `unit_type` string, required — volume/weight
      - `pool_type` string, required
      - `unit` string, required — Valid units of measurement are: - For 'volume': 'nL', 'µL', 'mL', 'L' - For 'weight': 'ng', 'µg', 'mg', 'g', 'Kg'
      - `fixed_amount` integer, required — Specifies the exact amount to draw
      - `stocks_list` integer[], required — List of stock IDs from which to draw
      - `pooled_stock_info` object, required — Contains all the necessary stock fields for creating a stock during the pooling event. This object may include all the relevant stock properties.
        - `name` string, required
        - `stockable_type` string, required — Identifies the class name of the stock item, such as 'Biocollections::Bacterium'. This indicates the category of the entity and must match valid system-defined class names.
        - `stockable_id` integer, required
        - `storage_type` string, required — Specifies the storage classification, such as 'System::Storage::Storage', indicating the type of storage facility used for the item.
        - `storage_id` integer, required
  - CreateCustomSamplePoolingEvent — draw a custom amount from each stock.
    - `token` string, required
    - `item` object
      - `name` string, required — The description of pool purpose
      - `unit_type` string, required — volume/weight
      - `pool_type` string, required
      - `unit` string, required — Valid units of measurement are: - For 'volume': 'nL', 'µL', 'mL', 'L' - For 'weight': 'ng', 'µg', 'mg', 'g', 'Kg'
      - `stocks_usage` object, required — Hash of stock IDs and the desired amount to pool.
      - `pooled_stock_info` object, required — Contains all the necessary stock fields for creating a stock during the pooling event. This object may include all the relevant stock properties.
        - `stockable_type` string, required — Identifies the class name of the stock item, such as 'Biocollections::Bacterium'. This indicates the category of the entity and must match valid system-defined class names.
        - `stockable_id` integer, required
        - `storage_type` string, required — Specifies the storage classification, such as 'System::Storage::Storage', indicating the type of storage facility used for the item.
        - `storage_id` integer, required
        - `name` string, required
  - CreateConsumeSamplePoolingEvent — draw the entire amount and consume.
    - `token` string, required
    - `item` object
      - `name` string, required — The description of pool purpose
      - `unit_type` string, required — volume/weight
      - `pool_type` string, required
      - `unit` string, required — Valid units of measurement are: - For 'volume': 'nL', 'µL', 'mL', 'L' - For 'weight': 'ng', 'µg', 'mg', 'g', 'Kg'
      - `stocks_list` integer[], required — List of stock IDs from which to draw
      - `pooled_stock_info` object, required — Contains all the necessary stock fields for creating a stock during the pooling event. This object may include all the relevant stock properties.
        - `stockable_type` string, required — Identifies the class name of the stock item, such as 'Biocollections::Bacterium'. This indicates the category of the entity and must match valid system-defined class names.
        - `stockable_id` integer, required
        - `storage_type` string, required — Specifies the storage classification, such as 'System::Storage::Storage', indicating the type of storage facility used for the item.
        - `storage_id` integer, required
        - `name` string, required

## Response `200`

OK

- object — Returns detailed information about the updated pool event.
  - `id` integer — The ID of the pool event
  - `name` string — The description of pool purpose
  - `unit_type` string
  - `pool_type` string
  - `unit` string
  - `initial_amount` string
  - `member_id` integer — The initiator of the pool action
  - `stock_id` integer — The pooled stock ID
  - `stock_name` string — The pooled stock name
  - `stock_url` string

## Other responses

- `401` — Unauthorized
- `404` — Not Found
- `422` — Unprocessable entity

---

[API](https://skmtc.net/labguru/apis/labguru-api.md) · [All operations](https://skmtc.net/labguru/apis/labguru-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/labguru/labguru-api/revisions/0534e4d70b77/schema)
