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

# Query



## OpenAPI

````yaml /openapi.json post /v1/workspaces/{workspaceId}/projects/{projectId}/pricing/query
openapi: 3.1.0
info:
  title: Specurate API
  description: ''
  version: 1.0.0
  contact: {}
servers:
  - url: https://app.specurate.com/api
    description: API Server
security: []
tags: []
paths:
  /v1/workspaces/{workspaceId}/projects/{projectId}/pricing/query:
    post:
      tags:
        - Project Pricing
      summary: Query
      operationId: ProjectPricingController_query_v1
      parameters:
        - name: workspaceId
          required: true
          in: path
          schema:
            type: string
        - name: projectId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectPricingQueryDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ProjectPricingGroupsResponseDto'
                  - $ref: '#/components/schemas/ProjectPricingRowsResponseDto'
components:
  schemas:
    ProjectPricingQueryDto:
      type: object
      properties:
        slotId:
          type: string
          pattern: ^[1-9]\d{0,18}$
        search:
          type: string
          minLength: 1
          maxLength: 255
        issue:
          type: string
          enum:
            - any
            - overrun
            - incomplete
            - shortfall
            - missing_cost
            - sourcing_gap
            - required_stock_shortfall
            - over_cost_plan
            - missing_client_price
            - over_client_plan
            - below_target
        groupBy:
          default: []
          maxItems: 2
          type: array
          items:
            type: object
            properties:
              field:
                enum:
                  - category
                  - area
                  - supplier
                  - pricing_method
                type: string
              direction:
                default: asc
                type: string
                enum:
                  - asc
                  - desc
            required:
              - field
            additionalProperties: false
        groupPath:
          default: []
          maxItems: 2
          type: array
          items:
            type: object
            properties:
              fieldKey:
                enum:
                  - category
                  - area
                  - supplier
                  - pricing_method
                type: string
              valueKey:
                anyOf:
                  - type: string
                    maxLength: 1000
                  - type: 'null'
            required:
              - fieldKey
              - valueKey
            additionalProperties: false
        cursor:
          type: string
          minLength: 1
          maxLength: 262144
        limit:
          default: 50
          type: integer
          minimum: 1
          maximum: 100
      additionalProperties: false
    ProjectPricingGroupsResponseDto:
      type: object
      properties:
        kind:
          enum:
            - groups
          type: string
        path:
          type: array
          items:
            $ref: '#/components/schemas/TableQueryGroupPathSegmentDto'
        fieldKey:
          enum:
            - category
            - area
            - supplier
            - pricing_method
          type: string
        groups:
          type: array
          items:
            $ref: '#/components/schemas/TableQueryGroupDto'
        orderRevision:
          type:
            - integer
            - 'null'
        matchedCount:
          type: integer
          minimum: 0
        level:
          type: number
        nextCursor:
          type:
            - string
            - 'null'
        hasMore:
          type: boolean
        summary:
          $ref: '#/components/schemas/ProjectPricingSummaryDto'
      required:
        - kind
        - path
        - fieldKey
        - groups
        - orderRevision
        - matchedCount
        - level
        - nextCursor
        - hasMore
        - summary
    ProjectPricingRowsResponseDto:
      type: object
      properties:
        kind:
          enum:
            - rows
          type: string
        path:
          type: array
          items:
            $ref: '#/components/schemas/TableQueryGroupPathSegmentDto'
        items:
          type: array
          items:
            $ref: '#/components/schemas/ProjectPricingRowDto'
        orderRevision:
          type:
            - integer
            - 'null'
        matchedCount:
          type: integer
          minimum: 0
        nextCursor:
          type:
            - string
            - 'null'
        hasMore:
          type: boolean
        summary:
          $ref: '#/components/schemas/ProjectPricingSummaryDto'
      required:
        - kind
        - path
        - items
        - orderRevision
        - matchedCount
        - nextCursor
        - hasMore
        - summary
    TableQueryGroupPathSegmentDto:
      type: object
      properties:
        fieldKey:
          type: string
        valueKey:
          type:
            - string
            - 'null'
      required:
        - fieldKey
        - valueKey
    TableQueryGroupDto:
      type: object
      properties:
        path:
          type: array
          items:
            $ref: '#/components/schemas/TableQueryGroupPathSegmentDto'
        valueKey:
          type:
            - string
            - 'null'
        label:
          type:
            - string
            - 'null'
        itemCount:
          type: number
      required:
        - path
        - valueKey
        - label
        - itemCount
    ProjectPricingSummaryDto:
      type: object
      properties:
        issueCounts:
          $ref: '#/components/schemas/ProjectPricingIssueCountsDto'
        lineCount:
          type: number
        activeCount:
          type: number
        budgetedCount:
          type: number
        budgetGapCount:
          type: number
        costedCount:
          type: number
        pricedCount:
          type: number
        totals:
          $ref: '#/components/schemas/ProjectPricingTotalsDto'
        targetMarginVersion:
          type:
            - number
            - 'null'
        targetMarginVersionId:
          type:
            - string
            - 'null'
      required:
        - issueCounts
        - lineCount
        - activeCount
        - totals
        - targetMarginVersion
        - targetMarginVersionId
    ProjectPricingRowDto:
      type: object
      properties:
        pricingMethod:
          type:
            - string
            - 'null'
          enum:
            - standard
            - com
            - null
        overriddenFields:
          type: array
          items:
            type: string
            enum:
              - purchase_quantity
              - unit_cost
              - client_price
              - purchase_tax_rate
              - client_sales_tax_rate
        unitOfMeasure:
          type:
            - string
            - 'null'
        purchasingUnit:
          enum:
            - units
            - packages
            - null
          type:
            - string
            - 'null'
        issues:
          type: array
          items:
            type: string
            enum:
              - missing_cost
              - sourcing_gap
              - required_stock_shortfall
              - over_cost_plan
              - missing_client_price
              - over_client_plan
              - below_target
        formulaResults:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/FormulaResultResponseDto'
        slotId:
          type: string
        primaryItemId:
          type:
            - string
            - 'null'
        refNumber:
          type:
            - string
            - 'null'
        name:
          type:
            - string
            - 'null'
        imageUrl:
          type:
            - string
            - 'null'
        categoryId:
          type:
            - string
            - 'null'
        categoryName:
          type:
            - string
            - 'null'
        supplierName:
          type:
            - string
            - 'null'
        areaLabel:
          type:
            - string
            - 'null'
        useSameTaxRate:
          type: boolean
        quantity:
          type: string
        targetMargin:
          type:
            - string
            - 'null'
        costKnown:
          type: boolean
        clientPriceKnown:
          type: boolean
        coverage:
          $ref: '#/components/schemas/ProjectPricingCoverageDto'
        gapChoices:
          type: array
          items:
            $ref: '#/components/schemas/BudgetAnalysisGapChoiceDto'
        gapComparisons:
          type: array
          items:
            $ref: '#/components/schemas/BudgetAnalysisGapComparisonDto'
        inputs:
          $ref: '#/components/schemas/ProjectPricingInputsDto'
      required:
        - overriddenFields
        - unitOfMeasure
        - purchasingUnit
        - issues
        - formulaResults
        - slotId
        - primaryItemId
        - refNumber
        - name
        - imageUrl
        - categoryId
        - categoryName
        - supplierName
        - areaLabel
        - useSameTaxRate
        - quantity
        - coverage
        - gapChoices
        - gapComparisons
        - inputs
    ProjectPricingIssueCountsDto:
      type: object
      properties:
        any:
          type: number
        overrun:
          type: number
        incomplete:
          type: number
        shortfall:
          type: number
        sourcing_gap:
          type: number
        required_stock_shortfall:
          type: number
        missing_cost:
          type: number
        over_cost_plan:
          type: number
        missing_client_price:
          type: number
        over_client_plan:
          type: number
        below_target:
          type: number
      required:
        - any
        - overrun
        - incomplete
        - shortfall
        - sourcing_gap
        - required_stock_shortfall
    ProjectPricingTotalsDto:
      type: object
      properties:
        itemizedClient:
          type: string
        knownExtendedCost:
          type: string
        knownExtendedClientBeforeTax:
          type: string
    FormulaResultResponseDto:
      type: object
      properties:
        value:
          type:
            - string
            - 'null'
          pattern: ^-?\d+\.\d{6}$
        source:
          enum:
            - formula
            - manual
          type: string
        formulaSlug:
          type: string
      required:
        - value
        - source
        - formulaSlug
    ProjectPricingCoverageDto:
      type: object
      properties:
        lineCount:
          type: number
        budgetGapCount:
          type: number
        costGapCount:
          type: number
        clientGapCount:
          type: number
        incompleteInputCount:
          type: number
        purchasingShortfallCount:
          type: number
        installedShortfallCount:
          type: number
        requiredStockShortfallCount:
          type: number
      required:
        - lineCount
        - incompleteInputCount
        - purchasingShortfallCount
        - installedShortfallCount
        - requiredStockShortfallCount
    BudgetAnalysisGapChoiceDto:
      type: object
      properties:
        issue:
          type: string
          enum:
            - incomplete
            - margin
            - overrun
            - shortfall
            - line_overrun_specified
            - line_overrun_purchase
        comparison:
          type: string
          enum:
            - planning_itemized
            - planning_specified
            - planning_purchase
            - itemized_specified
            - itemized_purchase
            - specified_purchase
            - default_effective
            - margin_specified
            - margin_purchase
        side:
          type: string
          enum:
            - cost
            - client
        scopeKey:
          type: string
        budgetVersion:
          type: string
        origin:
          type: string
          enum:
            - pricing
        expectedComparison:
          $ref: '#/components/schemas/BudgetAnalysisExpectedComparisonDto'
      required:
        - issue
        - comparison
        - side
        - scopeKey
        - budgetVersion
        - expectedComparison
    BudgetAnalysisGapComparisonDto:
      type: object
      properties:
        comparison:
          type: string
          enum:
            - planning_itemized
            - planning_specified
            - planning_purchase
            - itemized_specified
            - itemized_purchase
            - specified_purchase
            - default_effective
            - margin_specified
            - margin_purchase
        side:
          type: string
          enum:
            - cost
            - client
        scopeKey:
          type: string
        budgetVersion:
          type: string
        origin:
          type: string
          enum:
            - pricing
        expectedComparison:
          $ref: '#/components/schemas/BudgetAnalysisExpectedComparisonDto'
      required:
        - comparison
        - side
        - scopeKey
        - budgetVersion
        - expectedComparison
    ProjectPricingInputsDto:
      type: object
      properties:
        source_price:
          type:
            - string
            - 'null'
        trade_discount:
          type:
            - string
            - 'null'
        fabrication_labor:
          type:
            - string
            - 'null'
        markup:
          type:
            - string
            - 'null'
        budget_price:
          type:
            - string
            - 'null'
        budgetQuantity:
          type:
            - string
            - 'null'
        purchase_quantity:
          type:
            - string
            - 'null'
        specified_purchase_quantity:
          type:
            - string
            - 'null'
        purchased_units:
          type:
            - string
            - 'null'
        purchase_tax_rate:
          type:
            - string
            - 'null'
        client_sales_tax_rate:
          type:
            - string
            - 'null'
      required:
        - source_price
        - purchase_quantity
        - specified_purchase_quantity
        - purchased_units
        - purchase_tax_rate
        - client_sales_tax_rate
    BudgetAnalysisExpectedComparisonDto:
      type: object
      properties:
        baseline:
          type:
            - string
            - 'null'
        compared:
          type:
            - string
            - 'null'
      required:
        - baseline
        - compared

````

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