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

# Generate a note from the patient's documents

> Creates a new session for the patient and queues generation of a clinical note from the patient's uploaded documents (text extraction must have completed for at least one document) — no recording or transcript needed. Returns 202 with the new session id; generation typically takes under a minute. Register a NOTE_CREATED outbound webhook to be notified when the note is ready, or poll GET /sessions/{sessionId}/notes. Requires the notes:write scope. Each call creates a new session, so do not retry a request that already returned 202.



## OpenAPI

````yaml /openapi/ext-api-v1.json post /patients/{patientId}/notes/from-documents
openapi: 3.0.0
info:
  title: Healos External API
  version: 1.0.0
  description: >-
    External API for managing patients, documents, and appointments, listing
    providers and note templates, pulling clinical notes (with transcript and
    patient context), and running insurance eligibility checks.
servers:
  - url: https://api.healos.ai/ext-api/v1
    description: Production
  - url: http://localhost:8787/ext-api/v1
    description: Local development
security:
  - ApiKeyAuth: []
paths:
  /patients/{patientId}/notes/from-documents:
    post:
      tags:
        - Notes
      summary: Generate a note from the patient's documents
      description: >-
        Creates a new session for the patient and queues generation of a
        clinical note from the patient's uploaded documents (text extraction
        must have completed for at least one document) — no recording or
        transcript needed. Returns 202 with the new session id; generation
        typically takes under a minute. Register a NOTE_CREATED outbound webhook
        to be notified when the note is ready, or poll GET
        /sessions/{sessionId}/notes. Requires the notes:write scope. Each call
        creates a new session, so do not retry a request that already returned
        202.
      parameters:
        - schema:
            type: string
            pattern: ^\d+$
            example: '481926357104938271'
          required: true
          name: patientId
          in: path
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                template_id:
                  type: string
                  format: uuid
                  description: >-
                    Template to generate with. Defaults to the clinician's
                    default template. Must be a built-in template or one owned
                    by your organization.
                model:
                  type: string
                  description: >-
                    Note quality, the same choices as the HealOS dashboard:
                    fast, balanced, or detailed. Defaults to the standard
                    quality.
                  enum:
                    - detailed
                    - balanced
                    - fast
                  example: balanced
              description: Generation options (all fields optional)
      responses:
        '202':
          description: Note generation queued
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      session_id:
                        type: string
                      status:
                        type: string
                        enum:
                          - queued
                    required:
                      - session_id
                      - status
                  message:
                    type: string
                required:
                  - data
                  - message
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Insufficient scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Patient or template not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: The patient has no documents with extracted text
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
        '503':
          description: Generation could not be queued
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
      required:
        - error
    RateLimitError:
      type: object
      properties:
        error:
          type: string
          example: Rate limit exceeded. Please retry after the window resets.
      required:
        - error
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key obtained from /api/v1/ext-api-keys

````

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