Reports

Lease custom fields report

Lists leases together with the values of the company's own custom fields, and lets you filter on those values. One row is one lease, with its tenants, its unit, its property, and the custom field values you asked to display.

GET
https://api.portal.magicdoor.com/company-app/reports/magic-tags/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

propertyIdstring

Only return leases on this property.

portfolioIdstring

Only return leases in this portfolio.

propertyIdsstring[]

Only return leases on these properties. Repeat the parameter once per id.

portfolioIdsstring[]

Only return leases in these portfolios. Repeat the parameter once per id.

unitIdsstring[]

Only return leases on these units. Repeat the parameter once per id.

leaseIdsstring[]

Only return these leases. Repeat the parameter once per id.

tenantIdsstring[]

Only return leases these tenants are on. Repeat the parameter once per id.

leaseStart.startstring · date-time

Only return leases starting at or after this moment.

leaseStart.endstring · date-time

Only return leases starting at or before this moment.

leaseEnd.startstring · date-time

Only return leases ending at or after this moment.

leaseEnd.endstring · date-time

Only return leases ending at or before this moment.

moveOutDate.startstring · date-time

Only return leases with a move-out at or after this moment.

moveOutDate.endstring · date-time

Only return leases with a move-out at or before this moment.

created.startstring · date-time

Only return leases created at or after this moment.

created.endstring · date-time

Only return leases created at or before this moment.

monthToMonthboolean

Only return leases that do, or do not, roll month to month.

evictionboolean

Only return leases with, or without, an eviction in progress.

endedboolean

Only return leases that have, or have not, been closed out.

draftboolean

Only return leases that are, or are not, still drafts.

balance.fromnumber

Only return leases whose balance is at least this much.

balance.tonumber

Only return leases whose balance is at most this much.

postedBalance.fromnumber

Only return leases whose posted balance is at least this much.

postedBalance.tonumber

Only return leases whose posted balance is at most this much.

searchstring

Free-text search across the lease and its tenants.

displayCustomFieldIdsstring[]

Which custom fields to return values for. Repeat the parameter once per id. Leave it out and no values are returned.

magicTags.equalStringobject

Only return leases where the named custom field holds exactly this text. Written as magicTags.equalString[<customFieldId>]=<value>.

magicTags.containsStringobject

Only return leases where the named custom field contains this text. Written as magicTags.containsString[<customFieldId>]=<value>.

magicTags.equalsBoolobject

Only return leases where the named custom field holds this true or false value. Written as magicTags.equalsBool[<customFieldId>]=true.

magicTags.dateobject

Only return leases where the named custom field's date falls in this range, both ends included. Written as magicTags.date[<customFieldId>].start and .end.

magicTags.numberobject

Only return leases where the named custom field's number falls in this range. Written as magicTags.number[<customFieldId>].from and .to.

Response

200 · The matching leases with their custom field values.

leasesobject[]

One entry per matching lease.

propertiesobject[]

Every property named by a lease.

unitsobject[]

Every unit named by a lease.

customFieldDefinitionsobject[]

The custom fields whose values are returned, so their ids can be shown as names.

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

Custom fields are defined by the company, so a value's type depends on its definition. Each value object carries one filled slot and leaves the rest absent. Look the value's customFieldId up in customFieldDefinitions for its name, and in the custom fields endpoint for its options.type, which tells you which slot to read.

The field's options.typeWhich property carries the value
stringstringValue, or stringArray when the field is multiple
numbernumberValue
booleanbooleanValue
datetimedateTimeValue
referencereferenceValue, or referenceArray when the field is multiple

The magicTags filters are keyed by custom field id, and which one you use depends on that field's type. They are written into the query string with the id in brackets.

Leases whose Parking space field is A1
curl --request GET \
  --url '{{baseUrl}}/company-app/reports/magic-tags/leases?displayCustomFieldIds=1830472847398418018&magicTags.equalString%5B1830472847398418018%5D=A1' \
  --header 'Authorization: Bearer $ACCESS_TOKEN'
Nothing comes back unless you ask for it

customFieldValues is only filled for the fields named in displayCustomFieldIds. Filtering on a field does not add it to the output; list it in displayCustomFieldIds as well if you want to see it.

No paging

This report has no page or pageSize. Every matching lease comes back in one response, so narrow it with the filters on a large portfolio.