> ## 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.

# Generate project items report



## OpenAPI

````yaml /openapi.yaml post /reports/project_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:
  /reports/project_items:
    post:
      tags:
        - Report
      summary: Generate project items report
      operationId: reports/project_items#create
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/requestBodyReportProjectItemsCreate'
        required: true
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/report'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: Not Found
          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:
    requestBodyReportProjectItemsCreate:
      type: object
      properties:
        project_id:
          type: integer
        report_extension:
          type: string
          enum:
            - xlsx
            - pdf
        columns_list:
          type: array
          description: Used for report_extension xlsx only. pdf uses used_fields instead.
          items:
            type: string
        include_components:
          type: boolean
          description: >-
            xlsx: appends a trailing "Component Quantity" column and inserts an
            extra, shaded row right after each item's row for every component
            linked via an outgoing item link, rendering the same columns_list
            with the component's own data plus the link's quantity in the
            trailing column. pdf: nests a `components` array under each
            project_items row, one entry per linked component, carrying the same
            used_fields as the item row plus `component_quantity`. One level
            deep in both formats.
        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.
        per_page:
          type: integer
          description: >-
            Used for report_extension pdf only. Internal DB fetch batch size
            while building the report; does not limit the report's total item
            count. Defaults to a server-side value and is silently clamped to a
            max of 100 rather than rejected.
        groups:
          type: array
          description: Used for report_extension pdf only.
          items:
            type: object
            properties:
              column_slug:
                type: string
              sort:
                type: string
                enum:
                  - asc
                  - desc
        used_fields:
          type: object
          description: >-
            Used for report_extension pdf only. Selects which schema-defined
            record and collection fields to resolve.
          properties:
            records:
              type: array
              items:
                type: object
                properties:
                  record_path:
                    type: string
                  fields:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                      required:
                        - path
                required:
                  - record_path
            collections:
              type: array
              items:
                type: object
                properties:
                  collection_path:
                    type: string
                  fields:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                      required:
                        - path
                required:
                  - collection_path
        js_report_template:
          type: object
          properties:
            content:
              type: string
            engine:
              type: string
              enum:
                - handlebars
            recipe:
              type: string
              enum:
                - chrome-pdf
            chrome:
              type: object
      required:
        - project_id
    report:
      type: object
      properties:
        id:
          type: integer
        status:
          type: string
          enum:
            - processing
            - completed
            - failed
        report_kind:
          type: string
          enum:
            - projects_list
            - project_items_list
            - product_items_list
            - cross_project_items_list
            - project_items_matrix
            - package_baseline_items_list
            - cross_project_baseline_items_list
            - purchase_orders_list
            - goods_receipts_list
            - supplier_invoices_list
            - purchase_order_record
            - supplier_invoice_record
            - goods_receipt_record
        report_extension:
          type: string
          enum:
            - xlsx
            - pdf
        job_id:
          type: string
          format: uuid
        project_id:
          type: integer
          nullable: true
        project:
          type: object
          nullable: true
          properties:
            id:
              type: integer
            name:
              type: string
          required:
            - id
            - name
        file_url:
          type: string
          nullable: true
        error_message:
          type: string
          nullable: true
          description: Free-text failure reason (only set for failed reports)
        created_at:
          type: string
          format: date-time
      required:
        - id
        - status
        - report_kind
        - report_extension
        - job_id
        - project
        - error_message
        - created_at
    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
  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.