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

# Get Brand Intelligence Group Commentary Route

> Weekly AI commentary for one Tracked Brands group, cached per ISO week.

First view of a week queues a background generation and returns a pending
placeholder; `refresh=true` re-queues at most once per 24h (cooldown is
server-enforced — a throttled refresh still returns the cached response
with `cache_status=refresh_throttled`).

Same client-curated cohort as the Insights route, so the same narrowing
applies (finding C2 / ruling R21) -- and it must happen BEFORE the cache
key is derived, otherwise a caller could mint a cache entry keyed on ids
they cannot see and the background refresh would generate commentary over
them.



## OpenAPI

````yaml /openapi.json post /api/v1/brands/{brand_id}/brand-intelligence/group-insights/commentary
openapi: 3.1.0
info:
  title: AITasker
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/brands/{brand_id}/brand-intelligence/group-insights/commentary:
    post:
      tags:
        - Brand Intelligence
        - Brand Intelligence
      summary: Get Brand Intelligence Group Commentary Route
      description: >-
        Weekly AI commentary for one Tracked Brands group, cached per ISO week.


        First view of a week queues a background generation and returns a
        pending

        placeholder; `refresh=true` re-queues at most once per 24h (cooldown is

        server-enforced — a throttled refresh still returns the cached response

        with `cache_status=refresh_throttled`).


        Same client-curated cohort as the Insights route, so the same narrowing

        applies (finding C2 / ruling R21) -- and it must happen BEFORE the cache

        key is derived, otherwise a caller could mint a cache entry keyed on ids

        they cannot see and the background refresh would generate commentary
        over

        them.
      operationId: >-
        get_brand_intelligence_group_commentary_route_api_v1_brands__brand_id__brand_intelligence_group_insights_commentary_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/BrandIntelligenceGroupCommentaryRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BrandIntelligenceGroupCommentaryResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    BrandIntelligenceGroupCommentaryRequest:
      properties:
        advertiser_ids:
          items:
            type: string
            format: uuid
          type: array
          maxItems: 60
          minItems: 1
          title: Advertiser Ids
        group_label:
          anyOf:
            - type: string
              maxLength: 120
            - type: 'null'
          title: Group Label
        refresh:
          type: boolean
          title: Refresh
          default: false
      type: object
      required:
        - advertiser_ids
      title: BrandIntelligenceGroupCommentaryRequest
    BrandIntelligenceGroupCommentaryResponse:
      properties:
        group_key:
          type: string
          title: Group Key
        generated_at:
          type: string
          format: date-time
          title: Generated At
        period:
          type: string
          title: Period
        prompt_version:
          type: string
          title: Prompt Version
        schema_version:
          type: string
          title: Schema Version
        status:
          type: string
          enum:
            - ready
            - pending
          title: Status
          default: ready
        summary:
          type: string
          maxLength: 600
          title: Summary
          default: ''
        weekly:
          items:
            $ref: '#/components/schemas/BrandIntelligenceInsight'
          type: array
          maxItems: 6
          title: Weekly
        monthly:
          items:
            $ref: '#/components/schemas/BrandIntelligenceInsight'
          type: array
          maxItems: 6
          title: Monthly
        recommendations:
          items:
            $ref: '#/components/schemas/BrandIntelligenceInsight'
          type: array
          maxItems: 6
          title: Recommendations
        source_refs:
          additionalProperties:
            type: string
          type: object
          title: Source Refs
        provenance:
          additionalProperties:
            anyOf:
              - type: string
              - type: 'null'
          type: object
          title: Provenance
        fallback_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Fallback Reason
        refresh_available_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Refresh Available At
      type: object
      required:
        - group_key
        - generated_at
        - period
        - prompt_version
        - schema_version
      title: BrandIntelligenceGroupCommentaryResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    BrandIntelligenceInsight:
      properties:
        title:
          type: string
          maxLength: 120
          minLength: 1
          title: Title
        detail:
          type: string
          maxLength: 600
          minLength: 1
          title: Detail
        evidence_refs:
          items:
            type: string
          type: array
          maxItems: 8
          minItems: 1
          title: Evidence Refs
        confidence:
          type: string
          enum:
            - low
            - medium
            - high
          title: Confidence
          default: medium
      type: object
      required:
        - title
        - detail
        - evidence_refs
      title: BrandIntelligenceInsight
    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
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````