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

# Aggregate therapy summary

> Returns an aggregate summary computed across all nights on record: adherence, usage, usage-weighted AHI, event composition, and best/worst nights. Nights with under 1 minute of usage are excluded from the summary; `compliantNights` counts nights with at least 4 hours (240 minutes) of usage.



## OpenAPI

````yaml /openapi.json get /api/v1/me/summary
openapi: 3.1.0
info:
  title: Apnealytics API
  version: 1.0.0
  description: >-
    A read-only REST API for your own CPAP therapy data. Authenticate with a
    personal API key (created in the app under Account → API) sent as a Bearer
    token. Every response is JSON and is scoped to your own account only. The
    API is a Pro feature.


    Apnealytics is a tracking and coaching tool, not a medical device.
    Machine-estimated AHI and the values returned here are not a clinical
    diagnosis — discuss your therapy with a qualified clinician.
servers:
  - url: https://my.apnealytics.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Account
    description: Account profile and high-level counts.
  - name: Therapy
    description: Nightly therapy data and aggregate summaries.
  - name: Vitals
    description: Wearable / Apple Health daily metrics.
paths:
  /api/v1/me/summary:
    get:
      tags:
        - Therapy
      summary: Aggregate therapy summary
      description: >-
        Returns an aggregate summary computed across all nights on record:
        adherence, usage, usage-weighted AHI, event composition, and best/worst
        nights. Nights with under 1 minute of usage are excluded from the
        summary; `compliantNights` counts nights with at least 4 hours (240
        minutes) of usage.
      operationId: getSummary
      responses:
        '200':
          description: Aggregate therapy summary.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SummaryResponse'
              example:
                summary:
                  nights: 212
                  compliantNights: 198
                  avgUsageHrs: 7.14
                  medianUsageHrs: 7.3
                  compliancePct: 92.5
                  avgAhi: 3.42
                  medianAhi: 3.1
                  pctUnder5: 81.6
                  avgLeak95: 12.4
                  avgPress95: 10.8
                  composition:
                    obstructive: 46
                    central: 11
                    hypopnea: 40
                    unclassified: 3
                  bestNight:
                    date: '2026-03-18'
                    ahi: 0.3
                  worstNight:
                    date: '2025-12-27'
                    ahi: 14.9
                nights: 212
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/ServerError'
      security:
        - bearerAuth: []
components:
  schemas:
    SummaryResponse:
      type: object
      properties:
        summary:
          $ref: '#/components/schemas/TherapySummary'
        nights:
          type: integer
          description: Total number of nights fed into the summary.
      required:
        - summary
        - nights
    TherapySummary:
      type: object
      description: >-
        Aggregate therapy statistics. Percentages are 0–100; usage is in hours;
        AHI and leak are averaged over qualifying nights.
      properties:
        nights:
          type: integer
          description: >-
            Number of nights with at least 1 minute of usage that were
            summarized.
        compliantNights:
          type: integer
          description: Count of summarized nights with at least 4 hours (240 min) of usage.
        avgUsageHrs:
          type: number
          description: Mean usage in hours (2 dp).
        medianUsageHrs:
          type: number
          description: Median usage in hours (2 dp).
        compliancePct:
          type: number
          description: Percent of calendar days spanned that had a >=4h night (1 dp).
        avgAhi:
          type: number
          description: Usage-weighted mean AHI over nights with a recorded AHI (2 dp).
        medianAhi:
          type: number
          description: Median AHI over nights with a recorded AHI (2 dp).
        pctUnder5:
          type: number
          description: Percent of AHI nights with AHI < 5 (1 dp).
        avgLeak95:
          type: number
          description: Mean 95th-percentile leak in L/min (1 dp).
        avgPress95:
          type: number
          description: Mean 95th-percentile pressure in cmH2O (1 dp).
        composition:
          type: object
          description: >-
            Event composition as whole-number percentages of total scored
            events.
          properties:
            obstructive:
              type: number
            central:
              type: number
            hypopnea:
              type: number
            unclassified:
              type: number
          required:
            - obstructive
            - central
            - hypopnea
            - unclassified
        bestNight:
          type: object
          description: Lowest-AHI night. Omitted when no night has a recorded AHI.
          properties:
            date:
              type: string
              format: date
            ahi:
              type: number
          required:
            - date
            - ahi
        worstNight:
          type: object
          description: Highest-AHI night. Omitted when no night has a recorded AHI.
          properties:
            date:
              type: string
              format: date
            ahi:
              type: number
          required:
            - date
            - ahi
      required:
        - nights
        - compliantNights
        - avgUsageHrs
        - medianUsageHrs
        - compliancePct
        - avgAhi
        - medianAhi
        - pctUnder5
        - avgLeak95
        - avgPress95
        - composition
    Error:
      type: object
      description: Uniform error envelope. `error` is a stable machine-readable code.
      properties:
        error:
          type: string
          description: Error code.
          enum:
            - unauthorized
            - invalid_request
            - server_error
      required:
        - error
  responses:
    Unauthorized:
      description: >-
        Missing, malformed, revoked, expired, or non-Pro API key. The body never
        distinguishes between these cases.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: unauthorized
    ServerError:
      description: >-
        Unexpected server error. The body carries no stack trace or internal
        detail.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: server_error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Personal API key, created in the app under Account → API. Send it as
        `Authorization: Bearer apn_...`. Keys are read-only, Pro-gated, and
        revocable. A revoked, expired, or non-Pro key returns 401.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.