Create a unit
Adds a unit to a property. Optionally creates the unit's marketing listing at the same time.
Authorization
AuthorizationstringrequiredBody
application/json
namestringrequiredWhat to call the unit — usually its number or letter, 1 to 150 characters. For a single-unit property "Home" is the usual choice.
propertyIdstringrequiredThe property to add the unit to. It must be active.
addressobjectAn address of the unit's own, for the rare case where it differs from the property's. Leave it out and the unit uses the property address.
bedsnumberBedrooms. Zero or more, in steps of 0.5.
bathsnumberBathrooms. Zero or more, in steps of 0.5.
unitSizeSqftintegerFloor area in square feet. Zero or more.
marketRentnumberThe rent the unit is expected to fetch, as a decimal with at most two places, for example 1850.00. Between 0 and 1,000,000,000,000.
floorintegerWhich floor the unit is on. Must be at least 1 and no higher than the property's totalFloors, or 200 when the property does not declare one.
createUnitListingbooleanSet it true and MagicDoor creates the unit's marketing listing alongside the unit.
imageSessionIdstringId of a completed upload session for the unit's main photo.
imageIdstringdeprecatedId of an already-uploaded but unclaimed file. Use imageSessionId instead.
magicTagsobjectFree-form labels, as a map of string keys to string values.
Response
200 · The new unit, hydrated.
idstringSnowflake id of the unit.
namestringThe unit's name — typically its number or letter, for example "2B". For a single-unit property this is often "Home".
addressobjectAn address that overrides the property's, for a unit with its own street address. Absent when the unit uses the property address, which is the usual case.
bedsnumberBedrooms. Whole or half numbers only. Absent when it was never set.
bathsnumberBathrooms. Whole or half numbers only. Absent when it was never set.
unitSizeSqftintegerFloor area in square feet. Absent when it was never set.
marketRentnumberThe rent this unit is expected to fetch, as a decimal amount such as 1850.00. This is an asking figure on the unit, not the rent on any lease. Absent when it was never set.
floorintegerWhich floor the unit is on, 1 to 200. Absent when it was never set.
propertyIdstringThe property this unit belongs to.
portfolioIdstringThe portfolio the unit's property belongs to. Kept in step with the property.
activebooleanfalse once the unit has been deactivated.
imageIdstringThe file behind the unit's main photo. Absent when no photo has been set.
iconsstring[]Icon keys pinned to the unit. Free-form strings.
magicTagsobjectFree-form labels on the unit, as a map of string keys to string values. Absent when none are set.
imageobjectThe unit's main photo, resolved from imageId. Absent when no photo has been set.
propertyobjectThe property this unit belongs to, expanded.
activeLeasesLease[]The leases currently running on this unit, in the same shape the leases endpoints return. Usually zero or one; more than one appears when leases overlap. Empty for a vacant unit.
postedBalancenumberComputed: what the unit's leases owe, counting only charges that have already been posted.
singleLineAddressstringComputed one-line address for the unit: the unit's own address if it has one, otherwise the property's address with the unit name appended. The unit name is left off for a single-unit property. Absent when neither the unit nor the property has an address.
recentRentalApplicationsintegerComputed: how many distinct rental applications that have not been retracted named this unit in the recent window.
latestRentalApplicationIdstringThe most recent rental application, not retracted, that named this unit. Absent when nobody has applied.
400 · A required field is missing or fails validation — no name, `beds` or `baths` not a multiple of 0.5, `marketRent` with more than two decimal places, or a `floor` above the property's `totalFloors`. The response carries an `errors` member mapping each rejected field name to its message.
401 · The access token is missing, expired, or not for this company.
404 · The property does not exist or belongs to another company.
422 · The property has been deactivated, so units cannot be added to it.
MagicDoor nests records four deep: a portfolio holds properties, a property holds units, and a lease is signed on a unit. The unit is the rentable thing — an apartment, a house, a shop. A single-family house is still modelled as a property with one unit, usually named "Home". portfolioId on a unit is a copy of its property's and follows the property when it moves.
The unit holds the facts of the physical space — beds, baths, square feet, floor, marketRent. The unit listing is the marketing record MagicDoor publishes to prospective tenants: title, description, photos, asking rent, availability date. They share an id but have separate lifecycles and separate endpoints, and changing one does not change the other.