Chats

Create a tenant chat

Opens the one-to-one chat with a tenant and returns its id. The tenant is the only participant.

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

tenantIdstringrequired

The tenant to open a chat with.

example: 1827991044238376960

Response

200 · The tenant's chat.

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 tenant with that id belongs to your company.

422 · The tenant record has been deactivated.

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.

Calling it again returns the same chat rather than making a second one.