Chats

Create a work order chat

Opens the chat between your company and the work order's vendor, and returns its id. Only the vendor is a participant — the tenant is not in this chat.

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

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 chat for.

example: 1830176882571018240

Response

200 · The work order's vendor 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.

A work order already linked to a chat returns that chat. Calling it again returns the same chat rather than making a second one.

A work order with no vendor assigned has nobody to put in a chat. The call succeeds with no chatId and a failureReason of "WorkOrder does not have a vendor assigned". Check chatId before using it.