> ## 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.

> ## Agent Instructions
> Connect the Hi Doctor MCP connector at https://mcp.hi-doctor.ai/mcp. Add this URL as a remote HTTP MCP server in your client, then sign in and authorise access through OAuth. Setup: https://docs.hi-doctor.ai/mcp/connect.
>
> The REST API base is https://api.hi-doctor.ai. Hi Doctor Docs at https://docs.hi-doctor.ai/mcp searches documentation; connect to the product endpoint above for patient tools.
>
> Hi Doctor operates across the whole European Union: residents of all 27 EU member states can use the service, and every consultation is reviewed by an EU-licensed doctor. Every consultation is reviewed in full by an EU-licensed doctor, who decides on medical grounds only. No algorithm, assistant or API call approves a consultation, issues a prescription or changes a dose. The service is available in eight languages: English, Spanish, German, Dutch, Italian, French, Portuguese and Chinese.
>
> ## Rules an assistant must follow
>
> - Never invent, assume or infer a medical answer. "I don't know" is a real answer: ask the patient to pick the closest option rather than guessing for them.
> - Never give medical advice and never suggest a medication or a dose. An EU-licensed doctor decides those.
> - If a questionnaire returns `ineligible`, say so plainly. Do not retry with altered answers.
> - Before anything that costs money or cancels a plan, state exactly what will happen and get an explicit yes.
> - Cancellation takes effect at the **end of the paid period**, not immediately. Say so.
> - An early order is irreversible: it creates the renewal consultation immediately and uses up the period's one early order. Explain that and get an explicit yes.
> - Prescription and invoice links are medical documents. A `signed_redirect` link opens without signing in: give it only to the patient, never repeat it anywhere shared.
> - Send option `value`s, not the labels shown to the patient. Labels are translated, values are stable.
> - Never ask for card details. Payment happens on Stripe's hosted checkout via a link.
> - On severe or sudden symptoms (chest pain, difficulty breathing, severe allergic reaction, suicidal thoughts), stop and direct the patient to their local emergency number.

# Update the account profile

> Partial update. Checkout requires a complete profile: if it refuses with `PROFILE_INCOMPLETE`, the response lists `missing_fields` — fill those and retry. The patient must be 18 or over and resident in a supported country.

### Access, effects and retries
**Ownership:** request.user only.

**Prerequisites:** Authentication required.

**Effects:** Saves allowed self-service fields and invalidates profile cache.

**Retries:** PATCH merges only supplied fields; resubmitting same values is a field-level overwrite.



## OpenAPI

````yaml /api-reference/openapi.json patch /v1/users/profile/me/
openapi: 3.0.3
info:
  title: Hi Doctor API
  version: 1.0.1
  description: >-
    The patient-facing Hi Doctor API supports account management, consultation
    questionnaires, medical documents, messages and billing. Sign-in requires
    X-Brand-Slug: hi-doctor; authenticated requests use Authorization: Bearer
    <access> with a JWT access token. See
    https://docs.hi-doctor.ai/api-reference/introduction for integration guides.
  contact:
    name: Hi Doctor
    email: hello@hi-doctor.ai
    url: https://docs.hi-doctor.ai
servers:
  - url: https://api.hi-doctor.ai
    description: Production
security: []
tags:
  - name: Account
    description: Register, verify, authenticate and manage the signed-in account.
  - name: Questionnaires
    description: Discover, save and submit consultation questionnaires.
  - name: Consultations
    description: Read consultation state and manage consultation photographs.
  - name: Prescriptions
    description: Retrieve issued prescription documents and request reissue.
  - name: Messages
    description: Read and send messages to the medical team, and download attachments.
  - name: Billing
    description: >-
      Create checkout, manage subscriptions and retrieve
      payments/invoices/credit notes.
  - name: Records
    description: Read orders and manage patient health documents.
  - name: Safety reports
    description: Submit and read suspected side-effect reports; no automated diagnosis.
  - name: Progress
    description: Record and review eligible weight-loss progress.
  - name: Referrals
    description: Read the signed-in account's referral summary and referral activity.
