---
title: "Search all private and open type channels"
method: POST
path: "/api/v4/channels/search"
tags: ["channels"]
---

# Search all private and open type channels

`POST /api/v4/channels/search`

Returns all private and open type channels where 'term' matches on the name, display name, or purpose of
the channel.

Configured 'default' channels (ex Town Square and Off-Topic) can be excluded from the results
with the `exclude_default_channels` boolean parameter.

Channels that are associated (via GroupChannel records) to a given group can be excluded from the results
with the `not_associated_to_group` parameter and a group id string.

## Query parameters

- `system_console` boolean

## Request body

- object
  - `term` string, required — The string to search in the channel name, display name, and purpose.
  - `not_associated_to_group` string — A group id to exclude channels that are associated to that group via GroupChannel records.
  - `exclude_default_channels` boolean — Exclude default channels from the results by setting this parameter to true.
  - `team_ids` string[] — Filters results to channels belonging to the given team ids
  - `group_constrained` boolean — Filters results to only return channels constrained to a group
  - `exclude_group_constrained` boolean — Filters results to exclude channels constrained to a group
  - `public` boolean — Filters results to only return Public / Open channels, can be used in conjunction with `private` to return both `public` and `private` channels
  - `private` boolean — Filters results to only return Private channels, can be used in conjunction with `public` to return both `private` and `public` channels
  - `deleted` boolean — Filters results to only return deleted / archived channels
  - `page` integer — The page number to return, if paginated. If this parameter is not present with the `per_page` parameter then the results will be returned un-paged.
  - `per_page` integer — The number of entries to return per page, if paginated. If this parameter is not present with the `page` parameter then the results will be returned un-paged.
  - `exclude_policy_constrained` boolean — If set to true, only channels which do not have a granular retention policy assigned to them will be returned. The `sysconsole_read_compliance_data_retention` permission is required to use this parameter.
  - `include_search_by_id` boolean — If set to true, returns channels where given search 'term' matches channel ID.

## Response `200`

Paginated channel response. (Note that the non-paginated response—returned if the request body does not contain both `page` and `per_page` fields—is a simple array of channels.)

- object
  - `channels` 38cb7293Channel[] — The channels that matched the query.
    - `id` string
    - `create_at` integer — The time in milliseconds a channel was created
    - `update_at` integer — The time in milliseconds a channel was last updated
    - `delete_at` integer — The time in milliseconds a channel was deleted
    - `team_id` string
    - `type` string
    - `display_name` string
    - `name` string
    - `header` string
    - `purpose` string
    - `last_post_at` integer — The time in milliseconds of the last post of a channel
    - `total_msg_count` integer
    - `creator_id` string
  - `total_count` number — The total number of results, regardless of page and per_page requested.

## Other responses

- `400` — Invalid or missing parameters in URL or request body
- `401` — No access token provided

---

[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)
