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

# Create Brand Intelligence Post Analysis Route

> Analyze one library post and place it in this brand's Analyzed Posts.



## OpenAPI

````yaml /openapi.json post /api/v1/brands/{brand_id}/brand-intelligence/post-analyses
openapi: 3.1.0
info:
  title: AITasker
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/brands/{brand_id}/brand-intelligence/post-analyses:
    post:
      tags:
        - Brand Intelligence
        - Brand Intelligence
      summary: Create Brand Intelligence Post Analysis Route
      description: Analyze one library post and place it in this brand's Analyzed Posts.
      operationId: >-
        create_brand_intelligence_post_analysis_route_api_v1_brands__brand_id__brand_intelligence_post_analyses_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/BrandIntelligencePostAnalysisRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BrandIntelligencePostAnalysisDetail'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    BrandIntelligencePostAnalysisRequest:
      properties:
        item_id:
          type: string
          format: uuid
          title: Item Id
        force:
          type: boolean
          title: Force
          default: false
      type: object
      required:
        - item_id
      title: BrandIntelligencePostAnalysisRequest
    BrandIntelligencePostAnalysisDetail:
      properties:
        brand_id:
          type: string
          format: uuid
          title: Brand Id
        item_id:
          type: string
          format: uuid
          title: Item Id
        analysis_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Analysis Id
        status:
          type: string
          enum:
            - not_analyzed
            - queued
            - running
            - completed
            - failed
          title: Status
        analysis_kind:
          type: string
          title: Analysis Kind
          default: post_teardown
        summary:
          anyOf:
            - type: string
            - type: 'null'
          title: Summary
        overall_score:
          anyOf:
            - type: integer
              maximum: 100
              minimum: 0
            - type: 'null'
          title: Overall Score
        performance_index:
          anyOf:
            - type: integer
              maximum: 100
              minimum: 0
            - type: 'null'
          title: Performance Index
        detected_format:
          anyOf:
            - type: string
            - type: 'null'
          title: Detected Format
        is_stale:
          type: boolean
          title: Is Stale
          default: false
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
        requested_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Requested At
        analyzed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Analyzed At
        job_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Job Id
        item:
          anyOf:
            - $ref: '#/components/schemas/ContentLibraryItemSummary'
            - type: 'null'
        result:
          anyOf:
            - $ref: '#/components/schemas/BrandIntelligencePostAnalysisResult'
            - type: 'null'
        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
      type: object
      required:
        - brand_id
        - item_id
        - status
      title: BrandIntelligencePostAnalysisDetail
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ContentLibraryItemSummary:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        kind:
          type: string
          enum:
            - social_post
            - content
          title: Kind
        platform:
          anyOf:
            - type: string
            - type: 'null'
          title: Platform
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
        title:
          type: string
          title: Title
        excerpt:
          anyOf:
            - type: string
            - type: 'null'
          title: Excerpt
        media_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Media Type
        is_video:
          type: boolean
          title: Is Video
          default: false
        thumbnail_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Thumbnail Url
        media_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Media Url
        download_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Download Url
        media_mirrored:
          type: boolean
          title: Media Mirrored
          default: false
        media_width:
          anyOf:
            - type: integer
              exclusiveMinimum: 0
            - type: 'null'
          title: Media Width
        media_height:
          anyOf:
            - type: integer
              exclusiveMinimum: 0
            - type: 'null'
          title: Media Height
        media_items:
          items:
            $ref: '#/components/schemas/ContentLibraryPostMediaItemSummary'
          type: array
          title: Media Items
        event:
          anyOf:
            - $ref: '#/components/schemas/ContentLibraryEventSummary'
            - type: 'null'
        published_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Published At
        language:
          anyOf:
            - type: string
            - type: 'null'
          title: Language
        theme:
          anyOf:
            - type: string
            - type: 'null'
          title: Theme
        video_duration_seconds:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Video Duration Seconds
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
        tags:
          items:
            type: string
          type: array
          title: Tags
        topics:
          items:
            type: string
          type: array
          title: Topics
        views:
          anyOf:
            - type: integer
            - type: 'null'
          title: Views
        likes:
          anyOf:
            - type: integer
            - type: 'null'
          title: Likes
        comments:
          anyOf:
            - type: integer
            - type: 'null'
          title: Comments
        shares:
          anyOf:
            - type: integer
            - type: 'null'
          title: Shares
        engagements:
          anyOf:
            - type: integer
            - type: 'null'
          title: Engagements
        source_status:
          type: string
          enum:
            - available
            - unavailable
          title: Source Status
          default: available
        source_unavailable_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Unavailable Reason
        platforms:
          items:
            type: string
          type: array
          title: Platforms
        publisher:
          $ref: '#/components/schemas/ContentLibraryPublisherSummary'
        analysis:
          anyOf:
            - $ref: '#/components/schemas/ContentLibraryItemAnalysisSummary'
            - type: 'null'
      type: object
      required:
        - id
        - kind
        - title
        - publisher
      title: ContentLibraryItemSummary
    BrandIntelligencePostAnalysisResult:
      properties:
        summary:
          type: string
          maxLength: 900
          title: Summary
          default: ''
        detected_format:
          type: string
          enum:
            - image
            - video
            - carousel
            - text
            - mixed
            - unknown
          title: Detected Format
          default: unknown
        overall_score:
          anyOf:
            - type: integer
              maximum: 100
              minimum: 0
            - type: 'null'
          title: Overall Score
        post_scorecard:
          anyOf:
            - $ref: '#/components/schemas/BrandIntelligencePostScorecard'
            - type: 'null'
        performance:
          anyOf:
            - $ref: '#/components/schemas/BrandIntelligencePostPerformance'
            - type: 'null'
        primary_recommendation:
          anyOf:
            - $ref: '#/components/schemas/BrandIntelligencePostRecommendation'
            - type: 'null'
        hook:
          anyOf:
            - $ref: '#/components/schemas/BrandIntelligencePostAnalysisPoint'
            - type: 'null'
        message:
          anyOf:
            - $ref: '#/components/schemas/BrandIntelligencePostAnalysisPoint'
            - type: 'null'
        engagement:
          anyOf:
            - $ref: '#/components/schemas/BrandIntelligencePostAnalysisPoint'
            - type: 'null'
        audience:
          anyOf:
            - $ref: '#/components/schemas/BrandIntelligencePostAnalysisPoint'
            - type: 'null'
        strengths:
          items:
            $ref: '#/components/schemas/BrandIntelligencePostAnalysisPoint'
          type: array
          maxItems: 8
          title: Strengths
        weaknesses:
          items:
            $ref: '#/components/schemas/BrandIntelligencePostAnalysisPoint'
          type: array
          maxItems: 8
          title: Weaknesses
        risks:
          items:
            $ref: '#/components/schemas/BrandIntelligencePostAnalysisPoint'
          type: array
          maxItems: 8
          title: Risks
        test_ideas:
          items:
            $ref: '#/components/schemas/BrandIntelligencePostAnalysisPoint'
          type: array
          maxItems: 8
          title: Test Ideas
        format_analysis:
          additionalProperties: true
          type: object
          title: Format Analysis
        limitations:
          items:
            type: string
          type: array
          maxItems: 8
          title: Limitations
        evidence_refs:
          additionalProperties:
            type: string
          type: object
          title: Evidence Refs
      type: object
      title: BrandIntelligencePostAnalysisResult
    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
    ContentLibraryPostMediaItemSummary:
      properties:
        media_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Media Type
        thumbnail_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Thumbnail Url
        media_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Media Url
      type: object
      title: ContentLibraryPostMediaItemSummary
      description: One safe, ordered asset from a multi-media social post.
    ContentLibraryEventSummary:
      properties:
        event_id:
          type: string
          title: Event Id
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        starts_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Starts At
        ends_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ends At
        timezone:
          anyOf:
            - type: string
            - type: 'null'
          title: Timezone
        venue_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Venue Name
        address:
          anyOf:
            - type: string
            - type: 'null'
          title: Address
        going_count:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Going Count
        interested_count:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Interested Count
      type: object
      required:
        - event_id
      title: ContentLibraryEventSummary
      description: Validated public metadata for a Facebook event story.
    ContentLibraryPublisherSummary:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        domain:
          anyOf:
            - type: string
            - type: 'null'
          title: Domain
        platform:
          anyOf:
            - type: string
            - type: 'null'
          title: Platform
        profile_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Profile Url
        handle:
          anyOf:
            - type: string
            - type: 'null'
          title: Handle
        avatar_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Avatar Url
        industries:
          items:
            type: string
          type: array
          title: Industries
        business_models:
          items:
            type: string
          type: array
          title: Business Models
      type: object
      required:
        - id
        - name
      title: ContentLibraryPublisherSummary
    ContentLibraryItemAnalysisSummary:
      properties:
        analysis_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Analysis Id
        status:
          type: string
          enum:
            - not_analyzed
            - queued
            - running
            - completed
            - failed
          title: Status
        summary:
          anyOf:
            - type: string
            - type: 'null'
          title: Summary
        overall_score:
          anyOf:
            - type: integer
              maximum: 100
              minimum: 0
            - type: 'null'
          title: Overall Score
        performance_index:
          anyOf:
            - type: integer
              maximum: 100
              minimum: 0
            - type: 'null'
          title: Performance Index
        detected_format:
          anyOf:
            - type: string
            - type: 'null'
          title: Detected Format
        is_stale:
          type: boolean
          title: Is Stale
          default: false
        analyzed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Analyzed At
      type: object
      required:
        - status
      title: ContentLibraryItemAnalysisSummary
      description: >-
        The tile-sized slice of a post teardown.


        Enough for the score badge and the ``AnalysisActionButton`` state
        machine,

        without shipping a full report into a 24-card feed payload. Populated by

        ONE batched query per page in ``search_content_library`` — never per
        item.


        ``status`` carries the full response vocabulary (including the synthetic

        ``not_analyzed``) so the shape matches the analysis routes exactly;
        today

        the embed only ever emits ``completed`` because a partial run has
        nothing

        a tile can show.
    BrandIntelligencePostScorecard:
      properties:
        rubric_version:
          type: string
          title: Rubric Version
          default: post-scorecard-v1
        basis:
          type: string
          const: creative_only
          title: Basis
          default: creative_only
        score:
          anyOf:
            - type: integer
              maximum: 100
              minimum: 0
            - type: 'null'
          title: Score
        coverage:
          type: integer
          maximum: 100
          minimum: 0
          title: Coverage
          default: 0
        confidence:
          type: string
          enum:
            - low
            - medium
            - high
          title: Confidence
          default: low
        elements:
          items:
            $ref: '#/components/schemas/BrandIntelligencePostScoreElement'
          type: array
          maxItems: 6
          title: Elements
      type: object
      title: BrandIntelligencePostScorecard
      description: >-
        Craft assessment of the post. NEVER an observed-performance score.


        ``basis`` stays pinned to ``creative_only`` so this number and the
        separate

        ``performance`` block can be compared: a post that scores 82 on craft
        and

        lands in the 12th performance percentile is only expressible while the
        two

        are not fused.
    BrandIntelligencePostPerformance:
      properties:
        index:
          anyOf:
            - type: integer
              maximum: 100
              minimum: 0
            - type: 'null'
          title: Index
        metric_used:
          anyOf:
            - type: string
            - type: 'null'
          title: Metric Used
        metric_value:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Metric Value
        baseline_median:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Baseline Median
        sample_size:
          type: integer
          minimum: 0
          title: Sample Size
          default: 0
        window_days:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Window Days
        trend:
          type: string
          enum:
            - accruing
            - plateaued
            - unknown
          title: Trend
          default: unknown
        history:
          anyOf:
            - $ref: '#/components/schemas/BrandIntelligencePostPerformanceHistory'
            - type: 'null'
        coverage_notes:
          items:
            type: string
          type: array
          maxItems: 12
          title: Coverage Notes
      type: object
      title: BrandIntelligencePostPerformance
      description: |-
        Observed outcome, computed server-side and never produced by the model.

        ``index`` is a percentile WITHIN the post's own publisher — comparing a
        400-follower B2B account against a consumer brand on absolute counts is
        noise. ``None`` below the configured minimum sample rather than a
        meaningless percentile.
    BrandIntelligencePostRecommendation:
      properties:
        element_key:
          type: string
          enum:
            - hook_anatomy
            - visual_craft
            - message_clarity
            - engagement_mechanics
            - audio_pacing
            - audience_fit
          title: Element Key
        observation:
          type: string
          maxLength: 500
          minLength: 1
          title: Observation
        action:
          type: string
          maxLength: 500
          minLength: 1
          title: Action
        rationale:
          type: string
          maxLength: 500
          minLength: 1
          title: Rationale
        location:
          anyOf:
            - type: string
              maxLength: 120
            - type: 'null'
          title: Location
        expected_metric:
          anyOf:
            - type: string
              maxLength: 160
            - type: 'null'
          title: Expected Metric
        priority:
          type: string
          enum:
            - low
            - medium
            - high
          title: Priority
          default: medium
        effort:
          type: string
          enum:
            - low
            - medium
            - high
          title: Effort
          default: medium
        confidence:
          type: string
          enum:
            - low
            - medium
            - high
          title: Confidence
          default: medium
        evidence_refs:
          items:
            type: string
          type: array
          maxItems: 8
          minItems: 1
          title: Evidence Refs
      type: object
      required:
        - element_key
        - observation
        - action
        - rationale
        - evidence_refs
      title: BrandIntelligencePostRecommendation
      description: The single highest-priority, evidence-backed post test.
    BrandIntelligencePostAnalysisPoint:
      properties:
        title:
          type: string
          maxLength: 120
          minLength: 1
          title: Title
        detail:
          type: string
          maxLength: 900
          minLength: 1
          title: Detail
        evidence_refs:
          items:
            type: string
          type: array
          maxItems: 8
          title: Evidence Refs
        confidence:
          type: string
          enum:
            - low
            - medium
            - high
          title: Confidence
          default: medium
      type: object
      required:
        - title
        - detail
      title: BrandIntelligencePostAnalysisPoint
    BrandIntelligencePostScoreElement:
      properties:
        key:
          type: string
          enum:
            - hook_anatomy
            - visual_craft
            - message_clarity
            - engagement_mechanics
            - audio_pacing
            - audience_fit
          title: Key
        label:
          type: string
          maxLength: 80
          title: Label
          default: ''
        summary:
          type: string
          maxLength: 500
          title: Summary
          default: ''
        score:
          anyOf:
            - type: integer
              maximum: 100
              minimum: 0
            - type: 'null'
          title: Score
        weight:
          type: integer
          maximum: 100
          minimum: 0
          title: Weight
          default: 0
        coverage:
          type: integer
          maximum: 100
          minimum: 0
          title: Coverage
          default: 0
        status:
          type: string
          enum:
            - scored
            - unknown
            - not_applicable
          title: Status
          default: unknown
        confidence:
          type: string
          enum:
            - low
            - medium
            - high
          title: Confidence
          default: medium
        criteria:
          items:
            $ref: '#/components/schemas/BrandIntelligencePostScoreCriterion'
          type: array
          maxItems: 6
          title: Criteria
      type: object
      required:
        - key
      title: BrandIntelligencePostScoreElement
      description: A server-normalized post scorecard dimension.
    BrandIntelligencePostPerformanceHistory:
      properties:
        trend:
          type: string
          title: Trend
          default: unknown
        delta:
          anyOf:
            - type: integer
            - type: 'null'
          title: Delta
        delta_pct:
          anyOf:
            - type: number
            - type: 'null'
          title: Delta Pct
        observations:
          type: integer
          minimum: 0
          title: Observations
          default: 0
      type: object
      title: BrandIntelligencePostPerformanceHistory
      description: >-
        The observation-series delta behind the percentile.


        ``trend`` is deliberately a plain ``str`` rather than a Literal: the
        panel

        already falls back to its "unknown" copy for anything it does not

        recognise, so widening the vocabulary later must not turn into a

        validation error on a stored payload.
    BrandIntelligencePostScoreCriterion:
      properties:
        key:
          type: string
          maxLength: 64
          minLength: 1
          title: Key
        label:
          type: string
          maxLength: 80
          title: Label
          default: ''
        rating:
          anyOf:
            - type: integer
              maximum: 4
              minimum: 0
            - type: 'null'
          title: Rating
        status:
          type: string
          enum:
            - scored
            - unknown
            - not_applicable
          title: Status
          default: unknown
        detail:
          type: string
          maxLength: 500
          title: Detail
          default: ''
        evidence_refs:
          items:
            type: string
          type: array
          maxItems: 8
          title: Evidence Refs
        confidence:
          type: string
          enum:
            - low
            - medium
            - high
          title: Confidence
          default: medium
      type: object
      required:
        - key
      title: BrandIntelligencePostScoreCriterion
      description: |-
        One observable, anchored 0-4 check inside a post scorecard element.

        ``label``, ``status`` and the numeric score are server-owned; the model
        supplies key/rating/detail/evidence only.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````