> ## 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 Negative Aspect Trend Route

> Negative aspect mentions per period for one focused brand (Design 10.4).

Separate from the sentiment trend above because the two have different
platform contracts: rating bands pool safely across platforms, aspect
mentions never do. ``all_platforms`` therefore widens the response to
one INDEPENDENTLY SCOPED series per available platform, exactly like the
aspect matrix's "All platforms" shape -- it is never a merged series.



## OpenAPI

````yaml /openapi.json post /api/v1/brands/{brand_id}/brand-intelligence/review-group-insights/negative-aspect-trend
openapi: 3.1.0
info:
  title: AITasker
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/brands/{brand_id}/brand-intelligence/review-group-insights/negative-aspect-trend:
    post:
      tags:
        - Brand Reviews
        - Brand Reviews
      summary: Review Group Insights Negative Aspect Trend Route
      description: |-
        Negative aspect mentions per period for one focused brand (Design 10.4).

        Separate from the sentiment trend above because the two have different
        platform contracts: rating bands pool safely across platforms, aspect
        mentions never do. ``all_platforms`` therefore widens the response to
        one INDEPENDENTLY SCOPED series per available platform, exactly like the
        aspect matrix's "All platforms" shape -- it is never a merged series.
      operationId: >-
        review_group_insights_negative_aspect_trend_route_api_v1_brands__brand_id__brand_intelligence_review_group_insights_negative_aspect_trend_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/BrandReviewNegativeAspectTrendRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BrandReviewNegativeAspectTrendResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    BrandReviewNegativeAspectTrendRequest:
      properties:
        advertiser_id:
          type: string
          format: uuid
          title: Advertiser Id
        platform:
          anyOf:
            - type: string
              enum:
                - trustpilot
                - google
            - type: 'null'
          title: Platform
        all_platforms:
          type: boolean
          title: All Platforms
          default: false
      type: object
      required:
        - advertiser_id
      title: BrandReviewNegativeAspectTrendRequest
      description: The focused brand plus the platform scope for its negative-aspect trend.
    BrandReviewNegativeAspectTrendResponse:
      properties:
        generated_at:
          type: string
          format: date-time
          title: Generated At
        advertiser_id:
          type: string
          format: uuid
          title: Advertiser Id
        brand_name:
          type: string
          title: Brand Name
        available_platforms:
          items:
            type: string
            enum:
              - trustpilot
              - google
          type: array
          title: Available Platforms
        series:
          items:
            $ref: '#/components/schemas/ReviewNegativeAspectTrendSeries'
          type: array
          title: Series
      type: object
      required:
        - generated_at
        - advertiser_id
        - brand_name
      title: BrandReviewNegativeAspectTrendResponse
      description: Negative reviews by sub-category over time (Design 10.4, Figure 4).
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ReviewNegativeAspectTrendSeries:
      properties:
        platform:
          type: string
          enum:
            - trustpilot
            - google
          title: Platform
        coverage:
          $ref: '#/components/schemas/ReviewTrendCoverage'
        buckets:
          items:
            $ref: '#/components/schemas/ReviewNegativeAspectTrendBucket'
          type: array
          title: Buckets
      type: object
      required:
        - platform
        - coverage
      title: ReviewNegativeAspectTrendSeries
      description: |-
        ONE platform's independently scoped negative-aspect trend.

        ``platform`` is never None. A platform-less series would be exactly the
        "all pooled" shape the aspect contract forbids (Design 0.4 item 3), and
        Trustpilot and Google aspect mentions are not summable quantities.
    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
    ReviewTrendCoverage:
      properties:
        status:
          type: string
          enum:
            - ok
            - single_bucket
            - no_overlap
            - no_data
          title: Status
        reason:
          type: string
          title: Reason
          default: ''
        bucket_size:
          anyOf:
            - type: string
              enum:
                - week
                - month
                - quarter
                - year
            - type: 'null'
          title: Bucket Size
        window_start:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Window Start
        window_end:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Window End
        review_count:
          type: integer
          minimum: 0
          title: Review Count
          default: 0
        depth_capped:
          type: boolean
          title: Depth Capped
          default: false
        leading_partial_bucket_start:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Leading Partial Bucket Start
      type: object
      required:
        - status
      title: ReviewTrendCoverage
      description: What the selected advertiser's stored sample can support.
    ReviewNegativeAspectTrendBucket:
      properties:
        period_start:
          type: string
          format: date-time
          title: Period Start
        negative_mentions:
          type: integer
          minimum: 0
          title: Negative Mentions
        aspects:
          items:
            $ref: '#/components/schemas/ReviewNegativeAspectSlice'
          type: array
          title: Aspects
        is_partial:
          type: boolean
          title: Is Partial
          default: false
        included_in_trend:
          type: boolean
          title: Included In Trend
          default: true
      type: object
      required:
        - period_start
        - negative_mentions
      title: ReviewNegativeAspectTrendBucket
      description: One calendar bucket of negative aspect mentions, stacked by aspect.
    ReviewNegativeAspectSlice:
      properties:
        aspect:
          type: string
          title: Aspect
        aspect_label:
          type: string
          title: Aspect Label
        mentions:
          type: integer
          minimum: 0
          title: Mentions
        share_pct:
          type: number
          maximum: 100
          minimum: 0
          title: Share Pct
        sub_themes:
          items:
            $ref: '#/components/schemas/ReviewNegativeSubTheme'
          type: array
          title: Sub Themes
      type: object
      required:
        - aspect
        - aspect_label
        - mentions
        - share_pct
      title: ReviewNegativeAspectSlice
      description: 'One stack segment: an aspect''s negative mentions inside one period.'
    ReviewNegativeSubTheme:
      properties:
        sub_theme:
          type: string
          maxLength: 60
          title: Sub Theme
        mentions:
          type: integer
          minimum: 0
          title: Mentions
        evidence_excerpt:
          anyOf:
            - type: string
              maxLength: 300
            - type: 'null'
          title: Evidence Excerpt
        source_url:
          anyOf:
            - type: string
              maxLength: 2048
            - type: 'null'
          title: Source Url
      type: object
      required:
        - sub_theme
        - mentions
      title: ReviewNegativeSubTheme
      description: >-
        One free-form sub-theme inside a negative aspect slice.


        ``evidence_excerpt`` is the classifier's own VERBATIM span, capped at
        300

        characters exactly like every other evidence producer in this module. It

        is deliberately NOT ``brand_reviews.body``: this schema carries no body

        field at all, so a future refactor cannot start populating one by

        accident (Design 0.4 item 2).
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````