Vital Aggregate API

The Aggregate API from Vital — 3 operation(s) for aggregate.

Operations 3

POST /aggregate/v1/user/{user_id}/query Query One #
GET /aggregate/v1/user/{user_id}/continuous_query/{query_id_or_slug}/result_table Get Result Table For Query #
GET /aggregate/v1/user/{user_id}/continuous_query/{query_id_or_slug}/task_history Get Task History For Query #

Documentation

Specifications

Schemas & Data

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/vital-io-aggregate-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

vital-io-aggregate-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Vital Io Aggregate API
  version: 0.4.497
  description: 'Operations tagged Aggregate across 3 of this provider''s published API definitions: vital-openapi-original.json, vital-openapi-original.yml, vital-sense-api-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.us.junction.com
  x-fern-server-name: Production
- url: https://api.eu.junction.com
  x-fern-server-name: ProductionEU
- url: https://api.sandbox.us.junction.com
  x-fern-server-name: Sandbox
- url: https://api.sandbox.eu.junction.com
  x-fern-server-name: SandboxEU
security:
- apiKeyAuth: []
tags:
- name: Aggregate
paths:
  /aggregate/v1/user/{user_id}/query:
    post:
      summary: Query One
      operationId: query_one_aggregate_v1_user__user_id__query_post
      parameters:
      - name: user_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: The user id to query for
      - name: accept
        in: header
        required: false
        schema:
          enum:
          - '*/*'
          - application/json
          - application/vnd.vital.tar+gzip+parquet
          type: string
          default: '*/*'
          title: Accept
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QueryBatch'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AggregationResponse'
            application/vnd.vital.tar+gzip+parquet: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-fern-sdk-group-name: aggregate
      x-fern-sdk-method-name: query_one
      x-fern-availability: beta
      tags:
      - Aggregate
    servers:
    - url: https://api.us.junction.com
      x-fern-server-name: Production
    - url: https://api.eu.junction.com
      x-fern-server-name: ProductionEU
    - url: https://api.sandbox.us.junction.com
      x-fern-server-name: Sandbox
    - url: https://api.sandbox.eu.junction.com
      x-fern-server-name: SandboxEU
  /aggregate/v1/user/{user_id}/continuous_query/{query_id_or_slug}/result_table:
    get:
      summary: Get Result Table For Query
      operationId: get_result_table_for_query_aggregate_v1_user__user_id__continuous_query__query_id_or_slug__result_table_get
      parameters:
      - name: user_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: User Id
      - name: query_id_or_slug
        in: path
        required: true
        schema:
          anyOf:
          - type: string
            format: uuid
          - type: string
          union_mode: left_to_right
          title: Query Id Or Slug
      - name: accept
        in: header
        required: false
        schema:
          enum:
          - '*/*'
          - application/json
          - application/vnd.apache.parquet
          type: string
          default: '*/*'
          title: Accept
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AggregationResult'
            application/vnd.apache.parquet: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-fern-sdk-group-name: aggregate
      x-fern-sdk-method-name: get_result_table_for_continuous_query
      x-fern-availability: beta
      tags:
      - Aggregate
    servers:
    - url: https://api.us.junction.com
      x-fern-server-name: Production
    - url: https://api.eu.junction.com
      x-fern-server-name: ProductionEU
    - url: https://api.sandbox.us.junction.com
      x-fern-server-name: Sandbox
    - url: https://api.sandbox.eu.junction.com
      x-fern-server-name: SandboxEU
  /aggregate/v1/user/{user_id}/continuous_query/{query_id_or_slug}/task_history:
    get:
      summary: Get Task History For Query
      operationId: get_task_history_for_query_aggregate_v1_user__user_id__continuous_query__query_id_or_slug__task_history_get
      parameters:
      - name: user_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: User Id
      - name: query_id_or_slug
        in: path
        required: true
        schema:
          anyOf:
          - type: string
            format: uuid
          - type: string
          union_mode: left_to_right
          title: Query Id Or Slug
      - name: next_cursor
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Next Cursor
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          default: 50
          title: Limit
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContinuousQueryTaskHistoryResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-fern-sdk-group-name: aggregate
      x-fern-sdk-method-name: get_task_history_for_continuous_query
      x-fern-availability: beta
      tags:
      - Aggregate
    servers:
    - url: https://api.us.junction.com
      x-fern-server-name: Production
    - url: https://api.eu.junction.com
      x-fern-server-name: ProductionEU
    - url: https://api.sandbox.us.junction.com
      x-fern-server-name: Sandbox
    - url: https://api.sandbox.eu.junction.com
      x-fern-server-name: SandboxEU
