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

# Analytics V2 References

> Retrieves the list of evidence references (citations) used in an analytics conversation, in normalized format with enriched metadata.

> **Note:** This endpoint returns references from the Analytics V2 SSE endpoint. Some source types (e.g., `rms`) require a separate onboarding process. For more information, please contact us at support@linqalpha.com.

**Usage Flow:**
1. Call the Analytics SSE V2 endpoint (`POST /v2/analytics/sse`)
2. From the SSE stream, find the `conversation` event → extract `conversation_id`
3. After the stream finishes, call this endpoint with the `conversation_id`
4. The response contains all references with citation index, source document info, and metadata

**How to view original documents:**
- **Via Viewer:** `https://chat.linqalpha.com/rms/viewer?conversation_id={conversation_id}&citation_idx={citation_idx}`

**Note:** This endpoint returns references in the same normalized format as the v1 references API, with enriched metadata fields (s3_file_key, external_url, calendar_date, fiscal_year, etc.). Use this endpoint when consuming the v2 analytics SSE stream.



## OpenAPI

````yaml GET /v2/analytics/conversations/{conversation_id}/references
openapi: 3.0.1
info:
  title: LinqAlpha API
  description: >-
    Linq helps finance professionals make informed decisions using
    Retrieval-Augmented Generation (RAG)-enhanced answers. By leveraging
    cutting-edge Large Language Models (LLM) and supplementary technology, Linq
    provides the most optimized responses based on your queries.
  version: 1.0.0
  license:
    name: MIT
servers:
  - url: https://api.linqalpha.com
security:
  - ApiKeyAuth: []
tags:
  - name: Search
    description: Search and generate responses
  - name: Data
    description: Data retrieval and mapping
  - name: Feedback
    description: Conversation feedback
  - name: RMS
    description: Research Management System
  - name: Source Management
    description: Source batch and file management
  - name: MCP
    description: >-
      LinqAlpha MCP — Financial data tools for AI assistants via Model Context
      Protocol
  - name: Connectors
    description: Customer Connectors — customer-owned MCP connector management
  - name: Briefing
    description: Briefing Agent — automated market briefings with scheduling and delivery
  - name: Status
    description: Sync status — check organization, document, and container sync progress
