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

# Weekly rollup snapshot

> Single snapshot of the metrics the around-the-brain weekly automation needs (QA average + p50 + p95, conversation count, agent turn count, hallucination flag count, top 5 hallucination kinds, top 5 handoff reasons). The weekly-qa-rollup n8n workflow polls this endpoint each Monday morning. Window defaults to the last 7 days; pass `since=ISO8601` for a custom window (bounded between 1 hour and 90 days in the past).



## OpenAPI

````yaml https://app.vorel.ai/api/v1/openapi.json get /api/v1/analytics/weekly-rollup
openapi: 3.1.0
info:
  title: Vorel API
  version: 0.1.0
  description: >-
    Public API for Vorel — the AI receptionist for any business. Read your
    conversations, leads, appointments, and catalog; push CRM-side updates back
    into the platform. All endpoints accept bearer-auth API keys issued at
    `/settings/integrations/api-keys` in the dashboard. Per-key rate limit is
    200 req/min.
  contact:
    name: Vorel support
    email: hello@vorel.ai
  license:
    name: Proprietary
servers:
  - url: https://app.vorel.ai
    description: Production
  - url: http://localhost:3000
    description: Local dev
security:
  - BearerAuth: []
tags:
  - name: Conversations
    description: Inbound customer conversations across channels.
  - name: Leads
    description: Qualified-lead rows attached to conversations.
  - name: Appointments
    description: Scheduled customer engagements.
  - name: Offerings
    description: Tenant catalog (properties, services, treatments — vertical-specific).
  - name: Analytics
    description: >-
      Aggregate metrics for tenant + automation consumers. The around-the-brain
      workflows read these rather than mass-querying the resource endpoints.
  - name: CRM
    description: >-
      Operator-side writes into the tenant's configured CRM (HubSpot /
      Salesforce / Zoho / etc.). Per-tenant field mappings translate canonical
      Vorel keys to vendor-side keys before the driver call.
paths:
  /api/v1/analytics/weekly-rollup:
    get:
      tags:
        - Analytics
      summary: Weekly rollup snapshot
      description: >-
        Single snapshot of the metrics the around-the-brain weekly automation
        needs (QA average + p50 + p95, conversation count, agent turn count,
        hallucination flag count, top 5 hallucination kinds, top 5 handoff
        reasons). The weekly-qa-rollup n8n workflow polls this endpoint each
        Monday morning. Window defaults to the last 7 days; pass `since=ISO8601`
        for a custom window (bounded between 1 hour and 90 days in the past).
      operationId: getWeeklyRollup
      parameters:
        - name: since
          in: query
          required: false
          description: >-
            Inclusive lower bound of the rollup window. ISO 8601 timestamp.
            Defaults to 7 days before the request time. Must be at least 1 hour
            and at most 90 days in the past.
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: Rollup snapshot for the requested window.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WeeklyRollup'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
      security:
        - BearerAuth:
            - read
components:
  schemas:
    WeeklyRollup:
      type: object
      required:
        - since
        - computed_at
        - qa_avg
        - qa_p50
        - qa_p95
        - conversation_count
        - agent_turn_count
        - hallucination_flag_count
        - top_flag_kinds
        - top_handoff_reasons
      description: >-
        Single snapshot of the metrics the around-the-brain weekly automation
        needs. All percentile / average fields are nullable when no source rows
        exist in the window — render those as "no data" rather than zero.
      properties:
        since:
          type: string
          format: date-time
          description: Inclusive lower bound of the window.
        computed_at:
          type: string
          format: date-time
        qa_avg:
          type: number
          nullable: true
          description: Mean QA total_score.
        qa_p50:
          type: number
          nullable: true
          description: Median QA total_score.
        qa_p95:
          type: number
          nullable: true
          description: 95th percentile QA total_score.
        conversation_count:
          type: integer
          minimum: 0
        agent_turn_count:
          type: integer
          minimum: 0
          description: messages.role IN (agent_bot, agent_human).
        hallucination_flag_count:
          type: integer
          minimum: 0
          description: Messages with non-empty hallucination_flags array.
        top_flag_kinds:
          type: array
          maxItems: 5
          items:
            $ref: '#/components/schemas/KindCount'
        top_handoff_reasons:
          type: array
          maxItems: 5
          items:
            $ref: '#/components/schemas/KindCount'
    KindCount:
      type: object
      required:
        - kind
        - count
      properties:
        kind:
          type: string
        count:
          type: integer
          minimum: 0
    ErrorEnvelope:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - unauthorized
                - forbidden
                - rate_limited
                - bad_request
                - not_found
                - conflict
                - internal_error
              description: Machine-readable error category.
            message:
              type: string
              description: >-
                Human-readable error description; safe to surface in tenant
                logs.
  responses:
    BadRequest:
      description: Body validation failed. Error message names the offending field.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Unauthorized:
      description: Missing, malformed, unknown, or revoked API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Forbidden:
      description: >-
        API key is valid but lacks the required scope for this endpoint. Issue a
        new key with the necessary scope at `/settings/integrations/api-keys`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    RateLimited:
      description: >-
        200 req/min per API key exceeded. `Retry-After` header carries
        seconds-until-reset.
      headers:
        Retry-After:
          schema:
            type: integer
        X-RateLimit-Limit:
          schema:
            type: integer
        X-RateLimit-Remaining:
          schema:
            type: integer
        X-RateLimit-Reset:
          schema:
            type: integer
          description: Unix epoch seconds.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: vapk_<env>_<48-hex>
      description: >-
        Tenant-issued API key. Format: `vapk_live_<48 hex chars>` (60 chars
        total). Issue + manage at `/settings/integrations/api-keys` in the Vorel
        dashboard. Each key has a scope set (`read`, `leads:write`,
        `appointments:write`, `offerings:write`); endpoints requiring a write
        scope reject keys without it with a 403 envelope.

````