components:
  schemas:
    AsleepAtValueMacroExpr:
      properties:
        value_macro:
          type: string
          const: asleep_at
          title: Value Macro
        version:
          type: string
          const: automatic
          title: Version
          default: automatic
      type: object
      required:
      - value_macro
      title: AsleepAtValueMacroExpr
    Period:
      properties:
        value:
          type: integer
          minimum: 1
          title: Value
          default: 1
        unit:
          type: string
          enum:
          - minute
          - hour
          - day
          - week
          - month
          - year
          title: Unit
          description: ℹ️ This enum is non-exhaustive.
      type: object
      required:
      - unit
      title: Period
    MealColumnExpr:
      properties:
        meal:
          type: string
          enum:
          - calories
          - carbohydrate_gram
          - protein_gram
          - alcohol_gram
          - water_gram
          - fibre_gram
          - sugar_gram
          - cholesterol_gram
          - saturated_fat_gram
          - monounsaturated_fat_gram
          - polyunsaturated_fat_gram
          - omega3_fat_gram
          - omega6_fat_gram
          - total_fat_gram
          - sodium_milligram
          - potassium_milligram
          - calcium_milligram
          - phosphorus_milligram
          - magnesium_milligram
          - iron_milligram
          - zinc_milligram
          - fluoride_milligram
          - chloride_milligram
          - vitamin_a_milligram
          - vitamin_b1_milligram
          - riboflavin_milligram
          - niacin_milligram
          - pantothenic_acid_milligram
          - vitamin_b6_milligram
          - biotin_microgram
          - vitamin_b12_microgram
          - vitamin_c_milligram
          - vitamin_d_microgram
          - vitamin_e_milligram
          - vitamin_k_microgram
          - folic_acid_microgram
          - chromium_microgram
          - copper_milligram
          - iodine_microgram
          - manganese_milligram
          - molybdenum_microgram
          - selenium_microgram
          - date
          - name
          - source_type
          - source_provider
          - source_app_id
          - source_device_id
          title: Meal
          description: ℹ️ This enum is non-exhaustive.
      type: object
      required:
      - meal
      title: MealColumnExpr
    ContinuousQueryTaskStatus:
      type: string
      enum:
      - scheduled
      - started
      - completed
      - error
      - skipped
      title: ContinuousQueryTaskStatus
      description: ℹ️ This enum is non-exhaustive.
    IndexColumnExpr:
      properties:
        index:
          type: string
          enum:
          - sleep
          - derived_readiness
          - activity
          - workout
          - body
          - meal
          - menstrual_cycle
          - profile
          - timeseries
          title: Index
          description: ℹ️ This enum is non-exhaustive.
      type: object
      required:
      - index
      title: IndexColumnExpr
    MenstrualCycleColumnExpr:
      properties:
        menstrual_cycle:
          type: string
          enum:
          - period_start
          - period_end
          - cycle_end
          - is_predicted
          - menstrual_flow
          - cervical_mucus
          - intermenstrual_bleeding
          - contraceptive
          - detected_deviations
          - ovulation_test
          - home_pregnancy_test
          - home_progesterone_test
          - sexual_activity
          - basal_body_temperature
          - source_type
          - source_provider
          - source_app_id
          - source_device_id
          title: Menstrual Cycle
          description: ℹ️ This enum is non-exhaustive.
      type: object
      required:
      - menstrual_cycle
      title: MenstrualCycleColumnExpr
    DerivedReadinessColumnExpr:
      properties:
        derived_readiness:
          type: string
          enum:
          - date
          - chronotype
          - sleep_score
          - recovery_score
          - recovery_zone
          - stress_score
          - strain_score
          - strain_zone
          title: Derived Readiness
          description: ℹ️ This enum is non-exhaustive.
      type: object
      required:
      - derived_readiness
      title: DerivedReadinessColumnExpr
    ContinuousQueryTaskHistoryResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/ContinuousQueryTaskHistoryEntry'
          type: array
          title: Data
        next_cursor:
          anyOf:
          - type: string
          - type: 'null'
          title: Next Cursor
      type: object
      required:
      - data
      - next_cursor
      title: ContinuousQueryTaskHistoryResponse
    MCSexualActivityFieldExpr:
      properties:
        field_for:
          type: string
          const: menstrual_cycle
          title: Field For
          default: menstrual_cycle
        sexual_activity:
          type: string
          enum:
          - date
          - protection_used
          title: Sexual Activity
          description: ℹ️ This enum is non-exhaustive.
      additionalProperties: false
      type: object
      required:
      - sexual_activity
      title: MCSexualActivityFieldExpr
    MCIntermenstrualBleedingFieldExpr:
      properties:
        field_for:
          type: string
          const: menstrual_cycle
          title: Field For
          default: menstrual_cycle
        intermenstrual_bleeding:
          type: string
          const: date
          title: Intermenstrual Bleeding
      additionalProperties: false
      type: object
      required:
      - intermenstrual_bleeding
      title: MCIntermenstrualBleedingFieldExpr
    QueryBatch:
      properties:
        timeframe:
          anyOf:
          - $ref: '#/components/schemas/RelativeTimeframe'
          - $ref: '#/components/schemas/Placeholder'
          title: Timeframe
        queries:
          items:
            $ref: '#/components/schemas/Query'
          type: array
          title: Queries
        config:
          $ref: '#/components/schemas/QueryConfig'
      type: object
      required:
      - timeframe
      - queries
      title: QueryBatch
    AggregateExpr:
      properties:
        arg:
          anyOf:
          - $ref: '#/components/schemas/SleepColumnExpr'
          - $ref: '#/components/schemas/DerivedReadinessColumnExpr'
          - $ref: '#/components/schemas/ActivityColumnExpr'
          - $ref: '#/components/schemas/WorkoutColumnExpr'
          - $ref: '#/components/schemas/BodyColumnExpr'
          - $ref: '#/components/schemas/MealColumnExpr'
          - $ref: '#/components/schemas/MenstrualCycleColumnExpr'
          - $ref: '#/components/schemas/ProfileColumnExpr'
          - $ref: '#/components/schemas/SleepScoreValueMacroExpr'
          - $ref: '#/components/schemas/ChronotypeValueMacroExpr'
          - $ref: '#/components/schemas/AsleepAtValueMacroExpr'
          - $ref: '#/components/schemas/AwakeAtValueMacroExpr'
          - $ref: '#/components/schemas/AwakeningsValueMacroExpr'
          - $ref: '#/components/schemas/UnrecognizedValueMacroExpr'
          - $ref: '#/components/schemas/DiscreteTimeseriesExpr'
          - $ref: '#/components/schemas/IntervalTimeseriesExpr'
          - $ref: '#/components/schemas/InsulinInjectionTimeseriesExpr'
          - $ref: '#/components/schemas/BloodPressureTimeseriesExpr'
          - $ref: '#/components/schemas/TemperatureTimeseriesExpr'
          - $ref: '#/components/schemas/WorkoutDurationTimeseriesExpr'
          - $ref: '#/components/schemas/NoteTimeseriesExpr'
          - $ref: '#/components/schemas/IndexColumnExpr'
          - $ref: '#/components/schemas/ScalarOutputSubqueryExpr'
          title: Arg
        func:
          type: string
          enum:
          - mean
          - min
          - max
          - sum
          - count
          - median
          - stddev
          - oldest
          - newest
          title: Func
          description: ℹ️ This enum is non-exhaustive.
      type: object
      required:
      - arg
      - func
      title: AggregateExpr
    AwakeningsValueMacroExpr:
      properties:
        value_macro:
          type: string
          const: awakenings
          title: Value Macro
        version:
          type: string
          const: automatic
          title: Version
          default: automatic
      type: object
      required:
      - value_macro
      title: AwakeningsValueMacroExpr
    MCMenstrualFlowFieldExpr:
      properties:
        field_for:
          type: string
          const: menstrual_cycle
          title: Field For
          default: menstrual_cycle
        menstrual_flow:
          type: string
          enum:
          - date
          - flow
          title: Menstrual Flow
          description: ℹ️ This enum is non-exhaustive.
      additionalProperties: false
      type: object
      required:
      - menstrual_flow
      title: MCMenstrualFlowFieldExpr
    AwakeAtValueMacroExpr:
      properties:
        value_macro:
          type: string
          const: awake_at
          title: Value Macro
        version:
          type: string
          const: automatic
          title: Version
          default: automatic
      type: object
      required:
      - value_macro
      title: AwakeAtValueMacroExpr
    Query:
      properties:
        select:
          items:
            anyOf:
            - $ref: '#/components/schemas/AggregateExpr'
            - $ref: '#/components/schemas/GroupKeyColumnExpr'
            - $ref: '#/components/schemas/SleepColumnExpr'
            - $ref: '#/components/schemas/DerivedReadinessColumnExpr'
            - $ref: '#/components/schemas/ActivityColumnExpr'
            - $ref: '#/components/schemas/WorkoutColumnExpr'
            - $ref: '#/components/schemas/BodyColumnExpr'
            - $ref: '#/components/schemas/MealColumnExpr'
            - $ref: '#/components/schemas/MenstrualCycleColumnExpr'
            - $ref: '#/components/schemas/ProfileColumnExpr'
            - $ref: '#/components/schemas/SleepScoreValueMacroExpr'
            - $ref: '#/components/schemas/ChronotypeValueMacroExpr'
            - $ref: '#/components/schemas/AsleepAtValueMacroExpr'
            - $ref: '#/components/schemas/AwakeAtValueMacroExpr'
            - $ref: '#/components/schemas/AwakeningsValueMacroExpr'
            - $ref: '#/components/schemas/UnrecognizedValueMacroExpr'
            - $ref: '#/components/schemas/DiscreteTimeseriesExpr'
            - $ref: '#/components/schemas/IntervalTimeseriesExpr'
            - $ref: '#/components/schemas/InsulinInjectionTimeseriesExpr'
            - $ref: '#/components/schemas/BloodPressureTimeseriesExpr'
            - $ref: '#/components/schemas/TemperatureTimeseriesExpr'
            - $ref: '#/components/schemas/WorkoutDurationTimeseriesExpr'
            - $ref: '#/components/schemas/NoteTimeseriesExpr'
            - $ref: '#/components/schemas/IndexColumnExpr'
            - $ref: '#/components/schemas/ScalarOutputSubqueryExpr'
            - $ref: '#/components/schemas/SourceColumnExpr'
          type: array
          title: Select
        group_by:
          items:
            anyOf:
            - $ref: '#/components/schemas/DateTruncExpr'
            - $ref: '#/components/schemas/DatePartExpr'
            - $ref: '#/components/schemas/SleepColumnExpr'
            - $ref: '#/components/schemas/DerivedReadinessColumnExpr'
            - $ref: '#/components/schemas/ActivityColumnExpr'
            - $ref: '#/components/schemas/WorkoutColumnExpr'
            - $ref: '#/components/schemas/BodyColumnExpr'
            - $ref: '#/components/schemas/MealColumnExpr'
            - $ref: '#/components/schemas/MenstrualCycleColumnExpr'
            - $ref: '#/components/schemas/ProfileColumnExpr'
            - $ref: '#/components/schemas/SleepScoreValueMacroExpr'
            - $ref: '#/components/schemas/ChronotypeValueMacroExpr'
            - $ref: '#/components/schemas/AsleepAtValueMacroExpr'
            - $ref: '#/components/schemas/AwakeAtValueMacroExpr'
            - $ref: '#/components/schemas/AwakeningsValueMacroExpr'
            - $ref: '#/components/schemas/UnrecognizedValueMacroExpr'
            - $ref: '#/components/schemas/DiscreteTimeseriesExpr'
            - $ref: '#/components/schemas/IntervalTimeseriesExpr'
            - $ref: '#/components/schemas/InsulinInjectionTimeseriesExpr'
            - $ref: '#/components/schemas/BloodPressureTimeseriesExpr'
            - $ref: '#/components/schemas/TemperatureTimeseriesExpr'
            - $ref: '#/components/schemas/WorkoutDurationTimeseriesExpr'
            - $ref: '#/components/schemas/NoteTimeseriesExpr'
            - $ref: '#/components/schemas/SourceColumnExpr'
          type: array
          title: Group By
        where:
          anyOf:
          - type: string
          - type: 'null'
          title: Where
          description: 'A WHERE clause filtering the input data. If a GROUP BY clause is present, filtering happens prior to GROUP BY evaluation.


            WHERE clause uses SQL Expression syntax to describe the filtering criteria:

            * Available operators: `>`, `>=`, `<`, `<=`, `=`, `!=`, `NOT`, `AND` and `OR`.

            * Parentheses is supported.'
      type: object
      required:
      - select
      title: Query
    BloodPressureTimeseriesExpr:
      properties:
        timeseries:
          type: string
          const: blood_pressure
          title: Timeseries
        field:
          anyOf:
          - type: string
            enum:
            - source_provider
            - source_type
          - type: string
            const: source_app_id
          - type: string
            enum:
            - source_workout_id
            - source_sport
          - type: string
            enum:
            - timezone_offset
            - type
          - type: string
            enum:
            - systolic
            - diastolic
          title: Field
          description: ℹ️ This enum is non-exhaustive.
      type: object
      required:
      - timeseries
      - field
      title: BloodPressureTimeseriesExpr
    DiscreteTimeseriesExpr:
      properties:
        timeseries:
          type: string
          enum:
          - glucose
          - heartrate
          - hrv
          - ige
          - igg
          - cholesterol
          - weight
          - fat
          - blood_oxygen
          - electrocardiogram_voltage
          - respiratory_rate
          - stress_level
          title: Timeseries
          description: ℹ️ This enum is non-exhaustive.
        field:
          anyOf:
          - type: string
            enum:
            - source_provider
            - source_type
          - type: string
            const: source_app_id
          - type: string
            enum:
            - source_workout_id
            - source_sport
          - type: string
            enum:
            - timezone_offset
            - type
          - type: string
            const: value
          title: Field
          description: ℹ️ This enum is non-exhaustive.
      type: object
      required:
      - timeseries
      - field
      title: DiscreteTimeseriesExpr
    ActivityColumnExpr:
      properties:
        activity:
          type: string
          enum:
          - date
          - calories_total
          - calories_active
          - steps
          - distance_meter
          - floors_climbed
          - duration_active_second
          - intensity_sedentary_second
          - intensity_low_second
          - intensity_medium_second
          - intensity_high_second
          - heart_rate_mean
          - heart_rate_minimum
          - heart_rate_maximum
          - heart_rate_resting
          - heart_rate_mean_walking
          - wheelchair_use
          - wheelchair_push
          - source_type
          - source_provider
          - source_app_id
          - source_device_id
          - time_zone
          - time_zone_offset
          title: Activity
          description: ℹ️ This enum is non-exhaustive.
      type: object
      required:
      - activity
      title: ActivityColumnExpr
    SleepColumnExpr:
      properties:
        sleep:
          type: string
          enum:
          - id
          - session_start
          - session_end
          - state
          - type
          - duration_second
          - stage_asleep_second
          - stage_awake_second
          - stage_light_second
          - stage_rem_second
          - stage_deep_second
          - stage_unknown_second
          - latency_second
          - heart_rate_minimum
          - heart_rate_mean
          - heart_rate_maximum
          - heart_rate_dip
          - heart_rate_resting
          - efficiency
          - hrv_mean_rmssd
          - hrv_mean_sdnn
          - skin_temperature
          - skin_temperature_delta
          - respiratory_rate
          - score
          - recovery_readiness_score
          - source_type
          - source_provider
          - source_app_id
          - source_device_id
          - time_zone
          title: Sleep
          description: ℹ️ This enum is non-exhaustive.
      type: object
      required:
      - sleep
      title: SleepColumnExpr
    IntervalTimeseriesExpr:
      properties:
        timeseries:
          type: string
          enum:
          - steps
          - distance
          - vo2_max
          - heart_rate_alert
          - stand_hour
          - sleep_breathing_disturbance
          - water
          - caffeine
          - mindfulness_minutes
          - calories_active
          - floors_climbed
          - calories_basal
          - afib_burden
          - stand_duration
          - sleep_apnea_alert
          - wheelchair_push
          - forced_expiratory_volume_1
          - forced_vital_capacity
          - peak_expiratory_flow_rate
          - inhaler_usage
          - fall
          - uv_exposure
          - daylight_exposure
          - handwashing
          - basal_body_temperature
          - body_mass_index
          - lean_body_mass
          - waist_circumference
          - heart_rate_recovery_one_minute
          - workout_swimming_stroke
          - workout_distance
          - carbohydrates
          title: Timeseries
          description: ℹ️ This enum is non-exhaustive.
        field:
          anyOf:
          - type: string
            enum:
            - source_provider
            - source_type
          - type: string
            const: source_app_id
          - type: string
            enum:
            - source_workout_id
            - source_sport
          - type: string
            enum:
            - timezone_offset
            - type
          - type: string
            enum:
            - duration
            - value
          title: Field
          description: ℹ️ This enum is non-exhaustive.
      type: object
      required:
      - timeseries
      - field
      title: IntervalTimeseriesExpr
    Placeholder:
      properties:
        placeholder:
          type: boolean
          const: true
          title: Placeholder
      type: object
      required:
      - placeholder
      title: Placeholder
    Labs:
      type: string
      enum:
      - ayumetrix
      - spiriplex
      - ussl
      - quest
      - sonora_quest
      - labcorp
      - bioreference
      - us_biotek
      - manual
      - sanocardio
      - ihd
      - nexus
      - my_uti
      - crl
      title: Labs
      description: ℹ️ This enum is non-exhaustive.
    AggregateFieldExpr:
      properties:
        func:
          type: string
          enum:
          - mean
          - min
          - max
          - sum
          - count
          - median
          - stddev
          - oldest
          - newest
          title: Func
          description: ℹ️ This enum is non-exhaustive.
        arg:
          anyOf:
          - $ref: '#/components/schemas/MCMenstrualFlowFieldExpr'
          - $ref: '#/components/schemas/MCCervicalMucusFieldExpr'
          - $ref: '#/components/schemas/MCIntermenstrualBleedingFieldExpr'
          - $ref: '#/components/schemas/MCContraceptiveFieldExpr'
          - $ref: '#/components/schemas/MCDetectedDeviationsFieldExpr'
          - $ref: '#/components/schemas/MCOvulationTestFieldExpr'
          - $ref: '#/components/schemas/MCHomePregnancyTestFieldExpr'
          - $ref: '#/components/schemas/MCHomeProgesteroneTestFieldExpr'
          - $ref: '#/components/schemas/MCSexualActivityFieldExpr'
          - $ref: '#/components/schemas/MCBasalBodyTemperatureFieldExpr'
          - $ref: '#/components/schemas/ElementFieldExpr'
          - type: 'null'
          title: Arg
      type: object
      required:
      - func
      title: AggregateFieldExpr
      description: 'Aggregate over unnested list elements, optionally targeting a struct field.


        When arg is None, the aggregate operates on the list elements directly

        (e.g., count-all, or mean/sum on a scalar numeric list).

        When arg is a FieldExpr, the struct field is extracted before aggregating.'
    MCOvulationTestFieldExpr:
      properties:
        field_for:
          type: string
          const: menstrual_cycle
          title: Field For
          default: menstrual_cycle
        ovulation_test:
          type: string
          enum:
          - date
          - test_result
          title: Ovulation Test
          description: ℹ️ This enum is non-exhaustive.
      additionalProperties: false
      type: object
      required:
      - ovulation_test
      title: MCOvulationTestFieldExpr
    ProfileColumnExpr:
      properties:
        profile:
          type: string
          enum:
          - height_centimeter
          - birth_date
          - wheelchair_use
          - gender
          - sex
          - source_type
          - source_provider
          - source_app_id
          - source_device_id
          - created_at
          - updated_at
          title: Profile
          description: ℹ️ This enum is non-exhaustive.
      type: object
      required:
      - profile
      title: ProfileColumnExpr
    DatePartExpr:
      properties:
        arg:
          anyOf:
          - $ref: '#/components/schemas/IndexColumnExpr'
          - $ref: '#/components/schemas/Placeholder'
          title: Arg
        date_part:
          anyOf:
          - type: string
            enum:
            - minute
            - hour
            - day
            - week
            - month
            - year
          - type: string
            enum:
            - weekday
            - week_of_year
            - day_of_year
          title: Date Part
          description: ℹ️ This enum is non-exhaustive.
      type: object
      required:
      - arg
      - date_part
      title: DatePartExpr
    MCCervicalMucusFieldExpr:
      properties:
        field_for:
          type: string
          const: menstrual_cycle
          title: Field For
          default: menstrual_cycle
        cervical_mucus:
          type: string
          enum:
          - date
          - quality
          title: Cervical Mucus
          description: ℹ️ This enum is non-exhaustive.
      additionalProperties: false
      type: object
      required:
      - cervical_mucus
      title: MCCervicalMucusFieldExpr
    SourceColumnExpr:
      properties:
        source:
          anyOf:
          - type: string
            enum:
            - source_provider
            - source_type
          - type: string
            const: source_app_id
          - type: string
            enum:
            - source_workout_id
            - source_sport
          title: Source
          description: ℹ️ This enum is non-exhaustive.
      type: object
      required:
      - source
      title: SourceColumnExpr
    GroupKeyColumnExpr:
      properties:
        group_key:
          anyOf:
          - type: integer
          - type: string
            const: '*'
          title: Group Key
      type: object
      required:
      - group_key
      title: GroupKeyColumnExpr
    AggregationResult:
      properties:
        table:
          additionalProperties:
            items: {}
            type: array
          type: object
          title: Table
          description: The result table of the query, organized in a column oriented format.
      type: object
      required:
      - table
      title: AggregationResult
    TemperatureTimeseriesExpr:
      properties:
        timeseries:
          type: string
          enum:
          - body_temperature
          - body_temperature_delta
          title: Timeseries
          description: ℹ️ This enum is non-exhaustive.
        field:
          anyOf:
          - type: string
            enum:
            - source_provider
            - source_type
          - type: string
            const: source_app_id
          - type: string
            enum:
            - source_workout_id
            - source_sport
          - type: string
            enum:
            - timezone_offset
            - type
          - type: string
            enum:
            - duration
            - value
          - type: string
            const: sensor_location
          title: Field
          description: ℹ️ This enum is non-exhaustive.
      type: object
      required:
      - timeseries
      - field
      title: TemperatureTimeseriesExpr
    MCDetectedDeviationsFieldExpr:
      properties:
        field_for:
          type: string
          const: menstrual_cycle
          title: Field For
          default: menstrual_cycle
        detected_deviations:
          type: string
          enum:
          - date
          - deviation
          title: Detected Deviations
          description: ℹ️ This enum is non-exhaustive.
      additionalProperties: false
      type: object
      required:
      - detected_deviations
      title: MCDetectedDeviationsFieldExpr
    RelativeTimeframe:
      properties:
        type:
          type: string
          const: relative
          title: Type
        anchor:
          type: string
          format: date
          title: Anchor
        past:
          $ref: '#/components/schemas/Period'
      type: object
      required:
      - type
      - anchor
      - past
      title: RelativeTimef

# --- truncated at 32 KB (45 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/vital-io/refs/heads/main/openapi/vital-io-aggregate-api-openapi.yml