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

# Compute longitudinal biomarker and wearable trends

> Compute longitudinal biomarker and wearable trends (direction, delta, and status) across all uploads for a user.



## OpenAPI

````yaml /openapi.json post /users/{user_id}/trends
openapi: 3.1.0
info:
  title: ForeverBetter Wellness API
  version: 0.4.8
  description: >-
    ForeverBetter Wellness API and MCP-compatible service for genetics,
    biomarkers, wearables, lab locator handoffs, dashboard specs, and hosted
    billing.
  x-guidance: >-
    Use /openapi.json to discover the API. For a payable operation, make the
    exact request without credentials, select a compatible option from
    PAYMENT-REQUIRED, then retry unchanged with PAYMENT-SIGNATURE. x402 payments
    create a payer-scoped private workspace; do not send user_id or
    organization_id. Use GET /.well-known/x402.json for the live route and price
    catalog.
servers:
  - url: https://api.foreverbetter.xyz
security:
  - bearerAuth: []
paths:
  /users/{user_id}/trends:
    post:
      summary: Compute longitudinal biomarker and wearable trends
      description: >-
        Compute longitudinal biomarker and wearable trends (direction, delta,
        and status) across all uploads for a user.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                organization_id:
                  type: string
                  minLength: 1
                markers:
                  type: array
                  items:
                    type: string
                modality:
                  type: string
                  enum:
                    - biomarkers
                    - wearables
                window_days:
                  type: number
                  minimum: 1
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrendsResult'
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      security:
        - bearerAuth: []
components:
  schemas:
    TrendsResult:
      type: object
      additionalProperties: false
      required:
        - user_id
        - generated_at
        - marker_count
        - improving
        - worsening
        - stable
        - markers
      properties:
        user_id:
          type: string
          minLength: 1
        organization_id:
          type: string
          minLength: 1
        generated_at:
          type: string
          format: date-time
        window_days:
          type: integer
        marker_count:
          type: integer
        improving:
          type: integer
        worsening:
          type: integer
        stable:
          type: integer
        markers:
          type: array
          items:
            type: object
            additionalProperties: true
            required:
              - marker
              - name
              - modality
              - trend
              - first
              - latest
              - points
            properties:
              marker:
                type: string
              name:
                type: string
              modality:
                type: string
                enum:
                  - genetics
                  - biomarkers
                  - wearables
                  - behavioral
              trend:
                type: string
                enum:
                  - improving
                  - worsening
                  - stable
                  - baseline
              first:
                type: number
              latest:
                type: number
              points:
                type: array
                items:
                  type: object
                  additionalProperties: false
                  required:
                    - value
                    - observed_at
                    - source_id
                  properties:
                    value:
                      type: number
                    observed_at:
                      type: string
                      format: date-time
                    source_id:
                      type: string
    ProblemDetails:
      type: object
      additionalProperties: true
      required:
        - type
        - title
        - status
        - detail
      properties:
        type:
          type: string
        title:
          type: string
        status:
          type: integer
        detail:
          type: string
        instance:
          type: string
        request_id:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````