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

# Group project items



## OpenAPI

````yaml /openapi.yaml post /projects/{project_id}/project_items/group_items
openapi: 3.0.1
info:
  title: GetSpecs REST API
  description: REST API documentation for GetSpecs.
  version: 1.0.0
servers:
  - url: /v1
  - url: https://demo-api.getspecs.io/v1
security: []
paths:
  /projects/{project_id}/project_items/group_items:
    post:
      tags:
        - ProjectItem
      summary: Group project items
      operationId: project_items#group_items
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: integer
        - name: page
          in: query
          required: false
          schema:
            type: integer
        - name: per_page
          in: query
          required: false
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/requestBodyProjectItemGroupItems'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                  - groups
                properties:
                  groups:
                    type: array
                    items:
                      $ref: '#/components/schemas/item_group'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      security:
        - apiKey: []
          workspaceId: []
components:
  schemas:
    requestBodyProjectItemGroupItems:
      type: object
      required:
        - groups
      properties:
        groups:
          type: array
          items:
            type: object
            required:
              - column_slug
            properties:
              column_slug:
                type: string
              sort:
                type: string
                enum:
                  - asc
                  - desc
        filter:
          $ref: '#/components/schemas/filter'
        area_ids:
          type: array
          nullable: true
          items:
            type: integer
          description: >-
            Scopes quantity (and any formula depending on it) to the sum of the
            given areas' contributions instead of the item's global total. Each
            id must reference an active area belonging to the project.
    item_group:
      type: object
      properties:
        key:
          nullable: true
        label:
          nullable: true
        items:
          type: array
          items:
            $ref: '#/components/schemas/item'
        groups:
          type: array
          items:
            $ref: '#/components/schemas/item_group'
    error:
      type: object
      properties:
        error:
          type: string
        errors:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
                nullable: true
              code:
                type: string
                nullable: true
              message:
                type: string
            required:
              - message
    filter:
      type: object
      properties:
        ids:
          type: array
          items:
            type: integer
        columns:
          type: array
          items:
            type: object
            required:
              - column_slug
              - operator
            properties:
              column_slug:
                type: string
              operator:
                type: string
              value: {}
              value2: {}
              values:
                type: array
                items:
                  type: string
    item:
      type: object
      properties:
        id:
          type: integer
        identifier:
          type: string
        position:
          type: integer
          nullable: true
        category:
          type: object
          nullable: true
          properties:
            id:
              type: integer
            name:
              type: string
            code:
              type: string
              nullable: true
        project:
          type: object
          nullable: true
          properties:
            id:
              type: integer
            name:
              type: string
            code:
              type: string
              nullable: true
        data:
          type: object
  securitySchemes:
    apiKey:
      type: apiKey
      name: authorization
      in: header
    workspaceId:
      type: apiKey
      name: X-Workspace-ID
      in: header

````

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