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

# Change an insurance policy's type

> Sets the policy type of a policy already on the chart, and changes nothing else about it. The body is `policyType` only; any other field is refused with 400. The policy (`GET /insurance-policies`) must belong to this patient in the patient's own EHR instance; otherwise 404. EHRs without a policy type answer 400 `capability_unsupported` (see `GET /payers/capabilities`, `insurance.policyType`). The current type is read from the EHR first: when it already matches, nothing is written and the request returns 200, so a retry is always safe. The response is the EHR's own read-back after the change. 409 `policy_update_refused` means the EHR did not take the change: it refused the save (for example, ModMed locks a policy that has claims), or still shows the previous type after it. Retrying will not help; check the policy in the EHR. 404 `insurance_not_found` means the EHR has no active policy with this id on the chart (archived policies cannot be changed here). `GET /insurance-policies` shows the new type after the next EHR sync; this response is the EHR's own copy. A policy just added with `POST /patients/{id}/insurance:exact` is not listed there, and so cannot be changed here, until that sync.



## OpenAPI

````yaml /openapi-v3.json patch /patients/{patientId}/insurance-policies/{policyId}
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:
  /patients/{patientId}/insurance-policies/{policyId}:
    patch:
      tags:
        - Patients
      summary: Change an insurance policy's type
      description: >-
        Sets the policy type of a policy already on the chart, and changes
        nothing else about it. The body is `policyType` only; any other field is
        refused with 400. The policy (`GET /insurance-policies`) must belong to
        this patient in the patient's own EHR instance; otherwise 404. EHRs
        without a policy type answer 400 `capability_unsupported` (see `GET
        /payers/capabilities`, `insurance.policyType`). The current type is read
        from the EHR first: when it already matches, nothing is written and the
        request returns 200, so a retry is always safe. The response is the
        EHR's own read-back after the change. 409 `policy_update_refused` means
        the EHR did not take the change: it refused the save (for example,
        ModMed locks a policy that has claims), or still shows the previous type
        after it. Retrying will not help; check the policy in the EHR. 404
        `insurance_not_found` means the EHR has no active policy with this id on
        the chart (archived policies cannot be changed here). `GET
        /insurance-policies` shows the new type after the next EHR sync; this
        response is the EHR's own copy. A policy just added with `POST
        /patients/{id}/insurance:exact` is not listed there, and so cannot be
        changed here, until that sync.
      operationId: PatientsPublicController_updateInsurancePolicyType
      parameters:
        - name: patientId
          required: true
          in: path
          description: Patient ID
          schema:
            type: string
        - name: policyId
          required: true
          in: path
          description: Insurance policy ID from `GET /insurance-policies`
          schema:
            type: string
        - name: X-Organization-Id
          in: header
          required: true
          schema:
            type: string
          description: Target clinic organization ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateInsurancePolicyTypeBody'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateInsurancePolicyTypeSuccessResponse'
        '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'
        '409':
          description: Resource conflict (e.g. editing a signed note)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiConflictResponse'
        '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'
        '503':
          description: EHR integration unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiServiceUnavailableResponse'
      security:
        - api-key: []
components:
  schemas:
    UpdateInsurancePolicyTypeBody:
      type: object
      properties:
        policyType:
          type: string
          description: >-
            The policy type to set, using ModMed's own names. The only field
            this route accepts; any other field is refused with 400.
          enum:
            - MEDICARE
            - MEDICARE_ADVANTAGE
            - MEDICAID
            - CHIP
            - TRICARE
            - CHAMPVA
            - GOVERNMENT_OTHER
            - COMMERCIAL_OTHER
            - HMO
            - PPO
            - EPO
            - POS
            - GHP
            - IPA
            - ACA_EXCHANGE
          example: MEDICARE
      required:
        - policyType
    UpdateInsurancePolicyTypeSuccessResponse:
      type: object
      properties:
        code:
          type: string
          description: Response code
          example: success
        data:
          $ref: '#/components/schemas/UpdateInsurancePolicyTypeData'
      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
    PublicApiConflictResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code
          example: conflict
        message:
          type: string
          description: Human-readable error message
          example: Cannot edit a signed note
        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
    PublicApiServiceUnavailableResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code
          example: server_unresponsive
        message:
          type: string
          description: Human-readable error message
          example: EHR integration is not available for this note
        trace_id:
          type: string
          description: Trace ID for debugging
          example: 550e8400-e29b-41d4-a716-446655440000
      required:
        - code
        - message
        - trace_id
    UpdateInsurancePolicyTypeData:
      type: object
      properties:
        policyId:
          type: string
          description: The insurance policy id from `GET /insurance-policies`
          example: pol_3f2c9a1e7b6d4c5e8f9a0b1c2d3e4f5a
        policyType:
          type: string
          description: >-
            The policy type the EHR holds, read back from the EHR after the
            change
          example: MEDICARE
      required:
        - policyId
        - policyType
  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.