paths:
  /v2/analytics/conversations/{conversation_id}/references:
    get:
      tags:
        - Data
      summary: Analytics V2 References
      description: >-
        Retrieves the list of evidence references (citations) used in an
        analytics conversation, in normalized format with enriched metadata.


        > **Note:** This endpoint returns references from the Analytics V2 SSE
        endpoint. Some source types (e.g., `rms`) require a separate onboarding
        process. For more information, please contact us at
        support@linqalpha.com.


        **Usage Flow:**

        1. Call the Analytics SSE V2 endpoint (`POST /v2/analytics/sse`)

        2. From the SSE stream, find the `conversation` event → extract
        `conversation_id`

        3. After the stream finishes, call this endpoint with the
        `conversation_id`

        4. The response contains all references with citation index, source
        document info, and metadata


        **How to view original documents:**

        - **Via Viewer:**
        `https://chat.linqalpha.com/rms/viewer?conversation_id={conversation_id}&citation_idx={citation_idx}`


        **Note:** This endpoint returns references in the same normalized format
        as the v1 references API, with enriched metadata fields (s3_file_key,
        external_url, calendar_date, fiscal_year, etc.). Use this endpoint when
        consuming the v2 analytics SSE stream.
      parameters:
        - name: conversation_id
          in: path
          description: >-
            Conversation ID (UUID). Provided in the `conversation` SSE event
            from the Analytics SSE V2 endpoint.
          required: true
          schema:
            type: string
            format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        - name: organization_id
          in: query
          description: >-
            Organization ID. Required for platform API keys to identify the
            target organization.
          required: false
          schema:
            type: string
            format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        - name: user_id
          in: query
          description: >-
            User ID. Required together with `user_email` for platform API keys
            to identify the specific user who owns the conversation.
          required: false
          schema:
            type: string
          example: user-123
        - name: user_email
          in: query
          description: >-
            User email. Required together with `user_id` for platform API keys
            to identify the specific user who owns the conversation.
          required: false
          schema:
            type: string
            format: email
          example: john.doe@example.com
      responses:
        '200':
          description: References response (normalized format)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalyticsReferencesResponse'
              example:
                error: null
                payload:
                  references:
                    - id: '1'
                      citation_idx: '1'
                      search_type: rms
                      chunk_id: ad477254-58ef-4965-b86a-26ff9f5b3614
                      text: >-
                        UBS Investment Research report on energy sector
                        companies...
                      text_type: paragraph
                      document_id: 47061a59-2e02-4711-a096-8ba5744c73d0
                      document_name: ued39062.pdf
                      s3_file_key: >-
                        production/data-original/1ec8b21f-c799-4fbb-a6cc-1548d45334f3/organization/2a96a7ca-f2ba-4098-92f8-742e9eb2ede6/s3/4b24a452b612b89d2c046e1740c5c6f75952ce8abc46b00abcc548409196f9f3.pdf
                      external_url: null
                      metadata:
                        calendar_date: '2026-03-02T00:00:00Z'
                        fiscal_year: 2025
                        fiscal_quarter: 4
                        source: filing
                        tickers:
                          - BRKM5
                          - ECOPETL
                          - PETR4
                          - YPFD
                          - PRIO3
                        company_names:
                          - Braskem
                          - Ecopetrol
                          - Petrobras
                          - YPF
                          - PRIO
                        stock_ids:
                          - BBG001S6ZH89
                          - BBG001SSJG36
                          - BBG001S7GRB2
                          - BBG001S7KCP5
                          - BBG001T9LDJ4
                        document_category: Analysis, Report & Note
                        document_subcategory: Brokerage
                        rms_document_type: null
                        rms_type: null
                        rms_sub_type: null
                        sector:
                          - Energy
                        subsector:
                          - Oil & gas
                        publisher: UBS
                        countries:
                          - United States
                          - Iran
                          - Israel
                          - Saudi Arabia
                          - Brazil
                        regions:
                          - North America
                          - EMEA
                          - LatAm
                          - Europe
                          - APAC
                        participants:
                          - name: Donald Trump
                            role: President
                            organization: United States
                            participation_type: referenced
                        tags: []
                        parent_id: 608fabf4-c879-486f-83d1-3a889d91f74e
                        parent_document_id: 608fabf4-c879-486f-83d1-3a889d91f74e
                        creation_timestamp: '2026-03-02T15:49:29+00:00'
                        last_contribution_timestamp: '2026-03-02T15:49:29+00:00'
                        document_tags:
                          - research_report
                          - brokerage
                        creator_name: null
                        last_contributor_name: null
                        offset:
                          - top: 0.683
                            left: 0.076
                            page: 8
                            width: 0.561
                            height: 0.229
                      custom_metadata: null
        '400':
          description: Bad Request - Invalid conversation_id format.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
              example:
                error:
                  code: INVALID_REQUEST_BODY
                  msg: conversation_id must be a valid UUID
                  message: conversation_id must be a valid UUID
                payload: null
        '401':
          description: Unauthorized - Invalid authentication credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
              example:
                error:
                  code: API_KEY_MISSING
                  msg: header does not contain api key
                  message: header does not contain api key
                payload: null
