Units

List units

Returns a page of units, each hydrated with its property, its active leases, its balance and its address as one line, plus the value of every unit custom field the company has defined.

GET
https://api.portal.magicdoor.com/company-app/units

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.

Query parameters

pageinteger

Which page to return. Starts at 1.

default: 1
pageSizeinteger

How many records per page. Between 1 and 100. Defaults to 50.

default: 50
activeboolean

true returns only active units, false only deactivated ones. Omit to get both.

namestring

Exact name match, 1 to 150 characters.

nameLikestring

Case-insensitive substring match on the unit name. At least 1 character.

propertyIdstring

Return only units on this property.

portfolioIdstring

Return only units whose property sits in this portfolio.

searchstring

Free-text search. The term is stripped of punctuation and common address words are abbreviated — "avenue" becomes "ave", "apartment" becomes "apt" — and then every word in it must appear in the record's searchable text, which is built from its name and address. Must not be empty if given.

Response

200 · One page of hydrated units, plus the definitions of the custom fields their values refer to.

itemsUnit[]

The units on this page.

currentPageinteger

The page you asked for. Note the name: this endpoint calls it currentPage, not page.

totalPagesinteger

How many pages the filtered set fills at this page size.

pageSizeinteger

How many records a page holds.

totalCountinteger

How many records match the filter across every page.

customFieldsobject[]

The definitions behind the customFieldValues on each item, so you can render a value without a second call.

400 · A query parameter failed validation — `page` below 1, `pageSize` outside 1 to 100, or an id that is not a decimal number. 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.

Where a unit sits

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.

Which fields you can write

The unit record stores name, address, beds, baths, unitSizeSqft, marketRent, floor, imageId, icons and magicTags. propertyId and portfolioId are set when the unit is created and changed only by the move endpoint. Everything else on the response is computed on read: address.isValid, singleLineAddress, activeLeases, postedBalance, recentRentalApplications and latestRentalApplicationId.

This envelope names the page `currentPage`

The rest of the MagicDoor API returns page in its pagination envelope. The legacy Portal endpoints, including this one, return currentPage instead. The request parameter is still page.