Convert a maintenance request into a work order
Turns a reported problem into a scheduled job. The new work order takes the request's title, lease and entry permission, gets a description MagicDoor writes for the vendor, and receives copies of the request's files. The request itself is then moved to waitingForWorkOrder. Note the URL sits under maintenance requests, not work orders. Requires the maintenance_requests:write permission — not work_orders:write.
Authorization
AuthorizationstringrequiredPath parameters
maintenanceRequestIdstringrequiredThe maintenance request to convert. A Snowflake id, sent as a decimal string.
Body
application/json
Every value here is optional; send {} to convert on the request's own terms.
vendorIdstringThe vendor to give the job to. They must belong to the company and be active. Leave it out to raise the work order unassigned.
dueDatestring · dateThe date the job is wanted by. The request's own due date is not carried over, so set it here if you want one.
urgencyenum<string>The urgency for the work order. Leave it out to take the request's urgency.
statusenum<string>The state to raise the work order in. Leave it out for pending.
Response
200 · The work order that was raised. The maintenance request is now `waitingForWorkOrder`, and `maintenanceRequestId` on the work order points back at it.
idstringrequiredThe work order.
referencestringrequiredThe work order number people quote, generated when the work order is raised.
titlestringrequiredWhat the job is, in a line. MagicDoor writes it from the description when you do not supply one.
statusenum<string>requiredWhere the job has got to.
urgencyenum<string>requiredHow urgent the job is.
portfolioIdstringrequiredThe portfolio the property sits in.
propertyIdstringrequiredThe property the work is on.
unitIdstringThe unit the work is on. Absent when the job covers the whole property.
leaseIdstringThe lease the work is tied to. Absent when it is not tied to one.
vendorobjectThe vendor doing the work, in the same shape as Get a vendor. Absent when no vendor is assigned. The properties below are the ones you are most likely to want; the full vendor record is returned.
locationobjectWhere the work is, looked up from the property and unit at read time.
assignedOnstring · date-timeWhen a vendor was last put on the job, in the company's timezone and without an offset. Absent while no vendor is assigned.
chatIdstringThe chat with the vendor. Absent until one is opened — see Open the vendor chat on a work order.
groupChatIdstringThe chat with the vendor and the tenants together. Absent until one is opened.
assignedPropertyManagerIdstringThe property manager who owns this work order. Absent while nobody is assigned.
maintenanceRequestIdstringThe maintenance request this job came from. Absent when the job was raised on its own.
recurringWorkOrderIdstringThe recurring work order that raised this one. Absent when it was not raised on a schedule.
dueDatestring · dateThe date the job is wanted by, in the company's timezone. Absent when no date was set.
sessionsobject[]requiredThe visits booked for this work order, earliest first. An empty array when nothing is booked.
createdstring · date-timerequiredWhen the work order was raised, in the company's timezone and without an offset.
updatedstring · date-timeWhen it last changed, in the company's timezone and without an offset.
descriptionstringrequiredWhat needs doing, in full.
internalDescriptionstringNotes for staff only, never shown to the tenant or the vendor. Absent when there are none.
permissionToEnterbooleanrequiredWhether someone may enter the unit when the tenant is not home.
filesobject[]requiredFiles attached to the work order. An empty array when there are none.
billsobject[]The work order's bills — its draft bills, plus the real vendor bills any of them have been converted into. An empty array when there are none.
chartOfAccountsobject[]requiredThe company's whole chart of accounts, included so a bill's account can be picked without a second call.
401 · The request carried no valid access token.
403 · The token is not a property manager token, or it lacks the `maintenance_requests:write` permission.
404 · No such maintenance request, it belongs to another company, or `vendorId` names a vendor that does not exist for it.
422 · The vendor has been deactivated.
Each file on the maintenance request is cloned into a new file owned by the work order. The request keeps its own copies, and removing a file from one side leaves the other side alone.