Work order chat

Open the group chat on a work order

Returns the id of the work order's group chat — the vendor plus every tenant still on the lease behind the originating maintenance request — creating it if there is none. Calling it twice is safe. Requires the work_orders:read permission.

POST
https://services.magicdoor.com/maintenance/company-portal/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 whose group chat you want. A Snowflake id, sent as a decimal string.

example: 1841200938471029248

Response

200 · Either a chat id, or a reason why no chat could be opened. Missing prerequisites come back as `failureReason`, not as an error.

chatIdstring

The chat. Absent when no chat could be opened.

failureReasonstring

Why no chat could be opened. The two reasons this endpoint produces are that the work order has no vendor assigned, and that it did not come from a maintenance request — the tenants are found through that request's lease. Absent on success.

401 · The request carried no valid access token.

403 · The token is not a property manager token, or it lacks the `work_orders:read` permission.

404 · No such work order, it belongs to another company, the maintenance request behind it no longer exists, or the vendor assigned to it no longer exists.

The stored chat is checked before it is handed back: if it has been closed, or its id now points at a different work order's conversation, a fresh chat is created. Before creating one, MagicDoor also looks for another work order raised in the last five minutes with the same lease, vendor, title and description — if it finds one with a group chat, both work orders are pointed at that same chat rather than opening a second one for what is really the same job.