Chats

Create a rental application chat

Opens the chat for an applicant and returns its id. An applicant already on file as a tenant gets their tenant chat; otherwise the chat is keyed on their phone number.

POST
https://api.portal.magicdoor.com/company-app/rental-applications/{rentalApplicationId}/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

rentalApplicationIdstringrequired

The rental application to open a chat about.

example: 1829404481123549184

Response

200 · The applicant'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 rental application 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.

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

An applicant with no tenant record and no phone number has nothing to key a chat on. That is a normal state for a half-finished application, so the call succeeds with no chatId and a failureReason of "Rental application does not have a phone number". Check chatId before using it.