{
  "openapi": "3.1.0",
  "info": {
    "title": "Insurance API",
    "description": "This API supports the management of insurances.",
    "version": "0.1.0"
  },
  "servers": [
    {
      "url": "https://sandbox.elationemr.com/api/2.0",
      "description": "Sandbox Environment"
    }
  ],
  "paths": {
    "/patients/{patient_id}/policies": {
      "get": {
        "operationId": "get_policies_patients__patient_id__policies_get",
        "parameters": [
          {
            "in": "path",
            "name": "patient_id",
            "required": true,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Patient Id"
            }
          },
          {
            "in": "query",
            "name": "active_only",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Active Only"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PoliciesResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "RequireAuthentication": []
          }
        ],
        "summary": "Get Policies",
        "tags": [
          "INSURANCE POLICIES"
        ]
      },
      "post": {
        "operationId": "create_policies_patients__patient_id__policies_post",
        "parameters": [
          {
            "in": "path",
            "name": "patient_id",
            "required": true,
            "schema": {
              "title": "Patient Id",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/PolicyCreateRequestBasic"
                  },
                  {
                    "$ref": "#/components/schemas/PolicyCreateRequestBasicList"
                  }
                ],
                "title": "Policy Request"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/PolicyResponse"
                    },
                    {
                      "$ref": "#/components/schemas/PoliciesResponse"
                    }
                  ],
                  "title": "Response Create Policies Patients  Patient Id  Policies Post"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Not authorized"
          },
          "403": {
            "description": "practice_id not authorized for this client"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "RequireAuthentication": []
          }
        ],
        "summary": "Create Policies",
        "tags": [
          "INSURANCE POLICIES"
        ]
      },
      "put": {
        "operationId": "put_policies_patients__patient_id__policies_put",
        "parameters": [
          {
            "in": "path",
            "name": "patient_id",
            "required": true,
            "schema": {
              "title": "Patient Id",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PolicyPutRequestBasicList"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PoliciesResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "403": {
            "description": "practice_id not authorized for this client"
          },
          "404": {
            "description": "Policy id does not belong to this patient"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "RequireAuthentication": []
          }
        ],
        "summary": "Put Policies",
        "tags": [
          "INSURANCE POLICIES"
        ]
      }
    },
    "/patients/{patient_id}/policies/{policy_id}": {
      "delete": {
        "operationId": "delete_policy_patients__patient_id__policies__policy_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "patient_id",
            "required": true,
            "schema": {
              "title": "Patient Id",
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "policy_id",
            "required": true,
            "schema": {
              "title": "Policy Id",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "RequireAuthentication": []
          }
        ],
        "summary": "Delete Policy",
        "tags": [
          "INSURANCE POLICIES"
        ]
      },
      "get": {
        "operationId": "get_policy_patients__patient_id__policies__policy_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "patient_id",
            "required": true,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Patient Id"
            }
          },
          {
            "in": "path",
            "name": "policy_id",
            "required": true,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Policy Id"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolicyResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "RequireAuthentication": []
          }
        ],
        "summary": "Get Policy",
        "tags": [
          "INSURANCE POLICIES"
        ]
      },
      "put": {
        "operationId": "put_policy_patients__patient_id__policies__policy_id__put",
        "parameters": [
          {
            "in": "path",
            "name": "patient_id",
            "required": true,
            "schema": {
              "title": "Patient Id",
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "policy_id",
            "required": true,
            "schema": {
              "title": "Policy Id",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PolicyPutRequestBasic"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolicyPutRequestBasic"
                }
              }
            },
            "description": "Successful Response"
          },
          "403": {
            "description": "practice_id not authorized for this client"
          },
          "404": {
            "description": "Policy id does not belong to this patient"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "RequireAuthentication": []
          }
        ],
        "summary": "Put Policy",
        "tags": [
          "INSURANCE POLICIES"
        ]
      }
    },
    "/patients/{patient_id}/policies/{policy_id}/card-images": {
      "get": {
        "operationId": "get_card_images_by_policy_patients__patient_id__policies__policy_id__card_images_get",
        "parameters": [
          {
            "in": "path",
            "name": "patient_id",
            "required": true,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Patient Id"
            }
          },
          {
            "in": "path",
            "name": "policy_id",
            "required": true,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Policy Id"
            }
          },
          {
            "in": "query",
            "name": "size",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ImageSize",
              "default": "thumbnail"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "$ref": "#/components/schemas/CardImageUrlFetchResponse"
                  },
                  "title": "Response Get Card Images By Policy Patients  Patient Id  Policies  Policy Id  Card Images Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "RequireAuthentication": []
          }
        ],
        "summary": "Get Card Images By Policy",
        "tags": [
          "insurance-cards"
        ]
      },
      "post": {
        "operationId": "upsert_insurance_card_patients__patient_id__policies__policy_id__card_images_post",
        "parameters": [
          {
            "in": "path",
            "name": "patient_id",
            "required": true,
            "schema": {
              "title": "Patient Id",
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "policy_id",
            "required": true,
            "schema": {
              "title": "Policy Id",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_upsert_insurance_card_patients__patient_id__policies__policy_id__card_images_post"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProcessInsuranceCardImageUploadAsyncResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "403": {
            "description": "practice_id not authorized for this client"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "RequireAuthentication": []
          }
        ],
        "summary": "Upsert Insurance Card",
        "tags": [
          "insurance-cards"
        ]
      }
    },
    "/patients/{patient_id}/policies/{policy_id}/card-images/{image_rank}": {
      "delete": {
        "description": "Calling this endpoint twice, once with each image rank, will result in deleting\nthe card entirely.",
        "operationId": "delete_insurance_card_image_patients__patient_id__policies__policy_id__card_images__image_rank__delete",
        "parameters": [
          {
            "in": "path",
            "name": "patient_id",
            "required": true,
            "schema": {
              "title": "Patient Id",
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "policy_id",
            "required": true,
            "schema": {
              "title": "Policy Id",
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "image_rank",
            "required": true,
            "schema": {
              "title": "Image Rank",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "403": {
            "description": "practice_id not authorized for this client"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "RequireAuthentication": []
          }
        ],
        "summary": "Delete Insurance Card Image",
        "tags": [
          "insurance-cards"
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "Body_upsert_insurance_card_patients__patient_id__policies__policy_id__card_images_post": {
        "properties": {
          "image_1": {
            "anyOf": [
              {
                "contentMediaType": "application/octet-stream",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image 1"
          },
          "image_2": {
            "anyOf": [
              {
                "contentMediaType": "application/octet-stream",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image 2"
          }
        },
        "title": "Body_upsert_insurance_card_patients__patient_id__policies__policy_id__card_images_post",
        "type": "object"
      },
      "CardImageUrlFetchResponse": {
        "properties": {
          "image_rank": {
            "title": "Image Rank",
            "type": "integer"
          },
          "url": {
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "url",
          "image_rank"
        ],
        "title": "CardImageUrlFetchResponse",
        "type": "object"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail",
            "type": "array"
          }
        },
        "title": "HTTPValidationError",
        "type": "object"
      },
      "ImageSize": {
        "enum": [
          "full",
          "thumbnail",
          "original"
        ],
        "title": "ImageSize",
        "type": "string"
      },
      "InsurancePaymentProgram": {
        "enum": [
          "medicare_part_b",
          "medicare_advantage",
          "medicaid",
          "commercial_hmsa",
          "commercial_sfhp",
          "commercial_other",
          "workers_compensation"
        ],
        "title": "InsurancePaymentProgram",
        "type": "string"
      },
      "InsurerRelationship": {
        "enum": [
          "self",
          "child",
          "spouse",
          "other"
        ],
        "title": "InsurerRelationship",
        "type": "string"
      },
      "PoliciesResponse": {
        "properties": {
          "current_page_num": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Page Num"
          },
          "next_page_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Page Url"
          },
          "page_first_item_num": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Page First Item Num"
          },
          "page_last_item_num": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Page Last Item Num"
          },
          "previous_page_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Previous Page Url"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/PolicyResponse"
            },
            "title": "Results",
            "type": "array"
          },
          "total_item_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Item Count"
          },
          "total_page_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Page Count"
          }
        },
        "required": [
          "results"
        ],
        "title": "PoliciesResponse",
        "type": "object"
      },
      "PolicyCreateRequestBasic": {
        "description": "Request model for creating a new insurance policy.\nAddress fields are for the insurance carrier.",
        "properties": {
          "address": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Carrier street address",
            "title": "Address"
          },
          "carrier_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Insurance carrier identifier",
            "title": "Carrier Id"
          },
          "carrier_name": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Name of the insurance carrier",
            "title": "Carrier Name"
          },
          "city": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Carrier city",
            "title": "City"
          },
          "copay": {
            "anyOf": [
              {
                "maxLength": 19,
                "pattern": "^-?\\d{1,8}(\\.\\d{1,10})?$|^$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Copay amount",
            "title": "Copay"
          },
          "county_code": {
            "anyOf": [
              {
                "maxLength": 10,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Carrier county code",
            "title": "County Code"
          },
          "deductible": {
            "anyOf": [
              {
                "maxLength": 19,
                "pattern": "^-?\\d{1,8}(\\.\\d{1,10})?$|^$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Deductible amount",
            "title": "Deductible"
          },
          "end_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Policy end date",
            "title": "End Date"
          },
          "extension": {
            "anyOf": [
              {
                "maxLength": 6,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Carrier phone extension",
            "title": "Extension"
          },
          "group_id": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Group identifier",
            "title": "Group Id"
          },
          "insured_person_address": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Insured person's street address",
            "title": "Insured Person Address"
          },
          "insured_person_city": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Insured person's city",
            "title": "Insured Person City"
          },
          "insured_person_dob": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Insured person's date of birth",
            "title": "Insured Person Dob"
          },
          "insured_person_first_name": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Insured person's first name",
            "title": "Insured Person First Name"
          },
          "insured_person_id": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Insured person's identifier",
            "title": "Insured Person Id"
          },
          "insured_person_last_name": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Insured person's last name",
            "title": "Insured Person Last Name"
          },
          "insured_person_sex_at_birth": {
            "anyOf": [
              {
                "maxLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Insured person's sex at birth",
            "title": "Insured Person Sex At Birth"
          },
          "insured_person_ssn": {
            "anyOf": [
              {
                "maxLength": 11,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Insured person's SSN",
            "title": "Insured Person Ssn"
          },
          "insured_person_state": {
            "anyOf": [
              {
                "maxLength": 2,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Insured person's state code",
            "title": "Insured Person State"
          },
          "insured_person_zip": {
            "anyOf": [
              {
                "maxLength": 10,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Insured person's ZIP code",
            "title": "Insured Person Zip"
          },
          "medicare_secondary_code": {
            "anyOf": [
              {
                "maxLength": 5,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Medicare secondary code",
            "title": "Medicare Secondary Code"
          },
          "member_id": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Member identifier",
            "title": "Member Id"
          },
          "patient_dob": {
            "description": "Patient's date of birth",
            "format": "date",
            "title": "Patient Dob",
            "type": "string"
          },
          "patient_first_name": {
            "description": "Patient's first name",
            "maxLength": 70,
            "title": "Patient First Name",
            "type": "string"
          },
          "patient_last_name": {
            "description": "Patient's last name",
            "maxLength": 70,
            "title": "Patient Last Name",
            "type": "string"
          },
          "payment_program": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InsurancePaymentProgram"
              },
              {
                "type": "null"
              }
            ],
            "description": "Insurance payment program type"
          },
          "phone": {
            "anyOf": [
              {
                "maxLength": 20,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Carrier phone number",
            "title": "Phone"
          },
          "plan_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Insurance plan identifier",
            "title": "Plan Id"
          },
          "plan_name": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Name of the insurance plan",
            "title": "Plan Name"
          },
          "practice_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Practice the policy belongs to. Must be one of the practices your API credentials are authorized for, or the request is rejected. If omitted, the first practice associated with your credentials is used. If your credentials are authorized for more than one practice, always specify this field explicitly \u2014 which practice is 'first' is not something you control and is not guaranteed to stay the same over time.",
            "title": "Practice Id"
          },
          "rank": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Policy rank (1=primary, 2=secondary, 3=tertiary)",
            "title": "Rank"
          },
          "relationship_to_insured": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InsurerRelationship"
              },
              {
                "type": "null"
              }
            ],
            "default": "self",
            "description": "Relationship of the patient to the insured person"
          },
          "start_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Policy start date",
            "title": "Start Date"
          },
          "state": {
            "anyOf": [
              {
                "maxLength": 2,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Carrier state code",
            "title": "State"
          },
          "status": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Status"
              },
              {
                "type": "null"
              }
            ],
            "description": "Current status of the policy"
          },
          "suite": {
            "anyOf": [
              {
                "maxLength": 40,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Carrier suite/unit number",
            "title": "Suite"
          },
          "vendor_company_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "For internal use only",
            "title": "Vendor Company Id"
          },
          "vendor_external_id": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "For internal use only",
            "title": "Vendor External Id"
          },
          "zip": {
            "anyOf": [
              {
                "maxLength": 10,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Carrier ZIP code",
            "title": "Zip"
          }
        },
        "required": [
          "patient_first_name",
          "patient_last_name",
          "patient_dob"
        ],
        "title": "PolicyCreateRequestBasic",
        "type": "object"
      },
      "PolicyCreateRequestBasicList": {
        "description": "Request model for creating a list of new insurance policies.\nAddress fields are for the insurance carrier.",
        "items": {
          "$ref": "#/components/schemas/PolicyCreateRequestBasic"
        },
        "title": "PolicyCreateRequestBasicList",
        "type": "array"
      },
      "PolicyPutRequestBasic": {
        "description": "Request model for updating an insurance policy.\nAddress fields are for the insurance carrier.",
        "properties": {
          "address": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Carrier street address",
            "title": "Address"
          },
          "carrier_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Insurance carrier identifier",
            "title": "Carrier Id"
          },
          "carrier_name": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Name of the insurance carrier",
            "title": "Carrier Name"
          },
          "city": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Carrier city",
            "title": "City"
          },
          "copay": {
            "anyOf": [
              {
                "maxLength": 19,
                "pattern": "^-?\\d{1,8}(\\.\\d{1,10})?$|^$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Copay amount",
            "title": "Copay"
          },
          "county_code": {
            "anyOf": [
              {
                "maxLength": 10,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Carrier county code",
            "title": "County Code"
          },
          "deductible": {
            "anyOf": [
              {
                "maxLength": 19,
                "pattern": "^-?\\d{1,8}(\\.\\d{1,10})?$|^$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Deductible amount",
            "title": "Deductible"
          },
          "end_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Policy end date",
            "title": "End Date"
          },
          "extension": {
            "anyOf": [
              {
                "maxLength": 6,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Carrier phone extension",
            "title": "Extension"
          },
          "group_id": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Group identifier",
            "title": "Group Id"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Policy ID. If provided, updates the existing policy. If omitted, creates a new policy with a generated ID.",
            "title": "Id"
          },
          "insured_person_address": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Insured person's street address",
            "title": "Insured Person Address"
          },
          "insured_person_city": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Insured person's city",
            "title": "Insured Person City"
          },
          "insured_person_dob": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Insured person's date of birth",
            "title": "Insured Person Dob"
          },
          "insured_person_first_name": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Insured person's first name",
            "title": "Insured Person First Name"
          },
          "insured_person_id": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Insured person's identifier",
            "title": "Insured Person Id"
          },
          "insured_person_last_name": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Insured person's last name",
            "title": "Insured Person Last Name"
          },
          "insured_person_sex_at_birth": {
            "anyOf": [
              {
                "maxLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Insured person's sex at birth",
            "title": "Insured Person Sex At Birth"
          },
          "insured_person_ssn": {
            "anyOf": [
              {
                "maxLength": 11,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Insured person's SSN",
            "title": "Insured Person Ssn"
          },
          "insured_person_state": {
            "anyOf": [
              {
                "maxLength": 2,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Insured person's state code",
            "title": "Insured Person State"
          },
          "insured_person_zip": {
            "anyOf": [
              {
                "maxLength": 10,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Insured person's ZIP code",
            "title": "Insured Person Zip"
          },
          "medicare_secondary_code": {
            "anyOf": [
              {
                "maxLength": 5,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Medicare secondary code",
            "title": "Medicare Secondary Code"
          },
          "member_id": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Member identifier",
            "title": "Member Id"
          },
          "patient_dob": {
            "description": "Patient's date of birth",
            "format": "date",
            "title": "Patient Dob",
            "type": "string"
          },
          "patient_first_name": {
            "description": "Patient's first name",
            "maxLength": 70,
            "title": "Patient First Name",
            "type": "string"
          },
          "patient_last_name": {
            "description": "Patient's last name",
            "maxLength": 70,
            "title": "Patient Last Name",
            "type": "string"
          },
          "payment_program": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InsurancePaymentProgram"
              },
              {
                "type": "null"
              }
            ],
            "description": "Insurance payment program type"
          },
          "phone": {
            "anyOf": [
              {
                "maxLength": 20,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Carrier phone number",
            "title": "Phone"
          },
          "plan_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Insurance plan identifier",
            "title": "Plan Id"
          },
          "plan_name": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Name of the insurance plan",
            "title": "Plan Name"
          },
          "practice_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Practice the policy belongs to. Must be one of the practices your API credentials are authorized for, or the request is rejected. If omitted and id refers to an existing policy, that policy's current practice is preserved; if omitted and id is absent or doesn't match an existing policy (i.e. this creates a new policy), the first practice associated with your credentials is used, as on create. If your credentials are authorized for more than one practice, always specify this field explicitly \u2014 which practice is 'first' is not something you control and is not guaranteed to stay the same over time.",
            "title": "Practice Id"
          },
          "rank": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Policy rank (1=primary, 2=secondary, 3=tertiary)",
            "title": "Rank"
          },
          "relationship_to_insured": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InsurerRelationship"
              },
              {
                "type": "null"
              }
            ],
            "default": "self",
            "description": "Relationship of the patient to the insured person"
          },
          "start_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Policy start date",
            "title": "Start Date"
          },
          "state": {
            "anyOf": [
              {
                "maxLength": 2,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Carrier state code",
            "title": "State"
          },
          "status": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Status"
              },
              {
                "type": "null"
              }
            ],
            "description": "Current status of the policy"
          },
          "suite": {
            "anyOf": [
              {
                "maxLength": 40,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Carrier suite/unit number",
            "title": "Suite"
          },
          "vendor_company_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "For internal use only",
            "title": "Vendor Company Id"
          },
          "vendor_external_id": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "For internal use only",
            "title": "Vendor External Id"
          },
          "zip": {
            "anyOf": [
              {
                "maxLength": 10,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Carrier ZIP code",
            "title": "Zip"
          }
        },
        "required": [
          "patient_first_name",
          "patient_last_name",
          "patient_dob"
        ],
        "title": "PolicyPutRequestBasic",
        "type": "object"
      },
      "PolicyPutRequestBasicList": {
        "items": {
          "$ref": "#/components/schemas/PolicyPutRequestBasic"
        },
        "title": "PolicyPutRequestBasicList",
        "type": "array"
      },
      "PolicyResponse": {
        "properties": {
          "address": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Address"
          },
          "back_image_path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Path to the back image of the insurance card",
            "title": "Back Image Path"
          },
          "can_check_eligibility": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": false,
            "description": "Indicates whether eligibility can be checked for this policy",
            "title": "Can Check Eligibility"
          },
          "carrier_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Carrier Id"
          },
          "carrier_name": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Carrier Name"
          },
          "city": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "City"
          },
          "copay": {
            "anyOf": [
              {
                "maxLength": 19,
                "pattern": "^-?\\d{1,8}(\\.\\d{1,10})?$|^$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Copay"
          },
          "county_code": {
            "anyOf": [
              {
                "maxLength": 10,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "County Code"
          },
          "deductible": {
            "anyOf": [
              {
                "maxLength": 19,
                "pattern": "^-?\\d{1,8}(\\.\\d{1,10})?$|^$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deductible"
          },
          "end_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Date"
          },
          "extension": {
            "anyOf": [
              {
                "maxLength": 6,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Extension"
          },
          "front_image_path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Path to the front image of the insurance card",
            "title": "Front Image Path"
          },
          "group_id": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Group Id"
          },
          "hippospace": {
            "maxLength": 255,
            "title": "Hippospace",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "integer"
          },
          "insured_person_address": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Insured Person Address"
          },
          "insured_person_city": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Insured Person City"
          },
          "insured_person_dob": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Insured Person Dob"
          },
          "insured_person_first_name": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Insured Person First Name"
          },
          "insured_person_id": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Insured Person Id"
          },
          "insured_person_last_name": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Insured Person Last Name"
          },
          "insured_person_sex_at_birth": {
            "anyOf": [
              {
                "maxLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Insured Person Sex At Birth"
          },
          "insured_person_ssn": {
            "anyOf": [
              {
                "maxLength": 11,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Insured Person Ssn"
          },
          "insured_person_state": {
            "anyOf": [
              {
                "maxLength": 2,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Insured Person State"
          },
          "insured_person_zip": {
            "anyOf": [
              {
                "maxLength": 10,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Insured Person Zip"
          },
          "is_legacy_insurance": {
            "default": false,
            "title": "Is Legacy Insurance",
            "type": "boolean"
          },
          "medicare_secondary_code": {
            "anyOf": [
              {
                "maxLength": 5,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Medicare Secondary Code"
          },
          "member_id": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Id"
          },
          "patient_dob": {
            "format": "date",
            "title": "Patient Dob",
            "type": "string"
          },
          "patient_first_name": {
            "maxLength": 70,
            "title": "Patient First Name",
            "type": "string"
          },
          "patient_id": {
            "title": "Patient Id",
            "type": "integer"
          },
          "patient_last_name": {
            "maxLength": 70,
            "title": "Patient Last Name",
            "type": "string"
          },
          "payment_program": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InsurancePaymentProgram"
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "anyOf": [
              {
                "maxLength": 20,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "plan_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Plan Id"
          },
          "plan_name": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Plan Name"
          },
          "practice_id": {
            "title": "Practice Id",
            "type": "integer"
          },
          "rank": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rank"
          },
          "relationship_to_insured": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InsurerRelationship"
              },
              {
                "type": "null"
              }
            ],
            "default": "self"
          },
          "start_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Date"
          },
          "state": {
            "anyOf": [
              {
                "maxLength": 2,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "State"
          },
          "status": {
            "$ref": "#/components/schemas/Status"
          },
          "suite": {
            "anyOf": [
              {
                "maxLength": 40,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Suite"
          },
          "vendor_company_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vendor Company Id"
          },
          "vendor_external_id": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vendor External Id"
          },
          "zip": {
            "anyOf": [
              {
                "maxLength": 10,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Zip"
          }
        },
        "required": [
          "id",
          "hippospace",
          "practice_id",
          "patient_id",
          "patient_first_name",
          "patient_last_name",
          "patient_dob",
          "status"
        ],
        "title": "PolicyResponse",
        "type": "object"
      },
      "ProcessInsuranceCardImageUploadAsyncResponse": {
        "properties": {
          "message": {
            "default": "The insurance card is uploading.",
            "title": "Message",
            "type": "string"
          },
          "success": {
            "default": true,
            "title": "Success",
            "type": "boolean"
          }
        },
        "title": "ProcessInsuranceCardImageUploadAsyncResponse",
        "type": "object"
      },
      "Status": {
        "enum": [
          "active",
          "inactive"
        ],
        "title": "Status",
        "type": "string"
      },
      "ValidationError": {
        "properties": {
          "ctx": {
            "title": "Context",
            "type": "object"
          },
          "input": {
            "title": "Input"
          },
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      }
    },
    "securitySchemes": {
      "RequireAuthentication": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "tags": [
    {
      "name": "health"
    },
    {
      "name": "insurance-cards",
      "description": "Upload and get insurance card images"
    },
    {
      "name": "insurance-eligibility",
      "description": "Check insurance eligibility"
    },
    {
      "name": "canonical-payer",
      "description": "Upload and store canonical payers csv"
    },
    {
      "name": "submitters",
      "description": "Submitter account management"
    },
    {
      "name": "provider-enrollment",
      "description": "Enroll providers at clearinghouses"
    }
  ]
}