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

# List Sources (by root domain)

> Returns the top cited sources for a website, grouped by root domain. Each row carries citation, mention, brand-mention, and impression metrics for the requested date range, plus a `default_source_type` classification (`owned` / `competitor` / `partner` / `third_party`).

Companion to [POST /api/v1/source-pages](/api-reference/sources/list-source-pages), which returns the same data grouped per URL (one row per cited page) instead of per root domain.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/sources
openapi: 3.1.0
info:
  title: AthenaHQ API
  description: >-
    AthenaHQ API provides programmatic access to manage your websites and
    prompts for AI-powered content optimization.
  version: 1.0.0
  contact:
    email: support@athenahq.ai
servers:
  - url: https://api.athenahq.ai
    description: Production server
security:
  - apiKey: []
tags:
  - name: Basics
    description: Core API operations for managing websites and prompts
  - name: Metrics
    description: Metrics and analytics endpoints for tracking AI visibility
  - name: Billing
    description: Billing and credits endpoints for managing usage
  - name: Team Management
    description: Endpoints for managing team members and invitations
  - name: Groups
    description: Endpoints for managing groups of websites
  - name: Content
    description: >-
      Endpoints for accessing Content Hub data — tabs, tracked URLs, and per-URL
      prompt breakdowns.
  - name: Pitch Workspace
    description: >-
      Endpoints for accessing pitch workspace reports — org-scoped pitch runs
      with competitors, prompts, attributes, and aggregate metrics.
  - name: Knowledge Base
    description: >-
      Endpoints for reading the brand Knowledge Base — approved brand facts and
      the pillars that organize them.
