Leases

List leases

Returns a page of the company's leases, each with its unit, property and tenants already filled in, plus the company's custom-field definitions so you can read the values on each lease.

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

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: 1example: 1
pageSizeinteger

How many rows per page, between 1 and 100.

default: 50example: 50
searchstring

Free-text search across the leases.

leaseStart.startstring · date-time

Only leases whose start date is on or after this instant.

leaseStart.endstring · date-time

Only leases whose start date is on or before this instant.

leaseEnd.startstring · date-time

Only leases whose end date is on or after this instant.

leaseEnd.endstring · date-time

Only leases whose end date is on or before this instant.

monthToMonthboolean

Only leases that do, or do not, continue month to month.

evictionboolean

Only leases that are, or are not, flagged for eviction.

endedboolean

Only leases that have, or have not, been ended. Note that an expired lease has not been ended.

draftboolean

Only draft leases, or only activated ones.

withBalanceboolean

Set to true for only leases whose balance is above zero. Ignored when balance.from or balance.to is given.

withPostedBalanceboolean

Set to true for only leases whose settled balance is above zero. Ignored when postedBalance.from or postedBalance.to is given.

balance.fromnumber

Lowest balance to include.

balance.tonumber

Highest balance to include.

balance.includeFromboolean

Whether balance.from itself counts as a match.

default: true
balance.includeToboolean

Whether balance.to itself counts as a match.

default: true
postedBalance.fromnumber

Lowest settled balance to include.

postedBalance.tonumber

Highest settled balance to include.

postedBalance.includeFromboolean

Whether postedBalance.from itself counts as a match.

default: true
postedBalance.includeToboolean

Whether postedBalance.to itself counts as a match.

default: true
tenantIdsstring[]

Only leases that include any of these tenants.

unitIdsstring[]

Only leases on any of these units.

propertyIdsstring[]

Only leases on any of these properties.

portfolioIdsstring[]

Only leases in any of these portfolios.

unitIdstring

Only leases on this unit. Ignored when unitIds is given.

propertyIdstring

Only leases on this property. Ignored when propertyIds is given.

portfolioIdstring

Only leases in this portfolio. Ignored when portfolioIds is given.

Response

200 · A page of leases.

itemsHydratedLease[]

The rows on this page.

currentPageinteger

The page you asked for. Pages start at 1.

totalPagesinteger

How many pages exist at this page size.

pageSizeinteger

How many rows a page holds.

totalCountinteger

How many rows match in total, across all pages.

customFieldsCustomField[]

The company's custom-field definitions for leases, so the customFieldValues on each row can be labelled.

400 · The request failed validation. `errors` maps each field name to what was wrong with it.

401 · The access token is missing, expired, or not for this company.

Lease states

A lease is a draft until it is activated, future before its start date, and a live lease after that. When a fixed term runs past its end date the lease becomes expired, which in MagicDoor is a normal ongoing state — rent keeps being charged and nothing about the lease is cancelled. Expiry never turns into ending. A lease only becomes ended when someone ends it, and eviction is a separate flag that can be set while the lease is live.