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

# Update AI summary (PUT)

> Fully update an AI summary



## OpenAPI

````yaml /api-reference/openapi.yaml put /users/{user_id}/ai/summaries/{summary_id}
openapi: 3.1.0
info:
  title: ONVY Health API
  description: >-
    AI-powered holistic health services API with data merging and metrics
    calculation
  version: 1.0.0
  contact:
    name: ONVY Support
    email: support@onvy.health
    url: https://onvy.health
  license:
    name: Proprietary
    url: https://onvy.health/terms
servers:
  - url: https://api.onvy.health
    description: Public API
security:
  - bearerAuth: []
tags:
  - name: static
    description: Static configuration endpoints
  - name: users
    description: User management
  - name: baselines
    description: User baseline metrics
  - name: daily-records
    description: Daily health records
  - name: chat
    description: AI chat completions
  - name: facts
    description: User facts for individualization
  - name: activities
    description: User activities (workouts and mindfulness sessions)
  - name: ai-summaries
    description: |
      AI-generated summaries. This is how ONVY exposes domain-specific
      insights such as meal nutrition analysis, sleep insights, workouts,
      and daily, weekly, nutrition, trend, and impact analysis. Most
      summary types are system-generated; the public create surface
      currently accepts `type=meal`.
  - name: custom-records
    description: Custom records and types
  - name: meals
    description: Nutrition meal tracking
paths:
  /users/{user_id}/ai/summaries/{summary_id}:
    put:
      tags:
        - ai-summaries
      summary: Update AI summary (PUT)
      description: Fully update an AI summary
      operationId: updateAISummaryPut
      parameters:
        - $ref: '#/components/parameters/UserIdParam'
        - $ref: '#/components/parameters/SummaryIdParam'
      requestBody:
        description: Complete AI summary data
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AISummary'
      responses:
        '200':
          description: AI summary updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AISummary'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  parameters:
    UserIdParam:
      name: user_id
      in: path
      required: true
      description: User ID (e.g., google_104940819145861640201)
      schema:
        type: string
    SummaryIdParam:
      name: summary_id
      in: path
      required: true
      description: AI Summary ID
      schema:
        type: string
  schemas:
    AISummary:
      title: AISummary
      type: object
      required:
        - id
        - name
        - user_id
        - project_id
        - created_at
        - updated_at
        - period
        - data
        - llm_output
      properties:
        id:
          type: string
          description: Unique summary identifier
        name:
          type: string
          enum:
            - WorkoutSummary
            - MindfulsessionSummary
            - MealSummary
            - SleepSummary
            - DailySummary
            - WeeklySummary
            - TrendSummary
            - ImpactSummary
            - WeeklyActivitySummary
            - DailyNutritionSummary
            - WeeklyNutritionSummary
        user_id:
          type: string
        project_id:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        providers:
          type: array
          items:
            type: string
            enum:
              - GARMIN
              - APPLE
              - OURA
              - FITBIT
              - WHOOP
        is_custom:
          type: boolean
          description: If provided by customer POST
        ref:
          type: string
          description: Optional reference to original data
        period:
          type: object
          required:
            - type
            - id
            - start
            - end
          properties:
            type:
              type: string
              enum:
                - activity
                - day
                - week
                - month
                - quarter
                - half-year
                - year
            id:
              type: string
              description: Period identifier (e.g., 2024-W43, 2024-10-21)
            start:
              type: string
              format: date-time
            end:
              type: string
              format: date-time
            duration_seconds:
              type: integer
              description: Duration in seconds (for activity periods)
        data:
          type: object
          description: Additional metrics specific to summary type
        llm_output:
          type: object
          required:
            - language
            - title
            - text
          properties:
            language:
              type: string
              description: Language code (e.g., en, de)
            title:
              type: string
              description: Generated title
            text:
              type: string
              description: Generated summary text
            followup_questions:
              type: array
              items:
                type: string
        knowledge_urls:
          type: array
          items:
            type: object
            required:
              - title
              - url
            properties:
              title:
                type: string
              url:
                type: string
                format: uri
        user_comment:
          type:
            - string
            - 'null'
        user_rating:
          type: integer
          enum:
            - -1
            - 0
            - 1
          description: '-1 = bad, 0 = no rating, 1 = good'
        llm_debug:
          type: object
          properties:
            model:
              type: string
              description: Model used for generation
            prompt_id:
              type: string
              description: Prompt template identifier
            org_prompt_id:
              type: string
              description: Organization-specific prompt override
    ValidationError:
      type: object
      title: ValidationError
      required:
        - error
      properties:
        error:
          type: string
          minLength: 1
      additionalProperties: false
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: OAuth bearer token for Health API authentication

````