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

# Company Retrieval

> Retrieves a list of companies from the Captide database based on a natural language query. 
    This endpoint uses Captide's RAG system to understand company names, tickers, or informal references 
    and returns matching companies with their full details.
    
    **Example queries:**
    - "Give me Estee Lauder and Louis Vuitton"
    - "Show me Apple and Microsoft"
    - "Find companies with tickers AAPL and MSFT"
    
    This v2 endpoint is functionally identical to v1. It is provided for API version consistency.



## OpenAPI

````yaml POST /api/v2/rag/company-retrieval
openapi: 3.1.0
info:
  title: Captide REST API
  description: >-
    API for accessing financial disclosures and AI-powered financial document
    analysis.
  version: 0.3.13
servers:
  - url: https://rest-api.captide.co
    description: Prod server
security: []
paths:
  /api/v2/rag/company-retrieval:
    post:
      tags:
        - Retrieval Augmented Generation
      summary: Retrieve companies by natural language query (v2)
      description: >-
        Retrieves a list of companies from the Captide database based on a
        natural language query. 
            This endpoint uses Captide's RAG system to understand company names, tickers, or informal references 
            and returns matching companies with their full details.
            
            **Example queries:**
            - "Give me Estee Lauder and Louis Vuitton"
            - "Show me Apple and Microsoft"
            - "Find companies with tickers AAPL and MSFT"
            
            This v2 endpoint is functionally identical to v1. It is provided for API version consistency.
      operationId: company_retrieval_api_v2_rag_company_retrieval_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentRequest'
              description: Natural language query to find companies
              examples:
                - query: Give me Estee Lauder and Louis Vuitton
        required: true
      responses:
        '200':
          description: Companies retrieved successfully
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/CompanyResponse'
                type: array
                title: Response Company Retrieval Api V2 Rag Company Retrieval Post
              example:
                - id: 91f6c6da-478f-4161-b451-aa5177cc7fb9
                  name: Apple Inc.
                  tickers:
                    - AAPL
                  countries:
                    - US
                  filesWithSec: true
                  cik: '320193'
                  permid: '4295905573'
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - APIKeyHeader: []
components:
  schemas:
    AgentRequest:
      properties:
        query:
          type: string
          minLength: 1
          title: Query
          description: The natural language query
        documentIds:
          anyOf:
            - type: string
            - type: 'null'
          title: Documentids
          description: >-
            Comma-separated string of document file IDs. If provided and
            non-empty, skips document and company selection and goes directly to
            retrieval.
      type: object
      required:
        - query
      title: AgentRequest
      description: Request model for agent queries.
    CompanyResponse:
      properties:
        id:
          type: string
          title: Id
          description: Unique company ID
        name:
          type: string
          title: Name
          description: Company name
        tickers:
          items:
            type: string
          type: array
          title: Tickers
          description: >-
            List of ticker symbols with exchange suffixes (e.g., 'ASML',
            'ASML.AS')
        countries:
          items:
            type: string
          type: array
          title: Countries
          description: Company's country of domicile (ISO 3166-1 alpha-2)
        filesWithSec:
          type: boolean
          title: Fileswithsec
          description: Whether the company files reports with the SEC
        cik:
          anyOf:
            - type: string
            - type: 'null'
          title: Cik
          description: Central Index Key (CIK) assigned by the SEC
        permid:
          anyOf:
            - type: string
            - type: 'null'
          title: Permid
          description: PermID (Permanent Identifier) assigned by Refinitiv
      type: object
      required:
        - id
        - name
        - tickers
        - countries
        - filesWithSec
      title: CompanyResponse
      description: Response model for single company retrieval.
    ErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
      type: object
      required:
        - detail
      title: ErrorResponse
      description: Standard error response model for all API endpoints.
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````