Chats

Create a lease chat

Opens the one chat that covers a lease and returns its id. Every tenant on the lease is a participant in it — this is one conversation, not one per tenant.

POST
https://api.portal.magicdoor.com/company-app/leases/{leaseId}/chat

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

leaseIdstringrequired

The lease to open a chat for.

example: 1829833104612495360

Response

200 · The lease's chat, or the reason there is none.

chatIdstring

The chat to talk to this recipient in. Absent when failureReason explains why no chat could be made.

failureReasonstring

Why no chat could be made. Absent on success.

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

404 · No lease with that id belongs to your company.

This call creates or finds a chat. It does not message anyone. Nothing reaches the recipient until you post a message to the returned chatId.

A lease already linked to a chat returns that chat. Calling it again returns the same chat rather than making a second one.

Tenants who have moved out are left out. Tenants whose lease has not started yet are included, so you can talk to someone before their move-in date.

A lease with exactly one tenant gets that tenant's own chat rather than a new lease chat, so chatId may be a chat whose type is tenant.

A lease whose tenants have all moved out has nobody to put in a chat. That is a normal state, so the call succeeds with no chatId and a failureReason of "Lease does not have active or future tenants". Check chatId before using it.