Skip to Content
HomeLink Hub
Legal Verification

Invite a lawyer to partner

POST
/api/v1/legal/partnership-invites/email

Access: Bearer token required. Roles: AGENT, ADMIN, LANDLORD.

Sends a partnership invite to a lawyer who is already registered on the platform with role LAWYER; the email is trimmed and lower-cased before the lookup. A LegalPartnershipInvite is created with status invite_pending, and the lawyer is emailed ("You've Been Invited to Partner on HomeLink Hub") with the inviter's name, the note and a link to their invites page. The email is fire-and-forget: a mail failure does not fail the request. No in-app notification or socket event is emitted. The lawyer must accept (status contracted) before the inviter can assign them to a property. An inviter can have only one invite_pending or contracted invite per lawyer; after a rejection a new invite may be sent. inviteNote is limited to 2000 characters by the model, but that is enforced by Mongoose, so an over-long note fails as a 500 rather than a 400. Any unexpected error inside the legal service (including a Mongoose cast or validation failure) is re-thrown as a 500 carrying the underlying error's message plus an errorData field holding the serialized underlying error.

Authorization

bearerAuth
headerAuthorizationBearer <JWT>

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

Request Body

application/json
  1. body
email*string

Email address of a registered user whose role is LAWYER.

inviteNote?string

Optional message shown to the lawyer in the invite email. Max 2000 characters.

Response Body

Invite created and emailed

application/json
  1. response
status*integer
success*boolean
message*string
data*
Example Request
curl -X POST 'http://localhost:4000/api/v1/legal/partnership-invites/email' \  -H 'Content-Type: application/json' \  -d '{  "email": "folake.adeyemi@example.com",  "inviteNote": "We list 10-15 Lekki properties a month and need title verification."}'
Example Response
{  "status": 201,  "success": true,  "message": "Invite sent successfully",  "data": {    "_id": "6660a7d49b1d4a0012ab3510",    "inviterId": "665f1c2e9b1d4a0012ab34c1",    "lawyerId": "665f1c2e9b1d4a0012ab34c3",    "email": "folake.adeyemi@example.com",    "status": "invite_pending",    "inviteNote": "We list 10-15 Lekki properties a month and need title verification.",    "invitedAt": "2026-06-04T09:15:22.481Z",    "createdAt": "2026-06-04T09:15:22.481Z",    "updatedAt": "2026-06-04T09:15:22.481Z",    "__v": 0  }}