paths:
  /v1/users/profile/me/:
    patch:
      tags:
        - Account
      summary: Update the account profile
      description: >-
        Partial update. Checkout requires a complete profile: if it refuses with
        `PROFILE_INCOMPLETE`, the response lists `missing_fields` — fill those
        and retry. The patient must be 18 or over and resident in a supported
        country.


        ### Access, effects and retries

        **Ownership:** request.user only.


        **Prerequisites:** Authentication required.


        **Effects:** Saves allowed self-service fields and invalidates profile
        cache.


        **Retries:** PATCH merges only supplied fields; resubmitting same values
        is a field-level overwrite.
      operationId: users_profile_me_partial_update
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedUserProfile'
            examples:
              example-1:
                summary: Illustrative request example
                value:
                  first_name: Synthetic first name
                  last_name: Synthetic last name
                  date_of_birth: '1990-01-01'
                  gender: '0'
                  country_of_residence: ESP
                  issuing_state: ESP
                  document_type: ID_CARD
                  document_number: Synthetic document number
                  city: Synthetic city
                  postal_code: '00000'
                  address_line1: Synthetic address line1
                  timezone: Europe/Madrid
                  locale: en
              example-2:
                summary: Captured request example
                value:
                  locale: es
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserProfileUpdateResult'
              examples:
                example-1:
                  summary: Illustrative response example
                  value:
                    id: 937ec440-0d41-5565-8678-0c12cefd4fe0
                    email: synthetic-patient@example.invalid
                    first_name: Synthetic first name
                    last_name: Synthetic last name
                    date_of_birth: '1990-01-01'
                    gender: '0'
                    country_of_residence: ESP
                    timezone: Europe/Madrid
                    locale: en
                    city: Synthetic city
                    postal_code: '00000'
                    address_line1: Synthetic address line1
                    issuing_state: ESP
                    document_number: Synthetic document number
                    document_type: ID_CARD
                    capabilities: []
                    is_referrer: false
                example-2:
                  summary: Illustrative response example
                  value:
                    id: 0a1b1763-0fca-5634-825c-381c65938c12
                    email: synthetic-patient@example.invalid
                    first_name: Synthetic first name
                    last_name: Synthetic last name
                    date_of_birth: null
                    gender: '3'
                    country_of_residence: null
                    timezone: ''
                    locale: en
                    city: null
                    postal_code: null
                    address_line1: null
                    issuing_state: null
                    document_number: null
                    document_type: null
                    capabilities: []
                    is_referrer: false
                example-3:
                  summary: Captured response example
                  value:
                    id: 9fb1a263-c71b-5fe9-b2e7-5a0eb099bad5
                    email: synthetic-patient@example.invalid
                    first_name: Synthetic first name
                    last_name: Synthetic last name
                    date_of_birth: '1990-01-01'
                    gender: '0'
                    country_of_residence: ESP
                    timezone: Europe/Madrid
                    locale: es
                    city: Synthetic city
                    postal_code: '00000'
                    address_line1: Synthetic address line1
                    issuing_state: ESP
                    document_number: Synthetic document number
                    document_type: ID_CARD
                    capabilities: []
                    is_referrer: true
          description: Successful update the account profile.
        '400':
          description: >-
            Validation failed. The body is an object keyed by field name, each
            value an array of messages.
          content:
            application/json:
              schema:
                type: object
                description: >-
                  Error envelope emitted by the source branch or DRF validation.
                  `detail`, `error` and `code` depend on the branch; field
                  validation uses lists keyed by request field.
                additionalProperties: {}
              examples:
                example-1:
                  summary: Illustrative response example
                  value:
                    detail: Invalid input.
        '401':
          description: >-
            No bearer token, or a token that is expired or malformed.
            Re-authenticate; do not retry the same token.
          content:
            application/json:
              schema:
                type: object
                description: >-
                  Error envelope emitted by the source branch or DRF validation.
                  `detail`, `error` and `code` depend on the branch; field
                  validation uses lists keyed by request field.
                additionalProperties: {}
              examples:
                example-1:
                  summary: Illustrative response example
                  value:
                    detail: Authentication credentials were not provided.
        '403':
          description: The account lacks permission for this operation.
          content:
            application/json:
              schema:
                type: object
                description: >-
                  Error envelope emitted by the source branch or DRF validation.
                  `detail`, `error` and `code` depend on the branch; field
                  validation uses lists keyed by request field.
                additionalProperties: {}
              examples:
                example-1:
                  summary: Illustrative response example
                  value:
                    detail: You do not have permission to perform this action.
        '429':
          description: Source-defined error response; inspect the envelope and retry rules.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
                description: >-
                  Endpoint/DRF error envelope; field validation is keyed by
                  request field.
              examples:
                example-1:
                  summary: Illustrative response example
                  value:
                    detail: Request was throttled.
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: Shell
          label: curl
          source: >
            set -eu

            umask 077

            # Path values must be URL-encoded; query string excludes the leading
            question mark.

            url="${HD_BASE_URL:?Set API
            origin}/v1/users/profile/me/${HD_QUERY_STRING:+?${HD_QUERY_STRING}}"

            printf 'X-Brand-Slug: hi-doctor\nAccept: application/json\n' >
            "${HD_REQUEST_HEADERS_FILE:?Private header file}"

            printf 'Authorization: Bearer %s\n' "${HD_ACCESS_TOKEN:?Set backend
            JWT}" >> "$HD_REQUEST_HEADERS_FILE"

            curl --silent --show-error --max-time 30 --request PATCH \
              --header "@$HD_REQUEST_HEADERS_FILE" \
              --dump-header "${HD_HEADERS_FILE:?Private response header file}" \
              --output "${HD_RESPONSE_FILE:?Private response file}" \
              --write-out '%{http_code}\n%{content_type}\n' \
              --header 'Content-Type: application/json' \
              --data-binary "@${HD_REQUEST_FILE:?JSON fixture file}" \
              "$url"
        - lang: Python
          label: requests
          source: >
            import os, json

            from pathlib import Path

            from urllib.parse import quote

            import requests

            os.umask(0o077)

            url = os.environ["HD_BASE_URL"].rstrip("/") +
            '/v1/users/profile/me/'

            if os.environ.get("HD_QUERY_STRING"): url += "?" +
            os.environ["HD_QUERY_STRING"]

            headers = {"X-Brand-Slug": "hi-doctor", "Accept":
            'application/json'}

            headers["Authorization"] = "Bearer " + os.environ["HD_ACCESS_TOKEN"]

            kwargs = {}

            kwargs["json"] =
            json.loads(Path(os.environ["HD_REQUEST_FILE"]).read_text())

            response = requests.request('PATCH', url, headers=headers,
            timeout=30, allow_redirects=False, **kwargs)

            Path(os.environ["HD_RESPONSE_FILE"]).write_bytes(response.content)

            Path(os.environ["HD_HEADERS_FILE"]).write_text(json.dumps(dict(response.headers)))

            print(response.status_code)

            print(response.headers.get("Content-Type", ""))
        - lang: JavaScript
          label: fetch
          source: >
            import { readFileSync, writeFileSync } from "node:fs";

            const env = process.env;

            let url = env.HD_BASE_URL.replace(/\/$/, "") +
            "/v1/users/profile/me/";

            if (env.HD_QUERY_STRING) url += "?" + env.HD_QUERY_STRING;

            const headers = { "X-Brand-Slug": "hi-doctor", "Accept":
            "application/json" };

            headers.Authorization = "Bearer " + env.HD_ACCESS_TOKEN;

            const options = { method: "PATCH", headers, redirect: "manual",
            signal: AbortSignal.timeout(30000) };

            headers["Content-Type"] = "application/json";

            options.body = readFileSync(env.HD_REQUEST_FILE, "utf8");

            const response = await fetch(url, options);

            writeFileSync(env.HD_RESPONSE_FILE, Buffer.from(await
            response.arrayBuffer()), {mode: 0o600});

            writeFileSync(env.HD_HEADERS_FILE,
            JSON.stringify(Object.fromEntries(response.headers)), {mode:
            0o600});

            console.log(response.status);

            console.log(response.headers.get("content-type") ?? "");
