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

# Upload a health document

> The patient's own health documents: outside prescriptions, lab results.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/users/documents/
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/documents/:
    post:
      tags:
        - Records
      summary: Upload a health document
      description: 'The patient''s own health documents: outside prescriptions, lab results.'
      operationId: users_documents_create
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatientDocumentUpload'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatientDocumentUpload'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PatientDocument'
          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:
    PatientDocumentUpload:
      type: object
      properties:
        file:
          type: string
          format: uri
        kind:
          allOf:
            - $ref: '#/components/schemas/KindBccEnum'
          default: other
        note:
          type: string
          default: ''
          maxLength: 500
        consultation_id:
          type: string
          format: uuid
          nullable: true
      required:
        - file
    PatientDocument:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        url:
          type: string
          format: uri
          readOnly: true
        filename:
          type: string
          readOnly: true
        content_type:
          type: string
          maxLength: 100
        size_bytes:
          type: integer
        kind:
          $ref: '#/components/schemas/KindBccEnum'
        note:
          type: string
          maxLength: 500
        consultation:
          type: string
          format: uuid
          readOnly: true
          nullable: true
        consultation_summary:
          allOf:
            - $ref: '#/components/schemas/PatientDocumentConsultationSummary'
          nullable: true
          readOnly: true
        uploaded_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - consultation
        - consultation_summary
        - content_type
        - filename
        - id
        - size_bytes
        - uploaded_at
        - url
    KindBccEnum:
      enum:
        - prescription
        - lab_result
        - photo
        - other
      type: string
    PatientDocumentConsultationSummary:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        status:
          type: string
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        treatment_id:
          type: string
          readOnly: true
          nullable: true
        dosage:
          type: string
          readOnly: true
          nullable: true
        form_type:
          type: string
          readOnly: true
          nullable: true
      required:
        - created_at
        - dosage
        - form_type
        - id
        - status
        - treatment_id
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Access token from POST /v1/users/token/
    jwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````