openapi: 3.0.3
info:
  title: Fundable Investors API
  description: |
    API for accessing investor data including search, detailed investor information, and filtered investor discovery.

    ## Authentication
    All API requests require authentication using an API key in the Authorization header.

    ## Rate Limits
    API usage is tracked and may be subject to monthly limits depending on your API key tier.

    ## Investor Identifiers
    Investors can be identified using query parameters with any of the following formats:
    - `id` - UUID format (e.g., "?id=550e8400-e29b-41d4-a716-446655440000")
    - `domain` - Domain or full URL (e.g., "?domain=sequoiacap.com" or "?domain=https://sequoiacap.com")
    - `linkedin` - LinkedIn company URL (e.g., "?linkedin=https://linkedin.com/company/sequoia-capital")
    - `crunchbase` - Crunchbase organization URL (e.g., "?crunchbase=https://crunchbase.com/organization/sequoia-capital")

    ## Parameter Validation (for /investors endpoint)
    The /investors endpoint (POST) enforces strict validation on the JSON request body:
    - **Unknown Fields**: Any field not in the allowed set will result in a `422 UNKNOWN_PARAMETER` error
    - **Enum Values**: Fields like `financing_types`, `sort_by`, `employee_count`, and `ipo_status` only accept exact enum values
    - **Data Types**: Array fields must be arrays (not comma-separated strings), numeric fields must be numbers
    - **Array Fields**: Cannot be empty arrays; provide values or omit the field entirely
    - **Batch Limits**: Identifier batch lookups are limited to 100 items each

    ## Investor List Endpoint (/investors)
    The `/investors` endpoint accepts a POST request with a structured JSON body organized into three filter sections:

    ### `identifiers` — Investor lookup filters
    - `ids` — Investor UUIDs
    - `domains` — Investor domains (max 100)
    - `linkedin_urls` — Investor LinkedIn URLs (max 100)
    - `crunchbase_urls` — Investor Crunchbase URLs (max 100)

    ### `investor` — Entity-level filters
    - `locations` — Investor HQ location (permalinks)
    - `employee_count` — Investor firm employee count ranges

    ### `company_investments` — Portfolio filters
    - `search_query` — Semantic search for a niche that /industry/search cannot resolve to an existing taxonomy filter. Describe **what portfolio companies do** (product/technology/business model), not attributes like stage, location, or funding. Results are ranked by portfolio relevance and capped at 150 semantic matches
    - `min_relevance` — Minimum relevance threshold (0–1) for the portfolio semantic search
    - `company_ids` — Specific portfolio companies (by UUID)
    - `industries`, `super_categories`, `locations` — Portfolio company attributes
    - `employee_count`, `ipo_status` — Portfolio company characteristics
    - `total_raised_min`, `total_raised_max` — Portfolio company total raised range
    - `financing_types`, `deal_size_min`, `deal_size_max`, `deal_start_date`, `deal_end_date` — Deal characteristics
    - `only_lead_deals` — Only count deals where investor was lead
    - `min_matching_deals` — Minimum deals matching above criteria

    When portfolio filters are active, each investor in the response includes `filtered_deal_count` and `filtered_lead_count`.
    These values count only deals that matched the supplied `company_investments` filters.

  version: 1.0.0
  contact:
    name: Fundable API Support
    url: jacob@tryfundable.ai
  license:
    name: Proprietary
    url: https://www.tryfundable.ai/terms/privacy/

servers:
  - url: https://www.tryfundable.ai/api/v1
    description: Production server

security:
  - bearerAuth: []

