> ## 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 baseline (PUT)

> Fully update a baseline



## OpenAPI

````yaml /api-reference/openapi.yaml put /users/{user_id}/baselines/{baseline_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}/baselines/{baseline_id}:
    put:
      tags:
        - baselines
      summary: Update baseline (PUT)
      description: Fully update a baseline
      operationId: updateBaselinePut
      parameters:
        - $ref: '#/components/parameters/UserIdParam'
        - $ref: '#/components/parameters/BaselineIdParam'
      requestBody:
        description: Complete baseline data
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Baseline'
      responses:
        '200':
          description: Baseline updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Baseline'
        '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
    BaselineIdParam:
      name: baseline_id
      in: path
      required: true
      description: Baseline ID
      schema:
        type: string
  schemas:
    Baseline:
      title: Baseline
      type: object
      required:
        - user_id
        - project_id
        - name
        - data
      properties:
        user_id:
          type: string
          description: User ID
        project_id:
          type: string
          description: Project ID
        name:
          type: string
          description: Baseline metric name
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        data:
          type: object
          required:
            - mean
            - median
            - size
            - std
          properties:
            mean:
              type: number
              description: Mean value
            median:
              type: number
              description: Median value
            size:
              type: integer
              description: Sample size
            std:
              type: number
              description: Standard deviation
    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

````