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

# Content gap for a run (all topics)

> Crosses the run’s topics with the source classification: per topic, whether the project’s owned entity has content on it (present = covered, absent = content gap), whether competitors do, the topic’s citation share, and its "ownable" (controllability) source mix. Ordered by citation share descending; use isContentGap to surface or filter the gaps among the top-cited topics. Presence needs the project’s relationship overlay populated (map entity domains + recompute); otherwise every topic reads as a gap. Empty while clustering is pending — poll the run until `topicsStatus` is `ready`.



## OpenAPI

````yaml https://api.mentionlab.io/api/docs-json get /api/v1/source-topics/runs/{runId}/content-gap
openapi: 3.0.0
info:
  title: MentionLab Public API v0.3.4-rc
  description: ''
  version: 0.3.4-rc
  contact: {}
servers:
  - url: https://api.mentionlab.io
security: []
tags: []
paths:
  /api/v1/source-topics/runs/{runId}/content-gap:
    get:
      tags:
        - Source Topics
      summary: Content gap for a run (all topics)
      description: >-
        Crosses the run’s topics with the source classification: per topic,
        whether the project’s owned entity has content on it (present = covered,
        absent = content gap), whether competitors do, the topic’s citation
        share, and its "ownable" (controllability) source mix. Ordered by
        citation share descending; use isContentGap to surface or filter the
        gaps among the top-cited topics. Presence needs the project’s
        relationship overlay populated (map entity domains + recompute);
        otherwise every topic reads as a gap. Empty while clustering is pending
        — poll the run until `topicsStatus` is `ready`.
      operationId: SourceTopicsV1Controller_getContentGap_v1
      parameters:
        - name: runId
          required: true
          in: path
          description: UUID of the run whose content gap to retrieve.
          schema:
            type: string
            format: uuid
        - name: x-project-id
          in: header
          description: Project ID to specify the project context
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentGapResponse'
        '400':
          description: >-
            The request failed validation — the body, query or path parameters
            are malformed or out of range.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: The request is missing valid authentication credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '403':
          description: >-
            The authenticated principal lacks the required permission, or access
            to the requested organisation/project.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
components:
  schemas:
    ContentGapResponse:
      type: object
      properties:
        runId:
          type: string
          description: The run whose content gap this describes.
          example: 019dd32e-b19e-7956-88f6-4b9a877f3697
        topicsStatus:
          description: >-
            Clustering status of the run. Topics only exist once this is
            `ready`; poll until then.
          example: ready
          allOf:
            - $ref: '#/components/schemas/SourceTopicTopicsStatus'
        totalCitations:
          type: number
          description: >-
            Sum of citationCount across all topics — the denominator for
            citationShare.
          example: 691
        analyzedSources:
          type: number
          description: >-
            Number of sources the run analyzed for topics. The difference vs the
            sum of topic sizes is sources that did not group into any topic.
          example: 96
        ownedDomainsMapped:
          type: boolean
          description: >-
            Whether the project has any source domains mapped as `owned`. When
            false, no topic can be marked covered — every row reads as a content
            gap regardless of the data. Prompt the user to map their brand’s
            domains.
          example: true
        competitorDomainsMapped:
          type: boolean
          description: >-
            Whether the project has any source domains mapped as `competitor`.
            When false, competitorPresent is always false.
          example: true
        topics:
          description: >-
            Topics ordered by citationShare descending. Use isContentGap to
            surface/filter the gaps among the top-cited topics.
          type: array
          items:
            $ref: '#/components/schemas/ContentGapTopicResponse'
      required:
        - runId
        - topicsStatus
        - totalCitations
        - analyzedSources
        - ownedDomainsMapped
        - competitorDomainsMapped
        - topics
    ApiErrorResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code of the error.
          example: 400
        message:
          type: string
          description: >-
            Human-readable description of the error. Validation failures return
            an array of per-field validation errors instead of a single string.
          example: Validation failed
        error:
          type: string
          description: Short name of the HTTP error.
          example: Bad Request
      required:
        - statusCode
    SourceTopicTopicsStatus:
      type: string
      enum:
        - pending
        - clustering
        - ready
        - failed
      description: >-
        Topic-clustering lifecycle, independent of embedding `status`. `pending`
        while embedding; `clustering` once the topic job runs; `ready` when
        topics are available; `failed` on clustering error. Poll until `ready`,
        then GET /source-topics/runs/{runId}/topics.
    ContentGapTopicResponse:
      type: object
      properties:
        id:
          type: string
          description: Topic (cluster) UUID.
          example: 019dd32e-b19e-7956-88f6-4b9a877f3697
        rank:
          type: number
          description: >-
            1-based priority rank within the run (1 = highest citation weight at
            analysis time).
          example: 1
        label:
          type: string
          description: LLM-assigned topic label.
          example: Electric vehicle charging
        keywords:
          description: Keywords summarizing the topic.
          example:
            - ev charging
            - charging network
            - fast charger
          type: array
          items:
            type: string
        size:
          type: number
          description: Number of source snapshots grouped in this topic.
          example: 14
        ownedPresent:
          type: boolean
          description: >-
            Whether the project’s owned entity has content on this topic — i.e.
            at least one cited source in the topic sits on an owned domain.
            Requires the project’s relationship overlay to be populated (map
            entity domains + recompute); otherwise every topic reads as a gap.
          example: false
        competitorPresent:
          type: boolean
          description: >-
            Whether at least one cited source in the topic sits on a competitor
            domain.
          example: true
        isContentGap:
          type: boolean
          description: >-
            Content-gap flag — true when the owned entity is NOT present
            (nothing of ours covers this topic).
          example: true
        citationCount:
          type: number
          description: >-
            Total citations (distinct AI responses) across the topic’s source
            snapshots, within the run’s filter scope.
          example: 128
        citationShare:
          type: number
          description: >-
            This topic’s share of the run’s total topic citations, as a
            percentage. Priority signal: high share + isContentGap = write here
            first.
          example: 18.5
        controllability:
          description: Source-controllability mix — how "ownable" the topic’s sources are.
          allOf:
            - $ref: '#/components/schemas/ContentGapControllabilityMix'
      required:
        - id
        - rank
        - label
        - keywords
        - size
        - ownedPresent
        - competitorPresent
        - isContentGap
        - citationCount
        - citationShare
        - controllability
    ContentGapControllabilityMix:
      type: object
      properties:
        owned:
          type: number
          description: Sources on an owned domain (relationship = owned).
          example: 2
        earnable:
          type: number
          description: >-
            Sources we can realistically earn/produce content on (PR, outreach,
            reviews, UGC, partnerships…).
          example: 7
        hard:
          type: number
          description: >-
            Low-control sources (encyclopedic, academic, government, others’
            corporate sites).
          example: 4
        unknown:
          type: number
          description: Unclassified sources (source type = other).
          example: 1
      required:
        - owned
        - earnable
        - hard
        - unknown

````