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

# Update a material pool



## OpenAPI

````yaml /openapi.json patch /material-pools/{id}
openapi: 3.1.0
info:
  title: Cula Tracking API
  version: 0.3.10
servers:
  - url: https://api.demo.cula.earth/tracking/v1
security: []
tags:
  - name: Organisations
    description: ''
  - name: Sites
    description: ''
  - name: Machines
    description: ''
  - name: Machine Variables
    description: ''
  - name: Machine Data Imports
    description: ''
  - name: Delivery Configs
    description: ''
  - name: Deliveries
    description: ''
  - name: Material Sourcing Configs
    description: ''
  - name: Material Sourcings
    description: ''
  - name: Material Conversion Configs
    description: ''
  - name: Material Conversions
    description: ''
  - name: Material Utilization Configs
    description: ''
  - name: Material Utilizations
    description: ''
  - name: Material Batches
    description: ''
  - name: Material Pools
    description: ''
  - name: Material Containers
    description: ''
  - name: Sinks
    description: ''
  - name: Documents
    description: ''
  - name: Webhooks
    description: ''
paths:
  /material-pools/{id}:
    patch:
      tags:
        - Material Pools
      summary: Update a material pool
      parameters:
        - name: Cula-Organisation-Id
          in: header
          description: >-
            ID of the organisation the request operates on behalf of (e.g.
            `org_...`). Must be an organisation the API client has access to.
          required: true
          schema:
            type: string
            example: org_01k83mfmhgchya944v86ryvhpq
        - name: id
          required: true
          in: path
          schema:
            type: string
            example: mpl_01k2xytkbr0pxazkxbj4j5gr0y
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateMaterialPoolRequest'
      responses:
        '200':
          description: Material pool updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MaterialPoolResponse'
        '400':
          description: Invalid request payload or parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: bad_request
                message: The field limit must not be greater than 100.
        '401':
          description: Missing or invalid access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: unauthorized
                message: Invalid or expired token
        '404':
          description: Resource not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: not_found
                message: >-
                  Resource with ID xyz_01k56g7aec6dt5zrtamc72vw446 could not be
                  found.
        '409':
          description: Conflicting resource state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: conflict
                message: >-
                  There exists already an object with external ID MY-CUSTOM-ID
                  within this organisation.
        '500':
          description: Unexpected server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: internal_server_error
                message: Internal server error.
      security:
        - AccessToken: []
components:
  schemas:
    UpdateMaterialPoolRequest:
      type: object
      properties:
        name:
          type: string
          nullable: true
          description: Human-readable name for the pool. Pass null to clear it.
          maxLength: 100
        type:
          allOf:
            - $ref: '#/components/schemas/MaterialPoolType'
        is_archived:
          type: boolean
          description: >-
            Archived pools are excluded from inventory views and are never
            auto-selected as a transaction target.
        external_id:
          type: string
          example: POOL-EXT-0001
          description: >-
            A optional custom ID that can be set to an internal ID from your
            system. This ID must be unique within all objects of the
            organisation you operate in. You can later use this external ID to
            reference and query this object. Be aware that you can update this
            ID later. If you need an immutable ID, use the object ID returned
            when creating the object. Pass null to remove it.
          nullable: true
          maxLength: 100
          minLength: 1
          pattern: ^[A-Za-z0-9\-_]+$
    MaterialPoolResponse:
      type: object
      properties:
        id:
          type: string
          example: mpl_01k2xytkbr0pxazkxbj4j5gr0y
          description: Unique identifier of the material pool.
        external_id:
          type: string
          nullable: true
          example: POOL-EXT-0001
          description: The external ID you assigned to this pool, if any.
        name:
          type: string
          nullable: true
          example: Woodchips pile north
          description: User-given name of the pool, if any.
        type:
          example: pile
          description: 'Physical form of the pool: a solid `pile` or a liquid `tank`.'
          allOf:
            - $ref: '#/components/schemas/MaterialPoolType'
        transaction_strategy:
          description: >-
            How mixed material is attributed to its sources during carbon
            accounting: `queue` consumes contributions oldest-first (FIFO),
            `stack` newest-first (LIFO). Fixed at creation.
          example: stack
          allOf:
            - $ref: '#/components/schemas/MaterialPoolTransactionStrategy'
        is_archived:
          type: boolean
          description: >-
            Archived pools are excluded from inventory views and are never
            auto-selected as a transaction target.
          example: false
        site:
          description: The site owning this pool.
          allOf:
            - $ref: '#/components/schemas/SiteReference'
        contents:
          description: Current per-material balances.
          type: array
          items:
            $ref: '#/components/schemas/MaterialPoolContent'
        created_at:
          type: string
          format: date-time
          example: '2025-10-10T21:03:58Z'
          description: Time the pool was created.
      required:
        - id
        - external_id
        - name
        - type
        - transaction_strategy
        - is_archived
        - site
        - contents
        - created_at
    Error:
      type: object
      properties:
        code:
          type: string
          example: bad_request
        message:
          type: string
          example: The field limit must not be greater than 100.
      required:
        - code
        - message
    MaterialPoolType:
      type: string
      enum:
        - pile
        - tank
      description: 'Physical form of the pool: a solid `pile` or a liquid `tank`.'
    MaterialPoolTransactionStrategy:
      type: string
      enum:
        - queue
        - stack
      description: >-
        How mixed material is attributed to its sources during carbon
        accounting: `queue` consumes contributions oldest-first (FIFO), `stack`
        newest-first (LIFO). Fixed at creation.
    SiteReference:
      type: object
      properties:
        id:
          type: string
          nullable: true
          example: ste_01k8g7aec6dt5zrtamc72ww446
        external_id:
          type: string
          nullable: true
          example: SITE-EXT-0001
      description: >-
        References a site by its ID and the external ID you assigned to it (if
        any).
      required:
        - id
        - external_id
    MaterialPoolContent:
      type: object
      properties:
        material:
          description: The material this balance is for.
          allOf:
            - $ref: '#/components/schemas/MaterialReference'
        weight_in_kg:
          type: number
          description: >-
            Current balance in kilograms of dry matter. Can be negative when
            material was extracted before the corresponding addition was
            recorded.
          example: 600
      description: Current balance of one material in the pool.
      required:
        - material
        - weight_in_kg
    MaterialReference:
      type: object
      properties:
        id:
          type: string
          example: mat_01kh0fwkq4x8p5ea34dr6e4v2e
          description: Unique identifier of the material.
      description: References a material by its ID.
      required:
        - id
  securitySchemes:
    AccessToken:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://auth.demo.cula.earth/oauth2/token
          scopes: {}
      description: >-
        OAuth 2.0 client credentials. Exchange your client_id and client_secret
        for an access token scoped to the organisation that provides data
        access.

````