components:
  schemas:
    AnalyticsReferencesResponse:
      type: object
      description: >-
        Wrapper for analytics references response (normalized format). The
        payload contains a list of references with enriched metadata.
      properties:
        error:
          type: object
          nullable: true
          description: Error object. Null on success.
        payload:
          type: object
          nullable: true
          properties:
            references:
              type: array
              items:
                type: object
                description: Reference in normalized format with enriched metadata
                properties:
                  id:
                    type: string
                    description: Citation index as string (e.g., "1")
                  citation_idx:
                    type: string
                    description: Citation index as string
                  search_type:
                    type: string
                    enum:
                      - rms
                      - external
                    description: Source type
                  chunk_id:
                    type: string
                    description: Chunk identifier
                  text:
                    type: string
                    description: Reference text content
                  text_type:
                    type: string
                    enum:
                      - paragraph
                      - table
                      - image
                      - news
                    description: Content type
                  document_id:
                    type: string
                    description: Source document ID
                  document_name:
                    type: string
                    description: Document title
                  s3_file_key:
                    type: string
                    nullable: true
                    description: S3 file path for document download
                  external_url:
                    type: string
                    nullable: true
                    description: External URL for the document
                  metadata:
                    type: object
                    description: >-
                      Enriched metadata with financial and document
                      classification fields
                    properties:
                      calendar_date:
                        type: string
                        nullable: true
                        description: Publication or event date
                      fiscal_year:
                        type: integer
                        nullable: true
                      fiscal_quarter:
                        type: integer
                        nullable: true
                      source:
                        type: string
                        nullable: true
                      tickers:
                        type: array
                        items:
                          type: string
                        nullable: true
                      company_names:
                        type: array
                        items:
                          type: string
                        nullable: true
                      stock_ids:
                        type: array
                        items:
                          type: string
                        nullable: true
                      document_category:
                        type: string
                        nullable: true
                      document_subcategory:
                        type: string
                        nullable: true
                      rms_document_type:
                        type: string
                        nullable: true
                      rms_type:
                        type: string
                        nullable: true
                      rms_sub_type:
                        type: string
                        nullable: true
                      sector:
                        type: array
                        items:
                          type: string
                        nullable: true
                      subsector:
                        type: array
                        items:
                          type: string
                        nullable: true
                      publisher:
                        type: string
                        nullable: true
                      countries:
                        type: array
                        items:
                          type: string
                        nullable: true
                      regions:
                        type: array
                        items:
                          type: string
                        nullable: true
                      participants:
                        type: array
                        nullable: true
                      tags:
                        type: array
                        items:
                          type: string
                        nullable: true
                      offset:
                        type: array
                        nullable: true
                      parent_id:
                        type: string
                        nullable: true
                        description: Parent document ID
                      parent_document_id:
                        type: string
                        nullable: true
                        description: Parent document ID (same as parent_id)
                      creation_timestamp:
                        type: string
                        nullable: true
                        description: Document creation timestamp (ISO 8601)
                      last_contribution_timestamp:
                        type: string
                        nullable: true
                        description: Last modification timestamp (ISO 8601)
                      document_tags:
                        type: array
                        items:
                          type: string
                        nullable: true
                        description: >-
                          Document classification tags (e.g. research_report,
                          brokerage)
                      creator_name:
                        type: string
                        nullable: true
                        description: Document creator name
                      last_contributor_name:
                        type: string
                        nullable: true
                        description: Last contributor name
                  custom_metadata:
                    type: object
                    nullable: true
                    description: Additional custom metadata
    ApiErrorResponse:
      type: object
      description: Standard error response wrapper
      properties:
        error:
          $ref: '#/components/schemas/ApiError'
        payload:
          description: Always null for error responses
          nullable: true
      required:
        - error
        - payload
    ApiError:
      type: object
      properties:
        code:
          type: string
          description: >-
            Error code indicating the type of error. Common codes:

            - Authentication: `API_KEY_MISSING`, `INVALID_API_KEY`

            - Validation: `INVALID_REQUEST_BODY`, `ORGANIZATION_ID_MISSING`,
            `TICKERS_MISSING`, `CHAT_MESSAGE_ID_MISSING`, `DOCUMENT_ID_MISSING`

            - Service: `SEARCH_FAIL`, `TTS_FAIL`, `CREATE_CONV_FAIL`,
            `GET_STOCK_FAIL`, `CREATE_MSG_FAIL`, `ALPHA_COMP_FAIL`,
            `GET_REF_FAIL`

            - Connectors: `CONNECTOR_LIST_FAIL`, `CONNECTOR_NOT_FOUND`,
            `CONNECTOR_CREATE_FAIL`, `CONNECTOR_UPDATE_FAIL`,
            `CONNECTOR_DELETE_FAIL`, `CONNECTOR_TEST_FAIL`

            - Not Found: `NOT_FOUND`
          example: INVALID_REQUEST_BODY
        msg:
          type: string
          description: Error message (deprecated, use `message` instead)
          example: query is required and must be a string
        message:
          type: string
          description: Error message providing more details about the error
          example: query is required and must be a string
      required:
        - code
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````