paths:
  /api/v1/sources:
    post:
      tags:
        - Sources
      summary: List Sources (by root domain)
      description: >-
        Returns the top cited sources for a website, grouped by root domain.
        Each row carries citation, mention, brand-mention, and impression
        metrics for the requested date range, plus a `default_source_type`
        classification (`owned` / `competitor` / `partner` / `third_party`).


        Companion to [POST
        /api/v1/source-pages](/api-reference/sources/list-source-pages), which
        returns the same data grouped per URL (one row per cited page) instead
        of per root domain.
      operationId: listSources
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SourcesListRequest'
      responses:
        '200':
          description: Successful response with the page of sources.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SourcesListResponse'
              example:
                sources:
                  - root_domain: wikipedia.org
                    total_mentions: 124
                    response_count: 86
                    estimated_impressions: 18400
                    domain_count: 31
                    mention_percentage: 12.3
                    citation_percentage: 14.1
                    competitor_mention_percentage: 3.2
                    brand_mention_percentage: 8.9
                    mentions_count: 47
                    responses_mentioned_count: 39
                    competitor_ids: []
                    default_source_type: third_party
                    source_type_ids: []
                    first_seen: '2024-01-04'
                pagination:
                  page_num: 0
                  page_size: 30
                  total: 142
        '400':
          description: Bad request — invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                missing_website_id:
                  value:
                    error: website_id is required
                invalid_website_id:
                  value:
                    error: website_id must be a uuid
        '401':
          description: Unauthorized — invalid or missing API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Forbidden — you don't have access to this website, or a sub-resource
            ID (`prompt_ids`, `competitor_ids`, `location_ids`) belongs to
            another website.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                website:
                  value:
                    error: Unauthorized access to this website
                prompts:
                  value:
                    error: Unauthorized access to these prompts
        '404':
          description: Website not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Website not found
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - apiKey: []
components:
  schemas:
    SourcesListRequest:
      type: object
      description: Request body for listing domain-grouped sources.
      required:
        - website_id
        - filters
      properties:
        website_id:
          type: string
          format: uuid
          description: The website to list sources for.
          example: 123e4567-e89b-12d3-a456-426614174000
        filters:
          $ref: '#/components/schemas/ApiFilters'
        page_num:
          type: integer
          minimum: 0
          default: 0
          description: Zero-indexed page number.
        page_size:
          type: integer
          minimum: 1
          maximum: 100
          default: 30
          description: Number of rows per page (1–100).
        sort_field:
          type: string
          enum:
            - citation_percentage
            - mention_percentage
            - competitor_mention_percentage
            - brand_mention_percentage
            - estimated_impressions
            - total_mentions
            - domain_count
            - mentions_count
            - root_domain
            - response_count
            - first_seen
          default: citation_percentage
          description: Column to sort by.
        sort_direction:
          type: string
          enum:
            - asc
            - desc
          default: desc
        search:
          type: string
          nullable: true
          description: >-
            Substring filter on `normalized_root_domain`. Protocol (`https://`),
            `www.`, path, query, and fragment are stripped before matching, so a
            full URL like `https://www.example.com/foo` collapses to
            `example.com`.
        mentioned:
          $ref: '#/components/schemas/SourcesMentionedFilter'
        competitors_mentioned:
          $ref: '#/components/schemas/SourcesMentionedFilter'
      example:
        website_id: 123e4567-e89b-12d3-a456-426614174000
        filters:
          start_date: '2024-01-01T00:00:00.000Z'
          end_date: '2024-01-31T23:59:59.999Z'
        page_size: 30
        sort_field: citation_percentage
        sort_direction: desc
    SourcesListResponse:
      type: object
      required:
        - sources
        - pagination
      properties:
        sources:
          type: array
          items:
            $ref: '#/components/schemas/SourceItem'
        pagination:
          $ref: '#/components/schemas/SourcesPagination'
    Error:
      type: object
      description: Error response object
      required:
        - error
      properties:
        error:
          type: string
          description: Error message describing what went wrong
          example: Unauthorized
    ApiFilters:
      type: object
      description: >-
        Filters for querying responses and metrics. Pass location filters in the
        JSON body as `filters.location_ids`.
      required:
        - start_date
      properties:
        start_date:
          type: string
          format: date-time
          description: Filter start date (UTC)
          example: '2024-01-01T00:00:00.000Z'
        end_date:
          type: string
          format: date-time
          description: Filter end date (UTC)
          example: '2024-12-31T23:59:59.999Z'
        models:
          type: array
          description: Filter by AI models
          items:
            type: string
            enum:
              - chatgpt
              - perplexity
              - gemini
              - google_ai_overview
              - copilot
              - claude
              - ai_mode
              - grok
              - deepseek
          example:
            - chatgpt
            - perplexity
        prompt_ids:
          type: array
          description: Filter by specific prompt IDs
          items:
            type: string
            format: uuid
        competitor_ids:
          type: array
          description: Filter by specific competitor IDs
          items:
            type: string
            format: uuid
        location_ids:
          type: array
          description: >-
            Filter by location IDs. Pass this in the JSON body as
            `filters.location_ids`, even when filtering by a single location.
            Use IDs returned by `GET /api/v1/locations`.
          items:
            type: string
            format: uuid
          example:
            - 123e4567-e89b-12d3-a456-426614174111
        prompt_status:
          type: string
          enum:
            - active
            - paused
          description: Filter by prompt status
        prompt_type:
          type: string
          enum:
            - branded
            - non_branded
          description: Filter by prompt type
    SourcesMentionedFilter:
      type: string
      enum:
        - 'yes'
        - 'no'
      description: >-
        If `yes`, only count sources where your brand was mentioned in the
        citing response. If `no`, only count sources where your brand was NOT
        mentioned. Omit the field to count every cited source.
    SourceItem:
      type: object
      description: >-
        A domain-grouped source row. Identifies one cited root domain with its
        citation, mention, and impression metrics for the requested date range.
      required:
        - root_domain
        - total_mentions
        - response_count
        - estimated_impressions
        - domain_count
        - mention_percentage
        - citation_percentage
        - competitor_mention_percentage
        - brand_mention_percentage
        - mentions_count
        - responses_mentioned_count
        - competitor_ids
        - default_source_type
        - source_type_ids
        - first_seen
      properties:
        root_domain:
          type: string
          description: The cited root domain (display form).
          example: wikipedia.org
        total_mentions:
          type: number
          description: >-
            Total citations of this domain (one per citing response) in the date
            range.
          example: 124
        response_count:
          type: number
          description: Distinct AI responses citing this domain.
          example: 86
        estimated_impressions:
          type: number
          description: >-
            Estimated impressions attributable to this domain across the date
            range.
          example: 18400
        domain_count:
          type: number
          description: Distinct subdomain count rolled up under this root domain.
          example: 31
        mention_percentage:
          type: number
          description: Citations of this domain as a percentage of all matching responses.
          example: 12.3
        citation_percentage:
          type: number
          description: >-
            Same numerator as `mention_percentage`. Kept for backward
            compatibility with the existing dashboard wire shape.
          example: 14.1
        competitor_mention_percentage:
          type: number
          description: >-
            Of the responses citing this domain, the percentage that also
            mention a tracked competitor.
          example: 3.2
        brand_mention_percentage:
          type: number
          description: >-
            Of the responses citing this domain, the percentage that mention the
            website's brand.
          example: 8.9
        mentions_count:
          type: number
          description: >-
            Per-URL rollup: count of cited URLs on this domain where the brand
            was mentioned.
          example: 47
        responses_mentioned_count:
          type: number
          description: Count of citing responses where the brand was mentioned.
          example: 39
        competitor_ids:
          type: array
          items:
            type: string
            format: uuid
          description: Tracked competitors mentioned in responses that cite this domain.
          example: []
        default_source_type:
          $ref: '#/components/schemas/SourceTypeClassification'
        source_type_ids:
          type: array
          items:
            type: string
            format: uuid
          description: >-
            Custom source-type tag UUIDs attached to this domain (in addition to
            `default_source_type`).
          example: []
        first_seen:
          type: string
          description: Earliest citation date for this domain in the date range.
          example: '2024-01-04'
    SourcesPagination:
      type: object
      description: >-
        Pagination metadata. Unlike `Pagination` (which uses `has_more`
        lookahead), the sources surfaces expose a precise `total` count — the
        underlying ClickHouse query computes it as a window function in the same
        scan, so there's no extra round-trip cost.
      required:
        - page_num
        - page_size
        - total
      properties:
        page_num:
          type: integer
          description: Zero-indexed page number returned.
          example: 0
        page_size:
          type: integer
          description: Maximum items per page.
          example: 30
        total:
          type: integer
          description: Total number of rows matching the filters (across all pages).
          example: 142
    SourceTypeClassification:
      type: string
      enum:
        - owned
        - competitor
        - partner
        - third_party
      description: >-
        How the source row is classified relative to the website. `owned` covers
        the website's own domains (including configured url-pattern owned
        domains). `competitor` matches tracked competitor root domains.
        `partner` matches configured affiliate domains. `third_party` is the
        residual bucket (Wikipedia, news, etc.). Per-website source-type
        overrides can promote/demote individual domains or URLs.
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key for authentication. You can create one
        [here](https://app.athenahq.ai/organization?tab=api).

````