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

# Where each document category is filed

> For every `category` `POST /patients/{id}/documents` accepts, the place on this EHR instance's charts it lands: ModMed the practice's category tab, matched by title; EZDerm the Correspondences folder. Read live from the EHR. `location: null` is a category with no place on this instance: an upload with it is still filed, on the chart uncategorized (`location: null`; EZDerm, which has no uncategorized folder, files it in Correspondences). On ModMed, lab, pathology and imaging prefer a tab that feeds the Results Management log (`location.resultsLog`), and `disclosure` files in the builtin PHI Release tab; EZDerm has no place for disclosures. Requires read:patient_documents or write:patient_documents.



## OpenAPI

````yaml /openapi-v3.json get /documents/categories
openapi: 3.0.0
info:
  title: Max AI Public API
  description: API for third-party marketplace apps
  version: '3.0'
  contact: {}
servers:
  - url: https://api.maxcare.ai/v3
security: []
tags: []
paths:
  /documents/categories:
    get:
      tags:
        - Patients
      summary: Where each document category is filed
      description: >-
        For every `category` `POST /patients/{id}/documents` accepts, the place
        on this EHR instance's charts it lands: ModMed the practice's category
        tab, matched by title; EZDerm the Correspondences folder. Read live from
        the EHR. `location: null` is a category with no place on this instance:
        an upload with it is still filed, on the chart uncategorized (`location:
        null`; EZDerm, which has no uncategorized folder, files it in
        Correspondences). On ModMed, lab, pathology and imaging prefer a tab
        that feeds the Results Management log (`location.resultsLog`), and
        `disclosure` files in the builtin PHI Release tab; EZDerm has no place
        for disclosures. Requires read:patient_documents or
        write:patient_documents.
      operationId: DocumentCategoriesPublicController_listDocumentCategories
      parameters:
        - name: instanceId
          required: false
          in: query
          description: >-
            EHR instance to read. Optional when the organization has one EHR
            instance.
          schema:
            type: string
        - name: X-Organization-Id
          in: header
          required: true
          schema:
            type: string
          description: Target clinic organization ID
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentCategoriesSuccessResponse'
        '400':
          description: Missing or invalid request parameter
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiBadRequestResponse'
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiUnauthorizedResponse'
        '403':
          description: Insufficient scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiForbiddenResponse'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiNotFoundResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiRateLimitResponse'
        '502':
          description: EHR sync failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiBadGatewayResponse'
      security:
        - api-key: []
components:
  schemas:
    DocumentCategoriesSuccessResponse:
      type: object
      properties:
        code:
          type: string
          description: Response code
          example: success
        data:
          $ref: '#/components/schemas/DocumentCategoriesData'
      required:
        - code
        - data
    PublicApiBadRequestResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code
          example: bad_request
        message:
          type: string
          description: Human-readable error message
          example: '''id'' must be a valid UUID'
        trace_id:
          type: string
          description: Trace ID for debugging
          example: 550e8400-e29b-41d4-a716-446655440000
      required:
        - code
        - message
        - trace_id
    PublicApiUnauthorizedResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code
          example: unauthorized
        message:
          type: string
          description: Human-readable error message
          example: Invalid or missing API key
        trace_id:
          type: string
          description: Trace ID for debugging
          example: 550e8400-e29b-41d4-a716-446655440000
      required:
        - code
        - message
        - trace_id
    PublicApiForbiddenResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code
          example: forbidden
        message:
          type: string
          description: Human-readable error message
          example: Insufficient scope
        trace_id:
          type: string
          description: Trace ID for debugging
          example: 550e8400-e29b-41d4-a716-446655440000
      required:
        - code
        - message
        - trace_id
    PublicApiNotFoundResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code
          example: not_found
        message:
          type: string
          description: Human-readable error message
          example: Resource not found
        trace_id:
          type: string
          description: Trace ID for debugging
          example: 550e8400-e29b-41d4-a716-446655440000
      required:
        - code
        - message
        - trace_id
    PublicApiRateLimitResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code
          example: rate_limit_exceeded
        message:
          type: string
          description: Human-readable error message
          example: Rate limit exceeded. Maximum 1000 requests per 60 seconds.
        trace_id:
          type: string
          description: Trace ID for debugging
          example: 550e8400-e29b-41d4-a716-446655440000
      required:
        - code
        - message
        - trace_id
    PublicApiBadGatewayResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code
          example: unexpected_integration_error
        message:
          type: string
          description: Human-readable error message
          example: EHR sync failed
        trace_id:
          type: string
          description: Trace ID for debugging
          example: 550e8400-e29b-41d4-a716-446655440000
      required:
        - code
        - message
        - trace_id
    DocumentCategoriesData:
      type: object
      properties:
        instanceId:
          type: string
          description: EHR instance, as a raw UUID
          example: 5b0e7a52-1c3f-4b8e-9d2a-7f6c4e1a2b3c
        ehrType:
          type: string
          example: modmed
        categories:
          type: array
          items:
            $ref: '#/components/schemas/DocumentCategoryMapping'
      required:
        - instanceId
        - ehrType
        - categories
    DocumentCategoryMapping:
      type: object
      properties:
        category:
          type: string
          enum:
            - referral
            - pathology
            - lab
            - imaging
            - prior_authorization
            - medical_records
            - records_request
            - correspondence
            - prescription
            - forms
            - insurance
            - billing
            - audit
            - disclosure
          example: pathology
        location:
          nullable: true
          description: >-
            Where an upload with this category lands. Null: the category has no
            place on this instance, and an upload with it is still filed, on the
            chart uncategorized (`location: null`; EZDerm, which has no
            uncategorized folder, files it in Correspondences).
          allOf:
            - $ref: '#/components/schemas/DocumentLocationResponse'
      required:
        - category
        - location
    DocumentLocationResponse:
      type: object
      properties:
        id:
          type: string
          description: The EHR's id for it (ModMed category tab id, EZDerm folder type)
          example: '333500'
        title:
          type: string
          description: Name staff see in the EHR
          example: Pathology
        resultsLog:
          type: boolean
          description: >-
            ModMed: the tab feeds the Results Management log, where providers
            review and sign results. Lab, pathology and imaging uploads prefer
            such a tab. Routing to a specific provider is not set by the upload;
            assign a provider review task (POST /tasks) for that. Always false
            on EZDerm.
          example: true
      required:
        - id
        - title
        - resultsLog
  securitySchemes:
    api-key:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: Marketplace API key

````

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