Chats

Search chat messages

Searches every chat in your company by message text or attachment name, and returns the matches with the chats they came from.

GET
https://api.portal.magicdoor.com/company-app/chats/search

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

pageinteger

Which page to return. The first page is 1.

default: 1example: 1
pageSizeinteger

How many items to return per page. Between 1 and 100.

default: 50example: 25
searchstring

Text to look for in messages.

example: plumber
fileNamestring

Text to look for in attachment names.

Response

200 · One page of matching messages.

itemsChatMessage[]

The unread messages, one page at a time.

currentPageinteger

The page number that was returned.

totalPagesinteger

How many pages exist at this page size.

pageSizeinteger

How many items a page holds.

totalCountinteger

How many items match in total, across every page.

chatsChat[]

The chats the messages in items belong to, so you can show each message in context without another call.

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

Give search, fileName, or both. With neither, the endpoint returns your company's messages unfiltered, newest page first.