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

# Modify Nutrition Record

> ##### Change the portion size for a nutrition record by ID.

You can modify the nutrition record by updating the total serving size or consumption time. At least one of these fields must be provided.

The status of the successfully modified record will be set to `updated` while the input type will preserve the original value.

### Updating Serving Size

When the serving size is changed, all ingredients and their respective nutritional fields will be automatically recalculated proportionally to maintain the same nutritional ratios.
This allows you to easily adjust portion sizes while maintaining accurate nutritional information.

The new serving size is expected to be in the same unit as the original serving size.

### Setting Up Consumption Time

The consumption time indicates when the food was actually consumed. Leaving the consumption time empty or not providing it will keep the original value.

This allows you to first track planned meals (without consumption time) and eventually mark them as consumed by setting up consumption time.




## OpenAPI

````yaml patch /nutrition_records/{nutrition_record_id}
openapi: 3.1.0
info:
  title: Application user API
  version: 3.0.2
servers:
  - url: https://app-api.spikeapi.com/v3
security: []
paths:
  /nutrition_records/{nutrition_record_id}:
    patch:
      tags:
        - Nutrition AI
      summary: Modify Nutrition Record
      description: >
        ##### Change the portion size for a nutrition record by ID.


        You can modify the nutrition record by updating the total serving size
        or consumption time. At least one of these fields must be provided.


        The status of the successfully modified record will be set to `updated`
        while the input type will preserve the original value.


        ### Updating Serving Size


        When the serving size is changed, all ingredients and their respective
        nutritional fields will be automatically recalculated proportionally to
        maintain the same nutritional ratios.

        This allows you to easily adjust portion sizes while maintaining
        accurate nutritional information.


        The new serving size is expected to be in the same unit as the original
        serving size.


        ### Setting Up Consumption Time


        The consumption time indicates when the food was actually consumed.
        Leaving the consumption time empty or not providing it will keep the
        original value.


        This allows you to first track planned meals (without consumption time)
        and eventually mark them as consumed by setting up consumption time.
      operationId: patchNutritionRecordsByNutritionRecordId
      parameters:
        - description: Nutrition report record ID
          in: path
          name: nutrition_record_id
          required: true
          schema:
            description: Nutrition report record ID
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NutritionRecordPatchRequestBody'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NutritionRecord'
          description: OK
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Bad Request
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Unauthorized
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Not Found
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Unprocessable Entity
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Internal Server Error
      security:
        - bearer: []