paths:
  /investors:
    post:
      summary: Discover investor firms by their attributes and investments
      description: |
        Use this endpoint when the requested result is a list of investor firms. Filters
        under `company_investments` identify qualifying portfolio companies and deals, then
        return the firms that participated in those deals. For example, use this route to
        find San Francisco-based investors that participated in a Seed round during the
        last year.

        Use `POST /people` with investor filters instead when the desired result is an
        individual angel investor or lead partner attached to a firm. Use `POST /deals`
        when the desired result is the matching funding rounds themselves.

        ## Request Body Structure
        Send a JSON body with up to 3 filter sections plus pagination/sort at the top level:
        - `identifiers` - Look up specific investors by UUID, domain, LinkedIn, or Crunchbase
        - `investor` - Filter by investor entity attributes (location, employee count)
        - `company_investments` - Filter by portfolio (industries, deal characteristics, etc.). Supports semantic search via `search_query` + `min_relevance`.

        When `company_investments` filters are active, `filtered_deal_count` is the number
        of deals that matched those filters and `filtered_lead_count` is the number of those
        matched deals the investor led.
      operationId: listInvestors
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              example:
                page_size: 10
              properties:
                identifiers:
                  type: object
                  description: Investor lookup filters (OR'd together)
                  properties:
                    ids:
                      type: array
                      description: Investor UUIDs
                      items:
                        type: string
                        format: uuid
                      example: ["c5a3f6ac-f6c9-4686-aa6e-12aeb7419b82"]
                    domains:
                      type: array
                      description: Investor domains (max 100)
                      items:
                        type: string
                      example: ["sequoiacap.com", "a16z.com"]
                    linkedin_urls:
                      type: array
                      description: Investor LinkedIn URLs (max 100)
                      items:
                        type: string
                      example: ["https://linkedin.com/company/sequoia-capital", "https://linkedin.com/company/andreessen-horowitz"]
                    crunchbase_urls:
                      type: array
                      description: Investor Crunchbase URLs (max 100)
                      items:
                        type: string
                      example: ["https://crunchbase.com/organization/sequoia-capital", "https://crunchbase.com/organization/andreessen-horowitz"]
                investor:
                  type: object
                  description: Investor entity-level filters
                  properties:
                    locations:
                      type: array
                      description: Investor HQ location permalinks. Use /location/search to find permalinks. A value that is not an exact permalink is silently ignored (returns zero results, no error).
                      items:
                        type: string
                      example: ["san-francisco-california", "menlo-park-california"]
                    employee_count:
                      type: array
                      description: Investor firm employee count ranges
                      items:
                        type: string
                        enum: ["1-10", "11-50", "51-100", "101-250", "251-500", "501-1000", "1001-5000", "5001-10000", "10001+"]
                      example: ["11-50", "51-100"]
                company_investments:
                  type: object
                  description: Portfolio filters (filter by companies the investor has invested in)
                  properties:
                    company_ids:
                      type: array
                      description: Portfolio company UUIDs
                      items:
                        type: string
                        format: uuid
                      example: ["97ae048e-77bc-471b-821a-f9decb373689"]
                    search_query:
                      type: string
                      description: |
                        AI-powered semantic search matched against each investor's
                        portfolio companies — a flexible replacement for an industry tag.
                        First use /industry/search and apply an `industries` or
                        `super_categories` filter when the taxonomy contains the intended
                        category. Use semantic search only for a niche industry or specific
                        product type the taxonomy cannot express, describing what those
                        companies do — their product, technology, or business model (e.g.
                        "climate-focused carbon capture hardware"). Do NOT use it for other
                        attributes like stage, location, or funding — apply those with the
                        dedicated `company_investments` and `investor` filter fields instead.
                        Results are ranked by portfolio relevance and capped at 150 semantic
                        matches.
                      example: "climate-focused carbon capture hardware"
                    min_relevance:
                      type: number
                      minimum: 0
                      maximum: 1
                      description: |
                        Minimum relevance score threshold (0–1) for the portfolio-based
                        semantic search. Only applies when `search_query` is provided.
                        Investors whose portfolio match score falls below this threshold
                        are excluded. Defaults to 0 (return all results).
                      example: 0.5
                    locations:
                      type: array
                      description: Portfolio company location permalinks. Use /location/search to find permalinks. A value that is not an exact permalink is silently ignored (returns zero results, no error).
                      items:
                        type: string
                      example: ["san-francisco-california"]
                    industries:
                      type: array
                      description: Portfolio company industry permalinks. Use /industry/search to find permalinks. A value that is not an exact permalink is silently ignored (returns zero results, no error).
                      items:
                        type: string
                      example: ["artificial-intelligence", "fintech-e067"]
                    super_categories:
                      type: array
                      description: Broad industry super-category permalinks. Use /industry/search to find permalinks. A value that is not an exact permalink is silently ignored (returns zero results, no error).
                      items:
                        type: string
                      example: ["financial-services-d7b6"]
                    employee_count:
                      type: array
                      description: Portfolio company employee count ranges
                      items:
                        type: string
                        enum: ["1-10", "11-50", "51-100", "101-250", "251-500", "501-1000", "1001-5000", "5001-10000", "10001+"]
                      example: ["11-50", "51-100"]
                    ipo_status:
                      type: array
                      description: Portfolio company IPO status
                      items:
                        type: string
                        enum: ["public", "private"]
                      example: ["private"]
                    total_raised_min:
                      type: number
                      minimum: 0
                      description: Minimum total raised by portfolio companies (USD)
                      example: 10000000
                    total_raised_max:
                      type: number
                      minimum: 0
                      description: Maximum total raised by portfolio companies (USD)
                      example: 500000000
                    financing_types:
                      type: array
                      description: "Financing types with optional modifiers (pre, extension)"
                      items:
                        type: object
                        required:
                          - type
                        properties:
                          type:
                            type: string
                            enum: [
                              'SERIES_A', 'SERIES_B', 'SERIES_C', 'SERIES_D', 'SERIES_E', 'SERIES_F',
                              'SERIES_G', 'SERIES_H', 'SERIES_I', 'SERIES_J', 'SERIES_K', 'SERIES_L',
                              'SERIES_M', 'SEED', 'SAFE', 'CONVERTIBLE_NOTE', 'EQUITY', 'PREFERRED',
                              'SECONDARY_MARKET', 'DEBT_FINANCING', 'GRANT', 'NON_EQUITY_ASSISTANCE',
                              'CROWDFUNDING', 'INITIAL_COIN_OFFERING', 'FUNDING_ROUND'
                            ]
                          pre:
                            type: boolean
                            default: false
                            description: "Pre-round modifier (e.g., Pre-Seed, Pre-Series A)"
                          extension:
                            type: boolean
                            default: false
                            description: "Extension round modifier"
                      example:
                        - { "type": "SERIES_A" }
                        - { "type": "SERIES_B" }
                    deal_size_min:
                      type: number
                      minimum: 0
                      description: Minimum deal size (USD)
                      example: 1000000
                    deal_size_max:
                      type: number
                      minimum: 0
                      description: Maximum deal size (USD)
                      example: 100000000
                    deal_start_date:
                      type: string
                      format: date
                      description: Filter deals on or after this date (ISO 8601)
                      example: "2023-01-01"
                    deal_end_date:
                      type: string
                      format: date
                      description: Filter deals on or before this date (ISO 8601)
                      example: "2024-12-31"
                    only_lead_deals:
                      type: boolean
                      default: false
                      description: When true, only count deals where investor was lead
                    min_matching_deals:
                      type: integer
                      minimum: 1
                      description: Minimum number of deals matching the portfolio filters
                      example: 3
                page:
                  type: integer
                  minimum: 0
                  default: 0
                  description: Page number (0-based)
                page_size:
                  type: integer
                  minimum: 1
                  maximum: 500
                  default: 10
                  description: Number of results per page (max 500)
                sort_by:
                  type: string
                  enum: ["most_recent_deal", "recent_deals", "deals_led_ltm", "total_deals", "matching_deals"]
                  default: "most_recent_deal"
                  description: |
                    Sort order for results.
                    - **most_recent_deal** — Date of most recent investment (newest first)
                    - **recent_deals** — Deals in last 12 months (highest first)
                    - **deals_led_ltm** — Lead deals in last 12 months (highest first)
                    - **total_deals** — All-time deal count (highest first)
                    - **matching_deals** — Deals matching portfolio filters (highest first)
            examples:
              empty:
                summary: Empty request (no filters)
                value:
                  page_size: 5
              filter_only:
                summary: Investors in SF investing in AI Series A/B rounds
                value:
                  investor:
                    locations: ["san-francisco-california"]
                  company_investments:
                    industries: ["artificial-intelligence"]
                    financing_types:
                      - { "type": "SERIES_A" }
                      - { "type": "SERIES_B" }
                    deal_start_date: "2023-01-01"
                  page: 0
                  page_size: 25
                  sort_by: "most_recent_deal"
              batch_lookup:
                summary: Look up specific investors by domain
                value:
                  identifiers:
                    domains: ["sequoiacap.com", "a16z.com"]
              semantic_search:
                summary: Semantic search for climate-focused investors with AI portfolio
                value:
                  company_investments:
                    search_query: "climate-focused deep tech startups"
                  page: 0
                  page_size: 25
              lead_investors_recent:
                summary: Active lead investors with at least 3 matching deals
                value:
                  company_investments:
                    industries: ["fintech"]
                    only_lead_deals: true
                    min_matching_deals: 3
                    deal_start_date: "2024-01-01"
                  sort_by: "deals_led_ltm"
                  page_size: 50
      responses:
        '200':
          description: Successful response with paginated investor list
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      investors:
                        type: array
                        items:
                          $ref: '#/components/schemas/InvestorListItem'
                  meta:
                    type: object
                    properties:
                      total_count:
                        type: integer
                        description: Total number of investors matching filters
                        example: 142
                      page:
                        type: integer
                        example: 0
                      page_size:
                        type: integer
                        example: 25
                      credits_used:
                        type: integer
                        description: Number of credits consumed by this request
                        example: 10
                      credit_source:
                        type: string
                        nullable: true
                        enum: ['monthly', 'purchased']
                        description: Source of credits used (only included for non-API tier keys)
                        example: "monthly"
                      monthly_credits_remaining:
                        type: integer
                        nullable: true
                        description: Remaining monthly credits (only included for non-API tier keys)
                        example: 990
                      purchased_credits_remaining:
                        type: integer
                        nullable: true
                        description: Remaining purchased credits (only included for non-API tier keys)
                        example: 500
                required:
                  - success
                  - data
                  - meta
        '400':
          description: Validation error (invalid values)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ParameterValidationError'
        '401':
          description: Authentication error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthError'
        '422':
          description: Unknown parameter
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ParameterValidationError'
        '402':
          description: Insufficient credits to complete request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsufficientCreditsError'
        '429':
          description: Rate limit exceeded (per-minute)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
          headers:
            Retry-After:
              description: Number of seconds to wait before retrying
              schema:
                type: integer
                example: 60
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'

  /investor:
    get:
      summary: Get investor details and statistics by identifier
      description: |
        Use this endpoint when one investor firm is already identified and its full profile,
        statistics, and portfolio summary are required. Prefer a domain or LinkedIn URL when
        available; it can be passed directly without calling `/investor/search` first.

        Use `/investor/search` for fuzzy firm-name resolution or an uncertain identifier.
        Use `POST /investors` to discover or batch-retrieve multiple investor firms.

        Provide ONE of the following query parameters to identify the investor:
        - `id` - Investor UUID
        - `domain` - Investor domain or full URL (e.g., "sequoiacap.com" or "https://sequoiacap.com")
        - `linkedin` - LinkedIn company URL
        - `crunchbase` - Crunchbase organization URL

        The response includes the investor's statistics, portfolio summary, and profile links.
      operationId: getInvestorByIdentifier
      parameters:
        - name: id
          in: query
          description: Investor UUID
          required: false
          schema:
            type: string
            format: uuid
          example: "550e8400-e29b-41d4-a716-446655440000"
        - name: domain
          in: query
          description: Investor domain or full URL (e.g., "sequoiacap.com" or "https://sequoiacap.com") — URLs are automatically parsed to extract the domain
          required: false
          schema:
            type: string
          example: "sequoiacap.com"
        - name: linkedin
          in: query
          description: LinkedIn company URL
          required: false
          schema:
            type: string
          example: "https://linkedin.com/company/sequoia-capital"
        - name: crunchbase
          in: query
          description: Crunchbase organization URL
          required: false
          schema:
            type: string
          example: "https://crunchbase.com/organization/sequoia-capital"
      responses:
        '200':
          description: Successful response with investor data
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      investor:
                        $ref: '#/components/schemas/Investor'
                  meta:
                    type: object
                    properties:
                      page:
                        type: integer
                        example: 0
                      page_size:
                        type: integer
                        example: 1
                      credits_used:
                        type: integer
                        description: Number of credits consumed by this request
                        example: 10
                      credit_source:
                        type: string
                        nullable: true
                        enum: ['monthly', 'purchased']
                        description: Source of credits used (only included for non-API tier keys)
                        example: "monthly"
                      monthly_credits_remaining:
                        type: integer
                        nullable: true
                        description: Remaining monthly credits (only included for non-API tier keys)
                        example: 990
                      purchased_credits_remaining:
                        type: integer
                        nullable: true
                        description: Remaining purchased credits (only included for non-API tier keys)
                        example: 500
                required:
                  - success
                  - data
                  - meta
        '400':
          description: Validation error (missing or invalid identifier)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ParameterValidationError'
        '401':
          description: Authentication error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthError'
        '404':
          description: Investor not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '402':
          description: Insufficient credits to complete request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsufficientCreditsError'
        '429':
          description: Rate limit exceeded (per-minute)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
          headers:
            Retry-After:
              description: Number of seconds to wait before retrying
              schema:
                type: integer
                example: 60
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'

  /investor/deals:
    get:
      summary: Get deals for an investor by identifier
      description: |
        Use this endpoint when an investor firm is already identified and its complete deal
        history is required. Prefer a domain or LinkedIn URL when available; it can be passed
        directly without calling `/investor/search` first.

        Use `POST /investors` instead to discover firms from investment criteria, or
        `POST /deals` when the desired result is a filtered list of funding rounds.

        Provide ONE of the following query parameters to identify the investor:
        - `id` - Investor UUID
        - `domain` - Investor domain or full URL (e.g., "sequoiacap.com" or "https://sequoiacap.com")
        - `linkedin` - LinkedIn company URL
        - `crunchbase` - Crunchbase organization URL

        The response includes the investor's deals with pagination. If the identifier matches multiple investors (e.g., a16z has multiple firms), deals from all matches are returned together.
      operationId: getInvestorDeals
      parameters:
        - name: id
          in: query
          description: Investor UUID
          required: false
          schema:
            type: string
            format: uuid
          example: "550e8400-e29b-41d4-a716-446655440000"
        - name: domain
          in: query
          description: Investor domain or full URL (e.g., "sequoiacap.com" or "https://sequoiacap.com") — URLs are automatically parsed to extract the domain
          required: false
          schema:
            type: string
          example: "sequoiacap.com"
        - name: linkedin
          in: query
          description: LinkedIn company URL
          required: false
          schema:
            type: string
          example: "https://linkedin.com/company/sequoia-capital"
        - name: crunchbase
          in: query
          description: Crunchbase organization URL
          required: false
          schema:
            type: string
          example: "https://crunchbase.com/organization/sequoia-capital"
        - name: page
          in: query
          description: Page number (0-based)
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
          example: 0
        - name: page_size
          in: query
          description: Number of results per page (1-500)
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 500
            default: 10
          example: 10
      responses:
        '200':
          description: Successful response with deals for the investor
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      deals:
                        type: array
                        items:
                          $ref: '#/components/schemas/InvestorDeal'
                  meta:
                    type: object
                    properties:
                      total_count:
                        type: integer
                        description: Total number of deals for this investor
                        example: 247
                      page:
                        type: integer
                        example: 0
                      page_size:
                        type: integer
                        example: 10
                      credits_used:
                        type: integer
                        description: Number of credits consumed by this request
                        example: 10
                      credit_source:
                        type: string
                        nullable: true
                        enum: ['monthly', 'purchased']
                        description: Source of credits used (only included for non-API tier keys)
                        example: "monthly"
                      monthly_credits_remaining:
                        type: integer
                        nullable: true
                        description: Remaining monthly credits (only included for non-API tier keys)
                        example: 990
                      purchased_credits_remaining:
                        type: integer
                        nullable: true
                        description: Remaining purchased credits (only included for non-API tier keys)
                        example: 500
                required:
                  - success
                  - data
                  - meta
        '400':
          description: Validation error (missing, multiple, or invalid identifier)
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - MISSING_IDENTIFIER
                          - MULTIPLE_IDENTIFIERS
                          - INVALID_PARAMETER
                          - INVALID_DOMAIN
                          - INVALID_LINKEDIN_URL
                          - INVALID_CRUNCHBASE_URL
                          - INVALID_PAGE
                          - INVALID_PAGE_SIZE
                        example: "MISSING_IDENTIFIER"
                      message:
                        type: string
                        example: "An identifier parameter is required"
                      details:
                        type: object
                        properties:
                          help:
                            type: string
                            example: "Provide one of: domain, linkedin, or crunchbase. Example: ?domain=sequoiacap.com"
        '401':
          description: Authentication error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthError'
        '404':
          description: No investor found matching the provided identifier
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - NOT_FOUND
                        example: "NOT_FOUND"
                      message:
                        type: string
                        example: "No investor found matching the provided identifier"
                      details:
                        type: object
                        properties:
                          identifier_type:
                            type: string
                            example: "domain"
                          identifier_value:
                            type: string
                            example: "nonexistent.com"
        '402':
          description: Insufficient credits to complete request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsufficientCreditsError'
        '429':
          description: Rate limit exceeded (per-minute)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
          headers:
            Retry-After:
              description: Number of seconds to wait before retrying
              schema:
                type: integer
                example: 60
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'

  /investor/search:
    get:
      summary: Search investors by name, domain, LinkedIn, or Crunchbase
      description: |
        Use this endpoint primarily to resolve a fuzzy investor-firm name or an uncertain
        identifier. If a reliable domain or LinkedIn URL is already available, skip this
        search and pass it directly to `GET /investor` for one full profile or to
        `POST /investors` for a batch lookup.

        Exactly one parameter must be provided.

        **Search types:**
        - `name` — Fuzzy name search with relevance scoring
        - `domain` — Investor domain or full URL
        - `linkedin` — LinkedIn company URL
        - `crunchbase` — Crunchbase organization URL

        Identifier lookups (`domain`, `linkedin`, `crunchbase`) return `relevance_score: 1`.
        Examples:
        - `?linkedin=https://linkedin.com/company/sequoia-capital`
        - `?crunchbase=https://crunchbase.com/organization/sequoia-capital`
      operationId: searchInvestors
      parameters:
        - name: name
          in: query
          description: Investor name (fuzzy search with relevance scoring)
          required: false
          schema:
            type: string
          example: "sequoia"
        - name: domain
          in: query
          description: Investor domain or full URL (e.g., "sequoiacap.com" or "https://sequoiacap.com") — URLs are automatically parsed to extract the domain
          required: false
          schema:
            type: string
          example: "sequoiacap.com"
        - name: linkedin
          in: query
          description: LinkedIn company URL
          required: false
          schema:
            type: string
          example: "https://linkedin.com/company/sequoia-capital"
        - name: crunchbase
          in: query
          description: Crunchbase organization URL
          required: false
          schema:
            type: string
          example: "https://crunchbase.com/organization/sequoia-capital"
      responses:
        '200':
          description: Successful search results
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      investors:
                        type: array
                        items:
                          $ref: '#/components/schemas/InvestorSearchResult'
                  meta:
                    type: object
                    properties:
                      total_count:
                        type: integer
                        description: Number of investors returned
                        example: 8
                      page:
                        type: integer
                        example: 0
                      page_size:
                        type: integer
                        example: 1
                      credits_used:
                        type: integer
                        description: Number of credits consumed by this request
                        example: 0
                      credit_source:
                        type: string
                        nullable: true
                        enum: ['monthly', 'purchased']
                        description: Source of credits used (only included for non-API tier keys)
                        example: "monthly"
                      monthly_credits_remaining:
                        type: integer
                        nullable: true
                        description: Remaining monthly credits (only included for non-API tier keys)
                        example: 990
                      purchased_credits_remaining:
                        type: integer
                        nullable: true
                        description: Remaining purchased credits (only included for non-API tier keys)
                        example: 500
                required:
                  - success
                  - data
                  - meta
              example:
                success: true
                data:
                  investors:
                    - id: "770e8400-e29b-41d4-a716-446655440000"
                      guru_permalink: "acme-ventures"
                      name: "Acme Ventures"
                      description: "Early-stage venture capital firm focused on AI startups"
                      image: "https://example.com/acme-ventures-logo.png"
                      relevance_score: 0.92
                      domain: "acmeventures.com"
                      website: "https://acmeventures.com"
                    - id: "880e8400-e29b-41d4-a716-446655440001"
                      guru_permalink: "acme-capital"
                      name: "Acme Capital"
                      description: "Growth-stage investment firm"
                      image: "https://example.com/acme-capital-logo.png"
                      relevance_score: 0.85
                      domain: "acmecap.com"
                      website: "https://acmecap.com"
                meta:
                  total_count: 2
                  page: 0
                  page_size: 1
                  credits_used: 0
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - MISSING_SEARCH_PARAMS
                          - MULTIPLE_SEARCH_PARAMS
                          - EMPTY_SEARCH_TERM
                          - INVALID_DOMAIN
                          - INVALID_LINKEDIN_URL
                          - INVALID_CRUNCHBASE_URL
                        example: "MISSING_SEARCH_PARAMS"
                      message:
                        type: string
                        example: "At least one search parameter is required"
                      details:
                        type: object
                        properties:
                          help:
                            type: string
                            example: "Provide one of: name, domain, linkedin, or crunchbase. Example: ?name=sequoia or ?domain=sequoiacap.com"
                          provided:
                            type: string
                            nullable: true
                          examples:
                            type: object
                            nullable: true
                            properties:
                              valid:
                                type: array
                                items:
                                  type: string
                              invalid:
                                type: array
                                items:
                                  type: string
        '401':
          description: Authentication error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthError'
        '402':
          description: Insufficient credits to complete request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsufficientCreditsError'
        '429':
          description: Rate limit exceeded (per-minute)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
          headers:
            Retry-After:
              description: Number of seconds to wait before retrying
              schema:
                type: integer
                example: 60
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'

components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: |
        API key authentication using Bearer token format.
        Format: `Authorization: Bearer vg_your_api_key_here`
        
        API keys follow the pattern: `vg_[12_hex_chars]_[32_base64url_chars]`
        
  schemas:
    Investor:
      type: object
      description: Full investor profile
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the investor
        name:
          type: string
          description: Investor name
        # Stats
        total_deal_count:
          type: integer
          description: Total number of deals
        lead_deal_count:
          type: integer
          description: Number of deals where investor was lead
        deal_count_last_12_months:
          type: integer
          description: Deals in the last 12 months
        lead_deal_count_last_12_months:
          type: integer
          description: Lead deals in the last 12 months
        most_recent_deal_date:
          type: string
          format: date-time
          nullable: true
          description: Date of the most recent deal
        guru_permalink:
          type: string
          description: Fundable permalink for the investor
        domain:
          type: string
          nullable: true
          description: Investor domain
        website:
          type: string
          nullable: true
          format: uri
          description: Investor website URL
        linkedin:
          type: string
          nullable: true
          format: uri
          description: Investor LinkedIn URL
        pitchbook:
          type: string
          nullable: true
          format: uri
          description: Investor PitchBook URL
        crunchbase:
          type: string
          nullable: true
          format: uri
          description: Investor Crunchbase URL
        description:
          type: string
          nullable: true
          description: Description of the investor
        legal_name:
          type: string
          nullable: true
          description: Legal name of the investor
        num_employees:
          type: string
          nullable: true
          description: Employee count range
          example: "101-250"
        investment_stage:
          type: string
          nullable: true
          description: Investment stage focus
          example: "Series A"
        contact_email:
          type: string
          nullable: true
          format: email
          description: Contact email (when available)
        contact_phone:
          type: string
          nullable: true
          description: Contact phone number (when available)
        location:
          $ref: '#/components/schemas/LocationInfo'
        # Aggregated data
        top_industries:
          type: array
          description: Top industries invested in
          items:
            type: object
            properties:
              name:
                type: string
              permalink:
                type: string
              count:
                type: integer
        top_locations:
          type: array
          description: Top portfolio company locations
          items:
            type: object
            properties:
              name:
                type: string
              full_name:
                type: string
              permalink:
                type: string
              type:
                type: string
              count:
                type: integer
        top_round_types:
          type: array
          description: Most common round types
          items:
            type: object
            properties:
              type:
                type: string
              count:
                type: integer
      required:
        - id
        - name
        - guru_permalink
        - total_deal_count
        - lead_deal_count
        - deal_count_last_12_months

    InvestorListItem:
      description: Investor with optional portfolio filter counts, returned from the POST /investors endpoint
      allOf:
        - $ref: '#/components/schemas/Investor'
        - type: object
          properties:
            filtered_deal_count:
              type: integer
              nullable: true
              description: Number of deals matching the active `company_investments` filters
            filtered_lead_count:
              type: integer
              nullable: true
              description: Of the deals matching the active `company_investments` filters, how many the investor led

    LocationInfo:
      type: object
      description: Investor location details
      properties:
        region:
          type: object
          nullable: true
          properties:
            name:
              type: string
              example: "North America"
            permalink:
              type: string
              example: "north-america"
        country:
          type: object
          nullable: true
          properties:
            name:
              type: string
              example: "United States"
            permalink:
              type: string
              example: "united-states"
        state:
          type: object
          nullable: true
          properties:
            name:
              type: string
              example: "California"
            permalink:
              type: string
              example: "california"
        city:
          type: object
          nullable: true
          properties:
            name:
              type: string
              example: "San Francisco"
            permalink:
              type: string
              example: "san-francisco-california"

    InvestorDeal:
      type: object
      description: Deal returned by the /investor/deals endpoint. Same shape as the Deal schema in the Deals API.
      properties:
        id:
          type: string
          format: uuid
        round_type:
          type: string
          nullable: true
        extension:
          type: boolean
          nullable: true
        intermediate:
          type: string
          nullable: true
        pre:
          type: boolean
          nullable: true
        date:
          type: string
          format: date-time
          nullable: true
        created_at:
          type: string
          format: date-time
          nullable: true
        total_round_raised:
          type: number
          nullable: true
        deal_descriptions:
          type: object
          nullable: true
          properties:
            short_description:
              type: string
              nullable: true
            long_description:
              type: string
              nullable: true
        company_id:
          type: string
          format: uuid
        investor_ids:
          type: array
          description: UUIDs of firm investors participating in this deal. Angels are surfaced separately in `angel_investor_ids`.
          items:
            type: string
            format: uuid
        angel_investor_ids:
          type: array
          description: UUIDs of angel investors (people) on this deal. Resolve via `/people/{id}`. Empty array when no angels.
          items:
            type: string
            format: uuid
        financings:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
              type:
                type: string
              size_usd:
                type: number
                nullable: true
              size_native:
                type: number
                nullable: true
              currency:
                type: string
                nullable: true
        valuation:
          type: object
          nullable: true
          properties:
            valuation_currency:
              type: string
              nullable: true
            valuation_usd:
              type: number
              nullable: true
            valuation_native:
              type: number
              nullable: true
            type:
              type: string
        articles:
          type: array
          description: Related articles/sources for this deal. Always included; empty when no sources exist.
          items:
            $ref: '#/components/schemas/DealArticle'
      required:
        - id
        - round_type
        - extension
        - intermediate
        - pre
        - date
        - created_at
        - total_round_raised
        - deal_descriptions
        - company_id
        - investor_ids
        - angel_investor_ids
        - financings
        - valuation
        - articles

    DealArticle:
      type: object
      description: An article or source related to a deal
      properties:
        link:
          type: string
          nullable: true
          description: URL of the article
          example: "https://techcrunch.com/2024/01/15/company-raises-series-a"
        date:
          type: string
          nullable: true
          description: Date of the article
          example: "2024-01-15"
        is_primary:
          type: boolean
          description: Whether this is the primary source article for the deal
          example: true
      required:
        - is_primary

    ParameterValidationError:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          properties:
            code:
              type: string
              example: "VALIDATION_ERROR"
            message:
              type: string
              example: "Invalid request parameters"
            details:
              type: object
              properties:
                errors:
                  type: array
                  items:
                    type: object
                    properties:
                      field:
                        type: string
                      value:
                        type: string
                        nullable: true
                      message:
                        type: string
                      code:
                        type: string
                      validOptions:
                        type: array
                        items:
                          type: string
                help:
                  type: string
      required:
        - success
        - error

    InvestorSearchResult:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the investor
          example: "550e8400-e29b-41d4-a716-446655440000"
        guru_permalink:
          type: string
          nullable: true
          description: Fundable permalink for the investor
          example: "acme-ventures"
        name:
          type: string
          description: Investor name
          example: "Acme Ventures"
        description:
          type: string
          nullable: true
          description: Brief description of the investor
          example: "Early-stage venture capital firm focused on AI startups"
        relevance_score:
          type: number
          description: Search relevance score (0-1)
          example: 0.92
        domain:
          type: string
          nullable: true
          description: Investor website domain
          example: "acmeventures.com"
        website:
          type: string
          nullable: true
          format: uri
          description: Investor website URL
        linkedin:
          type: string
          nullable: true
          description: LinkedIn profile URL
        crunchbase:
          type: string
          nullable: true
          description: Crunchbase profile URL

    AuthError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum: ['AUTH_ERROR', 'INVALID_API_KEY', 'INACTIVE_API_KEY']
              example: 'AUTH_ERROR'
            message:
              type: string
              example: "API key not provided"
            details:
              type: object
              properties:
                help:
                  type: string
                  example: "Please provide your API key in the Authorization header"
                format:
                  type: string
                  example: "Bearer vg_your_api_key_here"
      required:
        - error

    RateLimitError:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          properties:
            code:
              type: string
              example: 'RATE_LIMIT_EXCEEDED'
            message:
              type: string
              example: "Rate limit exceeded. Maximum 200 requests per minute."
            details:
              type: object
              properties:
                limit:
                  type: integer
                  description: Maximum requests allowed per window
                  example: 200
                window:
                  type: string
                  description: Rate limit window duration
                  example: "60 seconds"
                help:
                  type: string
                  example: "Please reduce your request frequency and try again."
      required:
        - error

    InsufficientCreditsError:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          properties:
            code:
              type: string
              example: 'INSUFFICIENT_CREDITS'
            message:
              type: string
              example: "Not enough credits to complete this request. Visit https://www.tryfundable.ai/api-access to purchase more."
            details:
              type: object
              properties:
                credits_needed:
                  type: integer
                  nullable: true
                  description: Number of credits required (included when known post-execution)
                  example: 25
                monthly_credits_remaining:
                  type: integer
                  description: Remaining monthly credits
                  example: 0
                purchased_credits_remaining:
                  type: integer
                  description: Remaining purchased credits
                  example: 0
                help:
                  type: string
                  example: "Purchase additional credits at https://www.tryfundable.ai/api-access or upgrade your plan."
      required:
        - error

    ServerError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: 'INTERNAL_SERVER_ERROR'
            message:
              type: string
              example: "An unexpected error occurred"
            details:
              type: string
              nullable: true
              description: Error details (only in development mode)
      required:
        - error

    NotFoundError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum: ['INVESTOR_NOT_FOUND']
              example: 'INVESTOR_NOT_FOUND'
            message:
              type: string
              example: "Investor not found"
            details:
              type: object
              properties:
                help:
                  type: string
                  example: "Please check the investor identifier (ID, domain, LinkedIn URL, or Crunchbase URL) and try again"
      required:
        - error

tags:
  - name: investors
    description: Investor data and search operations
