Units

Deactivate a unit

Marks a unit inactive. The call is refused while the unit still has active leases unless forceEndLease is set, which ends them as part of the same call.

DELETE
https://api.portal.magicdoor.com/company-app/units/{unitId}/deactivate

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

unitIdstringrequired

Snowflake id of the unit, as a decimal string.

example: 1830472847398404098

Query parameters

forceEndLeaseboolean

Set it true to end the unit's active leases so the unit can be deactivated.

default: false

Response

200 · The unit is now inactive. The response has no body.

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

404 · No unit with that id, or it belongs to another company.

409 · The unit still has active leases and `forceEndLease` was not set. The problem document's `title` says how many are in the way.

`forceEndLease` ends real leases

With forceEndLease=true MagicDoor ends every active lease on the unit so the unit can be deactivated. That is not reversible by re-activating the unit. Leave it unset and you get a 409 listing what is in the way.