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

# Métricas de Quests

> Métricas detalhadas ou globais de quests

# Métricas de Quests

Retorna métricas de quests da empresa.
Com `quest_id`, retorna visão detalhada; sem `quest_id`, retorna visão global agregada.


## OpenAPI

````yaml GET /api/v1/public/quests/metrics
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/quests/metrics:
    get:
      tags:
        - API Pública
      summary: Métricas de quests
      description: >-
        Métricas de quests: detalhado se quest_id informado, global caso
        contrário.
      operationId: get_quest_metrics_api_v1_public_quests_metrics_get
      parameters:
        - description: ID da quest (null retorna visão global)
          in: query
          name: quest_id
          required: false
          schema:
            anyOf:
              - format: uuid
                type: string
              - type: 'null'
            description: ID da quest (null retorna visão global)
            title: Quest Id
        - in: query
          name: days
          required: false
          schema:
            default: 30
            maximum: 365
            minimum: 1
            title: Days
            type: integer
        - description: '"day", "week" ou "month"'
          in: query
          name: group_by
          required: false
          schema:
            default: day
            description: '"day", "week" ou "month"'
            title: Group By
            type: string
        - 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:
                anyOf:
                  - $ref: '#/components/schemas/QuestDetailedMetricsResponse'
                  - $ref: '#/components/schemas/QuestGlobalMetricsResponse'
                title: Response Get Quest Metrics Api V1 Public Quests Metrics Get
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    QuestDetailedMetricsResponse:
      description: Métricas detalhadas de uma quest específica.
      properties:
        avg_score:
          anyOf:
            - type: number
            - type: 'null'
          title: Avg Score
        completion_rate:
          default: 0
          title: Completion Rate
          type: number
        detractors:
          anyOf:
            - type: integer
            - type: 'null'
          title: Detractors
        neutrals:
          anyOf:
            - type: integer
            - type: 'null'
          title: Neutrals
        nps_score:
          anyOf:
            - type: integer
            - type: 'null'
          title: Nps Score
        period_days:
          default: 30
          title: Period Days
          type: integer
        promoters:
          anyOf:
            - type: integer
            - type: 'null'
          title: Promoters
        quest_id:
          title: Quest Id
          type: string
        responses_by_period:
          items:
            $ref: '#/components/schemas/QuestMetricsResponseByPeriod'
          title: Responses By Period
          type: array
        responses_total:
          default: 0
          title: Responses Total
          type: integer
        score_distribution:
          anyOf:
            - additionalProperties:
                type: integer
              type: object
            - type: 'null'
          title: Score Distribution
        status:
          title: Status
          type: string
        title:
          title: Title
          type: string
        top_responses:
          items:
            additionalProperties: true
            type: object
          title: Top Responses
          type: array
        type:
          title: Type
          type: string
      required:
        - quest_id
        - title
        - type
        - status
      title: QuestDetailedMetricsResponse
      type: object
    QuestGlobalMetricsResponse:
      description: Visão global de todas as quests da empresa.
      properties:
        avg_completion_rate:
          default: 0
          title: Avg Completion Rate
          type: number
        avg_nps_score:
          anyOf:
            - type: number
            - type: 'null'
          title: Avg Nps Score
        period_days:
          default: 30
          title: Period Days
          type: integer
        quests_active:
          default: 0
          title: Quests Active
          type: integer
        quests_summary:
          items:
            $ref: '#/components/schemas/QuestMetricsSummaryItem'
          title: Quests Summary
          type: array
        quests_total:
          default: 0
          title: Quests Total
          type: integer
        responses_total:
          default: 0
          title: Responses Total
          type: integer
      title: QuestGlobalMetricsResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    QuestMetricsResponseByPeriod:
      properties:
        avg_score:
          anyOf:
            - type: number
            - type: 'null'
          title: Avg Score
        count:
          default: 0
          title: Count
          type: integer
        period:
          title: Period
          type: string
      required:
        - period
      title: QuestMetricsResponseByPeriod
      type: object
    QuestMetricsSummaryItem:
      properties:
        completion_rate:
          default: 0
          title: Completion Rate
          type: number
        nps_score:
          anyOf:
            - type: integer
            - type: 'null'
          title: Nps Score
        quest_id:
          title: Quest Id
          type: string
        responses:
          default: 0
          title: Responses
          type: integer
        title:
          title: Title
          type: string
        type:
          title: Type
          type: string
      required:
        - quest_id
        - title
        - type
      title: QuestMetricsSummaryItem
      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

````