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

# Volume health for an inbox against its own baseline

> Compares the requested window's message volume against this inbox's own
recent norm and scores the deviation, for health/risk surfaces.

The baseline is a trailing average of the `baselinePeriods` windows of the
same length immediately before `dateFrom` (default 3). No seasonal
adjustment is applied. `dateFrom` and `dateTo` are both required; the window
plus its baseline must stay within a 400-day scan, so long ranges need a
lower `baselinePeriods`.

`severityScore` (0–100) tracks the size of a **decline** — growth scores 0
with label `none`. Bands: `critical` 75+, `high` 50–74, `moderate` 25–49,
`low` 1–24.

`trend` compares the two halves of the requested window, which is what
separates "down and still falling" from "down but recovering".

**Insufficient history is reported explicitly.** With no baseline volume,
`volumeVsBaselinePct` and `severityScore` are `null` and `severityLabel` is
`insufficient_history` — a silent `-100%` would be indistinguishable from a
real collapse and would drive alerts the data can't justify.




## OpenAPI

````yaml /openapi.yaml get /api/inboxes/{channelId}/health
openapi: 3.0.3
info:
  title: Aptly API
  version: '1.0'
  description: >
    The Aptly API lets you read and write cards on any Aptly board from external
    systems.


    All requests require an API key passed as the `x-token` header.

    API keys are scoped to your company and work across all boards.
servers:
  - url: https://core-api.getaptly.com
    description: Production
security:
  - ApiKeyHeader: []
paths:
  /api/inboxes/{channelId}/health:
    get:
      tags:
        - Inboxes
      summary: Volume health for an inbox against its own baseline
      description: >
        Compares the requested window's message volume against this inbox's own

        recent norm and scores the deviation, for health/risk surfaces.


        The baseline is a trailing average of the `baselinePeriods` windows of
        the

        same length immediately before `dateFrom` (default 3). No seasonal

        adjustment is applied. `dateFrom` and `dateTo` are both required; the
        window

        plus its baseline must stay within a 400-day scan, so long ranges need a

        lower `baselinePeriods`.


        `severityScore` (0–100) tracks the size of a **decline** — growth scores
        0

        with label `none`. Bands: `critical` 75+, `high` 50–74, `moderate`
        25–49,

        `low` 1–24.


        `trend` compares the two halves of the requested window, which is what

        separates "down and still falling" from "down but recovering".


        **Insufficient history is reported explicitly.** With no baseline
        volume,

        `volumeVsBaselinePct` and `severityScore` are `null` and `severityLabel`
        is

        `insufficient_history` — a silent `-100%` would be indistinguishable
        from a

        real collapse and would drive alerts the data can't justify.
      operationId: getInboxHealth
      parameters:
        - name: channelId
          in: path
          required: true
          schema:
            type: string
          description: External channel meta ID (`meta.id`) of the inbox.
        - name: dateFrom
          in: query
          required: true
          schema:
            type: string
            format: date-time
        - name: dateTo
          in: query
          required: true
          schema:
            type: string
            format: date-time
          description: Exclusive.
        - name: baselinePeriods
          in: query
          schema:
            type: integer
            default: 3
            minimum: 1
            maximum: 12
          description: >-
            How many same-length windows before `dateFrom` are averaged into the
            baseline.
        - name: includeJunk
          in: query
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Volume health for the window.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/InboxHealth'
        '400':
          description: >-
            Missing window, invalid `baselinePeriods`, or a window plus baseline
            exceeding the 400-day scan limit.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid or missing credential.
        '403':
          description: The authenticated user cannot reach this inbox.
        '404':
          description: Inbox not found in your company.
      security:
        - ApiKeyHeader: []
        - DelegateToken: []
        - PartnerBearer: []
components:
  schemas:
    InboxHealth:
      type: object
      properties:
        window:
          type: object
          properties:
            from:
              type: string
              format: date-time
            to:
              type: string
              format: date-time
        baseline:
          type: object
          properties:
            from:
              type: string
              format: date-time
            to:
              type: string
              format: date-time
            periods:
              type: integer
            avgVolume:
              type: number
              nullable: true
              description: Mean volume per period across the baseline span.
            sufficient:
              type: boolean
              description: >-
                False when the baseline span carried no volume. Everything
                derived from the baseline is null in that case.
        volume:
          type: integer
          description: Messages in the requested window.
        volumeVsBaselinePct:
          type: number
          nullable: true
          description: >-
            Percentage change against the baseline average. Negative is a
            decline. Null when `baseline.sufficient` is false.
        trend:
          type: string
          enum:
            - falling
            - rising
            - flat
            - unknown
          description: >-
            Second half of the window vs. the first. `unknown` when the window
            is too short to split.
        severityScore:
          type: integer
          nullable: true
          description: 0–100, tracking decline magnitude. 0 for flat or growing volume.
        severityLabel:
          type: string
          enum:
            - critical
            - high
            - moderate
            - low
            - none
            - insufficient_history
        tags:
          type: array
          items:
            type: string
          description: >-
            Human-readable flags, e.g. `Usage down`, `No activity`, `Still
            falling`.
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: x-token
    DelegateToken:
      type: apiKey
      in: header
      name: Authorization
      description: 'Delegate token issued by the platform. Format: `DelegateToken <token>`'
    PartnerBearer:
      type: http
      scheme: bearer
      description: 'Partner token. Format: `Authorization: Bearer <token>`'

````