---
title: "Search files in a team"
method: POST
path: "/api/v4/teams/{team_id}/files/search"
tags: ["teams", "files", "search"]
---

# Search files in a team

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

Search for files in a team based on file name, extention and file content (if file content extraction is enabled and supported for the files).
##### 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 files 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). To search for specific extensions included `ext:extension`.
  - `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`

Files list retrieval successful

- 38cb7293FileInfoList
  - `order` string[]
  - `file_infos` object
  - `next_file_id` string — The ID of next file info. Not omitted when empty or not relevant.
  - `prev_file_id` string — The ID of previous file info. Not omitted when empty or not relevant.

## 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/158a854b0c7d/schema)
