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

# Dashboard sparkline trends

> Daily time-series + period-over-period comparison for messages, conversations, runs, contacts.



## OpenAPI

````yaml /api-reference/openapi.json get /api/metrics/overview/trends
openapi: 3.1.0
info:
  title: Tedro API
  version: 1.0.0
  description: REST API for the Tedro communication operations platform.
servers:
  - url: https://api.tedro.io
    description: Production
security:
  - sessionCookie: []
    workspaceId: []
paths:
  /api/metrics/overview/trends:
    get:
      tags:
        - Metrics
      summary: Dashboard sparkline trends
      description: >-
        Daily time-series + period-over-period comparison for messages,
        conversations, runs, contacts.
      parameters:
        - schema:
            type: string
            enum:
              - 7d
              - 30d
            description: Range window (default 7d)
          required: false
          description: Range window (default 7d)
          name: range
          in: query
      responses:
        '200':
          description: Trend + comparison payload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricsTrendsResponse'
        '401':
          description: Unauthorized - missing or invalid session cookie
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden - insufficient role (admin required)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - sessionCookie: []
          workspaceId: []
components:
  schemas:
    MetricsTrendsResponse:
      type: object
      properties:
        range:
          type: string
        trends:
          type: object
          properties:
            messages:
              type: array
              items:
                $ref: '#/components/schemas/MetricsTrendPoint'
            conversations:
              type: array
              items:
                $ref: '#/components/schemas/MetricsTrendPoint'
            runs:
              type: array
              items:
                $ref: '#/components/schemas/MetricsTrendPoint'
            contacts:
              type: array
              items:
                $ref: '#/components/schemas/MetricsTrendPoint'
          required:
            - messages
            - conversations
            - runs
            - contacts
        comparison:
          type: object
          properties:
            messages:
              $ref: '#/components/schemas/MetricsComparisonStat'
            conversations:
              $ref: '#/components/schemas/MetricsComparisonStat'
            runs:
              $ref: '#/components/schemas/MetricsComparisonStat'
            contacts:
              $ref: '#/components/schemas/MetricsComparisonStat'
          required:
            - messages
            - conversations
            - runs
            - contacts
      required:
        - range
        - trends
        - comparison
      description: >-
        Sparkline trends + period-over-period comparison for the overview
        dashboard
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
      required:
        - error
    MetricsTrendPoint:
      type: object
      properties:
        date:
          type: string
        count:
          type: integer
      required:
        - date
        - count
    MetricsComparisonStat:
      type: object
      properties:
        current:
          type: integer
        previous:
          type: integer
        changePercent:
          type: integer
      required:
        - current
        - previous
        - changePercent
  securitySchemes:
    sessionCookie:
      type: apiKey
      in: cookie
      name: better-auth.session_token
      description: Session cookie set by Better Auth on sign-in.
    workspaceId:
      type: apiKey
      in: header
      name: x-workspace-id
      description: Workspace UUID. Required on all /api/* endpoints.

````