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

# Open your medical-team conversation

> Gets or creates the patient's own thread with the medical team.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/users/conversations/
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/conversations/:
    post:
      tags:
        - Messages
      summary: Open your medical-team conversation
      description: Gets or creates the patient's own thread with the medical team.
      operationId: users_conversations_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Conversation'
            example: {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Conversation'
              example:
                id: 0a1b2c3d-4e5f-4a6b-8c9d-000000000005
                user:
                  id: 0a1b2c3d-4e5f-4a6b-8c9d-000000000001
                  email: patient@example.com
                  first_name: Alex
                  last_name: Moreno
                  locale: en
                created_at: '2026-08-02T11:43:49.831536Z'
                updated_at: '2026-08-03T06:55:00Z'
                is_active: true
                pinned_at: null
                last_message:
                  id: 0a1b2c3d-4e5f-4a6b-8c9d-00000000000m
                  sender: 0a1b2c3d-4e5f-4a6b-8c9d-00000000000d
                  sender_type: DOCTOR
                  content: I will check in with you in two weeks.
                  file: null
                  is_read: true
                  created_at: '2026-08-03T06:55:00Z'
                last_message_created_at: '2026-08-03T06:55:00Z'
                last_message_sender_type: DOCTOR
                unread_count: 0
                subscription_status: active
          description: ''
        '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
      security:
        - jwtAuth: []
components:
  schemas:
    Conversation:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        user:
          allOf:
            - $ref: '#/components/schemas/ConversationParticipant'
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        is_active:
          type: boolean
        pinned_at:
          type: string
          format: date-time
          nullable: true
        last_message:
          allOf:
            - $ref: '#/components/schemas/ConversationMessage'
          readOnly: true
          description: The most recent message. **Null when the thread is empty.**
        last_message_created_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        last_message_sender_type:
          type: string
          enum:
            - USER
            - DOCTOR
          readOnly: true
          nullable: true
        unread_count:
          type: integer
          readOnly: true
        subscription_status:
          type: string
          readOnly: true
          nullable: true
        translation_target_lang:
          type: string
          readOnly: true
      required:
        - created_at
        - id
        - last_message
        - last_message_created_at
        - last_message_sender_type
        - subscription_status
        - unread_count
        - updated_at
        - user
    ConversationParticipant:
      type: object
      description: The patient a conversation belongs to.
      properties:
        id:
          type: string
          format: uuid
        email:
          type: string
          format: email
        first_name:
          type: string
        last_name:
          type: string
        locale:
          type: string
    ConversationMessage:
      type: object
      description: A single message in the patient's thread with the medical team.
      properties:
        id:
          type: string
          format: uuid
        sender:
          type: string
          format: uuid
          description: Account id of the sender.
        sender_type:
          type: string
          enum:
            - USER
            - DOCTOR
          description: '`USER` is the patient; `DOCTOR` is the medical team.'
        content:
          type: string
          nullable: true
        file:
          type: string
          format: uri
          nullable: true
        is_read:
          type: boolean
        created_at:
          type: string
          format: date-time
        translation_enabled:
          type: boolean
        translation_default_on:
          type: boolean
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Access token from POST /v1/users/token/
    jwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````