Chats

Create a work order group chat

Opens the one chat that puts the work order's vendor and the lease's tenants in the same conversation, and returns its id.

POST
https://api.portal.magicdoor.com/company-app/work-orders/{workOrderId}/chat/group

Authorization

Authorizationstringrequired
Bearer token — Send your API token in the Authorization header as Bearer <token>. Requests without a valid token are rejected with 401 Unauthorized.

Path parameters

workOrderIdstringrequired

The work order to open a group chat for.

example: 1830176882571018240

Response

200 · The group chat, or the reason there is none.

chatIdstring

The chat to talk to this recipient in. Absent when failureReason explains why no chat could be made.

failureReasonstring

Why no chat could be made. Absent on success.

401 · The access token is missing, expired, or not valid.

404 · No work order with that id belongs to your company.

This call creates or finds a chat. It does not message anyone. Nothing reaches the recipient until you post a message to the returned chatId.

This is a single conversation with the vendor and every tenant on the lease in it together. Anything posted to it is seen by all of them, the vendor included.

MagicDoor decides whether this work order should reuse a group chat that already exists — its own, or a near-duplicate sibling work order's — before opening a new one, so the chat you get back may already have history in it.

Tenants who have moved out are left out; tenants whose lease has not started yet are included.

A work order with no vendor, or one that is not attached to a maintenance request, has nothing to build a group chat from. The call succeeds with no chatId and a failureReason saying which is missing. Check chatId before using it.