> ## 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.

# Visão Geral de Métricas

> KPIs resumidos da operação de fidelização

# Visão Geral de Métricas

Retorna KPIs resumidos da operação de fidelização da empresa, incluindo clientes, pontos, cupons e cartões.

## Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.indiqai.com/api/v1/public/metrics/overview" \
    -H "X-API-Key: indiqai_sua_chave_aqui"
  ```

  ```typescript JavaScript theme={null}
  const response = await fetch('https://api.indiqai.com/api/v1/public/metrics/overview', {
    headers: { 'X-API-Key': 'indiqai_sua_chave_aqui' }
  });

  const data = await response.json();
  ```

  ```python Python theme={null}
  import httpx

  response = httpx.get(
      'https://api.indiqai.com/api/v1/public/metrics/overview',
      headers={'X-API-Key': 'indiqai_sua_chave_aqui'}
  )

  data = response.json()
  ```
</CodeGroup>

## Response

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "total_clients": 342,
    "active_clients_30d": 128,
    "total_points_distributed": 85200,
    "total_points_redeemed": 42600,
    "total_coupons_generated": 215,
    "total_coupons_used": 189,
    "total_loyalty_cards": 156,
    "completed_loyalty_cards": 47,
    "total_referrals": 89,
    "period": "all_time",
    "generated_at": "2026-03-20T12:00:00Z"
  }
  ```

  ```json 401 Unauthorized theme={null}
  {
    "detail": "API Key inválida ou não fornecida"
  }
  ```
</ResponseExample>

## Campos da Resposta

<ResponseField name="total_clients" type="integer">
  Total de clientes cadastrados
</ResponseField>

<ResponseField name="active_clients_30d" type="integer">
  Clientes com atividade nos últimos 30 dias
</ResponseField>

<ResponseField name="total_points_distributed" type="integer">
  Total de pontos distribuídos (histórico completo)
</ResponseField>

<ResponseField name="total_points_redeemed" type="integer">
  Total de pontos resgatados
</ResponseField>

<ResponseField name="total_coupons_generated" type="integer">
  Total de cupons gerados
</ResponseField>

<ResponseField name="total_coupons_used" type="integer">
  Total de cupons utilizados
</ResponseField>

<ResponseField name="total_loyalty_cards" type="integer">
  Total de cartões fidelidade criados
</ResponseField>

<ResponseField name="completed_loyalty_cards" type="integer">
  Cartões fidelidade completados
</ResponseField>

<ResponseField name="total_referrals" type="integer">
  Total de indicações registradas
</ResponseField>

<ResponseField name="period" type="string">
  Período das métricas (atualmente `all_time`)
</ResponseField>

<ResponseField name="generated_at" type="string">
  Timestamp de geração das métricas (ISO 8601)
</ResponseField>


## OpenAPI

````yaml GET /api/v1/public/metrics/overview
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/metrics/overview:
    get:
      tags:
        - API Pública
      summary: KPIs da empresa
      description: Retorna KPIs resumidos da empresa (clientes, cupons, pontos, etc).
      operationId: get_metrics_api_v1_public_metrics_overview_get
      parameters:
        - 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/PublicMetricsResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    PublicMetricsResponse:
      description: KPIs resumidos da empresa.
      properties:
        active_clients:
          default: 0
          title: Active Clients
          type: integer
        total_clients:
          default: 0
          title: Total Clients
          type: integer
        total_coupons:
          default: 0
          title: Total Coupons
          type: integer
        total_points_distributed:
          default: 0
          title: Total Points Distributed
          type: integer
        total_rewards_claimed:
          default: 0
          title: Total Rewards Claimed
          type: integer
      title: PublicMetricsResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      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

````