---
title: "POST /_twake/app/v1/search"
method: POST
path: "/_twake/app/v1/search"
tags: ["Search Engine"]
---

# POST /_twake/app/v1/search

`POST /_twake/app/v1/search`

Search performs with OpenSearch on Tchat messages and rooms

## Request body

- object
  - `searchValue` string, required — Value used to perform the search on rooms and messages data

## Response `200`

Success

- object
  - `rooms` object[] — List of rooms whose name contains the search value
    - `room_id` string
    - `name` string
    - `avatar_url` string — Url of the room's avatar
  - `messages` object[] — List of messages whose content or/and sender display name contain the search value
    - `room_id` string
    - `event_id` string — Id of the message
    - `content` string
    - `display_name` string — Sender display name
    - `avatar_url` string — Sender's avatar url if it is a direct chat, otherwise it is the room's avatar url
    - `room_name` string — Room's name in case of the message is not part of a direct chat
  - `mails` object[] — List of mails from Tmail whose meta or content contain the search value
    - `attachments` object[]
      - `contentDisposition` string
      - `fileExtension` string
      - `fileName` string
      - `mediaType` string
      - `subtype` string
      - `textContent` string
    - `bcc` object[]
      - `address` string
      - `domain` string
      - `name` string
    - `cc` object[]
      - `address` string
      - `domain` string
      - `name` string
    - `date` string
    - `from` object[]
      - `address` string
      - `domain` string
      - `name` string
    - `hasAttachment` boolean
    - `headers` object[]
      - `name` string
      - `value` string
    - `htmlBody` string
    - `isAnswered` boolean
    - `isDeleted` boolean
    - `isDraft` boolean
    - `isFlagged` boolean
    - `isRecent` boolean
    - `isUnread` boolean
    - `mailboxId` string
    - `mediaType` string
    - `messageId` string
    - `mimeMessageID` string
    - `modSeq` number
    - `saveDate` string
    - `sentDate` string
    - `size` number
    - `subject` string[]
    - `subtype` string
    - `textBody` string
    - `threadId` string
    - `to` object[]
      - `address` string
      - `domain` string
      - `name` string
    - `uid` number
    - `userFlags` string[]

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `404` — Private note not found
- `405` — Unrecognized
- `500` — Internal server error

## Changes

- **2024-06-05** `469fba74c62d` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/linagora/apis/twake-on-matrix-apis-documentation/changes/_twake/app/v1/search/post.md)

---

[API](https://skmtc.dev/linagora/apis/twake-on-matrix-apis-documentation.md) · [All operations](https://skmtc.dev/linagora/apis/twake-on-matrix-apis-documentation/llms.txt) · [OpenAPI document](https://skmtc.dev/linagora/apis/twake-on-matrix-apis-documentation/revisions/ecce38b281bc?raw)
