{
  "openapi": "3.0.1",
  "info": {
    "title": "MERS Actions",
    "version": "v1.1"
  },
  "tags": [
    {
      "name": "MERS Actions"
    }
  ],
  "paths": {
    "/change_data/{change_data_id}": {
      "get": {
        "summary": "Get details on a change data request (deprecated use `/mers_actions/{id}` instead)",
        "tags": [
          "Data Change"
        ],
        "description": "Use this endpoint to get details on a change data with a given id",
        "parameters": [
          {
            "name": "change_data_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "5279e4ca-cd04-49b3-9863-d94e9acc35fe",
              "description": "the unique identifier for the change data"
            }
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/change_data_attributes"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: authentication is missing or invalid"
          },
          "403": {
            "description": "forbidden: your role does not allow to proceed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Returned when the token lacks the `mers:basic` scope. A user without the view permission gets the bare string `\"Forbidden\"` instead.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Insufficient Scope, a scope of mers:basic is required."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "not found: no change data request with this id in the eVault (the body is `null`)"
          }
        }
      }
    },
    "/edeliveries/{edelivery_id}": {
      "get": {
        "summary": "Get details on an eDelivery",
        "tags": [
          "Transfer and eDelivery"
        ],
        "description": "Use this endpoint to get details on an eDelivery with a given id",
        "parameters": [
          {
            "name": "edelivery_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "5279e4ca-cd04-49b3-9863-d94e9acc35fe",
              "description": "the unique identifier for the eDelivery"
            }
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/edelivery_attributes"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: authentication is missing or invalid"
          },
          "403": {
            "description": "forbidden: your role does not allow to proceed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Returned when the token lacks the `mers:basic` scope. A user without the view permission gets the bare string `\"Forbidden\"` instead.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Insufficient Scope, a scope of mers:basic is required."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "not found: no eDelivery with this id in the eVault (the body is `null`)"
          }
        }
      }
    },
    "/inquiries/{inquiry_id}": {
      "get": {
        "summary": "Get details on an inquiry",
        "tags": [
          "Inquiry"
        ],
        "description": "Use this endpoint to get details on an inquiry with a given id",
        "parameters": [
          {
            "name": "inquiry_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "0d6bb319-b4fd-44a6-8dbc-e0311fe5bf94",
              "description": "the unique identifier for the inquiry"
            }
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/inquiry_attributes"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: authentication is missing or invalid"
          },
          "403": {
            "description": "forbidden: your role does not allow to proceed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Returned when the token lacks the `mers:basic` scope. A user without the view permission gets the bare string `\"Forbidden\"` instead.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Insufficient Scope, a scope of mers:basic is required."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "not found: no inquiry with this id in the eVault (the body is `null`)"
          }
        }
      }
    },
    "/mers_actions/bulk_transfer": {
      "post": {
        "summary": "Initiate a Bulk Transfer",
        "tags": [
          "Transfer and eDelivery"
        ],
        "description": "Use this endpoint to initiate multiple transfers according to pre-configured mappings",
        "operationId": "initiateBulkTransfer",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "ok",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/bulk_transfer_response"
                }
              }
            }
          },
          "400": {
            "description": "bad request: invalid payload, or every row failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "title": "invalid payload",
                      "properties": {
                        "error": {
                          "type": "string",
                          "example": "data should have min_number and partner_name",
                          "description": "error description, possible errors include:\n- data should have min_number and partner_name: returned if one of the objects in the data array is missing the min_number or partner_name key\n- data is not an array: returned if the data key is not an array\n- no bulk transfer mappings created: returned if no lender preferences exist for the current evault\n"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "title": "missing data key",
                      "properties": {
                        "errors": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "type": "string",
                              "example": "is required"
                            }
                          }
                        }
                      }
                    },
                    {
                      "type": "object",
                      "title": "every row failed validation",
                      "description": "same shape as the 200 response without `id`; `success` is false and no transfer was initiated",
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "success": {
                              "type": "boolean",
                              "example": false
                            },
                            "transfer_metrics": {
                              "$ref": "#/components/schemas/bulk_transfer_response/properties/data/properties/transfer_metrics"
                            },
                            "validation_errors": {
                              "$ref": "#/components/schemas/bulk_transfer_response/properties/data/properties/validation_errors"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: authentication is missing or invalid"
          },
          "403": {
            "description": "forbidden: your role does not allow to proceed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/insufficient_scope_error"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/bulk_transfer_payload"
              }
            }
          }
        }
      }
    },
    "/mers_actions/assumption": {
      "post": {
        "summary": "Report an assumption",
        "tags": [
          "Assumption"
        ],
        "description": "Use this endpoint to report an assumption to MERS.\n\nThis endpoint notifies MERS that the loan has been assumed by a new borrower.\n\nThe document must be registered, active, and not locked.\n\n",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "202": {
            "description": "accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/assumption_response"
                }
              }
            }
          },
          "400": {
            "description": "bad request: invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/assumption_error_response"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: authentication is missing or invalid"
          },
          "403": {
            "description": "forbidden: your role does not allow to proceed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/insufficient_scope_error"
                }
              }
            }
          },
          "404": {
            "description": "not found: no stored and sealed document with this MIN exists in your eVault",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/not_found_error"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/assumption_payload"
              }
            }
          }
        }
      }
    },
    "/mers_actions/bulk_change_partners": {
      "post": {
        "summary": "Update eNote partners through a Change Data",
        "tags": [
          "Data Change"
        ],
        "description": "Use this endpoint to update multiple eNote partners through a Change Data request to MERS.\n\nEach element of `data` is processed independently. The response status is 200 even when every row failed;\ninspect the `errors` object of each row in the response.\n",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "ok",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/bulk_change_partners_response"
                }
              }
            }
          },
          "400": {
            "description": "bad request: the data array is missing",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "string",
                          "example": "is required"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: authentication is missing or invalid"
          },
          "403": {
            "description": "forbidden: your role does not allow to proceed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/insufficient_scope_error"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/bulk_change_partners_payload"
              }
            }
          }
        }
      }
    },
    "/mers_actions/edeliver": {
      "post": {
        "summary": "Initiate an eDelivery",
        "tags": [
          "Transfer and eDelivery"
        ],
        "description": "Use this endpoint to initiate an eDelivery to a partner",
        "operationId": "initiateEdelivery",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "202": {
            "description": "accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/edeliver_response"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: eDelivery request was invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      },
                      "description": "information on errors that prevented the eDelivery from being created, keyed by the parameter at fault.\nObserved bodies:\n- {\"mers\": \"is required\"}: the `mers` object is missing\n- {\"emortgage_package_id\": \"is required\"}: neither emortgage_package_id nor min_number was provided\n- {\"emortgage_package_id\": \"document not registered\" | \"document is currently locked\" | \"emortgage package not primary\", \"code\": \"package_invalid\"}\n- {\"edelivery\": \"edelivery is disabled for this partner\", \"code\": \"edelivery_disabled\"}\n- {\"recipients\": \"[\"<org_id>\"] invalid\"}: recipient_org_id is missing or is not a partner of your eVault\n- {\"documents\": \"required\"}: the eVault does not hold a right to eDeliver this eNote\n",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "package_invalid",
                            "edelivery_disabled"
                          ],
                          "description": "a fixed keyword associated with the error type:\n- 'package_invalid': attempted to edeliver an emortgage package not in a edeliverable state\n- 'edelivery_disabled': eDelivery is disabled for the recipient partner\n"
                        }
                      },
                      "example": {
                        "emortgage_package_id": "document not registered",
                        "code": "package_invalid"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: authentication is missing or invalid"
          },
          "403": {
            "description": "forbidden: your role does not allow to proceed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/insufficient_scope_error"
                }
              }
            }
          },
          "404": {
            "description": "not found: the emortgage package or MIN does not exist in your eVault (empty body)"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/edeliver_payload"
              }
            }
          }
        }
      }
    },
    "/mers_actions/add_document": {
      "post": {
        "summary": "Add a document to an eNote (deprecated, use add_document_to_mers instead)",
        "tags": [
          "Add Document"
        ],
        "deprecated": true,
        "description": "Use this endpoint to add a document to an eNote.\n\nSupported document types: any MISMO supplemental document type except `Other` (the `DocumentSection::SUPPLEMENTAL_DOC_TYPES` list, e.g. NoteAddendum, AssumptionAgreement, PowerOfAttorney).\n\nThe file must be a pdf, jpg, jpeg, png, tiff, tif, or xml.\n",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "202": {
            "description": "accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/add_document_response"
                }
              }
            }
          },
          "400": {
            "description": "bad request: invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      },
                      "description": "the validation error plus a fixed `code` keyword. Observed bodies:\n- {\"mers\": \"is required\"}: the `mers` object is missing\n- {\"message\": \"Invalid file type\" | \"Invalid document type: <type>\", \"code\": \"bad_request\"}\n- {\"document\": \"Document is locked\", \"code\": \"document_locked\"}\n- when MERS rejected the action, the service error with `data` alongside: {\"document_id\": \"Document not active\" | \"Document not registered\", \"code\": \"package_invalid\"} or {\"document_id\": \"A duplicate document cannot be added to an eNote with the same Document Type as the existing document\", \"code\": \"duplicate_document\"}\n",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "bad_request",
                            "document_locked",
                            "package_invalid",
                            "duplicate_document"
                          ]
                        }
                      },
                      "example": {
                        "message": "Invalid document type: Note",
                        "code": "bad_request"
                      }
                    },
                    "data": {
                      "type": "object",
                      "description": "only present when the MERS action was attempted and rejected",
                      "properties": {
                        "change_data_id": {
                          "type": "string",
                          "nullable": true,
                          "example": null
                        },
                        "document_id": {
                          "type": "string",
                          "format": "uuid",
                          "example": "4d124b5b-cf5f-44e5-a8fc-e9cc386b2835"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: authentication is missing or invalid"
          },
          "403": {
            "description": "forbidden: your role does not allow to proceed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/insufficient_scope_error"
                }
              }
            }
          },
          "404": {
            "description": "not found: reviewable document or eNote not found (empty body)"
          },
          "422": {
            "description": "unprocessable entity: the file can not be used",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Unable to process file"
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/add_document_payload"
              }
            }
          }
        }
      }
    },
    "/mers_actions/add_document_to_mers": {
      "post": {
        "summary": "Add a document to an eNote",
        "tags": [
          "Add Document"
        ],
        "description": "Use this endpoint to notify MERS that a document was added to the eNote.\n\nThis endpoint requires that you first create the underlying file by POSTing it to `reviewable_documents`, then pass the returned `reviewable_document_id` to this endpoint.\n\nSupported file formats: pdf, jpg, jpeg, png, tiff, tif, or xml.\n\nSupported document types: any MISMO supplemental document type except `Other` (the `DocumentSection::SUPPLEMENTAL_DOC_TYPES` list, e.g. NoteAddendum, AssumptionAgreement, PowerOfAttorney).\n",
        "operationId": "addDocumentToMers",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "202": {
            "description": "accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/add_document_to_mers_response"
                }
              }
            }
          },
          "400": {
            "description": "bad request: invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/add_document_to_mers_error_response"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: authentication is missing or invalid"
          },
          "403": {
            "description": "forbidden: your role does not allow to proceed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/insufficient_scope_error"
                }
              }
            }
          },
          "404": {
            "description": "not found: reviewable document or eNote not found (empty body)"
          },
          "422": {
            "description": "unprocessable entity: the file can not be used",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/unprocessable_reviewable_document_error"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/add_document_to_mers_payload"
              }
            }
          }
        }
      }
    },
    "/mers_actions/modification": {
      "post": {
        "summary": "Add a document and submit a loan modification",
        "tags": [
          "Add Document"
        ],
        "description": "Use this endpoint to submit a loan modification. This effectively performs two actions in the MERS eRegistry:\n1) Add a document to the eNote (change_data action type: `AddDocument`)\n\n2) Submit a loan modification (change_data action type: `Modification`)\n\n\nThe response body returns the results of these two actions as an array, in the same order.\n\nIf the first action succeeds but the second action fails, the response status is still a failure (400) and the response includes the second action's error(s).\n\n\nThe supported file formats depend on the `loan_modification_type`:\n\n- `Paper` (default): uploaded document must be a PDF.\n\n- `Electronic`: uploaded document must be an XML file.\n\nSupported document types: any MISMO supplemental document type except `Other` (the `DocumentSection::SUPPLEMENTAL_DOC_TYPES` list, e.g. NoteAddendum, AssumptionAgreement, PowerOfAttorney).\n",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "202": {
            "description": "accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/mers_action_modification_response"
                }
              }
            }
          },
          "400": {
            "description": "bad request: invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/mers_action_modification_error_response"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: authentication is missing or invalid"
          },
          "403": {
            "description": "forbidden: your role does not allow to proceed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/insufficient_scope_error"
                }
              }
            }
          },
          "404": {
            "description": "not found: reviewable document or eNote does not exist in your eVault (empty body)"
          },
          "422": {
            "description": "unprocessable entity: the reviewable document is unprocessable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/unprocessable_reviewable_document_error"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/mers_action_modification_payload"
              }
            }
          }
        }
      }
    },
    "/mers_actions/inquiry": {
      "post": {
        "summary": "Initiate an inquiry",
        "tags": [
          "Inquiry"
        ],
        "description": "Use this endpoint to initiate an inquiry to MERS",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted: an inquiry was successfully initiated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "inquiry_id": {
                      "type": "string",
                      "format": "uuid",
                      "example": "0d6bb319-b4fd-44a6-8dbc-e0311fe5bf94",
                      "description": "The ID of the created inquiry"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: min_number is blank (empty body) or the mers object is missing ({\"errors\":{\"mers\":\"is required\"}})"
          },
          "401": {
            "description": "unauthorized: authentication is missing or invalid"
          },
          "403": {
            "description": "forbidden: your role does not allow to proceed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/insufficient_scope_error"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inquiry_payload"
              }
            }
          }
        }
      }
    },
    "/mers_actions/registration": {
      "post": {
        "summary": "Register an eNote (by MIN)",
        "tags": [
          "Registration"
        ],
        "description": "Use this endpoint to register an eNote with MERS by MIN number.\n\nThe eNote must be signed or inactive with reason for deactivation of `RegistrationReversal`.\n\n",
        "operationId": "registerEnote",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "202": {
            "description": "accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "example": "c2e67375-e923-4900-9131-75f90aa17eaa",
                          "description": "UUID of the created object"
                        },
                        "min_number": {
                          "type": "string",
                          "example": "999938091211784532",
                          "description": "MERS MIN number"
                        },
                        "document_id": {
                          "type": "string",
                          "format": "uuid",
                          "example": "c2e67375-e923-4900-9131-75f90aa17eaa",
                          "description": "UUID of the document"
                        },
                        "emortgage_package_id": {
                          "type": "string",
                          "format": "uuid",
                          "example": "c2e67375-e923-4900-9131-75f90aa17eaa",
                          "description": "UUID of the eMortgage package"
                        },
                        "mers_action": {
                          "type": "string",
                          "example": "registration",
                          "description": "the associated action in the MERS system"
                        },
                        "snapdocs_action": {
                          "type": "string",
                          "example": "registration",
                          "description": "the action executed"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad request: invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      },
                      "description": "the validation error, keyed by the parameter at fault, plus a fixed `code` keyword. Observed bodies:\n- {\"mers\": \"is required\"}: the `mers` object is missing\n- {\"min_number\": \"is_required\", \"code\": \"bad_request\"}\n- {\"document\": \"Document is active\", \"code\": \"bad_request\"}: the eNote is already registered\n- {\"document\": \"In order to re-register, document status must be \"RegistrationReversal\", but is \"<status>\"\", \"code\": \"bad_request\"}\n- {\"permissions\": \"you do not hold a right to change this document\", \"code\": \"rights_missing\"}\n",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "bad_request",
                            "rights_missing"
                          ]
                        }
                      },
                      "example": {
                        "min_number": "is_required",
                        "code": "bad_request"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: authentication is missing or invalid"
          },
          "403": {
            "description": "forbidden: your role does not allow to proceed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/insufficient_scope_error"
                }
              }
            }
          },
          "404": {
            "description": "not found: no stored and sealed document with this MIN exists in your eVault",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/not_found_error"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mers": {
                    "type": "object",
                    "properties": {
                      "min_number": {
                        "type": "string",
                        "description": "The MIN number of the eNote to be registered",
                        "example": "999938091211784532"
                      }
                    },
                    "required": [
                      "min_number"
                    ]
                  }
                },
                "required": [
                  "mers"
                ]
              }
            }
          }
        }
      }
    },
    "/mers_actions/transfer": {
      "post": {
        "summary": "Initiate a transfer",
        "tags": [
          "Transfer and eDelivery"
        ],
        "description": "Use this endpoint to initiate a transfer of rights on one note to a partner",
        "operationId": "initiateTransfer",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "202": {
            "description": "accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/transfer_response"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: transfer request was invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "information on errors that prevented the transfer from being created, keyed by the parameter at fault.\nObserved bodies:\n- {\"mers\": \"is required\"}: the `mers` object is missing\n- {\"emortgage_package_id\": \"is required\"}: neither emortgage_package_id nor min_number was provided\n- {\"emortgage_package_id\": \"document not registered\" | \"document is currently locked\" | \"emortgage package not primary\", \"code\": \"package_invalid\"}\n- {\"action_type\": \"This is an invalid combination of rights holders to update. Please adjust your rights holder changes and resubmit.\", \"code\": \"combination_invalid\"}\n- {\"permissions\": \"you do not hold a right to transfer documents with ids: [...]\", \"code\": \"rights_missing\"}\n- {\"<document_id>\": {\"effective_date\": \"date cannot be retroactive or more than 30 days in the future\"}} (with `data` alongside): the transfer service rejected the request; the error object is keyed by the document id\n",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "combination_invalid",
                            "package_invalid",
                            "rights_missing"
                          ],
                          "description": "a fixed keyword associated with the error type:\n- 'combination_invalid': the set of intended right holders does not correspond to a valid MERS transfer\n- 'package_invalid': attempted to transfer an emortgage package not in a transferrable state\n- 'rights_missing': attempted to transfer rights on a document that the eVault is not permitted to\n"
                        }
                      },
                      "example": {
                        "permissions": "you do not hold a right to transfer documents with ids: [\"06d07c1a-5a2f-4fb6-9cc8-768ee34a18f2\"]",
                        "code": "rights_missing"
                      }
                    },
                    "data": {
                      "type": "object",
                      "description": "only present when the transfer service rejected the request: the document_id and emortgage_package_id of the eNote (and `edeliveries` when `edeliver` was true)",
                      "properties": {
                        "document_id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "emortgage_package_id": {
                          "type": "string",
                          "format": "uuid"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: authentication is missing or invalid"
          },
          "403": {
            "description": "forbidden: your role does not allow to proceed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/insufficient_scope_error"
                }
              }
            }
          },
          "404": {
            "description": "not found: the emortgage package or MIN does not exist in your eVault (empty body)"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/transfer_payload"
              }
            }
          }
        }
      }
    },
    "/mers_actions/add_document_to_mers_reversal": {
      "post": {
        "summary": "Reverse the addition of a supplemental document to MERS",
        "tags": [
          "Add Document"
        ],
        "description": "Use this endpoint to reverse the addition of a supplemental document to an eNote in MERS.\n\nThe eNote must be registered, active, and have a supplemental document to reverse.\n",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "202": {
            "description": "accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "example": "c2e67375-e923-4900-9131-75f90aa17eaa",
                          "description": "UUID of the created object"
                        },
                        "min_number": {
                          "type": "string",
                          "example": "999938091211784532",
                          "description": "MERS MIN number"
                        },
                        "document_id": {
                          "type": "string",
                          "format": "uuid",
                          "example": "c2e67375-e923-4900-9131-75f90aa17eaa",
                          "description": "UUID of the document"
                        },
                        "emortgage_package_id": {
                          "type": "string",
                          "format": "uuid",
                          "example": "c2e67375-e923-4900-9131-75f90aa17eaa",
                          "description": "UUID of the eMortgage package"
                        },
                        "file_name": {
                          "type": "string",
                          "example": "supplemental_doc.pdf",
                          "description": "File name of the supplemental document being reversed"
                        },
                        "document_type": {
                          "type": "string",
                          "example": "NoteAddendum",
                          "description": "MISMO document type of the supplemental document"
                        },
                        "mers_action": {
                          "type": "string",
                          "example": "change_status",
                          "description": "the associated action in the MERS system"
                        },
                        "snapdocs_action": {
                          "type": "string",
                          "example": "add_document_to_mers_reversal",
                          "description": "the action executed"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      },
                      "nullable": true,
                      "description": "the validation error, keyed by the parameter at fault, plus a fixed `code` keyword. Observed bodies:\n- {\"mers\": \"is required\"}: the `mers` object is missing\n- {\"min_number\": \"is required\", \"code\": \"bad_request\"}\n- {\"document\": \"No matching supplemental document to reverse\", \"code\": \"bad_request\"}\n- {\"document\": \"Document is locked\", \"code\": \"document_locked\"}\n- {\"document\": \"Document not active\", \"code\": \"package_invalid\"}\n- {\"permissions\": \"you do not hold a right to change this document\", \"code\": \"rights_missing\"}\n- when MERS rejected the action, the service error with `data` alongside (e.g. {\"document\": \"<reason>\"})\n",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "bad_request",
                            "document_locked",
                            "package_invalid",
                            "rights_missing"
                          ]
                        }
                      },
                      "example": {
                        "document": "No matching supplemental document to reverse",
                        "code": "bad_request"
                      }
                    },
                    "data": {
                      "description": "only present when the MERS action was attempted and rejected; has no `id`",
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/mers_action_data"
                        }
                      ],
                      "properties": {
                        "file_name": {
                          "type": "string",
                          "example": "note_addendum.pdf"
                        },
                        "document_type": {
                          "type": "string",
                          "example": "NoteAddendum"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: authentication is missing or invalid"
          },
          "403": {
            "description": "forbidden: your role does not allow to proceed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/insufficient_scope_error"
                }
              }
            }
          },
          "404": {
            "description": "not found: no stored and sealed document with this MIN exists in your eVault",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/not_found_error"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mers": {
                    "type": "object",
                    "required": [
                      "min_number"
                    ],
                    "properties": {
                      "min_number": {
                        "type": "string",
                        "description": "MERS MIN number associated with the eNote",
                        "example": "999938091211784532"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/mers_actions/{id}": {
      "get": {
        "summary": "Get details on any MERS action",
        "tags": [
          "MERS Actions"
        ],
        "description": "Use this endpoint to get details on any MERS action (transfer, edelivery, change_data, change_status, check_connection, inquiry, registration) with a given id. The shape of `data.attributes` depends on the type of action; `data.mers_action` and `data.snapdocs_action` say which. Only available to apps, not to users.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "5279e4ca-cd04-49b3-9863-d94e9acc35fe",
              "description": "the unique identifier for the MERS action (transmission)"
            }
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/transfer_attributes"
                        },
                        {
                          "$ref": "#/components/schemas/mers_action_envelope"
                        }
                      ]
                    },
                    {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/edelivery_attributes"
                        },
                        {
                          "$ref": "#/components/schemas/mers_action_envelope"
                        }
                      ]
                    },
                    {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/change_data_attributes"
                        },
                        {
                          "$ref": "#/components/schemas/mers_action_envelope"
                        }
                      ]
                    },
                    {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/change_status_attributes"
                        },
                        {
                          "$ref": "#/components/schemas/mers_action_envelope"
                        }
                      ]
                    },
                    {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/inquiry_attributes"
                        },
                        {
                          "$ref": "#/components/schemas/mers_action_envelope"
                        }
                      ]
                    },
                    {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/registration_attributes"
                        },
                        {
                          "$ref": "#/components/schemas/mers_action_envelope"
                        }
                      ]
                    },
                    {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/check_connection_attributes"
                        },
                        {
                          "$ref": "#/components/schemas/mers_action_envelope"
                        }
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: authentication is missing or invalid"
          },
          "403": {
            "description": "forbidden: your role does not allow to proceed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Returned when the token lacks the `mers:basic` scope. A user (rather than an app) gets an empty body.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Insufficient Scope, a scope of mers:basic is required."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "not found: no MERS action with this id in the eVault (the body is `null`)"
          }
        }
      }
    },
    "/mers_actions/deactivation": {
      "post": {
        "summary": "Deactivate an eNote",
        "tags": [
          "Deactivation"
        ],
        "description": "Use this endpoint to deactivate an eNote record in MERS.\n\n\nThis action corresponds to MERS Change Status action types: ChargedOff, PaidOff, PaperReplacement, RegistrationReversal, or TransferredToProprietaryRegistry.\n\n\nThe eNote must be registered, active, and not locked.\n",
        "operationId": "deactivateEnote",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "202": {
            "description": "accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "example": "c2e67375-e923-4900-9131-75f90aa17eaa",
                          "description": "UUID of the created object"
                        },
                        "min_number": {
                          "type": "string",
                          "example": "999938091211784532",
                          "description": "MERS MIN number"
                        },
                        "document_id": {
                          "type": "string",
                          "format": "uuid",
                          "example": "c2e67375-e923-4900-9131-75f90aa17eaa",
                          "description": "UUID of the document"
                        },
                        "emortgage_package_id": {
                          "type": "string",
                          "format": "uuid",
                          "example": "c2e67375-e923-4900-9131-75f90aa17eaa",
                          "description": "UUID of the eMortgage package"
                        },
                        "mers_action": {
                          "type": "string",
                          "example": "change_status",
                          "description": "the associated action in the MERS system"
                        },
                        "snapdocs_action": {
                          "type": "string",
                          "example": "deactivation",
                          "description": "the action executed"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      },
                      "description": "the validation error, keyed by the parameter at fault, plus a fixed `code` keyword. Observed bodies:\n- {\"mers\": \"is required\"}: the `mers` object is missing\n- {\"min_number\": \"is required\", \"code\": \"bad_request\"}\n- {\"action\": \"value not supported\", \"code\": \"bad_request\"}\n- {\"document\": \"Document is locked\", \"code\": \"document_locked\"}\n- {\"document\": \"Document not active\", \"code\": \"package_invalid\"}\n- {\"permissions\": \"you do not hold a right to change this document\", \"code\": \"rights_missing\"}\n- when MERS rejected the action, the service error with `data` alongside (e.g. {\"document\": \"<reason>\"})\n",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "bad_request",
                            "document_locked",
                            "package_invalid",
                            "rights_missing"
                          ]
                        }
                      },
                      "example": {
                        "action": "value not supported",
                        "code": "bad_request"
                      }
                    },
                    "data": {
                      "description": "only present when the MERS action was attempted and rejected; has no `id`",
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/mers_action_data"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: authentication is missing or invalid"
          },
          "403": {
            "description": "forbidden: your role does not allow to proceed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/insufficient_scope_error"
                }
              }
            }
          },
          "404": {
            "description": "not found: no stored and sealed document with this MIN exists in your eVault",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/not_found_error"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mers": {
                    "type": "object",
                    "required": [
                      "action",
                      "min_number"
                    ],
                    "properties": {
                      "action": {
                        "type": "string",
                        "description": "The deactivation action type",
                        "enum": [
                          "ChargedOff",
                          "PaidOff",
                          "PaperReplacement",
                          "RegistrationReversal",
                          "TransferredToProprietaryRegistry"
                        ],
                        "example": "ChargedOff"
                      },
                      "min_number": {
                        "type": "string",
                        "description": "MERS MIN number associated with the eNote",
                        "example": "999938091211784532"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/mers_actions/deactivation_reversal": {
      "post": {
        "summary": "Reverse a deactivation on an eNote",
        "tags": [
          "Deactivation"
        ],
        "description": "Use this endpoint to reverse a deactivation on an eNote record in MERS.\n\n\n\nThis action corresponds to MERS Change Status action types: ChargedOffReversal, PaidOffReversal, PaperReplacementReversal, or TransferredToProprietaryRegistryReversal.\n\n\n\nThe eNote must be registered, deactivated (not active), and stored and sealed.\n\n\n\nNote: If the eNote was deactivated due to a RegistrationReversal, you must use the registration endpoint instead.\n",
        "operationId": "reverseEnoteDeactivation",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "202": {
            "description": "accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "example": "c2e67375-e923-4900-9131-75f90aa17eaa",
                          "description": "UUID of the created object"
                        },
                        "min_number": {
                          "type": "string",
                          "example": "999938091211784532",
                          "description": "MERS MIN number"
                        },
                        "document_id": {
                          "type": "string",
                          "format": "uuid",
                          "example": "c2e67375-e923-4900-9131-75f90aa17eaa",
                          "description": "UUID of the document"
                        },
                        "emortgage_package_id": {
                          "type": "string",
                          "format": "uuid",
                          "example": "c2e67375-e923-4900-9131-75f90aa17eaa",
                          "description": "UUID of the eMortgage package"
                        },
                        "mers_action": {
                          "type": "string",
                          "example": "change_status",
                          "description": "the associated action in the MERS system"
                        },
                        "snapdocs_action": {
                          "type": "string",
                          "example": "deactivation_reversal",
                          "description": "the action executed"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      },
                      "description": "the validation error, keyed by the parameter at fault, plus a fixed `code` keyword. Observed bodies:\n- {\"mers\": \"is required\"}: the `mers` object is missing\n- {\"min_number\": \"is required\", \"code\": \"bad_request\"}\n- {\"action\": \"value not supported\", \"code\": \"bad_request\"}\n- {\"document\": \"Document is locked\", \"code\": \"document_locked\"}\n- {\"document\": \"Document is active\", \"code\": \"package_invalid\"}\n- {\"document\": \"Document was deactivated due to registration reversal. Please use the registration endpoint instead.\", \"code\": \"bad_request\"}\n- {\"action\": \"Document was deactivated with <deactivation type>, cannot reverse with <action>\", \"code\": \"bad_request\"}\n- {\"permissions\": \"you do not hold a right to change this document\", \"code\": \"rights_missing\"}\n- when MERS rejected the action, the service error with `data` alongside (e.g. {\"document\": \"<reason>\"})\n",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "bad_request",
                            "document_locked",
                            "package_invalid",
                            "rights_missing"
                          ]
                        }
                      },
                      "example": {
                        "document": "Document is active",
                        "code": "package_invalid"
                      }
                    },
                    "data": {
                      "description": "only present when the MERS action was attempted and rejected; has no `id`",
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/mers_action_data"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: authentication is missing or invalid"
          },
          "403": {
            "description": "forbidden: your role does not allow to proceed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/insufficient_scope_error"
                }
              }
            }
          },
          "404": {
            "description": "not found: no stored and sealed document with this MIN exists in your eVault",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/not_found_error"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mers": {
                    "type": "object",
                    "required": [
                      "action",
                      "min_number"
                    ],
                    "properties": {
                      "action": {
                        "type": "string",
                        "description": "The deactivation reversal action type",
                        "enum": [
                          "ChargedOffReversal",
                          "PaidOffReversal",
                          "PaperReplacementReversal",
                          "TransferredToProprietaryRegistryReversal"
                        ],
                        "example": "ChargedOffReversal"
                      },
                      "min_number": {
                        "type": "string",
                        "description": "MERS MIN number associated with the eNote",
                        "example": "999938091211784532"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/mers_actions/assumption_reversal": {
      "post": {
        "summary": "Reverse an assumption on an eNote",
        "tags": [
          "Assumption"
        ],
        "description": "Use this endpoint to reverse an assumption on an eNote record in MERS.\n\nThis action corresponds to the MERS Change Status action type: AssumptionReversal.\n\nThe eNote must be registered, active and not locked.\n\n",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "202": {
            "description": "accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "example": "c2e67375-e923-4900-9131-75f90aa17eaa",
                          "description": "UUID of the created object"
                        },
                        "min_number": {
                          "type": "string",
                          "example": "999938091211784532",
                          "description": "MERS MIN number"
                        },
                        "document_id": {
                          "type": "string",
                          "format": "uuid",
                          "example": "c2e67375-e923-4900-9131-75f90aa17eaa",
                          "description": "UUID of the document"
                        },
                        "emortgage_package_id": {
                          "type": "string",
                          "format": "uuid",
                          "example": "c2e67375-e923-4900-9131-75f90aa17eaa",
                          "description": "UUID of the eMortgage package"
                        },
                        "mers_action": {
                          "type": "string",
                          "example": "change_status",
                          "description": "the associated action in the MERS system"
                        },
                        "snapdocs_action": {
                          "type": "string",
                          "example": "assumption_reversal",
                          "description": "the action executed"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      },
                      "description": "the validation error, keyed by the parameter at fault, plus a fixed `code` keyword. Observed bodies:\n- {\"mers\": \"is required\"}: the `mers` object is missing\n- {\"min_number\": \"is required\", \"code\": \"bad_request\"}\n- {\"document\": \"Document is locked\", \"code\": \"document_locked\"}\n- {\"document\": \"Document not active\", \"code\": \"package_invalid\"}\n- {\"permissions\": \"you do not hold a right to change this document\", \"code\": \"rights_missing\"}\n- when MERS rejected the action, the service error with `data` alongside (e.g. {\"document\": \"<reason>\"})\n",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "bad_request",
                            "document_locked",
                            "package_invalid",
                            "rights_missing"
                          ]
                        }
                      },
                      "example": {
                        "document": "Document is locked",
                        "code": "document_locked"
                      }
                    },
                    "data": {
                      "description": "only present when the MERS action was attempted and rejected; has no `id`",
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/mers_action_data"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: authentication is missing or invalid"
          },
          "403": {
            "description": "forbidden: your role does not allow to proceed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/insufficient_scope_error"
                }
              }
            }
          },
          "404": {
            "description": "not found: no stored and sealed document with this MIN exists in your eVault",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/not_found_error"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mers": {
                    "type": "object",
                    "required": [
                      "min_number"
                    ],
                    "properties": {
                      "min_number": {
                        "type": "string",
                        "description": "MERS MIN number associated with the eNote",
                        "example": "999938091211784532"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/mers_actions/modification_reversal": {
      "post": {
        "summary": "Reverse a modification on an eNote",
        "tags": [
          "Add Document"
        ],
        "description": "Use this endpoint to reverse a modification on an eNote record in MERS.\n\n\nThis action corresponds to the MERS Change Status action type: ModificationReversal.\n\n\nThe eNote must be registered, active, and have the loan modification indicator set to true.\n\n\n**Automatic Document Reversal:**\n\nIf the eNote has a supplemental document, this endpoint will automatically attempt to reverse it (DocumentReversal action).\n\n\n**Important:** If the modification reversal succeeds but the automatic document reversal fails, the response status is 400: `data` still contains the successful modification reversal record (first element) followed by the failed document reversal record (null `id`), and `errors` describes the document reversal failure. Pass `add_document_reversal: false` to skip the document reversal.\n",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "202": {
            "description": "accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "example": "c2e67375-e923-4900-9131-75f90aa17eaa",
                            "description": "UUID of the created object"
                          },
                          "min_number": {
                            "type": "string",
                            "example": "999938091211784532",
                            "description": "MERS MIN number associated with the eNote"
                          },
                          "document_id": {
                            "type": "string",
                            "format": "uuid",
                            "example": "c2e67375-e923-4900-9131-75f90aa17eaa",
                            "description": "UUID of the document"
                          },
                          "emortgage_package_id": {
                            "type": "string",
                            "format": "uuid",
                            "example": "c2e67375-e923-4900-9131-75f90aa17eaa",
                            "description": "UUID of the eMortgage package"
                          },
                          "file_name": {
                            "type": "string",
                            "example": "supplemental_doc.pdf",
                            "description": "File name of supplemental document (only in document reversal result)"
                          },
                          "document_type": {
                            "type": "string",
                            "example": "NoteAddendum",
                            "description": "Document type (only in document reversal result)"
                          },
                          "mers_action": {
                            "type": "string",
                            "example": "change_status",
                            "description": "the associated action in the MERS system"
                          },
                          "snapdocs_action": {
                            "type": "string",
                            "example": "modification_reversal",
                            "description": "the action executed"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      },
                      "description": "the validation error, keyed by the parameter at fault, plus a fixed `code` keyword. Observed bodies:\n- {\"mers\": \"is required\"}: the `mers` object is missing\n- {\"min_number\": \"is required\", \"code\": \"bad_request\"}\n- {\"document\": \"Document is locked\", \"code\": \"document_locked\"}\n- {\"document\": \"Document not active\", \"code\": \"package_invalid\"}\n- {\"document\": \"Modification indicator is not set\", \"code\": \"bad_request\"}\n- {\"permissions\": \"you do not hold a right to change this document\", \"code\": \"rights_missing\"}\n- when MERS rejected the modification reversal or the automatic document reversal, the service error with `data` alongside (e.g. {\"document\": \"<reason>\"})\n",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "bad_request",
                            "document_locked",
                            "package_invalid",
                            "rights_missing"
                          ]
                        }
                      },
                      "example": {
                        "document": "Modification indicator is not set",
                        "code": "bad_request"
                      }
                    },
                    "data": {
                      "type": "array",
                      "description": "only present when a MERS action was attempted: the modification_reversal record (with its `id` when it succeeded) and, if the modification reversal succeeded but the automatic document reversal failed, the add_document_to_mers_reversal record with a null `id`",
                      "items": {
                        "allOf": [
                          {
                            "$ref": "#/components/schemas/mers_action_data"
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: authentication is missing or invalid"
          },
          "403": {
            "description": "forbidden: your role does not allow to proceed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/insufficient_scope_error"
                }
              }
            }
          },
          "404": {
            "description": "not found: no stored and sealed document with this MIN exists in your eVault",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/not_found_error"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mers": {
                    "type": "object",
                    "required": [
                      "min_number"
                    ],
                    "properties": {
                      "min_number": {
                        "type": "string",
                        "description": "MERS MIN number associated with the eNote",
                        "example": "999938091211784532"
                      },
                      "add_document_reversal": {
                        "type": "boolean",
                        "description": "Whether to also execute document reversal if a supplemental document exists (defaults to true)",
                        "example": true
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/mers_actions/change_partner": {
      "post": {
        "summary": "Update an eNote partner through a Change Data",
        "tags": [
          "Data Change"
        ],
        "description": "Use this endpoint to update a single partner on an eNote record in MERS through a Change Data request.\n\nThe eNote must be registered, active and not locked, and your eVault must hold the rights required by the action.\n\n",
        "parameters": [],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "202": {
            "description": "accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "example": "c2e67375-e923-4900-9131-75f90aa17eaa",
                          "description": "UUID of the created Change Data"
                        },
                        "min_number": {
                          "type": "string",
                          "example": "999938091211784532",
                          "description": "MERS MIN number"
                        },
                        "document_id": {
                          "type": "string",
                          "format": "uuid",
                          "example": "c2e67375-e923-4900-9131-75f90aa17eaa",
                          "description": "UUID of the document"
                        },
                        "emortgage_package_id": {
                          "type": "string",
                          "format": "uuid",
                          "example": "c2e67375-e923-4900-9131-75f90aa17eaa",
                          "description": "UUID of the eMortgage package"
                        },
                        "mers_action": {
                          "type": "string",
                          "example": "change_data",
                          "description": "the associated action in the MERS system"
                        },
                        "snapdocs_action": {
                          "type": "string",
                          "example": "change_partner",
                          "description": "the action executed"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad request"
          },
          "403": {
            "description": "forbidden: your role does not allow to proceed"
          },
          "404": {
            "description": "not found: document not found"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mers": {
                    "type": "object",
                    "required": [
                      "min_number",
                      "action"
                    ],
                    "properties": {
                      "min_number": {
                        "type": "string",
                        "description": "MERS MIN number associated with the eNote",
                        "example": "999938091211784532"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "AddDelegateeForTransfers",
                          "ReleaseDelegateeForTransfers",
                          "AddMasterServicer",
                          "ReleaseSubservicer",
                          "AddSecuredPartyDelegatee",
                          "ReleaseSecuredPartyDelegatee",
                          "AddSecuredParty",
                          "ReleaseSecuredParty",
                          "ReverseSecuredParty"
                        ],
                        "description": "the action to take on the eNote\n- 'AddDelegateeForTransfers': add or update the delegatee for transfers, delegatee_for_transfers_org_id must be provided\n- 'ReleaseDelegateeForTransfers': remove the existing delegatee for transfers\n- 'AddMasterServicer': update the existing master servicer, master_servicer_org_id must be provided\n- 'ReleaseSubservicer': remove the existing subservicer, to add a subservicer use a transfer\n- 'AddSecuredPartyDelegatee': add or update the secured party delegatee, secured_party_delegatee_org_id must be provided\n- 'ReleaseSecuredPartyDelegatee': remove the existing secured party delegatee\n- 'AddSecuredParty': add a secured party, secured_party_org_id must be provided\n- 'ReleaseSecuredParty': remove a Secured Party from an eNote Record when it no longer has an interest in the eNote\n- 'ReverseSecuredParty': reverse the erroneous addition of a Secured Party to an eNote Record\n"
                      },
                      "delegatee_for_transfers_org_id": {
                        "type": "string",
                        "description": "MERS identifier of the new Delegatee for Transfers, required if action is AddDelegateeForTransfers",
                        "example": "0000001"
                      },
                      "master_servicer_org_id": {
                        "type": "string",
                        "description": "MERS identifier of the new Master Servicer, required if action is AddMasterServicer",
                        "example": "0000001"
                      },
                      "secured_party_delegatee_org_id": {
                        "type": "string",
                        "description": "MERS identifier of the new Secured Party Delegatee, required if action is AddSecuredPartyDelegatee",
                        "example": "0000001"
                      },
                      "secured_party_org_id": {
                        "type": "string",
                        "description": "MERS identifier of the new Secured Party, required if action is AddSecuredParty",
                        "example": "0000001"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/reviewable_documents": {
      "post": {
        "summary": "Upload a new file to an eNote",
        "tags": [
          "Add Document"
        ],
        "description": "Use this endpoint to upload a new file that needs to be appended to an eNote",
        "parameters": [
          {
            "name": "min_number",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "999938091211784532",
              "description": "the MIN number of the eNote to append the file to"
            }
          },
          {
            "name": "document_type",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "NoteAddendum",
              "description": "MISMO type of the document being added (any DocumentSection::SUPPLEMENTAL_DOC_TYPES value except Other); it is not validated on upload but by add_document_to_mers / modification"
            }
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/reviewable_document"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "MIN number not valid",
                      "description": "error description, possible errors include:\n- no file provided\n- file must be smaller than 200 MB\n- MIN number not valid: no document with this MIN exists in your eVault\n- unable to upload file to quarantine storage\n"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: authentication is missing or invalid"
          },
          "403": {
            "description": "forbidden: your role does not allow to proceed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/insufficient_scope_error"
                }
              }
            }
          },
          "422": {
            "description": "unprocessable entity: the virus scan failed or the file was not saved properly",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "File is unsafe",
                      "description": "error description, possible errors include:\n- File is unsafe: the virus scan failed\n- Unable to process file: the file could not be stored\n"
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "the file content"
                  }
                }
              }
            }
          },
          "required": true
        }
      }
    },
    "/transfers/{transfer_id}": {
      "get": {
        "summary": "Get details on a transfer",
        "tags": [
          "Transfer and eDelivery"
        ],
        "description": "Use this endpoint to get details on a transfer with a given id",
        "parameters": [
          {
            "name": "transfer_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "5279e4ca-cd04-49b3-9863-d94e9acc35fe",
              "description": "the unique identifier for the transfer"
            }
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/transfer_attributes"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: authentication is missing or invalid"
          },
          "403": {
            "description": "forbidden: your role does not allow to proceed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Returned when the token lacks the `mers:basic` scope. A user without the view permission gets the bare string `\"Forbidden\"` instead.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Insufficient Scope, a scope of mers:basic is required."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "not found: no transfer with this id in the eVault (the body is `null`)"
          }
        }
      }
    },
    "/transfers/{transfer_id}/cancel": {
      "post": {
        "summary": "Cancel a pending transfer",
        "tags": [
          "Transfer and eDelivery"
        ],
        "description": "Use this endpoint to cancel an outbound transfer in progress",
        "parameters": [
          {
            "name": "transfer_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "5279e4ca-cd04-49b3-9863-d94e9acc35fe",
              "description": "the unique identifier for the transfer"
            }
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "202": {
            "description": "accepted (empty body)"
          },
          "400": {
            "description": "bad request: the transfer cannot be cancelled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      },
                      "description": "the reason the cancellation was rejected, keyed by the field at fault. Observed bodies:\n- {\"mers_transfer_identifier\": \"required\"}: MERS has not yet assigned a tracking identifier to the transfer, retry later\n- {\"doc_info\": \"required\"}: the transfer has no documents\n- {\"action_type\": \"value not supported\"}: the transfer's action type cannot be cancelled\n",
                      "example": {
                        "mers_transfer_identifier": "required"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: authentication is missing or invalid"
          },
          "403": {
            "description": "forbidden: your role does not allow to proceed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/insufficient_scope_error"
                }
              }
            }
          },
          "404": {
            "description": "not found: record not found (empty body)"
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://demo.snapdocsevault.com/api",
      "description": "Snapdocs Evault demo environment"
    },
    {
      "url": "https://www.snapdocsevault.com/api",
      "description": "Snapdocs Evault production environment"
    }
  ],
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "insufficient_scope_error": {
        "type": "object",
        "description": "returned when the bearer token does not carry the scope required by the endpoint",
        "properties": {
          "error": {
            "type": "string",
            "example": "Insufficient Scope, a scope of mers:basic is required."
          }
        }
      },
      "not_found_error": {
        "type": "object",
        "properties": {
          "errors": {
            "type": "object",
            "properties": {
              "min_number": {
                "type": "string",
                "example": "not found"
              },
              "code": {
                "type": "string",
                "enum": [
                  "not_found"
                ],
                "example": "not_found"
              }
            }
          }
        }
      },
      "mers_action_data": {
        "type": "object",
        "description": "identifies the eNote and the action taken; on a failed request `id` is absent or null",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "example": "c2e67375-e923-4900-9131-75f90aa17eaa",
            "description": "UUID of the created MERS action (transmission)"
          },
          "min_number": {
            "type": "string",
            "example": "999938091211784532",
            "description": "MERS MIN number of the eNote"
          },
          "document_id": {
            "type": "string",
            "format": "uuid",
            "example": "c2e67375-e923-4900-9131-75f90aa17eaa",
            "description": "UUID of the document"
          },
          "emortgage_package_id": {
            "type": "string",
            "format": "uuid",
            "example": "c2e67375-e923-4900-9131-75f90aa17eaa",
            "description": "UUID of the eMortgage package (current version of the eNote)"
          },
          "mers_action": {
            "type": "string",
            "example": "change_status",
            "description": "the associated action in the MERS system"
          },
          "snapdocs_action": {
            "type": "string",
            "example": "deactivation",
            "description": "the action executed"
          }
        }
      },
      "bulk_change_partners_payload": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "action"
              ],
              "anyOf": [
                {
                  "required": [
                    "min_number"
                  ]
                },
                {
                  "required": [
                    "emortgage_package_id"
                  ]
                }
              ],
              "description": "provide either min_number or emortgage_package_id to identify the eNote",
              "properties": {
                "min_number": {
                  "type": "string",
                  "description": "The MIN number of the document; provide this or emortgage_package_id",
                  "example": "999938068729325206"
                },
                "emortgage_package_id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "The ID of the primary emortgage package of the document; provide this or min_number",
                  "example": "6cd9d939-f24e-44e7-88aa-b861599e0729"
                },
                "action": {
                  "type": "string",
                  "enum": [
                    "AddDelegateeForTransfers",
                    "ReleaseDelegateeForTransfers",
                    "AddMasterServicer",
                    "ReleaseSubservicer",
                    "AddSecuredParty",
                    "ReverseSecuredParty",
                    "ReleaseSecuredParty",
                    "AddSecuredPartyDelegatee",
                    "ReleaseSecuredPartyDelegatee"
                  ],
                  "description": "the action to take on the document\n- 'AddDelegateeForTransfers': add or update the delegatee for transfers, the new delegatee for transfers org ID must be provided\n- 'ReleaseDelegateeForTransfers': remove the existing delegatee for transfers\n- 'AddMasterServicer': update the existing master servicer\n- 'ReleaseSubservicer': remove the existing subservicer, to add a subservicer use a transfer\n- 'AddSecuredParty': add a secured party, the new secured party org ID must be provided\n- 'ReverseSecuredParty': reverse the erroneous addition of a Secured Party to an eNote Record\n- 'ReleaseSecuredParty': remove a Secured Party from an eNote Record when it no longer has an interest in the eNote\n- 'AddSecuredPartyDelegatee': add or update the secured party delegatee, the new secured party delegatee org ID must be provided\n- 'ReleaseSecuredPartyDelegatee': remove the existing secured party delegatee\n"
                },
                "delegatee_for_transfers_org_id": {
                  "type": "string",
                  "description": "MERS identifier of the organization to change Delegatee for Transfers to, required if action is AddDelegateeForTransfers",
                  "example": "0000001"
                },
                "master_servicer_org_id": {
                  "type": "string",
                  "description": "MERS identifier of the organization to change Master Servicer to, required if action is AddMasterServicer",
                  "example": "0000001"
                },
                "secured_party_org_id": {
                  "type": "string",
                  "description": "MERS identifier of the organization to change Secured Party to, required if action is AddSecuredParty",
                  "example": "0000001"
                },
                "secured_party_delegatee_org_id": {
                  "type": "string",
                  "description": "MERS identifier of the organization to change Secured Party Delegatee to, required if action is AddSecuredPartyDelegatee",
                  "example": "0000001"
                }
              }
            }
          }
        }
      },
      "bulk_change_partners_response": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "description": "one result per element of the request `data` array, in the same order; the request returns 200 even when every row failed, so check each row for `errors`",
            "items": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "object",
                  "properties": {
                    "change_data_id": {
                      "type": "string",
                      "nullable": true,
                      "description": "The ID of the change data object created for this request for this document, null if the row failed",
                      "example": "cf6751e1-881a-4c52-9ae8-9b713a2293ae"
                    },
                    "min_number": {
                      "type": "string",
                      "description": "The MIN number of the document",
                      "example": "999938068729325206"
                    },
                    "emortgage_package_id": {
                      "type": "string",
                      "description": "The ID of the emortgage package the change was made on",
                      "example": "6cd9d939-f24e-44e7-88aa-b861599e0729"
                    },
                    "document_id": {
                      "type": "string",
                      "description": "The ID of the document eh change was made on",
                      "example": "2400b487-c54e-46cf-9825-5d56ed8d3250"
                    }
                  }
                },
                "errors": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A description of the error"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "document_not_found",
                        "package_invalid",
                        "document_locked",
                        "bad_request",
                        "rights_missing"
                      ],
                      "description": "a fixed keyword associated with the error type: - 'document_not_found': the document with this MIN was not found in the evault - 'package_invalid': attempted to change data on a document / emortgage package that is not in a valid state - 'document_locked': the document is locked due to a convert to paper or certified print action being taken on it - 'bad_request': the set of parameters provided is not valid - 'rights_missing': attempted to change rights holders on a document that the eVault is not permitted to"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "bulk_transfer_payload": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "min_number",
                "partner_name"
              ],
              "properties": {
                "min_number": {
                  "type": "string",
                  "description": "The MIN number of the document to transfer",
                  "example": "999938068729325206"
                },
                "partner_name": {
                  "type": "string",
                  "description": "The partner name associated with the pre-configured Bulk Transfer Mapping"
                }
              }
            }
          }
        }
      },
      "bulk_transfer_response": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "The ID of the bulk transfer object",
                "example": "cf6751e1-881a-4c52-9ae8-9b713a2293ae"
              },
              "success": {
                "type": "boolean",
                "description": "whether the bulk transfer was initiated"
              },
              "transfer_metrics": {
                "type": "object",
                "properties": {
                  "total_count": {
                    "type": "integer",
                    "description": "how many transfer requests were received",
                    "example": 2
                  },
                  "valid_count": {
                    "type": "integer",
                    "description": "how many transfer requests were valid and processed",
                    "example": 1
                  },
                  "partners_for_transfer": {
                    "type": "array",
                    "description": "number of valid transfer requests per partner",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "description": "The partner name provided in the input",
                          "example": "Example Partner"
                        },
                        "count": {
                          "type": "integer",
                          "description": "how many valid transfer requests target this partner",
                          "example": 1
                        }
                      }
                    }
                  }
                }
              },
              "validation_errors": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "index": {
                      "type": "integer",
                      "description": "the index of the element in the payload data array that causes the error",
                      "example": 2
                    },
                    "min_number": {
                      "type": "string",
                      "description": "The MIN number provided in the input",
                      "example": "999938068729325206"
                    },
                    "partner_name": {
                      "type": "string",
                      "description": "The partner name provided in the input",
                      "example": "Example Partner"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "example": "No document exists with MIN number 999938068729325206",
                        "description": "a list of validation errors, possible validation errors include:\n- 'No document exists with MIN number <min number>': the MIN was not found in the eVault or can not be transferred (for example if the document is not registered with MERS)\n- 'Bulk Transfer preference does not exist for Partner Name: <partner name>': the partner name provided does not exist in the eVault (mapping is not set in Lender Preferences)\n"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "edeliver_payload": {
        "type": "object",
        "properties": {
          "mers": {
            "type": "object",
            "required": [
              "recipient_org_id"
            ],
            "anyOf": [
              {
                "required": [
                  "emortgage_package_id"
                ]
              },
              {
                "required": [
                  "min_number"
                ]
              }
            ],
            "description": "provide either emortgage_package_id or min_number to identify the eNote",
            "properties": {
              "emortgage_package_id": {
                "type": "string",
                "format": "uuid",
                "example": "02c0c641-f646-4c98-8879-87de6f91e375",
                "description": "id of the emortgage package to eDeliver; provide this or min_number"
              },
              "min_number": {
                "type": "string",
                "example": "100285647820008811",
                "description": "MIN of the document to eDeliver; provide this or emortgage_package_id"
              },
              "recipient_org_id": {
                "type": "string",
                "description": "MERS identifier of the organization to eDeliver to",
                "example": "0000001"
              }
            }
          }
        }
      },
      "edeliver_response": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "edelivery_id": {
                "type": "string",
                "format": "uuid",
                "description": "id of the created eDelivery",
                "example": "26a10d0a-a933-4a9e-afe6-ac5be3db9859"
              },
              "document_id": {
                "type": "string",
                "format": "uuid",
                "description": "id of the associated eDelivered document",
                "example": "4d124b5b-cf5f-44e5-a8fc-e9cc386b2835"
              },
              "emortgage_package_id": {
                "type": "string",
                "format": "uuid",
                "description": "id of the associated eDelivered emortgage package",
                "example": "cd7fd7e6-220e-4308-993b-01c90967014b"
              }
            }
          }
        }
      },
      "transfer_payload": {
        "type": "object",
        "properties": {
          "mers": {
            "type": "object",
            "anyOf": [
              {
                "required": [
                  "emortgage_package_id"
                ]
              },
              {
                "required": [
                  "min_number"
                ]
              }
            ],
            "description": "provide either emortgage_package_id or min_number to identify the eNote, and at least one transfer_to_*_org_id; the set of transfer_to_* fields provided must map to a MERS transfer type, otherwise the request fails with code combination_invalid",
            "properties": {
              "emortgage_package_id": {
                "type": "string",
                "format": "uuid",
                "example": "02c0c641-f646-4c98-8879-87de6f91e375",
                "description": "id of the emortgage package (version of the document) to transfer; provide this or min_number"
              },
              "min_number": {
                "type": "string",
                "example": "100285647820008811",
                "description": "MIN of the document to transfer; provide this or emortgage_package_id"
              },
              "edeliver": {
                "type": "boolean",
                "default": false,
                "example": true,
                "description": "whether to additionally edeliver an eNote copy to each receiving partner (partners with eDelivery disabled are skipped)"
              },
              "effective_date": {
                "type": "string",
                "format": "date-time",
                "description": "optional: date when the transfer is to be effective (defaults to today); must be between today and 30 days in the future",
                "example": "2023-07-31T00:00:00Z"
              },
              "transfer_to_controller_org_id": {
                "type": "string",
                "description": "MERS identifier of the organization to transfer Controller to",
                "example": "0000001"
              },
              "transfer_to_location_org_id": {
                "type": "string",
                "description": "MERS identifier of the organization to transfer Location to",
                "example": "0000001"
              },
              "transfer_to_delegatee_org_id": {
                "type": "string",
                "description": "MERS identifier of the organization to transfer Master Servicer to (deprecated, use transfer_to_master_servicer_org_id instead)",
                "example": "0000001"
              },
              "transfer_to_master_servicer_org_id": {
                "type": "string",
                "description": "MERS identifier of the organization to transfer Master Servicer to",
                "example": "0000001"
              },
              "transfer_to_subservicer_org_id": {
                "type": "string",
                "description": "MERS identifier of the organization to transfer Subservicer to; only valid together with transfer_to_master_servicer_org_id (or transfer_to_delegatee_org_id)",
                "example": "0000001"
              },
              "transfer_to_delegatee_for_transfers_org_id": {
                "type": "string",
                "description": "MERS identifier of the organization to transfer Delegatee for Transfers to",
                "example": "0000001"
              },
              "transfer_to_secured_party_org_id": {
                "type": "string",
                "description": "MERS identifier of the organization to transfer Secured Party to",
                "example": "0000001"
              },
              "transfer_to_secured_party_delegatee_org_id": {
                "type": "string",
                "description": "MERS identifier of the organization to transfer Secured Party Delegatee to",
                "example": "0000001"
              }
            }
          }
        }
      },
      "transfer_response": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "transfer_id": {
                "type": "string",
                "format": "uuid",
                "description": "id of the created transfer",
                "example": "26a10d0a-a933-4a9e-afe6-ac5be3db9859"
              },
              "document_id": {
                "type": "string",
                "format": "uuid",
                "description": "id of the associated transferred document",
                "example": "4d124b5b-cf5f-44e5-a8fc-e9cc386b2835"
              },
              "emortgage_package_id": {
                "type": "string",
                "format": "uuid",
                "description": "id of the associated transferred emortgage package",
                "example": "cd7fd7e6-220e-4308-993b-01c90967014b"
              },
              "edeliveries": {
                "type": "array",
                "description": "only present when `edeliver` was true; one entry per receiving partner (partners with eDelivery disabled are skipped)",
                "items": {
                  "type": "object",
                  "properties": {
                    "org_id": {
                      "type": "string",
                      "description": "MERS organization identifier of recipient of the eDelivery",
                      "example": "0000001"
                    },
                    "edelivery_id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "id of the created edelivery; absent when the eDelivery failed",
                      "example": "90d0c0c4-3e57-45f8-a7de-b90aa12c74e7"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      },
                      "description": "only present when the eDelivery to this partner failed (e.g. recipients: [\"0000001\"] invalid); the transfer itself still succeeded"
                    }
                  }
                }
              }
            }
          },
          "errors": {
            "type": "object",
            "description": "always an empty object on success",
            "example": {}
          }
        }
      },
      "transfer_attributes": {
        "title": "Transfer",
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "example": "29af140e-f250-4574-b6f4-f8aad2179b61",
                "description": "The transfer id"
              },
              "type": {
                "type": "string",
                "example": "transfers",
                "description": "The type of object"
              },
              "attributes": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "example": "Transfer",
                    "description": "The type of MERS action"
                  },
                  "created_at": {
                    "type": "string",
                    "example": "2023-07-31T21:18:27.669Z",
                    "format": "date-time",
                    "description": "time the transfer was created"
                  },
                  "updated_at": {
                    "type": "string",
                    "example": "2023-07-31T21:18:29.000Z",
                    "format": "date-time",
                    "description": "time the transfer was last updated"
                  },
                  "hidden_at": {
                    "type": "string",
                    "nullable": true,
                    "example": null,
                    "format": "date-time",
                    "description": "time the transfer was hidden from the eVault MERS activity list, null while it is still shown"
                  },
                  "direction": {
                    "type": "string",
                    "example": "outbound",
                    "description": "indicates if the transfer was initiated (outbound) or received (inbound)",
                    "enum": [
                      "outbound",
                      "inbound"
                    ]
                  },
                  "display_loan_number": {
                    "type": "string",
                    "description": "The loan number of the document. Use for display only: `--` when the transfer has no document or the value is unknown, `Multiple (N)` when it covers N documents."
                  },
                  "display_min_number": {
                    "type": "string",
                    "description": "The MIN number of the document. Use for display only: `--` when the transfer has no document, `Multiple (N)` when it covers N documents.",
                    "example": "999938068729325206"
                  },
                  "display_primary_borrower_name": {
                    "type": "string",
                    "description": "The primary borrower name of the document. Use for display only: `--` when the transfer has no document or the value is unknown, `Multiple (N)` when it covers N documents.",
                    "example": "Green"
                  },
                  "display_custom_data": {
                    "type": "object",
                    "description": "The document's custom field values keyed by the eVault's custom field names, with the same `--` / `Multiple (N)` conventions as the other display fields. Use for display only.",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "example": {
                      "Investor": "Example Investor"
                    }
                  },
                  "transmissions_documents_errors_count": {
                    "type": "integer",
                    "example": 0,
                    "description": "Number of document validation errors; always 0 for transfers"
                  },
                  "expires_at": {
                    "type": "string",
                    "nullable": true,
                    "example": "2023-08-01T01:00:00.000Z",
                    "description": "Date time at which the transfer expires (1 AM UTC the day after the effective date); null when the transfer has no effective date",
                    "format": "date-time"
                  },
                  "mers_received_at": {
                    "type": "string",
                    "example": "2023-07-31T21:18:29.000Z",
                    "format": "date-time",
                    "description": "Date time at which MERS received the transfer request"
                  },
                  "effective_date": {
                    "type": "string",
                    "example": "2023-07-31T00:00:00.000Z",
                    "format": "date-time",
                    "description": "time the transfer is effective"
                  },
                  "mers_tracking_identifier": {
                    "type": "string",
                    "example": "1350404",
                    "description": "The MERS transfer tracking ID"
                  },
                  "sender_name": {
                    "type": "string",
                    "example": "Partner1",
                    "description": "Organization that initiated the transfer. If the name of the organization is not known the MERS org ID is used instead."
                  },
                  "status": {
                    "type": "string",
                    "example": "initiated",
                    "enum": [
                      "initiated",
                      "pending_documents",
                      "can_accept_or_reject",
                      "no_rights_to_accept",
                      "processing_accept_or_reject",
                      "self_accepted",
                      "self_rejected",
                      "all_accepted",
                      "all_rejected",
                      "expired",
                      "canceled",
                      "mers_responded_failed",
                      "snapdocs_error",
                      "mers_disconnected"
                    ],
                    "description": "Current status of the transfer"
                  },
                  "display_status": {
                    "type": "string",
                    "example": "pending",
                    "description": "Simplified description of the transfer status: one of `accepted`, `blocked`, `expired`, `failed`, `pending`, `rejected` or `canceled`. A status with no simplified form (for example `mers_disconnected`) is returned as is."
                  },
                  "errors": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": "Description of an error causing the transfer to fail"
                    }
                  },
                  "transmissions_documents": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "min_number": {
                          "type": "string",
                          "description": "The MIN number of the document",
                          "example": "999938068729325206"
                        },
                        "document_id": {
                          "type": "string",
                          "description": "ID of the document being transferred when applicable, referencing a document object in the eVault"
                        },
                        "emortgage_package_id": {
                          "type": "string",
                          "description": "ID of the emortgage_package being transferred when applicable, referencing a version of the document object in the eVault"
                        }
                      }
                    }
                  },
                  "transmissions_organizations": {
                    "$ref": "#/components/schemas/transfer_transmissions_organizations"
                  },
                  "previous_right_holders": {
                    "description": "The rights holders of the transferred documents before the transfer, keyed by role. A role held by different organizations across the transfer's documents is returned as `{\"name\": \"Multiple (N)\"}` with no `mers_org`. Roles nobody held may be omitted rather than null.",
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/rights_holders"
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      },
      "edelivery_attributes": {
        "title": "eDelivery",
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "example": "29af140e-f250-4574-b6f4-f8aad2179b61",
                "description": "The eDelivery id"
              },
              "type": {
                "type": "string",
                "example": "edeliveries",
                "description": "The type of object"
              },
              "attributes": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "example": "Edelivery",
                    "description": "The type of MERS action"
                  },
                  "created_at": {
                    "type": "string",
                    "example": "2023-07-31T21:18:27.669Z",
                    "format": "date-time",
                    "description": "time the eDelivery was created"
                  },
                  "updated_at": {
                    "type": "string",
                    "example": "2023-07-31T21:18:29.000Z",
                    "format": "date-time",
                    "description": "time the eDelivery was last updated"
                  },
                  "hidden_at": {
                    "type": "string",
                    "nullable": true,
                    "example": null,
                    "format": "date-time",
                    "description": "time the eDelivery was hidden from the eVault MERS activity list, null while it is still shown"
                  },
                  "direction": {
                    "type": "string",
                    "example": "outbound",
                    "description": "indicates if the eDelivery was initiated (outbound) or received (inbound)",
                    "enum": [
                      "outbound",
                      "inbound"
                    ]
                  },
                  "display_loan_number": {
                    "type": "string",
                    "description": "The loan number of the document. Use for display only: `--` when the eDelivery has no document or the value is unknown, `Multiple (N)` when it covers N documents."
                  },
                  "display_min_number": {
                    "type": "string",
                    "description": "The MIN number of the document. Use for display only: `--` when the eDelivery has no document, `Multiple (N)` when it covers N documents.",
                    "example": "999938068729325206"
                  },
                  "display_primary_borrower_name": {
                    "type": "string",
                    "description": "The primary borrower name of the document. Use for display only: `--` when the eDelivery has no document or the value is unknown, `Multiple (N)` when it covers N documents.",
                    "example": "Green"
                  },
                  "display_custom_data": {
                    "type": "object",
                    "description": "The document's custom field values keyed by the eVault's custom field names, with the same `--` / `Multiple (N)` conventions as the other display fields. Use for display only.",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "example": {
                      "Investor": "Example Investor"
                    }
                  },
                  "expires_at": {
                    "type": "string",
                    "nullable": true,
                    "example": "2023-08-01T00:00:00.000Z",
                    "description": "Date time at which the eDelivery expires: 8 AM UTC the day after MERS received it while awaiting receipt confirmation, 30 days after while awaiting distribution approval; null in any other status",
                    "format": "date-time"
                  },
                  "mers_received_at": {
                    "type": "string",
                    "example": "2023-07-31T21:18:29.000Z",
                    "format": "date-time",
                    "description": "Date time at which MERS received the eDelivery request"
                  },
                  "mers_tracking_identifier": {
                    "type": "string",
                    "example": "1350404",
                    "description": "The MERS eDelivery tracking ID"
                  },
                  "sender_name": {
                    "type": "string",
                    "example": "Partner1",
                    "description": "Organization that initiated the eDelivery. If the name of the organization is not known the MERS org ID is used instead."
                  },
                  "status": {
                    "type": "string",
                    "example": "initiated",
                    "enum": [
                      "initiated",
                      "can_confirm_or_reject_receipt",
                      "confirming_or_rejecting_receipt",
                      "accepted_confirmation",
                      "rejected_confirmation",
                      "canceled_confirmation",
                      "confirmed_pending_distribution",
                      "distribution_validation_processing",
                      "distribution_has_blocking_validation_errors",
                      "can_accept_or_reject_distribution",
                      "accepting_or_rejecting_distribution",
                      "approved_distribution",
                      "disapproved_distribution",
                      "conditionally_approved_distribution",
                      "expired",
                      "mers_responded_failed",
                      "snapdocs_error",
                      "mers_disconnected"
                    ],
                    "description": "Current status of the eDelivery"
                  },
                  "display_status": {
                    "type": "string",
                    "example": "pending",
                    "description": "Simplified description of the eDelivery status: one of `accepted`, `blocked`, `expired`, `failed`, `pending`, `rejected` or `canceled`. A status with no simplified form (`canceled_confirmation`, `confirmed_pending_distribution`, `mers_disconnected`) is returned as is."
                  },
                  "errors": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": "Description of an error causing the eDelivery to fail"
                    }
                  },
                  "transmissions_documents_errors_count": {
                    "type": "integer",
                    "example": 0,
                    "description": "Total number of entries across `transmissions_documents_errors` and `critical_issues`"
                  },
                  "transmissions_documents_errors": {
                    "type": "object",
                    "description": "Validation errors found on the received documents, keyed by MIN",
                    "additionalProperties": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {
                      "999938068729325206": [
                        "Loan Number does not match"
                      ]
                    }
                  },
                  "critical_issues": {
                    "type": "object",
                    "description": "Issues that block accepting the received documents (for example a failed tamper seal or virus scan), keyed by MIN",
                    "additionalProperties": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {
                      "999938068729325206": [
                        "Tamper seal is invalid"
                      ]
                    }
                  },
                  "transmissions_documents": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "min_number": {
                          "type": "string",
                          "description": "The MIN number of the document",
                          "example": "999938068729325206"
                        },
                        "document_id": {
                          "type": "string",
                          "description": "ID of the document being eDelivered when applicable, referencing a document object in the eVault"
                        },
                        "emortgage_package_id": {
                          "type": "string",
                          "description": "ID of the emortgage_package being eDelivered when applicable, referencing a version of the document object in the eVault"
                        },
                        "has_reviewable_documents": {
                          "type": "boolean",
                          "example": false,
                          "description": "Whether files received alongside this document are available to review"
                        }
                      }
                    }
                  },
                  "transmissions_organizations": {
                    "type": "object",
                    "properties": {
                      "recipient": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/right_holder"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "inquiry_attributes": {
        "title": "Inquiry",
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "example": "0d6bb319-b4fd-44a6-8dbc-e0311fe5bf94",
                "description": "The inquiry ID"
              },
              "type": {
                "type": "string",
                "example": "inquiries",
                "description": "The type of object"
              },
              "attributes": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "initiated",
                      "complete",
                      "mers_responded_failed",
                      "snapdocs_error",
                      "mers_disconnected"
                    ],
                    "description": "The status of the inquiry:\n- 'initiated': the inquiry has been created and sent to MERS\n- 'complete': MERS has responded to the inquiry\n- 'mers_responded_failed': MERS has responded to the inquiry with an error\n- 'snapdocs_error': Snapdocs has encountered an error while processing the inquiry\n- 'mers_disconnected': the connection to MERS was lost before a response was received\n"
                  },
                  "mers_received_at": {
                    "type": "string",
                    "format": "date-time",
                    "nullable": true,
                    "description": "The time the inquiry was received by MERS, null until then"
                  },
                  "errors": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "condition": {
                          "type": "string",
                          "example": "Error",
                          "enum": [
                            "Error",
                            "Failed"
                          ],
                          "description": "Condition reported by MERS; only error conditions are included (`Failed` only for a rejected transfer), warnings are not"
                        },
                        "code": {
                          "type": "string",
                          "example": "5016",
                          "description": "Error code received from MERS, please refer to MERS documentation for more details"
                        },
                        "name": {
                          "type": "string",
                          "description": "Error name received from MERS, please refer to MERS documentation for more details"
                        },
                        "description": {
                          "type": "string",
                          "description": "Error description received from MERS, please refer to MERS documentation for more details"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "right_holder": {
        "type": "object",
        "properties": {
          "mers_org": {
            "type": "string",
            "description": "MERS identifier for the right holder; omitted when the entry stands for several organizations (`name` is then `Multiple (N)`)",
            "example": "0000001"
          },
          "name": {
            "type": "string",
            "description": "name of the right holder; the MERS org ID when the name is not known",
            "example": "Example Organization"
          }
        }
      },
      "rights_holders": {
        "type": "object",
        "properties": {
          "controller": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/right_holder"
              }
            ]
          },
          "location": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/right_holder"
              }
            ]
          },
          "master_servicer": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/right_holder"
              }
            ]
          },
          "subservicer": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/right_holder"
              }
            ]
          },
          "delegatee_for_transfers": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/right_holder"
              }
            ]
          },
          "secured_party": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/right_holder"
              }
            ]
          },
          "secured_party_delegatee": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/right_holder"
              }
            ]
          }
        }
      },
      "transfer_transmissions_organizations": {
        "type": "object",
        "description": "The organizations the transfer sends rights to, keyed by role. Only roles the transfer includes are present.",
        "properties": {
          "delegatee": {
            "type": "array",
            "description": "Legacy name for `master_servicer`, only present on older transfers",
            "items": {
              "$ref": "#/components/schemas/right_holder"
            }
          },
          "controller": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/right_holder"
            }
          },
          "location": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/right_holder"
            }
          },
          "master_servicer": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/right_holder"
            }
          },
          "subservicer": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/right_holder"
            }
          },
          "delegatee_for_transfers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/right_holder"
            }
          },
          "secured_party": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/right_holder"
            }
          },
          "secured_party_delegatee": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/right_holder"
            }
          }
        }
      },
      "reviewable_document": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "5279e4ca-cd04-49b3-9863-d94e9acc35fe",
            "description": "The reviewable document id"
          },
          "type": {
            "type": "string",
            "example": "reviewable_documents",
            "description": "The type of object"
          },
          "attributes": {
            "type": "object",
            "properties": {
              "min_number": {
                "type": "string",
                "description": "The MIN number of the eNote to append the file to",
                "example": "999938091211784532"
              },
              "document_type": {
                "type": "string",
                "description": "The document type",
                "example": "NoteAddendum"
              },
              "file_name": {
                "type": "string",
                "description": "The name of the file",
                "example": "document.pdf"
              },
              "file_type": {
                "type": "string",
                "description": "The type of the file",
                "example": "pdf"
              },
              "processable": {
                "type": "boolean",
                "description": "Whether the document can be used",
                "example": true
              },
              "validation_errors": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Issues found while validating the file; empty when the file is usable",
                "example": []
              }
            }
          }
        }
      },
      "add_document_payload": {
        "type": "object",
        "properties": {
          "mers": {
            "type": "object",
            "required": [
              "reviewable_document_id"
            ],
            "properties": {
              "reviewable_document_id": {
                "type": "string",
                "format": "uuid",
                "example": "02c0c641-f646-4c98-8879-87de6f91e375",
                "description": "id of the reviewable document to append to the eNote"
              }
            }
          }
        }
      },
      "add_document_response": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "change_data_id": {
                "type": "string",
                "format": "uuid",
                "example": "26a10d0a-a933-4a9e-afe6-ac5be3db9859",
                "description": "id of the created change data object"
              },
              "document_id": {
                "type": "string",
                "format": "uuid",
                "example": "4d124b5b-cf5f-44e5-a8fc-e9cc386b2835",
                "description": "id of the associated document (eNote)"
              }
            }
          },
          "errors": {
            "type": "object",
            "description": "always an empty object on success",
            "example": {}
          }
        }
      },
      "add_document_to_mers_payload": {
        "type": "object",
        "properties": {
          "mers": {
            "type": "object",
            "required": [
              "min_number",
              "reviewable_document_id"
            ],
            "properties": {
              "min_number": {
                "type": "string",
                "example": "999938029203623094",
                "description": "the MIN of the document (eNote)"
              },
              "reviewable_document_id": {
                "type": "string",
                "format": "uuid",
                "example": "02c0c641-f646-4c98-8879-87de6f91e375",
                "description": "id of the reviewable document to append to the eNote"
              }
            }
          }
        }
      },
      "add_document_to_mers_response": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "nullable": true,
                "example": "26a10d0a-a933-4a9e-afe6-ac5be3db9859",
                "description": "id of the created object, null if there was an error"
              },
              "min_number": {
                "type": "string",
                "example": "999938029203623094",
                "description": "the MIN of the document (eNote)"
              },
              "document_id": {
                "type": "string",
                "format": "uuid",
                "example": "4d124b5b-cf5f-44e5-a8fc-e9cc386b2835",
                "description": "id of the associated document (eNote)"
              },
              "emortgage_package_id": {
                "type": "string",
                "format": "uuid",
                "example": "a6114457-595c-4f45-818a-a7d4b3def565",
                "description": "the id of the associated emortgage package (current version of the eNote)"
              },
              "mers_action": {
                "type": "string",
                "example": "change_data",
                "description": "the associated action in the MERS system"
              },
              "snapdocs_action": {
                "type": "string",
                "example": "add_document_to_mers",
                "description": "the action executed"
              }
            }
          }
        }
      },
      "mers_action_modification_payload": {
        "type": "object",
        "properties": {
          "mers": {
            "type": "object",
            "required": [
              "min_number",
              "reviewable_document_id"
            ],
            "properties": {
              "min_number": {
                "type": "string",
                "example": "999938029203623094",
                "description": "the MIN of the document (eNote)"
              },
              "reviewable_document_id": {
                "type": "string",
                "format": "uuid",
                "example": "02c0c641-f646-4c98-8879-87de6f91e375",
                "description": "id of the reviewable document to append to the eNote"
              },
              "loan_modification_type": {
                "type": "string",
                "enum": [
                  "Paper",
                  "Electronic"
                ],
                "example": "Paper",
                "description": "Loan modification type. Defaults to Paper."
              }
            }
          }
        }
      },
      "mers_action_modification_response": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "description": "Two records are returned in order: add_document_to_mers then modification",
            "items": {
              "$ref": "#/components/schemas/add_document_to_mers_response/properties/data"
            }
          }
        }
      },
      "mers_action_modification_error_response": {
        "type": "object",
        "properties": {
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "the validation error, keyed by the parameter at fault, plus a fixed `code` keyword. Observed bodies:\n- {\"mers\": \"is required\"}: the `mers` object is missing\n- {\"min_number\": \"is required\" | \"does not match uploaded document MIN\", \"code\": \"bad_request\"}\n- {\"reviewable_document_id\": \"Invalid document type: <type>\" | \"Invalid file type for Paper modification: should be pdf\" | \"Invalid file type for Electronic modification: should be xml\", \"code\": \"bad_request\"}\n- {\"loan_modification_type\": \"value not supported\", \"code\": \"bad_request\"}\n- {\"document\": \"Document is locked\", \"code\": \"document_locked\"}\n- {\"document\": \"Document not active\", \"code\": \"package_invalid\"}\n- {\"permissions\": \"you do not hold a right to change this document\", \"code\": \"rights_missing\"}\n- when one of the two MERS actions was rejected, the service error with `data` alongside, e.g. {\"document\": \"Document not registered\", \"code\": \"package_invalid\"} or {\"document\": \"A duplicate document cannot be added to an eNote with the same Document Type as the existing document\", \"code\": \"duplicate_document\"}\n",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "bad_request",
                  "document_locked",
                  "package_invalid",
                  "rights_missing",
                  "duplicate_document"
                ]
              }
            }
          },
          "data": {
            "type": "array",
            "description": "only present when a MERS action was attempted: the add_document_to_mers record (and the modification record when the first action succeeded); the failed record has a null `id`",
            "items": {
              "$ref": "#/components/schemas/add_document_to_mers_response/properties/data"
            }
          }
        }
      },
      "add_document_to_mers_error_response": {
        "type": "object",
        "properties": {
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "the validation error, keyed by the parameter at fault, plus a fixed `code` keyword. Observed bodies:\n- {\"mers\": \"is required\"}: the `mers` object is missing\n- {\"min_number\": \"is required\" | \"does not match uploaded document MIN\", \"code\": \"bad_request\"}\n- {\"reviewable_document_id\": \"Invalid document type: <type>\" | \"Invalid file type: <type>\", \"code\": \"bad_request\"}\n- {\"document\": \"Document is locked\", \"code\": \"document_locked\"}\n- {\"document\": \"Document not active\", \"code\": \"package_invalid\"}\n- {\"permissions\": \"you do not hold a right to change this document\", \"code\": \"rights_missing\"}\n- when MERS rejected the action, the service error with `data` alongside, e.g. {\"document\": \"Document not registered\", \"code\": \"package_invalid\"} or {\"document\": \"A duplicate document cannot be added to an eNote with the same Document Type as the existing document\", \"code\": \"duplicate_document\"}\n",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "bad_request",
                  "document_locked",
                  "package_invalid",
                  "rights_missing",
                  "duplicate_document"
                ]
              }
            }
          },
          "data": {
            "description": "only present when the MERS action was attempted and rejected; `id` is null",
            "allOf": [
              {
                "$ref": "#/components/schemas/add_document_to_mers_response/properties/data"
              }
            ]
          }
        }
      },
      "unprocessable_reviewable_document_error": {
        "type": "object",
        "properties": {
          "errors": {
            "type": "object",
            "properties": {
              "reviewable_document_id": {
                "type": "string",
                "example": "Unable to process file"
              },
              "code": {
                "type": "string",
                "enum": [
                  "bad_request"
                ],
                "example": "bad_request"
              }
            }
          }
        }
      },
      "change_data_attributes": {
        "title": "Change data",
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "example": "29af140e-f250-4574-b6f4-f8aad2179b61",
                "description": "The change_data id"
              },
              "type": {
                "type": "string",
                "example": "change_data",
                "description": "The type of object"
              },
              "attributes": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "example": "ChangeData",
                    "description": "The type of MERS action"
                  },
                  "status": {
                    "type": "string",
                    "example": "initiated",
                    "enum": [
                      "initiated",
                      "in_progress",
                      "complete",
                      "mers_responded_failed",
                      "snapdocs_error",
                      "mers_disconnected"
                    ],
                    "description": "Current status of the change data request"
                  },
                  "action_type": {
                    "type": "string",
                    "example": "Add Document",
                    "description": "The type of change data action being requested, as a title-cased version of the MERS action type (for example `Add Document`, `Assumption`, `Modification`). For a rights-holder update it is `Update` followed by the changed roles, for example `Update Master Servicer, Secured Party`."
                  },
                  "created_at": {
                    "type": "string",
                    "example": "2023-07-31T21:18:27.669Z",
                    "format": "date-time",
                    "description": "time the change data request was created"
                  },
                  "updated_at": {
                    "type": "string",
                    "example": "2023-07-31T21:18:27.669Z",
                    "format": "date-time",
                    "description": "time the change data object was last updated"
                  },
                  "direction": {
                    "type": "string",
                    "example": "outbound",
                    "description": "indicates if the change data request was initiated (outbound) or received (inbound)",
                    "enum": [
                      "outbound",
                      "inbound"
                    ]
                  },
                  "display_loan_number": {
                    "type": "string",
                    "description": "The loan number of the document. Use for display only."
                  },
                  "display_min_number": {
                    "type": "string",
                    "description": "The MIN number of the document. Use for display only.",
                    "example": "999938068729325206"
                  },
                  "display_primary_borrower_name": {
                    "type": "string",
                    "description": "The primary borrower name. Use for display only.",
                    "example": "Green"
                  },
                  "mers_received_at": {
                    "type": "string",
                    "example": "2023-07-31T21:18:29.000Z",
                    "format": "date-time",
                    "description": "Date time at which MERS received the change data request"
                  },
                  "errors": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": "Description of an error causing the change data request to fail"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "change_status_attributes": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "example": "29af140e-f250-4574-b6f4-f8aad2179b61",
                "description": "The change status id"
              },
              "type": {
                "type": "string",
                "example": "change_statuses",
                "description": "The type of object"
              },
              "attributes": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "example": "ChangeStatus",
                    "description": "The type of MERS action"
                  },
                  "status": {
                    "type": "string",
                    "example": "initiated",
                    "enum": [
                      "initiated",
                      "in_progress",
                      "complete",
                      "mers_responded_failed",
                      "snapdocs_error",
                      "mers_disconnected"
                    ],
                    "description": "Current status of the change status request"
                  },
                  "action_type": {
                    "type": "string",
                    "example": "PaidOff",
                    "description": "The MERS change status action type as sent to or received from MERS, for example `PaidOff`, `ChargedOff`, `PaperReplacement`, `RegistrationReversal`, `TransferredToProprietaryRegistry`, `ConvertedToPaper`, their `...Reversal` counterparts, or the `...Notification` variants of each on inbound requests"
                  },
                  "created_at": {
                    "type": "string",
                    "example": "2023-07-31T21:18:27.669Z",
                    "format": "date-time",
                    "description": "time the change status request was created"
                  },
                  "updated_at": {
                    "type": "string",
                    "example": "2023-07-31T21:18:27.669Z",
                    "format": "date-time",
                    "description": "time the change status object was last updated"
                  },
                  "direction": {
                    "type": "string",
                    "example": "outbound",
                    "description": "indicates if the change status request was initiated (outbound) or received (inbound)",
                    "enum": [
                      "outbound",
                      "inbound"
                    ]
                  },
                  "display_loan_number": {
                    "type": "string",
                    "description": "The loan number of the document. Use for display only."
                  },
                  "display_min_number": {
                    "type": "string",
                    "description": "The MIN number of the document. Use for display only.",
                    "example": "999938068729325206"
                  },
                  "display_primary_borrower_name": {
                    "type": "string",
                    "description": "The primary borrower name. Use for display only.",
                    "example": "Green"
                  },
                  "mers_received_at": {
                    "type": "string",
                    "example": "2023-07-31T21:18:29.000Z",
                    "format": "date-time",
                    "description": "Date time at which MERS received the change status request"
                  },
                  "errors": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": "Description of an error causing the change status request to fail"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "registration_attributes": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "example": "29af140e-f250-4574-b6f4-f8aad2179b61",
                "description": "The registration id"
              },
              "type": {
                "type": "string",
                "example": "registrations",
                "description": "The type of object"
              },
              "attributes": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "example": "Registration",
                    "description": "The type of MERS action"
                  },
                  "status": {
                    "type": "string",
                    "example": "complete",
                    "enum": [
                      "initiated",
                      "complete",
                      "mers_responded_failed",
                      "snapdocs_error",
                      "mers_disconnected"
                    ],
                    "description": "Current status of the registration"
                  },
                  "action_type": {
                    "type": "string",
                    "example": "Registration",
                    "enum": [
                      "Registration",
                      "RegistrationAndTransferControl",
                      "RegistrationNotification",
                      "Other"
                    ],
                    "nullable": true,
                    "description": "The MERS registration action type"
                  },
                  "created_at": {
                    "type": "string",
                    "example": "2023-07-31T21:18:27.669Z",
                    "format": "date-time",
                    "description": "time the registration was created"
                  },
                  "updated_at": {
                    "type": "string",
                    "example": "2023-07-31T21:18:27.669Z",
                    "format": "date-time",
                    "description": "time the registration was last updated"
                  },
                  "direction": {
                    "type": "string",
                    "example": "outbound",
                    "description": "indicates if the registration was initiated (outbound) or received (inbound)",
                    "enum": [
                      "outbound",
                      "inbound"
                    ]
                  },
                  "display_loan_number": {
                    "type": "string",
                    "description": "The loan number of the document. Use for display only."
                  },
                  "display_min_number": {
                    "type": "string",
                    "description": "The MIN number of the document. Use for display only.",
                    "example": "999938068729325206"
                  },
                  "display_primary_borrower_name": {
                    "type": "string",
                    "description": "The primary borrower name. Use for display only.",
                    "example": "Green"
                  },
                  "mers_received_at": {
                    "type": "string",
                    "example": "2023-07-31T21:18:29.000Z",
                    "format": "date-time",
                    "description": "Date time at which MERS received the registration"
                  },
                  "errors": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": "Description of an error causing the registration to fail"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "check_connection_attributes": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "example": "29af140e-f250-4574-b6f4-f8aad2179b61",
                "description": "The check connection id"
              },
              "type": {
                "type": "string",
                "example": "check_connections",
                "description": "The type of object"
              },
              "attributes": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "example": "complete",
                    "enum": [
                      "initiated",
                      "complete",
                      "mers_responded_failed",
                      "snapdocs_error",
                      "mers_disconnected"
                    ],
                    "description": "Current status of the connection check"
                  },
                  "mers_received_at": {
                    "type": "string",
                    "nullable": true,
                    "example": "2023-07-31T21:18:29.000Z",
                    "format": "date-time",
                    "description": "Date time at which MERS received the connection check, null until then"
                  }
                }
              }
            }
          }
        }
      },
      "mers_action_envelope": {
        "type": "object",
        "description": "Fields `GET /mers_actions/{id}` adds to `data` on top of the type-specific attributes",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "mers_action": {
                "type": "string",
                "example": "change_data",
                "enum": [
                  "transfer",
                  "edelivery",
                  "change_data",
                  "change_status",
                  "check_connection",
                  "inquiry",
                  "registration",
                  "member_inquiry",
                  "controller_history"
                ],
                "description": "The kind of MERS action this record is"
              },
              "snapdocs_action": {
                "type": "string",
                "example": "assumption",
                "enum": [
                  "transfer",
                  "edelivery",
                  "change_data",
                  "assumption",
                  "modification",
                  "add_document_to_mers",
                  "change_status",
                  "check_connection",
                  "inquiry",
                  "registration",
                  "member_inquiry",
                  "controller_history"
                ],
                "description": "The Snapdocs action that created the record. The same as `mers_action` except for change data, where it is `assumption`, `modification` or `add_document_to_mers` for those action types and `change_data` otherwise."
              }
            }
          }
        }
      },
      "inquiry_payload": {
        "type": "object",
        "properties": {
          "mers": {
            "type": "object",
            "required": [
              "min_number"
            ],
            "properties": {
              "min_number": {
                "type": "string",
                "description": "The MIN number for which to do the inquiry",
                "example": "999938068729325206"
              },
              "signature_validation": {
                "type": "boolean",
                "default": true,
                "description": "Whether to validate the signature of the document with MERS, it is recommended to always validate the signature. Only the JSON boolean `false` disables the validation; any other value (including the string \"false\") keeps it enabled."
              }
            }
          }
        }
      },
      "assumption_payload": {
        "type": "object",
        "properties": {
          "mers": {
            "type": "object",
            "required": [
              "min_number",
              "borrowers_attributes"
            ],
            "properties": {
              "min_number": {
                "type": "string",
                "example": "999938029203623094",
                "description": "the MIN of the document (eNote)"
              },
              "borrowers_attributes": {
                "type": "array",
                "minItems": 1,
                "description": "at least one borrower with name_attributes is required; borrowers without name_attributes are ignored",
                "items": {
                  "type": "object",
                  "properties": {
                    "name_attributes": {
                      "type": "object",
                      "required": [
                        "first_name",
                        "last_name"
                      ],
                      "properties": {
                        "first_name": {
                          "type": "string",
                          "example": "David"
                        },
                        "middle_name": {
                          "type": "string",
                          "example": "John"
                        },
                        "last_name": {
                          "type": "string",
                          "example": "Green"
                        },
                        "name_suffix": {
                          "type": "string",
                          "example": "Jr"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "assumption_response": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "example": "26a10d0a-a933-4a9e-afe6-ac5be3db9859",
                "description": "id of the created change data object"
              },
              "min_number": {
                "type": "string",
                "example": "999938029203623094",
                "description": "the MIN of the document (eNote)"
              },
              "document_id": {
                "type": "string",
                "format": "uuid",
                "example": "4d124b5b-cf5f-44e5-a8fc-e9cc386b2835",
                "description": "id of the associated document (eNote)"
              },
              "emortgage_package_id": {
                "type": "string",
                "format": "uuid",
                "example": "a6114457-595c-4f45-818a-a7d4b3def565",
                "description": "the id of the associated emortgage package (current version of the eNote)"
              },
              "mers_action": {
                "type": "string",
                "example": "change_data",
                "description": "the associated action in the MERS system"
              },
              "snapdocs_action": {
                "type": "string",
                "example": "assumption",
                "description": "the action executed"
              }
            }
          }
        }
      },
      "assumption_error_response": {
        "type": "object",
        "properties": {
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "the validation error, keyed by the parameter at fault, plus a fixed `code` keyword. Observed bodies:\n- {\"mers\": \"is required\"}: the `mers` object is missing\n- {\"document_id\": \"is required\"}: `min_number` is missing\n- {\"name_attributes\": \"First name and last name are required\", \"code\": \"bad_request\"}\n- {\"borrowers_attributes\": \"At least one valid borrower is required\", \"code\": \"bad_request\"}\n- {\"document\": \"Document is locked\", \"code\": \"document_locked\"}\n- {\"document\": \"Document not active\", \"code\": \"package_invalid\"}\n- {\"permissions\": \"you do not hold a right to change this document\", \"code\": \"rights_missing\"}\n- when MERS rejected the action, the service error with `data` alongside, e.g. {\"document_id\": \"Document not registered\", \"code\": \"package_invalid\"}\n",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "bad_request",
                  "document_locked",
                  "package_invalid",
                  "rights_missing"
                ]
              }
            }
          },
          "data": {
            "description": "only present when the MERS action was attempted and rejected; has no `id`",
            "allOf": [
              {
                "$ref": "#/components/schemas/mers_action_data"
              }
            ]
          }
        }
      }
    }
  }
}