> ## 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 Own Brand Insights Route

> The n=1 Insights section on Analyze My Ads, for the caller's OWN brand.

GET, not POST: unlike the group-insights endpoint there is no
client-curated advertiser set to carry. The subject is resolved
server-side from the caller's own Brand by domain match, so no
caller-supplied advertiser id ever reaches the aggregation — which is
also why no ``visible_advertiser_ids`` narrowing is needed here.

ADR 0021: that resolution goes through
``review_advertiser_identity.owned_brand_advertiser_lookup_statement``
and never through ``brand_intel_tracked_group_members`` — see
``brand_digest_service.get_own_brand_insights``.

``platform`` narrows which of the brand's own creatives are counted, and a
caller that renders this beneath a single-platform feed must send it. The
resolved advertiser is a canonical identity spanning every platform the
brand advertises on, so WITHOUT it a Google-scoped surface would describe
the brand's Meta ads too. Omitting it keeps the all-platform behaviour
Paid Media's section already has, so no existing caller changes.

Flags: no new flag (the rollout plan is explicit that this surface needs
none — it is new UI over already-shipped computation, with no new
acquisition and no new LLM call). It composes the two existing gates it
actually reads through: the BI master switch and the shared
group-insights switch, since this IS the group-insights pipeline.



## OpenAPI

