> ## 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 cross-project baseline items report

> Async xlsx or pdf export of baseline rows across the active projects you are a member of, filtered like `cross_project_baseline_items/find_items` and in the same order. pdf renders `js_report_template` through jsreport with the fields picked in `used_fields` (see `schema`), optionally grouped like `cross_project_baseline_items/group_items`. The report has no `project_id`, so it broadcasts on the workspace stream. Needs `reports_create` and `baseline_items_view`.



## OpenAPI

````yaml /openapi.yaml post /reports/cross_project_baseline_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/cross_project_baseline_items:
    post:
      tags:
        - Report
      summary: Generate cross-project baseline items report
      description: >-
        Async xlsx or pdf export of baseline rows across the active projects you
        are a member of, filtered like `cross_project_baseline_items/find_items`
        and in the same order. pdf renders `js_report_template` through jsreport
        with the fields picked in `used_fields` (see `schema`), optionally
        grouped like `cross_project_baseline_items/group_items`. The report has
        no `project_id`, so it broadcasts on the workspace stream. Needs
        `reports_create` and `baseline_items_view`.
      operationId: reports/cross_project_baseline_items#create
      parameters:
        - name: X-Workspace-ID
          in: header
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/requestBodyReportCrossProjectBaselineItemsCreate
        required: true
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/report'
        '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:
    requestBodyReportCrossProjectBaselineItemsCreate:
      type: object
      properties:
        report_extension:
          type: string
          enum:
            - xlsx
            - pdf
        columns_list:
          type: array
          description: >-
            Used for report_extension xlsx only. Columns to render, in order.
            Defaults to all of them. `image` embeds the row's image, the same
            way image columns render in project items reports. The price columns
            are formatted in the row's currency: Unit Cost Price in
            `supplier_currency`, Cost Price and Client Price in
            `project_currency`.
          items:
            type: string
            enum:
              - project
              - package
              - identifier
              - image
              - name
              - category
              - package_section
              - description
              - unit_type
              - supplier_company_name
              - supplier_contact_name
              - supplier_contact_email
              - supplier_contact_phone
              - supplier_address
              - quantity
              - unit_cost_price
              - cost_price
              - client_price
              - project_currency
              - supplier_currency
              - origin
        filter:
          $ref: '#/components/schemas/cross_project_baseline_item_filter'
        per_page:
          type: integer
          description: >-
            Used for report_extension pdf only. Internal fetch batch size while
            building the report; does not limit the report's total row count.
            Defaults to 50, silently clamped to a max of 100.
        groups:
          type: array
          description: >-
            Used for report_extension pdf only. Same shape and rules as
            `cross_project_baseline_items/group_items` `groups`; flattened into
            `__group_row` marker rows in the `cross_project_baseline_items`
            collection.
          items:
            type: object
            required:
              - field
            properties:
              field:
                type: string
                enum:
                  - project
                  - package
                  - package_section
                  - category
                  - unit_type
                  - origin
                  - supplier_company_name
                  - supplier_contact_name
                  - supplier_contact_email
                  - supplier_contact_phone
                  - supplier_address
              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
    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
    cross_project_baseline_item_filter:
      allOf:
        - $ref: '#/components/schemas/baseline_item_filter'
        - type: object
          properties:
            project_ids:
              type: array
              items:
                type: integer
              description: >-
                Narrows to these projects (intersected with the active projects
                you're a member of).
            package_ids:
              type: array
              items:
                type: integer
              description: Package ids; exact match.
    baseline_item_filter:
      type: object
      properties:
        ids:
          type: array
          items:
            type: integer
          description: Baseline item ids; exact match.
        project_item_ids:
          type: array
          items:
            type: integer
          description: Source spec item ids; scoped to this package.
        origin:
          type: array
          items:
            type: string
            enum:
              - package
              - custom
        search:
          type: string
          description: >-
            Case-insensitive substring match on identifier, name and
            description.
        category:
          type: array
          items:
            type: string
          description: Category paths; each matches that path and every path under it.
        package_section_ids:
          type: array
          items:
            type: integer
          description: Section ids; exact match (subsections are not included).
        supplier:
          type: string
          description: Case-insensitive substring match across every supplier field.
        supplier_company_name:
          type: array
          items:
            type: string
          description: Exact match.
        supplier_contact_name:
          type: array
          items:
            type: string
          description: Exact match.
        supplier_contact_email:
          type: array
          items:
            type: string
          description: Exact match.
        supplier_contact_phone:
          type: array
          items:
            type: string
          description: Exact match.
        supplier_address:
          type: array
          items:
            type: string
          description: Exact match.
        remaining:
          type: boolean
          description: >-
            true keeps only rows with something left to order (quantity above
            the procured quantity), e.g. to order everything shown without
            hitting `baseline_item_fully_ordered`.
  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.