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

# Batch update project items

> updates project items in the given project



## OpenAPI

````yaml /swagger.yaml patch /projects/{id}/items
openapi: 3.1.0
info:
  title: Fohlio REST API
  description: This is the documentation for the Fohlio REST API.
  version: 1.0.0
servers:
  - url: /openapi
  - url: https://app.fohlio.com/be/openapi
security: []
paths:
  /projects/{id}/items:
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
    patch:
      tags:
        - Project Item
      summary: Batch update project items
      description: updates project items in the given project
      operationId: project_items#batch_update
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/requestBodyProjectItemsBatchUpdate'
            examples:
              ok:
                $ref: '#/components/examples/requestBodyProjectItemsBatchUpdate'
      responses:
        '200':
          description: OK
          content:
            application/json:
              examples:
                ok:
                  $ref: '#/components/examples/projectItemsBatchUpdate'
              schema:
                $ref: '#/components/schemas/projectItems'
        '400':
          description: Bad Request
          content:
            application/json:
              examples:
                bad_request:
                  $ref: '#/components/examples/responseBodyErrorBadRequest'
              schema:
                $ref: '#/components/schemas/error'
        '401':
          description: Unauthorized
          content:
            application/json:
              examples:
                unauthorized:
                  $ref: '#/components/examples/responseBodyErrorUnauthorized'
              schema:
                $ref: '#/components/schemas/error'
        '403':
          description: Forbidden
          content:
            application/json:
              examples:
                forbidden:
                  $ref: '#/components/examples/responseBodyErrorForbidden'
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: Not found
          content:
            application/json:
              examples:
                not_found:
                  $ref: '#/components/examples/responseBodyErrorNotFound'
              schema:
                $ref: '#/components/schemas/error'
        '413':
          description: Payload Too Large
          content:
            application/json:
              examples:
                payload_too_large:
                  $ref: '#/components/examples/responseBodyErrorPayloadTooLarge'
              schema:
                $ref: '#/components/schemas/error'
      security:
        - apiKey: []
