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

# Replace saved answers

> **Replaces the entire saved answer array.** This is not a merge: whatever you send becomes the complete set, and any answer you omit is erased.

Always send the full cumulative set of answers, not just the new ones. Send an empty array to clear all saved progress.

Only question keys present in the served schema are accepted, plus a closed allowlist of synthetic keys. Stored answers feed the prescriber's treatment baseline, so anything else is rejected.



## OpenAPI

````yaml /api-reference/openapi.json patch /v1/users/questionnaires/{slug}/progress/
openapi: 3.0.3
info:
  title: Hi-Doctor API
  version: 1.0.0
  description: >-
    Patient-facing REST API for Hi-Doctor.


    Authenticate with email and password to receive a JWT pair, then send the
    access token as `Authorization: Bearer <token>` on every subsequent request.


    Only patient-accessible endpoints are documented here. Clinician and
    back-office endpoints are intentionally omitted.
  contact:
    name: Hi-Doctor
    email: hello@hi-doctor.ai
    url: https://hi-doctor.ai
servers:
  - url: https://api.hi-doctor.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Account
    description: Registration, email verification, sign-in and profile.
  - name: Questionnaires
    description: Complete a consultation questionnaire and submit it for medical review.
  - name: Consultations
    description: Consultations a doctor has reviewed or is reviewing.
  - name: Prescriptions
    description: Prescriptions and reissue requests.
  - name: Billing
    description: Checkout, subscription management and the Stripe billing portal.
  - name: Records
    description: Orders, invoices and side-effect reports.
  - name: Messages
    description: The patient's private thread with their medical team.
  - name: Progress
    description: Weight, injection and note tracking. Requires an active treatment plan.
  - name: Referrals
    description: Referral summary and transactions.
paths:
  /v1/users/questionnaires/{slug}/progress/:
    patch:
      tags:
        - Questionnaires
      summary: Replace saved answers
      description: >-
        **Replaces the entire saved answer array.** This is not a merge:
        whatever you send becomes the complete set, and any answer you omit is
        erased.


        Always send the full cumulative set of answers, not just the new ones.
        Send an empty array to clear all saved progress.


        Only question keys present in the served schema are accepted, plus a
        closed allowlist of synthetic keys. Stored answers feed the prescriber's
        treatment baseline, so anything else is rejected.
      operationId: users_questionnaires_progress_partial_update
      parameters:
        - in: path
          name: slug
          schema:
            type: string
          required: true
      responses:
        '200':
          description: No response body
        '400':
          description: >-
            The slug is unknown, or an answer carries a question key that is not
            in the served schema.
          content:
            application/json:
              example:
                detail: 'Unknown questionnaire category: weight-lost'
        '401':
          description: >-
            No bearer token, or a token that is expired or malformed.
            Re-authenticate; do not retry the same token.
          content:
            application/json:
              example:
                detail: Given token not valid for any token type
                code: token_not_valid
                messages:
                  - token_class: AccessToken
                    token_type: access
                    message: Token is invalid
        '404':
          description: >-
            No such record, **or it belongs to another account**. Every endpoint
            is self-scoped, so a record you cannot see is indistinguishable from
            one that does not exist. Do not retry with a different id.
          content:
            application/json:
              example:
                detail: No Consultation matches the given query.
      security:
        - jwtAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Access token from POST /v1/users/token/
    jwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````