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

# Performance de Indicação

> Métricas agregadas de performance do programa de indicação

# Performance de Indicação

Retorna métricas agregadas do programa de indicação da empresa no período informado.

## Filtros

* `days` define janela de análise
* `client_id` opcional para filtrar um indicador específico

## Status comuns

* `200` métricas retornadas
* `401` API Key inválida ou revogada
* `403` plano sem `api_access`
* `422` parâmetro inválido


## OpenAPI

````yaml GET /api/v1/public/referral-performance
openapi: 3.1.0
info:
  contact:
    email: support@indiqai.com
    name: IndiqAI Support
    url: https://indiqai.com/
  description: Especificação OpenAPI da API Pública IndiqAI.
  license:
    name: Proprietary
    url: https://indiqai.com/license
  title: IndiqAI API Pública
  version: 1.5.0
servers:
  - description: Produção
    url: https://api.indiqai.com
security: []
paths:
  /api/v1/public/referral-performance:
    get:
      tags:
        - API Pública
      summary: Performance do programa de indicação
      description: Retorna performance do programa de indicação da empresa no período.
      operationId: get_referral_performance_api_v1_public_referral_performance_get
      parameters:
        - in: query
          name: days
          required: false
          schema:
            default: 30
            maximum: 365
            minimum: 1
            title: Days
            type: integer
        - in: query
          name: client_id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Client Id
        - description: Chave de API
          in: header
          name: X-API-Key
          required: true
          schema:
            description: Chave de API
            title: X-Api-Key
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReferralPerformanceResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    ReferralPerformanceResponse:
      description: Performance do programa de indicação da empresa.
      properties:
        avg_days_to_convert:
          anyOf:
            - type: number
            - type: 'null'
          title: Avg Days To Convert
        conversion_rate:
          default: 0
          title: Conversion Rate
          type: number
        converted_referrals:
          default: 0
          title: Converted Referrals
          type: integer
        pending_referrals:
          default: 0
          title: Pending Referrals
          type: integer
        period_days:
          default: 30
          title: Period Days
          type: integer
        referrals_by_period:
          items:
            $ref: '#/components/schemas/ReferralByPeriod'
          title: Referrals By Period
          type: array
        top_referrers:
          items:
            $ref: '#/components/schemas/ReferralTopReferrer'
          title: Top Referrers
          type: array
        total_referrals:
          default: 0
          title: Total Referrals
          type: integer
      title: ReferralPerformanceResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ReferralByPeriod:
      description: Indicações agrupadas por período.
      properties:
        converted:
          default: 0
          title: Converted
          type: integer
        generated:
          default: 0
          title: Generated
          type: integer
        period:
          title: Period
          type: string
      required:
        - period
      title: ReferralByPeriod
      type: object
    ReferralTopReferrer:
      description: Indicador com melhor performance.
      properties:
        client_id:
          title: Client Id
          type: string
        conversions:
          default: 0
          title: Conversions
          type: integer
        name:
          title: Name
          type: string
        referrals:
          default: 0
          title: Referrals
          type: integer
      required:
        - client_id
        - name
      title: ReferralTopReferrer
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object

````