components:
  schemas:
    requestBodyProjectItemsBatchUpdate:
      type: array
      items:
        type: object
        properties:
          id:
            type: integer
          columns:
            type: array
            items:
              type: object
              properties:
                key:
                  type: string
                value:
                  type:
                    - string
                    - number
                    - integer
              required:
                - key
                - value
          area_quantities:
            type: array
            description: >-
              Areas holding a quantity for this item that aren't included here
              are nullified.
            items:
              type: object
              properties:
                area_id:
                  type: integer
                quantity:
                  type: string
                quantity_override:
                  type: string
              required:
                - area_id
        required:
          - id
    projectItems:
      type: array
      items:
        $ref: '#/components/schemas/projectItem'
    error:
      type: object
      properties:
        error:
          type: string
    projectItem:
      properties:
        id:
          type: integer
        project_id:
          type: integer
        position:
          type: integer
        state:
          type: string
          enum:
            - active
            - removed
        quantity:
          type: number
        extra_quantity:
          type: number
        division:
          $ref: '#/components/schemas/category'
        vendor_id:
          type: integer
          nullable: true
        revit_id:
          type: string
          nullable: true
        child_item_ids:
          type: array
          items:
            type: integer
        area_quantities:
          type: array
          items:
            $ref: '#/components/schemas/areaQuantity'
        column_values:
          type: array
          items:
            type: object
            properties:
              column:
                $ref: '#/components/schemas/column'
              displayed_value:
                oneOf:
                  - type: string
                  - type: number
                nullable: true
              calculated_value:
                oneOf:
                  - type: string
                  - type: number
                nullable: true
              users:
                type: array
                items:
                  $ref: '#/components/schemas/user'
              images:
                type: array
                nullable: true
                items:
                  type: object
                  properties:
                    url:
                      type: string
                    small_url:
                      type: string
                    default:
                      type: boolean
                    presentable:
                      type: boolean
              docs:
                type: array
                nullable: true
                items:
                  type: object
                  properties:
                    url:
                      type: string
                    name:
                      type: string
                    extension:
                      type: string
              supplier:
                nullable: true
                allOf:
                  - $ref: '#/components/schemas/contact'
              manufacturer:
                nullable: true
                allOf:
                  - $ref: '#/components/schemas/contact'
              urls:
                type: array
                items:
                  type: string
    category:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        children:
          type: array
          items:
            $ref: '#/components/schemas/category'
    areaQuantity:
      properties:
        area_id:
          type: integer
        quantity:
          type: number
        area_multiplier:
          type: integer
    column:
      type: object
      properties:
        id:
          type: integer
        key:
          type: string
        type:
          type: string
        position:
          type: integer
        property:
          type: string
          enum:
            - project
            - product
            - pricing
    user:
      type: object
      properties:
        id:
          type: integer
        email:
          type: string
        name:
          type: string
    contact:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        data:
          type: object
          additionalProperties: true
          description: The details of the contact encoded in JSON format.
        addresses:
          type: array
          items:
            $ref: '#/components/schemas/contactAddress'
        people:
          type: array
          items:
            $ref: '#/components/schemas/contactPerson'
        categories:
          type: array
          items:
            $ref: '#/components/schemas/contactCategory'
    contactAddress:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        phone:
          type: string
          nullable: true
        post_code:
          type: string
          nullable: true
        address_line_1:
          type: string
          nullable: true
        address_line_2:
          type: string
          nullable: true
        city:
          type: string
          nullable: true
        state:
          type: string
          nullable: true
        country:
          type: string
          nullable: true
        priority:
          type: boolean
    contactPerson:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
          nullable: true
        email:
          type: string
          nullable: true
        phone:
          type: string
          nullable: true
        position:
          type: string
          nullable: true
        note:
          type: string
          nullable: true
        priority:
          type: boolean
    contactCategory:
      type: object
      properties:
        id:
          type: integer
        type:
          type: string
          enum:
            - client
            - supplier
            - general_contractor
            - manufacture
            - warehouse
  examples:
    requestBodyProjectItemsBatchUpdate:
      summary: An example of the request body for updating project items
      value:
        - id: 3
          columns:
            - key: name
              value: NEW NAME
            - key: symbol
              value: NEW SYMBOL
        - id: 5
          columns:
            - key: description
              value: NEW DESCRIPTION
            - key: __list_price__
              value: 42
          area_quantities:
            - area_id: 9
              quantity: '1'
    projectItemsBatchUpdate:
      summary: >-
        OK. The response includes every active/viewable column for each item
        (same as GET/POST /projects/{id}/items), not only the columns that were
        updated in the request.
      value:
        - id: 3
          project_id: 5
          position: 5
          state: active
          division:
            id: 10
            name: Furnishings
            code: FU
            key: 12_furnishings
            children: []
          vendor_id: 12
          revit_id: null
          column_values:
            - column:
                id: 1
                key: model_status
                name: Item Status
                type: model_status
                position: 1
                property: project
              displayed_value: Draft
            - column:
                id: 7
                key: symbol
                name: Tag/CAD Ref.
                type: text
                position: 7
                property: project
              displayed_value: NEW SYMBOL
            - column:
                id: 9
                key: quantity
                name: QTY
                type: quantity
                position: 9
                property: project
              displayed_value: '2'
              calculated_value: 2
            - column:
                id: 11
                key: name
                name: Product Name
                type: text
                position: 11
                property: product
              displayed_value: NEW NAME
            - column:
                id: 12
                key: sku
                name: 'Model #'
                type: text
                position: 12
                property: product
              displayed_value: CABINET GABIN IN OAK - SLATE GREY
          child_item_ids: []
          quantity: 2
          extra_quantity: 0
          area_quantities: []
        - id: 5
          project_id: 5
          position: 7
          state: active
          division:
            id: 10
            name: Furnishings
            code: FU
            key: 12_furnishings
            children: []
          vendor_id: 12
          revit_id: null
          column_values:
            - column:
                id: 1
                key: model_status
                name: Item Status
                type: model_status
                position: 1
                property: project
              displayed_value: Draft
            - column:
                id: 9
                key: quantity
                name: QTY
                type: quantity
                position: 9
                property: project
              displayed_value: '1'
              calculated_value: 1
            - column:
                id: 18
                key: description
                name: Description
                type: text
                position: 18
                property: product
              displayed_value: NEW DESCRIPTION
            - column:
                id: 56
                key: __list_price__
                name: Retail Price
                type: number
                position: 56
                property: pricing
              displayed_value: $42.00
              calculated_value: 42
          child_item_ids: []
          quantity: 1
          extra_quantity: 0
          area_quantities:
            - area_id: 9
              quantity: 1
              area_multiplier: 1
    responseBodyErrorBadRequest:
      value:
        error: 'Bad Request: <description>'
    responseBodyErrorUnauthorized:
      value:
        error: Unauthorized
    responseBodyErrorForbidden:
      value:
        error: Forbidden
    responseBodyErrorNotFound:
      value:
        error: Not Found
    responseBodyErrorPayloadTooLarge:
      value:
        error: Payload Too Large
  securitySchemes:
    apiKey:
      type: apiKey
      name: authorization
      in: header

````