Recurring work orders

Preview a schedule change

Shows what a proposed change to a recurring work order would do to the work orders it has already raised, without changing anything. Send the body you are about to send to the update endpoint and you get back the future work orders the new pattern would no longer cover. Requires the work_orders:read permission.

POST
https://services.magicdoor.com/maintenance/company-portal/work-orders/recurring/{recurringWorkOrderId}/schedule-preview

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

recurringWorkOrderIdstringrequired

The recurring work order to act on. A Snowflake id, sent as a decimal string.

example: 1838400938471029248

Body

application/json

The same body as the update endpoint. Only frequency, interval, weekdays, startsFrom, endsOn and workSessionTemplates affect the answer; the rest is accepted and ignored.

descriptionstringrequired

What the recurring job is. Between 1 and 2000 characters. MagicDoor writes the title from it when you leave title out.

urgencyenum<string>required

The urgency each generated work order gets.

urgenthighmediumlownone
frequencyenum<string>required

How often the job repeats, before interval is applied.

dailyweeklymonthlyyearly
startsFromstring · daterequired

The 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.

propertyIdstring

The property the work is on. Give either this, unitId or leaseId — whichever you give, the rest of the location is worked out from it.

unitIdstring

The unit the work is on.

leaseIdstring

The lease the work is tied to.

vendorIdstring

The vendor each generated work order goes to. It must be one of the company's vendors and must still be active.

assignedPropertyManagerIdstring

The property manager to put on each generated work order. They must belong to the company and must still be active.

titlestring

The title each generated work order gets. At most 250 characters. Leave it out and MagicDoor writes one from the description.

internalDescriptionstring

Notes for staff only. At most 2000 characters.

permissionToEnterboolean

Whether someone may enter the unit when the tenant is not home.

default: true
intervalinteger

How many periods sit between occurrences. Between 1 and 99. 2 with weekly means every other week.

default: 1
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.

sundaymondaytuesdaywednesdaythursdayfridaysaturday
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 · date

The date the schedule stops. It cannot be earlier than startsFrom. Leave it out to run forever.

Response

200 · What the change would strand. Nothing has been changed.

dayRemovedCountintegerrequired

How many stranded work orders fall on a date the new pattern no longer produces.

sessionsChangedCountintegerrequired

How many stranded work orders keep their date but have visits booked at times the new pattern no longer uses.

orphansobject[]required

The stranded work orders, one entry each. An empty array when the change strands nothing.

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 recurring work order, or it belongs to another company.