Create a recurring work order
Sets up a schedule that raises a work order on a repeating pattern. Creating one immediately raises the occurrences that fall inside the company's look-ahead window, so work orders can exist the moment this call returns. Requires the work_orders:write permission.
Authorization
AuthorizationstringrequiredBody
application/json
Say where the work is with one of propertyId, unitId or leaseId; MagicDoor fills in the rest of the location from it.
descriptionstringrequiredWhat the recurring job is. Between 1 and 2000 characters. MagicDoor writes the title from it when you leave title out.
urgencyenum<string>requiredThe urgency each generated work order gets.
frequencyenum<string>requiredHow often the job repeats, before interval is applied.
startsFromstring · daterequiredThe earliest date an occurrence may fall on. MagicDoor moves it forward to the first date the pattern allows, and the response tells you where it landed.
propertyIdstringThe property the work is on. Give either this, unitId or leaseId — whichever you give, the rest of the location is worked out from it.
unitIdstringThe unit the work is on.
leaseIdstringThe lease the work is tied to.
vendorIdstringThe vendor each generated work order goes to. It must be one of the company's vendors and must still be active.
assignedPropertyManagerIdstringThe property manager to put on each generated work order. They must belong to the company and must still be active.
titlestringThe title each generated work order gets. At most 250 characters. Leave it out and MagicDoor writes one from the description.
internalDescriptionstringNotes for staff only. At most 2000 characters.
permissionToEnterbooleanWhether someone may enter the unit when the tenant is not home.
intervalintegerHow many periods sit between occurrences. Between 1 and 99. 2 with weekly means every other week.
weekdaysenum<string>[]Which days of the week an occurrence falls on. Only allowed when frequency is weekly — sending it with any other frequency is rejected.
workSessionTemplatesobject[]The visits to book into each occurrence. Leave it out and the generated work order carries a due date but no booked visit.
endsOnstring · dateThe date the schedule stops. It cannot be earlier than startsFrom. Leave it out to run forever.
Response
200 · The schedule that was created, with `startsFrom` and `nextDueDate` set to the first date the pattern allows.
idstringrequiredThe recurring work order.
portfolioIdstringrequiredThe portfolio the property sits in. Worked out from the property, not sent by you.
propertyIdstringrequiredThe property the work is on.
unitIdstringThe unit the work is on. Absent when the schedule covers the whole property.
leaseIdstringThe lease the work is tied to. Absent when it is not tied to one.
vendorobjectThe vendor the generated work orders go to, in the same shape as Get a vendor. Absent when no vendor is set.
locationobjectWhere the work happens, looked up from the property and unit at read time.
assignedPropertyManagerIdstringThe property manager put on each generated work order. Absent when nobody is assigned.
titlestringThe title each generated work order gets. MagicDoor writes one from the description when you do not supply it.
descriptionstringrequiredWhat the recurring job is.
internalDescriptionstringNotes for staff only, never shown to the tenant or the vendor. Absent when there are none.
urgencyenum<string>requiredThe urgency each generated work order gets.
permissionToEnterbooleanrequiredWhether someone may enter the unit when the tenant is not home.
frequencyenum<string>requiredHow often the job repeats, before interval is applied.
intervalintegerrequiredHow many of those periods sit between occurrences. 2 with weekly means every other week.
weekdaysenum<string>[]requiredWhich days of the week an occurrence falls on. Only used by a weekly schedule; an empty array otherwise.
workSessionTemplatesobject[]requiredThe visits booked into each occurrence. An empty array means the generated work order carries a due date but no booked visit.
startsFromstring · daterequiredThe date the first occurrence falls on. MagicDoor moves the date you sent forward to the first date the pattern actually allows, so this can differ from what you sent.
endsOnstring · dateThe date the schedule stops. Absent when it runs forever.
nextDueDatestring · daterequiredThe date of the next occurrence still to be raised.
lastCreatedOnstring · date-timeWhen a work order was last raised from this schedule, in the company's timezone and without an offset. Absent when none has been.
activebooleanrequiredWhether the schedule is still raising work orders.
createdstring · date-timerequiredWhen the schedule was set up, in the company's timezone and without an offset.