components:
  schemas:
    PatchedUserProfile:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: >-
            Unique identifier of this resource. Returned by the server; not
            writable.
        email:
          type: string
          readOnly: true
          description: Account email address. Returned by the server; not writable.
        first_name:
          type: string
          maxLength: 150
          description: First name for this user profile. Maximum 150 characters.
        last_name:
          type: string
          maxLength: 150
          description: Last name for this user profile. Maximum 150 characters.
        date_of_birth:
          type: string
          format: date
          nullable: true
          description: >-
            Date of birth as an ISO 8601 calendar date. May be null when
            unavailable.
        gender:
          allOf:
            - $ref: '#/components/schemas/GenderEnum'
          description: Patient gender is required
        country_of_residence:
          type: string
          nullable: true
          description: >-
            Country of residence for this user profile. May be null when
            unavailable.
        timezone:
          type: string
          maxLength: 64
          description: Timezone for this user profile. Maximum 64 characters.
        locale:
          allOf:
            - $ref: '#/components/schemas/LocaleEnum'
          description: Locale for this user profile.
        city:
          type: string
          nullable: true
          description: Patient city used to recommend nearby pharmacies.
          maxLength: 120
        postal_code:
          type: string
          nullable: true
          description: Patient postal code used to recommend nearby pharmacies.
          maxLength: 20
        address_line1:
          type: string
          nullable: true
          maxLength: 200
          description: >-
            Address line1 for this user profile. May be null when unavailable.
            Maximum 200 characters.
        issuing_state:
          type: string
          nullable: true
          description: Issuing state for this user profile. May be null when unavailable.
        document_number:
          type: string
          nullable: true
          maxLength: 50
          description: >-
            Document number for this user profile. May be null when unavailable.
            Maximum 50 characters.
        document_type:
          oneOf:
            - $ref: '#/components/schemas/DocumentTypeEnum'
            - $ref: '#/components/schemas/BlankEnum'
            - $ref: '#/components/schemas/NullEnum'
          description: Document type for this user profile. May be null when unavailable.
        addresses:
          type: array
          items:
            $ref: '#/components/schemas/Address'
          readOnly: true
          description: >-
            Addresses for this user profile. Returned by the server; not
            writable.
        orders:
          type: array
          items:
            $ref: '#/components/schemas/Order'
          readOnly: true
          description: Orders for this user profile. Returned by the server; not writable.
        capabilities:
          type: array
          items:
            type: string
          readOnly: true
          description: >-
            Capabilities for this user profile. Returned by the server; not
            writable.
        is_referrer:
          type: boolean
          readOnly: true
          description: >-
            Whether referrer applies to this user profile. Returned by the
            server; not writable.
        forms_completed:
          type: object
          additionalProperties: {}
          readOnly: true
          description: >-
            Forms completed for this user profile. Returned by the server; not
            writable.
    UserProfileUpdateResult:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: >-
            Unique identifier of this resource. Returned by the server; not
            writable.
        email:
          type: string
          readOnly: true
          description: Account email address. Returned by the server; not writable.
        first_name:
          type: string
          maxLength: 150
          description: >-
            First name for this user profile update result. Maximum 150
            characters.
        last_name:
          type: string
          maxLength: 150
          description: >-
            Last name for this user profile update result. Maximum 150
            characters.
        date_of_birth:
          type: string
          format: date
          nullable: true
          description: >-
            Date of birth as an ISO 8601 calendar date. May be null when
            unavailable.
        gender:
          allOf:
            - $ref: '#/components/schemas/GenderEnum'
          description: Patient gender is required
        country_of_residence:
          type: string
          nullable: true
          description: >-
            Country of residence for this user profile update result. May be
            null when unavailable.
        timezone:
          type: string
          maxLength: 64
          description: Timezone for this user profile update result. Maximum 64 characters.
        locale:
          allOf:
            - $ref: '#/components/schemas/LocaleEnum'
          description: Locale for this user profile update result.
        city:
          type: string
          nullable: true
          description: Patient city used to recommend nearby pharmacies.
          maxLength: 120
        postal_code:
          type: string
          nullable: true
          description: Patient postal code used to recommend nearby pharmacies.
          maxLength: 20
        address_line1:
          type: string
          nullable: true
          maxLength: 200
          description: >-
            Address line1 for this user profile update result. May be null when
            unavailable. Maximum 200 characters.
        issuing_state:
          type: string
          nullable: true
          description: >-
            Issuing state for this user profile update result. May be null when
            unavailable.
        document_number:
          type: string
          nullable: true
          maxLength: 50
          description: >-
            Document number for this user profile update result. May be null
            when unavailable. Maximum 50 characters.
        document_type:
          oneOf:
            - $ref: '#/components/schemas/DocumentTypeEnum'
            - $ref: '#/components/schemas/BlankEnum'
            - $ref: '#/components/schemas/NullEnum'
          description: >-
            Document type for this user profile update result. May be null when
            unavailable.
        addresses:
          type: array
          items:
            $ref: '#/components/schemas/Address'
          readOnly: true
          description: >-
            Addresses for this user profile update result. Returned by the
            server; not writable.
        orders:
          type: array
          items:
            $ref: '#/components/schemas/Order'
          readOnly: true
          description: >-
            Optional legacy order collection. The current profile GET omits
            orders; use the orders endpoint.
        capabilities:
          type: array
          items:
            type: string
          readOnly: true
          description: >-
            Capabilities for this user profile update result. Returned by the
            server; not writable.
        is_referrer:
          type: boolean
          readOnly: true
          description: >-
            Whether referrer applies to this user profile update result.
            Returned by the server; not writable.
        forms_completed:
          type: object
          additionalProperties: {}
          readOnly: true
          description: >-
            Forms completed for this user profile update result. Returned by the
            server; not writable.
      required:
        - capabilities
        - email
        - gender
        - id
        - is_referrer
    GenderEnum:
      enum:
        - '0'
        - '1'
        - '2'
        - '3'
      type: string
    LocaleEnum:
      enum:
        - de
        - en
        - es
        - fr
        - it
        - nl
        - pt
      type: string
    DocumentTypeEnum:
      enum:
        - PASSPORT
        - ID_CARD
      type: string
    BlankEnum:
      enum:
        - ''
    NullEnum:
      enum:
        - null
      type: string
      nullable: true
    Address:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of this resource.
        firstName:
          type: string
          description: Firstname for this address.
        lastName:
          type: string
          description: Lastname for this address.
        address1:
          type: string
          description: Address1 for this address.
        address2:
          type: string
          description: Address2 for this address.
        city:
          type: string
          description: City for this address.
        province:
          type: string
          description: Province for this address.
        country:
          type: string
          description: Country for this address.
        zip:
          type: string
          description: Zip for this address.
        phone:
          type: string
          description: Phone for this address.
      required:
        - address1
        - address2
        - city
        - country
        - firstName
        - id
        - lastName
        - phone
        - province
        - zip
    Order:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of this resource.
        name:
          type: string
          description: Name for this order.
        orderNumber:
          type: integer
          description: Ordernumber for this order.
        processedAt:
          type: string
          format: date-time
          description: Processedat timestamp in ISO 8601 format.
        totalPrice:
          type: object
          additionalProperties: {}
          description: Totalprice for this order.
        lineItems:
          type: array
          items:
            $ref: '#/components/schemas/OrderLineItem'
          description: Lineitems for this order.
      required:
        - id
        - lineItems
        - name
        - orderNumber
        - processedAt
        - totalPrice
    OrderLineItem:
      type: object
      properties:
        title:
          type: string
          description: Title for this order line item.
        quantity:
          type: integer
          description: Quantity for this order line item.
        variant:
          type: object
          additionalProperties: {}
          description: Variant for this order line item.
      required:
        - quantity
        - title
        - variant
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.