Skip to Content
HomeLink Hub
Legal Verification

Send documents to the reviewing lawyer

POST
/api/v1/legal/assignments/{assignmentId}/documents

Access: Bearer token required. Roles: AGENT, ADMIN, LANDLORD. Also requires: Caller assigned the lawyer, or is the property's agent or landlord, or is an admin; Assignment status is assigned, accepted, in_review or changes_requested.

The lister uploads supporting documents for an open legal review. Send multipart/form-data with one or more files under the field name documents and an optional text field note. Up to 10 files per request, 10 MB each; allowed extensions are jpg, jpeg, png, gif, pdf, doc, docx, xls, xlsx, ppt, pptx, txt. Files are uploaded to Cloudinary by the upload middleware before the handler validates anything, so a request rejected afterwards has still stored its files. The caller must be the user who assigned the lawyer, the property's agent or landlord, or an admin. The batch is appended to documentSubmissions (each file as url, name, mimeType, size). If the assignment was changes_requested, this is the answer to that request: the assignment returns to in_review and the property's legalStatus to under_legal_review; in assigned, accepted or in_review the documents are simply added. A documents_submitted audit entry is written and the lawyer is notified (event lawyer_documents_submitted, title "New Documents to Review": in-app + notifications:new socket event, push, and email "New Documents to Review on HomeLink Hub"). data is the updated assignment with unpopulated ids. Upload-middleware failures are not converted to 4xx: they reach the error handler as 500s.

Authorization

bearerAuth
headerAuthorizationBearer <JWT>

Access token returned by sign-in. Send it as Authorization: Bearer <token>.

Path Parameters

assignmentId*string

ObjectId of the legal assignment the documents are for.

Request Body

multipart/form-data
  1. body
documents*unknown

One to ten files (repeat the field for each file). 10 MB per file; jpg, jpeg, png, gif, pdf, doc, docx, xls, xlsx, ppt, pptx or txt.

note?string

Optional message to the lawyer. Trimmed; max 2000 characters (model limit).

Response Body

Documents stored and the lawyer notified

application/json
  1. response
status*integer
success*boolean
message*string
data*
Example Request
curl -X POST 'http://localhost:4000/api/v1/legal/assignments/string/documents'
Example Response
{  "status": 201,  "success": true,  "message": "Documents sent to the lawyer",  "data": {    "_id": "6660a7d49b1d4a0012ab3501",    "propertyId": "665f1c2e9b1d4a0012ab34cd",    "lawyerId": "665f1c2e9b1d4a0012ab34c3",    "assignedBy": "665f1c2e9b1d4a0012ab34c1",    "mediaSnapshot": {      "images": [        {          "url": "https://res.cloudinary.com/example/image/upload/v1717500000/homelinkhub/media/living-room.jpg",          "metadata": {            "address": "14 Admiralty Way, Lekki Phase 1, Lagos",            "coordinates": [              3.4723,              6.4474            ]          },          "_id": "6660a7d49b1d4a0012ab3570"        }      ],      "videos": []    },    "status": "in_review",    "dueDate": "2026-06-12T17:00:00.000Z",    "notes": "Please confirm the C of O and survey plan.",    "decision": {      "checklist": []    },    "documentSubmissions": [      {        "_id": "6660a7d49b1d4a0012ab3505",        "documents": [          {            "url": "https://res.cloudinary.com/example/raw/upload/v1717600000/homelinkhub/media/certificate-of-occupancy.pdf",            "name": "certificate-of-occupancy.pdf",            "mimeType": "application/pdf",            "size": 482113          }        ],        "note": "C of O attached as requested.",        "submittedBy": "665f1c2e9b1d4a0012ab34c1",        "submittedAt": "2026-06-05T14:02:10.107Z"      }    ],    "createdAt": "2026-06-04T09:15:22.481Z",    "updatedAt": "2026-06-05T14:02:10.107Z",    "__v": 1  }}