---
title: "Search for team posts"
method: POST
path: "/api/v4/teams/{team_id}/posts/search"
tags: ["posts"]
---

# Search for team posts

`POST /api/v4/teams/{team_id}/posts/search`

Search posts in the team and from the provided terms string.
##### Permissions
Must be authenticated and have the `view_team` permission.

## Path parameters

- `team_id` string, required

## Request body

- object
  - `terms` string, required — The search terms as inputed by the user. To search for posts from a user include `from:someusername`, using a user's username. To search in a specific channel include `in:somechannel`, using the channel name (not the display name).
  - `is_or_search` boolean, required — Set to true if an Or search should be performed vs an And search.
  - `time_zone_offset` integer — Offset from UTC of user timezone for date searches.
  - `include_deleted_channels` boolean — Set to true if deleted channels should be included in the search. (archived channels)
  - `page` integer — The page to select. (Only works with Elasticsearch)
  - `per_page` integer — The number of posts per page. (Only works with Elasticsearch)

## Response `200`

Post list retrieval successful

- 38cb7293PostListWithSearchMatches
  - `order` string[]
  - `posts` object
  - `matches` object — A mapping of post IDs to a list of matched terms within the post.

## Other responses

- `400` — Invalid or missing parameters in URL or request body
- `401` — No access token provided
- `403` — Do not have appropriate permissions

---

[API](https://skmtc.dev/infomaniak/apis/api-reference-developer-tools.md) · [All operations](https://skmtc.dev/infomaniak/apis/api-reference-developer-tools/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/infomaniak/api-reference-developer-tools/revisions/667aae28fec6/schema)
