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

# Review Group Insights Aspect Diagnostics Route

> Per-aspect rating impact and sub-theme rollups for one brand.

Reads only columns the classification pass already wrote — no provider
call and no model participates, so every figure here is counted.



## OpenAPI

````yaml /openapi.json post /api/v1/brands/{brand_id}/brand-intelligence/review-group-insights/aspect-diagnostics
openapi: 3.1.0
info:
  title: AITasker
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/brands/{brand_id}/brand-intelligence/review-group-insights/aspect-diagnostics:
    post:
      tags:
        - Brand Reviews
        - Brand Reviews
      summary: Review Group Insights Aspect Diagnostics Route
      description: |-
        Per-aspect rating impact and sub-theme rollups for one brand.

        Reads only columns the classification pass already wrote — no provider
        call and no model participates, so every figure here is counted.
      operationId: >-
        review_group_insights_aspect_diagnostics_route_api_v1_brands__brand_id__brand_intelligence_review_group_insights_aspect_diagnostics_post
      parameters:
        - name: brand_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Brand Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReviewAspectDiagnosticsRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReviewAspectDiagnostics'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ReviewAspectDiagnosticsRequest:
      properties:
        advertiser_id:
          type: string
          format: uuid
          title: Advertiser Id
        platform:
          type: string
          enum:
            - trustpilot
            - google
          title: Platform
      type: object
      required:
        - advertiser_id
        - platform
      title: ReviewAspectDiagnosticsRequest
      description: >-
        Per-aspect diagnostics for ONE brand on ONE platform.


        Platform is required for the same reason the matrix requires it: reply
        and

        aspect behaviour differ enough between Trustpilot and Google that a
        pooled

        figure describes neither.
    ReviewAspectDiagnostics:
      properties:
        advertiser_id:
          type: string
          format: uuid
          title: Advertiser Id
        advertiser_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Advertiser Name
        platform:
          type: string
          enum:
            - trustpilot
            - google
          title: Platform
        classified_reviews:
          type: integer
          minimum: 0
          title: Classified Reviews
          default: 0
        examined_reviews:
          type: integer
          minimum: 0
          title: Examined Reviews
          default: 0
        sample_avg_rating:
          anyOf:
            - type: number
              maximum: 5
              minimum: 1
            - type: 'null'
          title: Sample Avg Rating
        min_mentions:
          type: integer
          minimum: 0
          title: Min Mentions
          default: 0
        sample_is_platform_total:
          type: boolean
          const: false
          title: Sample Is Platform Total
          default: false
        sample_basis_notice:
          type: string
          title: Sample Basis Notice
          default: >-
            Computed over AITasker's depth-capped sample of collected reviews,
            and within that only the reviews we classified — not the platform's
            full review population. Unclassified and uncollected reviews are
            excluded from every figure rather than counted as zero.
        aspects:
          items:
            $ref: '#/components/schemas/ReviewAspectRatingImpact'
          type: array
          title: Aspects
      type: object
      required:
        - advertiser_id
        - platform
      title: ReviewAspectDiagnostics
      description: The per-brand teardown layer under the cohort matrix.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ReviewAspectRatingImpact:
      properties:
        aspect:
          type: string
          maxLength: 100
          minLength: 1
          title: Aspect
        aspect_label:
          type: string
          maxLength: 100
          minLength: 1
          title: Aspect Label
        negative_reviews:
          type: integer
          minimum: 0
          title: Negative Reviews
          default: 0
        avg_rating_with_negative:
          anyOf:
            - type: number
              maximum: 5
              minimum: 1
            - type: 'null'
          title: Avg Rating With Negative
        avg_rating_without:
          anyOf:
            - type: number
              maximum: 5
              minimum: 1
            - type: 'null'
          title: Avg Rating Without
        max_sample_uplift:
          anyOf:
            - type: number
              maximum: 4
              minimum: 0
            - type: 'null'
          title: Max Sample Uplift
        below_min_mentions:
          type: boolean
          title: Below Min Mentions
          default: false
        sub_themes:
          items:
            $ref: '#/components/schemas/ReviewSubTheme'
          type: array
          maxItems: 8
          title: Sub Themes
      type: object
      required:
        - aspect
        - aspect_label
      title: ReviewAspectRatingImpact
      description: >-
        What complaints about ONE aspect coincide with, in stars.


        **This is an association, not a counterfactual.** ``max_sample_uplift``
        is

        the arithmetic identity "if every sampled review that complained about
        this

        aspect had instead rated at the average of the reviews that did not, the

        sample mean would become ``avg_rating_without``" — so the uplift is
        exactly

        ``avg_rating_without - sample_avg_rating``. It is an upper bound over
        the

        reviews we hold, NOT a prediction of what fixing the aspect would do:

        reviewers who complain about Delivery may also be unhappy for reasons
        this

        field cannot see, and the sample is depth-capped.


        Every figure is None rather than 0 when it could not be measured — a
        brand

        with no complaints about an aspect has no ``avg_rating_with_negative``,
        and

        rendering that as 0 stars would invert the finding.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ReviewSubTheme:
      properties:
        sub_theme:
          type: string
          maxLength: 60
          minLength: 1
          title: Sub Theme
        reviews:
          type: integer
          minimum: 1
          title: Reviews
        negative:
          type: integer
          minimum: 0
          title: Negative
          default: 0
        positive:
          type: integer
          minimum: 0
          title: Positive
          default: 0
      type: object
      required:
        - sub_theme
        - reviews
      title: ReviewSubTheme
      description: >-
        One emergent sub-theme under an aspect — "the diagnostic tier".


        The aspect vocabulary is closed (the classifier is offered an enum), but

        ``sub_theme`` is free text the model wrote, so this is the only layer
        that

        can say *what about Delivery* customers are talking about. It is
        therefore

        also the only layer whose label was never validated against a vocabulary
        —

        it is shown as a grouping, never as a measured category.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````