````yaml /openapi.json get /api/v1/brands/{brand_id}/brand-intelligence/own-brand-insights
openapi: 3.1.0
info:
  title: AITasker
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/brands/{brand_id}/brand-intelligence/own-brand-insights:
    get:
      tags:
        - Brand Intelligence
        - Brand Intelligence
      summary: Get Brand Intelligence Own Brand Insights Route
      description: >-
        The n=1 Insights section on Analyze My Ads, for the caller's OWN brand.


        GET, not POST: unlike the group-insights endpoint there is no

        client-curated advertiser set to carry. The subject is resolved

        server-side from the caller's own Brand by domain match, so no

        caller-supplied advertiser id ever reaches the aggregation — which is

        also why no ``visible_advertiser_ids`` narrowing is needed here.


        ADR 0021: that resolution goes through

        ``review_advertiser_identity.owned_brand_advertiser_lookup_statement``

        and never through ``brand_intel_tracked_group_members`` — see

        ``brand_digest_service.get_own_brand_insights``.


        ``platform`` narrows which of the brand's own creatives are counted, and
        a

        caller that renders this beneath a single-platform feed must send it.
        The

        resolved advertiser is a canonical identity spanning every platform the

        brand advertises on, so WITHOUT it a Google-scoped surface would
        describe

        the brand's Meta ads too. Omitting it keeps the all-platform behaviour

        Paid Media's section already has, so no existing caller changes.


        Flags: no new flag (the rollout plan is explicit that this surface needs

        none — it is new UI over already-shipped computation, with no new

        acquisition and no new LLM call). It composes the two existing gates it

        actually reads through: the BI master switch and the shared

        group-insights switch, since this IS the group-insights pipeline.
      operationId: >-
        get_brand_intelligence_own_brand_insights_route_api_v1_brands__brand_id__brand_intelligence_own_brand_insights_get
      parameters:
        - name: brand_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Brand Id
        - name: platform
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                maxLength: 200
              - type: 'null'
            title: Platform
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BrandIntelligenceOwnBrandInsightsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    BrandIntelligenceOwnBrandInsightsResponse:
      properties:
        generated_at:
          type: string
          format: date-time
          title: Generated At
        own_brand_state:
          type: string
          enum:
            - measured
            - not_resolved
            - no_ads
            - below_minimum
          title: Own Brand State
          default: not_resolved
        advertiser_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Advertiser Id
        brand_label:
          anyOf:
            - type: string
            - type: 'null'
          title: Brand Label
        classified_ads:
          type: integer
          title: Classified Ads
          default: 0
        insights:
          anyOf:
            - $ref: '#/components/schemas/BrandIntelligenceGroupInsightsResponse'
            - type: 'null'
      type: object
      required:
        - generated_at
      title: BrandIntelligenceOwnBrandInsightsResponse
      description: >-
        Paid Media > Analyze My Ads > the MY BRAND (n=1) Insights section.


        The SAME single-advertiser aggregation the brand digest already runs

        (``brand_digest_service.get_brand_digest_insights`` over

        ``group_insights_service.build_group_insights``), pointed at the
        reader's

        OWN advertiser instead of a tracked competitor's.


        The subject is resolved server-side from the caller's own Brand via

        ``review_advertiser_identity.owned_brand_advertiser_lookup_statement``

        (the domain match), NEVER from ``brand_intel_tracked_group_members`` —

        ADR 0021 reserves that table for competitor cohort membership, and

        reading it here would pull global ad-library cohort scope into a

        per-brand surface.


        ``insights`` is the untouched group-insights payload for a one-member

        set, so the section reuses the same primitives the group INSIGHTS tab

        does. Only the n=1-meaningful reads are rendered from it — format /

        platform mix, longevity, Top Hooks, launch cadence. The
        comparison-shaped

        reads (whitespace matrix, quadrant, cohort read) are structurally

        cohort features and have no meaning over one advertiser.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    BrandIntelligenceGroupInsightsResponse:
      properties:
        generated_at:
          type: string
          format: date-time
          title: Generated At
        group_key:
          type: string
          title: Group Key
        group_label:
          anyOf:
            - type: string
            - type: 'null'
          title: Group Label
        brand_count:
          type: integer
          title: Brand Count
          default: 0
        dated_ad_count:
          type: integer
          title: Dated Ad Count
          default: 0
        date_from:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Date From
        date_to:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Date To
        signals:
          $ref: '#/components/schemas/AdLibraryAdSignals'
        brands:
          items:
            $ref: '#/components/schemas/BrandIntelligenceGroupBrandRollup'
          type: array
          title: Brands
        launched_by_weekday:
          items:
            $ref: '#/components/schemas/BrandIntelligenceGroupWeekdayBucket'
          type: array
          title: Launched By Weekday
        own_brand:
          anyOf:
            - $ref: '#/components/schemas/BrandIntelligenceGroupBrandRollup'
            - type: 'null'
        own_brand_state:
          type: string
          enum:
            - measured
            - not_resolved
            - no_ads
            - below_minimum
          title: Own Brand State
          default: not_resolved
        own_brand_classified_ads:
          type: integer
          title: Own Brand Classified Ads
          default: 0
        dominant_industry:
          anyOf:
            - type: string
            - type: 'null'
          title: Dominant Industry
      type: object
      required:
        - generated_at
        - group_key
        - signals
      title: BrandIntelligenceGroupInsightsResponse
    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
    AdLibraryAdSignals:
      properties:
        total_ads:
          type: integer
          title: Total Ads
          default: 0
        active_ads:
          type: integer
          title: Active Ads
          default: 0
        inactive_ads:
          type: integer
          title: Inactive Ads
          default: 0
        dated_ads:
          type: integer
          title: Dated Ads
          default: 0
        themed_ads:
          type: integer
          title: Themed Ads
          default: 0
        new_ads_30d:
          type: integer
          title: New Ads 30D
          default: 0
        new_ads_14d:
          type: integer
          title: New Ads 14D
          default: 0
        new_ads_7d:
          type: integer
          title: New Ads 7D
          default: 0
        first_seen_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: First Seen At
        last_seen_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Seen At
        longest_active_days:
          anyOf:
            - type: integer
            - type: 'null'
          title: Longest Active Days
        avg_active_days:
          anyOf:
            - type: number
            - type: 'null'
          title: Avg Active Days
        run_length_measured_ads:
          type: integer
          title: Run Length Measured Ads
          default: 0
        distinct_concepts:
          type: integer
          title: Distinct Concepts
          default: 0
        avg_video_duration_seconds:
          anyOf:
            - type: number
            - type: 'null'
          title: Avg Video Duration Seconds
        platforms:
          items:
            $ref: '#/components/schemas/AdLibraryCountBucket'
          type: array
          title: Platforms
        formats:
          items:
            $ref: '#/components/schemas/AdLibraryCountBucket'
          type: array
          title: Formats
        landing_domains:
          items:
            $ref: '#/components/schemas/AdLibraryCountBucket'
          type: array
          title: Landing Domains
        landing_pages:
          items:
            $ref: '#/components/schemas/AdLibraryCountBucket'
          type: array
          title: Landing Pages
        hooks:
          items:
            $ref: '#/components/schemas/AdLibraryCountBucket'
          type: array
          title: Hooks
        ctas:
          items:
            $ref: '#/components/schemas/AdLibraryCountBucket'
          type: array
          title: Ctas
        countries:
          items:
            $ref: '#/components/schemas/AdLibraryCountBucket'
          type: array
          title: Countries
        languages:
          items:
            $ref: '#/components/schemas/AdLibraryCountBucket'
          type: array
          title: Languages
        industries:
          items:
            $ref: '#/components/schemas/AdLibraryCountBucket'
          type: array
          title: Industries
        themes:
          items:
            $ref: '#/components/schemas/AdLibraryCountBucket'
          type: array
          title: Themes
        launched_by_month:
          items:
            $ref: '#/components/schemas/AdLibraryMonthBucket'
          type: array
          title: Launched By Month
      type: object
      title: AdLibraryAdSignals
      description: >-
        Full-history rollups over ALL of an advertiser's stored ads.


        Server-computed so the Full Brand Page shows true totals — the previous

        client-side derivation only saw the capped ``recent_ads`` window, which

        made "first ad seen" and every distribution chip wrong for any
        advertiser

        with more than one page of ads. Bucket semantics mirror the Explore

        surfaces: ``platforms`` uses the same Meta publisher-platform expansion
        as

        the pill counts, ``landing_domains`` the same domain normalization as
        the

        ``landing_domain`` filter.
    BrandIntelligenceGroupBrandRollup:
      properties:
        advertiser_id:
          type: string
          format: uuid
          title: Advertiser Id
        name:
          type: string
          title: Name
        domain:
          anyOf:
            - type: string
            - type: 'null'
          title: Domain
        total_ads:
          type: integer
          title: Total Ads
          default: 0
        active_ads:
          type: integer
          title: Active Ads
          default: 0
        new_ads_30d:
          type: integer
          title: New Ads 30D
          default: 0
        image_ads:
          type: integer
          title: Image Ads
          default: 0
        video_ads:
          type: integer
          title: Video Ads
          default: 0
        other_ads:
          type: integer
          title: Other Ads
          default: 0
        dated_ads:
          type: integer
          title: Dated Ads
          default: 0
        platform_mapped_ads:
          type: integer
          title: Platform Mapped Ads
          default: 0
        platform_mapped_image_ads:
          type: integer
          title: Platform Mapped Image Ads
          default: 0
        platform_mapped_video_ads:
          type: integer
          title: Platform Mapped Video Ads
          default: 0
        platform_mapped_other_ads:
          type: integer
          title: Platform Mapped Other Ads
          default: 0
        platforms:
          items:
            $ref: '#/components/schemas/AdLibraryCountBucket'
          type: array
          title: Platforms
        themed_ads:
          type: integer
          title: Themed Ads
          default: 0
        themes:
          items:
            $ref: '#/components/schemas/AdLibraryCountBucket'
          type: array
          title: Themes
        last_seen_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Seen At
      type: object
      required:
        - advertiser_id
        - name
      title: BrandIntelligenceGroupBrandRollup
      description: Per-brand slice of a group aggregate (chart rows, not the tracker grid).
    BrandIntelligenceGroupWeekdayBucket:
      properties:
        weekday:
          type: integer
          maximum: 6
          minimum: 0
          title: Weekday
        total:
          type: integer
          minimum: 0
          title: Total
          default: 0
        brands:
          items:
            $ref: '#/components/schemas/AdLibraryCountBucket'
          type: array
          title: Brands
      type: object
      required:
        - weekday
      title: BrandIntelligenceGroupWeekdayBucket
      description: Ads launched on one weekday, stacked by top contributing brands.
    AdLibraryCountBucket:
      properties:
        key:
          type: string
          title: Key
        count:
          type: integer
          minimum: 0
          title: Count
          default: 0
        image_count:
          type: integer
          minimum: 0
          title: Image Count
          default: 0
        video_count:
          type: integer
          minimum: 0
          title: Video Count
          default: 0
        other_count:
          type: integer
          minimum: 0
          title: Other Count
          default: 0
      type: object
      required:
        - key
      title: AdLibraryCountBucket
      description: >-
        One distribution bucket of an advertiser's ads (e.g. platform → count).


        ``count`` is unchanged: every ad that falls in this bucket, regardless
        of

        creative format. The three ``*_count`` fields split that same total by
        the

        ad's SINGLE format class (see

        ``advertiser_signals.format_class_for_ad``) so the INSIGHTS tab can
        render

        an image/video/other stack, or filter to one class, without a second
        round

        trip.


        INVARIANT: ``image_count + video_count + other_count == count``.

        Producers that cannot classify must leave all three at 0 AND set count
        to 0.
    AdLibraryMonthBucket:
      properties:
        month:
          type: string
          title: Month
        count:
          type: integer
          minimum: 0
          title: Count
          default: 0
      type: object
      required:
        - month
      title: AdLibraryMonthBucket
      description: Ads launched in one ``YYYY-MM`` month (advertiser ad-velocity series).
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````