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

# Download a message attachment

> Streams the file attached to one message in the conversation. `410` when the attachment is no longer available; `404` when the message has no file.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/users/conversations/{id}/messages/{message_id}/attachment/
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 get an `access` token, then send it
    as `Authorization: Bearer <token>` on every request that needs one.
    Registering, verifying the code, signing in and refreshing the token all
    work without a bearer token.


    Every account-scoped endpoint returns only the authenticated patient's own
    records. A resource you cannot see is indistinguishable from one that does
    not exist.
  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.
  - name: Attribution
    description: Lead and attribution events from the landing funnel.
paths:
  /v1/users/conversations/{id}/messages/{message_id}/attachment/:
    get:
      tags:
        - users
      summary: Download a message attachment
      description: >-
        Streams the file attached to one message in the conversation. `410` when
        the attachment is no longer available; `404` when the message has no
        file.
      operationId: users_conversations_messages_attachment_retrieve
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
        - in: path
          name: message_id
          schema:
            type: string
            format: uuid
          required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Conversation'
          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
        '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:
  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
          nullable: true
          readOnly: 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
          nullable: true
      required:
        - created_at
        - id
        - last_message
        - last_message_created_at
        - last_message_sender_type
        - subscription_status
        - unread_count
        - updated_at
        - user
    ConversationParticipant:
      oneOf:
        - $ref: '#/components/schemas/ConversationUser'
        - $ref: '#/components/schemas/ConversationPatient'
    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
    ConversationUser:
      type: object
      description: |-
        Read-only nested user for conversation payloads. Carries
        country_of_residence for the doctor inbox (residence flag beside the
        patient name) without touching the registration UserSerializer, whose
        field set doubles as the write contract for sign-up.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        email:
          type: string
          format: email
          readOnly: true
        first_name:
          type: string
          readOnly: true
        last_name:
          type: string
          readOnly: true
        country_of_residence:
          type: string
          readOnly: true
          nullable: true
          description: >-
            ISO 3166-1 alpha-3 country code where the patient currently lives.
            Used for EU cross-border prescription dispensing guidance.
      required:
        - country_of_residence
        - email
        - first_name
        - id
        - last_name
    ConversationPatient:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        email:
          type: string
          format: email
          maxLength: 254
        first_name:
          type: string
          maxLength: 150
        last_name:
          type: string
          maxLength: 150
        locale:
          allOf:
            - $ref: '#/components/schemas/LocaleEnum'
          description: Preferred email locale.
      required:
        - email
        - id
    LocaleEnum:
      enum:
        - de
        - en
        - es
        - fr
        - it
        - nl
        - pt
      type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Access token from POST /v1/users/token/
    jwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````