components:
  schemas:
    NutritionRecordPatchRequestBody:
      additionalProperties: false
      properties:
        consumed_at:
          description: The UTC time when food was consumed
          examples:
            - '2006-01-02T15:04:05'
            - '2006-01-02T15:04:05Z'
          format: date-time
        serving_size:
          description: Serving size in metric units
          examples:
            - 120
          format: double
          type: number
      type: object
    NutritionRecord:
      additionalProperties: false
      properties:
        consumed_at:
          description: >-
            The UTC time when food was consumed. By default, it is set to the
            record update time
          examples:
            - '2006-01-02T15:04:05'
            - '2006-01-02T15:04:05Z'
          format: date-time
        dish_description:
          description: Detected dish description
          examples:
            - >-
              beef, ground, lean, cooked with broccoli, raw and rice, brown,
              cooked
          type: string
        dish_description_translated:
          description: Dish description translated to target language
          examples:
            - >-
              Rindfleisch, Hackfleisch, mager, gekocht mit Brokkoli, roh und
              Reis, braun, gekocht
          type: string
        dish_name:
          description: Detected dish name
          examples:
            - beef and broccoli stir-fry
          type: string
        dish_name_translated:
          description: Dish name translated to target language
          examples:
            - Rindfleisch und Brokkoli Pfanne
          type: string
        failure_reason:
          description: Reason for processing failure
          examples:
            - Unable to identify food items
          readOnly: true
          type: string
        ingredients:
          description: List of detected ingredients with nutritional information
          items:
            $ref: '#/components/schemas/NutritionRecordIngredient'
          type:
            - array
            - 'null'
        input_type:
          description: Nutrition record input type
          enum:
            - image
            - manual
          examples:
            - image
          readOnly: true
          type: string
        modified_at:
          description: Update timestamp in UTC
          examples:
            - '2025-09-15T10:30:12.132Z'
          format: date-time
          readOnly: true
          type: string
        nutri_score:
          description: Nutri-Score known as the 5-Colour Nutrition label (A-E)
          examples:
            - B
          type: string
        nutritional_fields:
          additionalProperties: false
          description: Nutritional values in the given serving size
          properties:
            calcium_mg:
              description: Calcium in milligrams
              examples:
                - 1000
              type: number
            carbohydrate_g:
              description: Carbohydrates in grams
              examples:
                - 250
              type: number
            cholesterol_mg:
              description: Cholesterol in milligrams
              examples:
                - 300
              type: number
            energy_kcal:
              description: Energy in kilocalories
              examples:
                - 800
              type: number
            fat_monounsaturated_g:
              description: Monounsaturated Fat in grams
              examples:
                - 20
              type: number
            fat_polyunsaturated_g:
              description: Polyunsaturated Fat in grams
              examples:
                - 15
              type: number
            fat_saturated_g:
              description: Saturated Fat in grams
              examples:
                - 20
              type: number
            fat_total_g:
              description: Total Fat in grams
              examples:
                - 65
              type: number
            fat_trans_g:
              description: Trans Fat in grams
              examples:
                - 0.5
              type: number
            fiber_total_dietary_g:
              description: Dietary Fiber in grams
              examples:
                - 25
              type: number
            folate_mcg:
              description: Folate in micrograms
              examples:
                - 400
              type: number
            iron_mg:
              description: Iron in milligrams
              examples:
                - 18
              type: number
            magnesium_mg:
              description: Magnesium in milligrams
              examples:
                - 400
              type: number
            niacin_mg:
              description: Niacin in milligrams
              examples:
                - 16
              type: number
            phosphorus_mg:
              description: Phosphorus in milligrams
              examples:
                - 700
              type: number
            potassium_mg:
              description: Potassium in milligrams
              examples:
                - 3500
              type: number
            protein_g:
              description: Protein in grams
              examples:
                - 50
              type: number
            riboflavin_mg:
              description: Riboflavin in milligrams
              examples:
                - 1.3
              type: number
            salt_g:
              description: Salt in grams
              examples:
                - 12
              type: number
            salt_mg:
              description: Salt in milligrams
              examples:
                - 25
              type: number
            sodium_g:
              description: Sodium in grams
              examples:
                - 56
              type: number
            sodium_mg:
              description: Sodium in milligrams
              examples:
                - 2300
              type: number
            sugars_total_g:
              description: Total Sugars in grams
              examples:
                - 50
              type: number
            thiamin_mg:
              description: Thiamin in milligrams
              examples:
                - 1.2
              type: number
            vitamin_a_rae_mcg:
              description: Vitamin A in micrograms
              examples:
                - 900
              type: number
            vitamin_b12_mcg:
              description: Vitamin B12 in micrograms
              examples:
                - 2.4
              type: number
            vitamin_b6_mg:
              description: Vitamin B6 in milligrams
              examples:
                - 1.7
              type: number
            vitamin_c_mg:
              description: Vitamin C in milligrams
              examples:
                - 90
              type: number
            vitamin_d_mcg:
              description: Vitamin D in micrograms
              examples:
                - 20
              type: number
            vitamin_e_mg:
              description: Vitamin E in milligrams
              examples:
                - 15
              type: number
            vitamin_k_mcg:
              description: Vitamin K in micrograms
              examples:
                - 120
              type: number
            zinc_mg:
              description: Zinc in milligrams
              examples:
                - 11
              type: number
          type: object
        record_id:
          description: Report record ID
          examples:
            - 6ba7b810-9dad-11d1-80b4-00c04fd430c8
          format: uuid
          readOnly: true
          type: string
        serving_size:
          description: Serving size in metric units
          examples:
            - 120
          format: double
          minimum: 0.01
          type: number
        status:
          description: Processing status
          enum:
            - pending
            - processing
            - completed
            - failed
            - updated
          examples:
            - completed
          readOnly: true
          type: string
        unit:
          description: Metric unit (g for solids, ml for liquids)
          enum:
            - g
            - mg
            - mcg
            - ml
            - kcal
          examples:
            - g
          type: string
        uploaded_at:
          description: Upload timestamp in UTC
          examples:
            - '2025-09-15T10:30:04.521Z'
          format: date-time
          readOnly: true
          type: string
        user_time_offset_minutes:
          description: User's local timezone offset in minutes
          examples:
            - -540
          format: int32
          type: integer
      required:
        - dish_name
        - serving_size
        - unit
      type: object
    ErrorModel:
      additionalProperties: false
      properties:
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
      type: object
    NutritionRecordIngredient:
      additionalProperties: false
      properties:
        name:
          description: Ingredient name using LANGUAL standard terminology
          examples:
            - beef, ground, lean, cooked
          type: string
        name_translated:
          description: Ingredient name translated to target language
          examples:
            - Rindfleisch, Hackfleisch, mager, gekocht
          type: string
        nutritional_fields:
          additionalProperties: false
          description: Nutritional values in the given serving size
          properties:
            calcium_mg:
              description: Calcium in milligrams
              examples:
                - 1000
              type: number
            carbohydrate_g:
              description: Carbohydrates in grams
              examples:
                - 250
              type: number
            cholesterol_mg:
              description: Cholesterol in milligrams
              examples:
                - 300
              type: number
            energy_kcal:
              description: Energy in kilocalories
              examples:
                - 800
              type: number
            fat_monounsaturated_g:
              description: Monounsaturated Fat in grams
              examples:
                - 20
              type: number
            fat_polyunsaturated_g:
              description: Polyunsaturated Fat in grams
              examples:
                - 15
              type: number
            fat_saturated_g:
              description: Saturated Fat in grams
              examples:
                - 20
              type: number
            fat_total_g:
              description: Total Fat in grams
              examples:
                - 65
              type: number
            fat_trans_g:
              description: Trans Fat in grams
              examples:
                - 0.5
              type: number
            fiber_total_dietary_g:
              description: Dietary Fiber in grams
              examples:
                - 25
              type: number
            folate_mcg:
              description: Folate in micrograms
              examples:
                - 400
              type: number
            iron_mg:
              description: Iron in milligrams
              examples:
                - 18
              type: number
            magnesium_mg:
              description: Magnesium in milligrams
              examples:
                - 400
              type: number
            niacin_mg:
              description: Niacin in milligrams
              examples:
                - 16
              type: number
            phosphorus_mg:
              description: Phosphorus in milligrams
              examples:
                - 700
              type: number
            potassium_mg:
              description: Potassium in milligrams
              examples:
                - 3500
              type: number
            protein_g:
              description: Protein in grams
              examples:
                - 50
              type: number
            riboflavin_mg:
              description: Riboflavin in milligrams
              examples:
                - 1.3
              type: number
            salt_g:
              description: Salt in grams
              examples:
                - 12
              type: number
            salt_mg:
              description: Salt in milligrams
              examples:
                - 25
              type: number
            sodium_g:
              description: Sodium in grams
              examples:
                - 56
              type: number
            sodium_mg:
              description: Sodium in milligrams
              examples:
                - 2300
              type: number
            sugars_total_g:
              description: Total Sugars in grams
              examples:
                - 50
              type: number
            thiamin_mg:
              description: Thiamin in milligrams
              examples:
                - 1.2
              type: number
            vitamin_a_rae_mcg:
              description: Vitamin A in micrograms
              examples:
                - 900
              type: number
            vitamin_b12_mcg:
              description: Vitamin B12 in micrograms
              examples:
                - 2.4
              type: number
            vitamin_b6_mg:
              description: Vitamin B6 in milligrams
              examples:
                - 1.7
              type: number
            vitamin_c_mg:
              description: Vitamin C in milligrams
              examples:
                - 90
              type: number
            vitamin_d_mcg:
              description: Vitamin D in micrograms
              examples:
                - 20
              type: number
            vitamin_e_mg:
              description: Vitamin E in milligrams
              examples:
                - 15
              type: number
            vitamin_k_mcg:
              description: Vitamin K in micrograms
              examples:
                - 120
              type: number
            zinc_mg:
              description: Zinc in milligrams
              examples:
                - 11
              type: number
          type: object
        serving_size:
          description: Serving size in metric units
          examples:
            - 120
          format: double
          type: number
        unit:
          description: Metric unit (g for solids, ml for liquids)
          enum:
            - g
            - mg
            - mcg
            - ml
            - kcal
          examples:
            - g
          type: string
      required:
        - name
        - serving_size
        - unit
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
  securitySchemes:
    bearer:
      bearerFormat: JWT
      scheme: bearer
      type: http

````