mattermost/api/v4/source/channels.yaml
Miguel de la Cruz 48f2fd0873
Merge the Integrated Boards MVP feature branch (#35796)
* Add CreatedBy and UpdatedBy to the properties fields and values (#34485)

* Add CreatedBy and UpdatedBy to the properties fields and values

* Fix types

---------

Co-authored-by: Miguel de la Cruz <miguel@ctrlz.es>

* Adds ObjectType to the property fields table (#34908)

Co-authored-by: Miguel de la Cruz <miguel@ctrlz.es>

* Update ObjectType migration setting an empty value and marking the column as not null (#34915)

Co-authored-by: Miguel de la Cruz <miguel@ctrlz.es>

* Adds uniqueness mechanisms to the property fields (#35058)

* Adds uniqueness mechanisms to the property fields

After adding ObjectType, this commit ensures that both the PSAv1 and
PSAv2 schemas are supported, and enforces property uniqueness through
both database indexes and a logical check when creating new property
fields.

* Adds uniqueness check to property updates

Updates are covered on this commit and we refactor as well the SQL
code to use the squirrel builder and work better with the conditional
addition of the `existingID` piece of the query.

* Add translations to error messages

* Fixing retrylayer mocks

* Remove retrylayer duplication

* Address review comments

* Fix comment to avoid linter issues

* Address PR comments

* Update server/channels/db/migrations/postgres/000157_add_object_type_to_property_fields.down.sql

Co-authored-by: Alejandro García Montoro <alejandro.garciamontoro@gmail.com>

* Update server/channels/db/migrations/postgres/000157_add_object_type_to_property_fields.up.sql

Co-authored-by: Alejandro García Montoro <alejandro.garciamontoro@gmail.com>

* Update server/channels/db/migrations/postgres/000157_add_object_type_to_property_fields.up.sql

Co-authored-by: Alejandro García Montoro <alejandro.garciamontoro@gmail.com>

* Update field validation to check only for valid target types

* Update migrations to avoid concurrent index creation within a transaction

* Update migrations to make all index ops concurrent

* Update tests to use valid PSAv2 property fields

* Adds a helper for valid PSAv2 TargetTypes

---------

Co-authored-by: Miguel de la Cruz <miguel@ctrlz.es>
Co-authored-by: Alejandro García Montoro <alejandro.garciamontoro@gmail.com>

* Fix property tests (#35388)

Co-authored-by: Miguel de la Cruz <miguel@ctrlz.es>

* Adds Integrated Boards feature flag (#35378)

Co-authored-by: Miguel de la Cruz <miguel@ctrlz.es>

* Adds Integrated Boards MVP API changes (#34822)

This PR includes the necessary changes for channels and posts
endpoints and adds a set of generic endpoints to retrieve and manage
property fields and values following the new Property System approach.

Co-authored-by: Miguel de la Cruz <miguel@ctrlz.es>
Co-authored-by: Mattermost Build <build@mattermost.com>

* Property System Architecture permissions for v2 (#35113)

* Adds uniqueness mechanisms to the property fields

After adding ObjectType, this commit ensures that both the PSAv1 and
PSAv2 schemas are supported, and enforces property uniqueness through
both database indexes and a logical check when creating new property
fields.

* Adds uniqueness check to property updates

Updates are covered on this commit and we refactor as well the SQL
code to use the squirrel builder and work better with the conditional
addition of the `existingID` piece of the query.

* Add translations to error messages

* Add the permissions to the migrations, model and update the store calls

* Adds the property field and property group app layer

* Adds authorization helpers for property fields and values

* Make sure that users cannot lock themselves out of property fields

* Migrate permissions from a JSON column to three normalized columns

* Remove the audit comment

* Use target level constants in authorization

* Log authorization membership failures

* Rename admin to sysadmin

* Fix i18n sorting

---------

Co-authored-by: Miguel de la Cruz <miguel@ctrlz.es>

* Add Views store and app layer (#35361)

* Add Views store and app layer for Integrated Boards

Implements the View entity (model, SQL store, service, app) as described
in the Integrated Boards tech spec. Views are channel-scoped board
configurations with typed props (board, kanban subviews) and soft-delete.

- public/model: View, ViewBoardProps, Subview, ViewPatch types with
  PreSave/PreUpdate/IsValid/Patch/Clone/Auditable
- Migration 158: Views table with jsonb Props column and indexes
- SqlViewStore: CRUD with nil-safe Props marshaling (AppendBinaryFlag)
- ViewService: CreateView seeds default kanban subview and links the
  boards property field; caches boardPropertyFieldID at startup
- App layer: CreateView/GetView/GetViewsForChannel/UpdateView/DeleteView
  with channel-membership permission checks and WebSocket events
  (view_created, view_updated, view_deleted)
- doSetupBoardsPropertyField: registers the Boards property group and
  board field in NewServer() before ViewService construction
- GetFieldByName now returns store.ErrNotFound instead of raw sql.ErrNoRows

* Move permission checks out of App layer for views

- Remove HasPermissionToChannel calls from all App view methods
- Drop userID params from GetView, GetViewsForChannel, UpdateView, DeleteView
- Fix doSetupBoardsPropertyField to include required TargetType for PSAv2 field

* Make View service generic and enforce board validation in model

- Remove board-specific auto-setup from service and server startup
- Enforce that board views require Props, at least one subview, and at least one linked property in IsValid()
- Move default subview seeding out of app layer; callers must provide valid props
- Call PreSave on subviews during PreUpdate to assign IDs to new subviews
- Update all tests to reflect the new validation requirements

* Restore migrations files to match base branch

* Distinguish ErrNotFound from other errors in view store Get

* Use CONCURRENTLY and nontransactional for index operations in views migration

* Split views index creation into separate nontransactional migrations

* Update migrations.list

* Update i18n translations for views

* Fix makeView helper to include required Props for board view validation

* Rename ctx parameter from c to rctx in OAuthProvider mock

* Remove views service layer, call store directly from app

* Return 500 for unexpected DB errors in GetView, 404 only for not-found

* Harden View model: deep-copy Props, validate linked property IDs

- Add ViewBoardProps.Clone() to deep-copy LinkedProperties and Subviews
- Use it in View.Clone() and View.Patch() to prevent shared-slice aliasing
- Iterate over LinkedProperties in View.IsValid() and reject invalid IDs
  with a dedicated i18n key
- Register ViewStore in storetest AssertExpectations so mock expectations
  are enforced
- Add tests covering all new behaviours

* Restore autotranslation worker_stopped i18n translation

* Fix view store test IDs and improve error handling in app layer

- Use model.NewId() for linked property IDs in testUpdateView to fix
  validation failure (IsValid rejects non-UUID strings)
- Fix import grouping in app/view.go (stdlib imports in one block)
- Return 404 instead of 500 when Update/Delete store calls return
  ErrNotFound (e.g. concurrent deletion TOCTOU race)

* Add View store mock to retrylayer test genStore helper

The View store was added to the store interface but the genStore()
helper in retrylayer_test.go was not updated, causing TestRetry to panic.
Also removes the duplicate Recap mock registration.

* Refactor view deletion and websocket event handling; update SQL store methods to use query builder

* revert property field store

* Remove useless migrations

* Add cursor-based pagination to View store GetForChannel

- Add ViewQueryCursor and ViewQueryOpts types with validation
- Return (views, cursor, error) for caller-driven pagination
- PerPage clamping: <=0 defaults to 20, >200 clamps to 200
- Support IncludeDeleted filter
- Add comprehensive store tests for pagination, cursor edge cases,
  PerPage clamping, and invalid input rejection
- Add app layer test for empty channelID → 400
- Update interface, retrylayer, timerlayer, and mock signatures

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Refactor test loops in ViewStore tests for improved readability

* change pagination to limit/offset

* Add upper-bound limits on View Subviews and LinkedProperties

Defense-in-depth validation: cap Subviews at 50 and LinkedProperties
at 500 to prevent abuse below the 300KB payload limit.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* MM-67388, MM-66528, MM-67750: Add View REST API endpoints, websocket events, and sort order (#35442)

* Add Views store and app layer for Integrated Boards

Implements the View entity (model, SQL store, service, app) as described
in the Integrated Boards tech spec. Views are channel-scoped board
configurations with typed props (board, kanban subviews) and soft-delete.

- public/model: View, ViewBoardProps, Subview, ViewPatch types with
  PreSave/PreUpdate/IsValid/Patch/Clone/Auditable
- Migration 158: Views table with jsonb Props column and indexes
- SqlViewStore: CRUD with nil-safe Props marshaling (AppendBinaryFlag)
- ViewService: CreateView seeds default kanban subview and links the
  boards property field; caches boardPropertyFieldID at startup
- App layer: CreateView/GetView/GetViewsForChannel/UpdateView/DeleteView
  with channel-membership permission checks and WebSocket events
  (view_created, view_updated, view_deleted)
- doSetupBoardsPropertyField: registers the Boards property group and
  board field in NewServer() before ViewService construction
- GetFieldByName now returns store.ErrNotFound instead of raw sql.ErrNoRows

* Move permission checks out of App layer for views

- Remove HasPermissionToChannel calls from all App view methods
- Drop userID params from GetView, GetViewsForChannel, UpdateView, DeleteView
- Fix doSetupBoardsPropertyField to include required TargetType for PSAv2 field

* Make View service generic and enforce board validation in model

- Remove board-specific auto-setup from service and server startup
- Enforce that board views require Props, at least one subview, and at least one linked property in IsValid()
- Move default subview seeding out of app layer; callers must provide valid props
- Call PreSave on subviews during PreUpdate to assign IDs to new subviews
- Update all tests to reflect the new validation requirements

* Restore migrations files to match base branch

* Distinguish ErrNotFound from other errors in view store Get

* Use CONCURRENTLY and nontransactional for index operations in views migration

* Split views index creation into separate nontransactional migrations

* Update migrations.list

* Update i18n translations for views

* Fix makeView helper to include required Props for board view validation

* Rename ctx parameter from c to rctx in OAuthProvider mock

* Remove views service layer, call store directly from app

* Return 500 for unexpected DB errors in GetView, 404 only for not-found

* Harden View model: deep-copy Props, validate linked property IDs

- Add ViewBoardProps.Clone() to deep-copy LinkedProperties and Subviews
- Use it in View.Clone() and View.Patch() to prevent shared-slice aliasing
- Iterate over LinkedProperties in View.IsValid() and reject invalid IDs
  with a dedicated i18n key
- Register ViewStore in storetest AssertExpectations so mock expectations
  are enforced
- Add tests covering all new behaviours

* Restore autotranslation worker_stopped i18n translation

* Fix view store test IDs and improve error handling in app layer

- Use model.NewId() for linked property IDs in testUpdateView to fix
  validation failure (IsValid rejects non-UUID strings)
- Fix import grouping in app/view.go (stdlib imports in one block)
- Return 404 instead of 500 when Update/Delete store calls return
  ErrNotFound (e.g. concurrent deletion TOCTOU race)

* Add View store mock to retrylayer test genStore helper

The View store was added to the store interface but the genStore()
helper in retrylayer_test.go was not updated, causing TestRetry to panic.
Also removes the duplicate Recap mock registration.

* Refactor view deletion and websocket event handling; update SQL store methods to use query builder

* revert property field store

* Add View API endpoints with OpenAPI spec, client methods, and i18n

Implement REST API for channel views (board-type) behind the
IntegratedBoards feature flag. Adds CRUD endpoints under
/api/v4/channels/{channel_id}/views with permission checks
matching the channel bookmark pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Remove useless migrations

* Add cursor-based pagination to View store GetForChannel

- Add ViewQueryCursor and ViewQueryOpts types with validation
- Return (views, cursor, error) for caller-driven pagination
- PerPage clamping: <=0 defaults to 20, >200 clamps to 200
- Support IncludeDeleted filter
- Add comprehensive store tests for pagination, cursor edge cases,
  PerPage clamping, and invalid input rejection
- Add app layer test for empty channelID → 400
- Update interface, retrylayer, timerlayer, and mock signatures

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add cursor-based pagination to View API for channel views

* Enhance cursor handling in getViewsForChannel and update tests for pagination

* Refactor test loops in ViewStore tests for improved readability

* Refactor loop in TestGetViewsForChannel for improved readability

* change pagination to limit/offset

* switch to limit/offset pagination

* Add upper-bound limits on View Subviews and LinkedProperties

Defense-in-depth validation: cap Subviews at 50 and LinkedProperties
at 500 to prevent abuse below the 300KB payload limit.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add view sort order API endpoint

Add POST /api/v4/channels/{channel_id}/views/{view_id}/sort_order
endpoint following the channel bookmarks reorder pattern. Includes
store, app, and API layers with full test coverage at each layer.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add connectionId to view WebSocket events and sort_order API spec

Thread connectionId from request header through all view handlers
(create, update, delete, sort_order) to WebSocket events, matching
the channel bookmarks pattern. Add sort_order endpoint to OpenAPI
spec. Update minimum server version to 11.6.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Remove duplicate View/ViewPatch definitions from definitions.yaml

The merge from integrated-boards-mvp introduced duplicate View and
ViewPatch schema definitions that were already defined earlier in
the file with more detail (including ViewBoardProps ref and enums).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Update minimum server version to 11.6 in views API spec

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add missing translations for view sort order error messages

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Merge integrated-boards-mvp into ibmvp_api-views; remove spec files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix flaky TestViewStore timestamp test on CI

Add sleep before UpdateSortOrder to ensure timestamps differ,
preventing same-millisecond comparisons on fast CI machines.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* remove duplicate views.yaml imclude

* Use c.boolString() for include_deleted query param in GetViewsForChannel

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix views.yaml sort order schema: use integer type and require body

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Refactor view sort order tests to use named IDs instead of array indices

Extract idA/idB/idC from views slice and add BEFORE/AFTER comments
to make stateful subtest ordering easier to follow.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Return 404 instead of 403 for view operations on deleted channels

Deleted channels should appear non-existent to callers rather than
revealing their existence via a 403. Detailed error text explains
the context for debugging.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* add missing channel deleteat checks

* Use c.Params.Page instead of manual page query param parsing in getViewsForChannel

c.Params already validates and defaults page/per_page, so the manual
parsing was redundant.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add support for total count in views retrieval

* Add tests for handling deleted views in GetViewsForChannel and GetView

* Short-circuit negative newIndex in UpdateSortOrder before opening transaction

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add per-channel limit on views to bound UpdateSortOrder cost

Without a cap, unbounded view creation makes sort-order updates
increasingly expensive (CASE WHEN per view, row locks). Adds
MaxViewsPerChannel=50 constant and enforces it in the app layer
before saving. Includes API and app layer tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Remove include_deleted support from views API

Soft-deleted views are structural metadata with low risk, but no other
similar endpoint (e.g. channel bookmarks) exposes deleted records without
an admin gate. Rather than adding an admin-only permission check for
consistency, remove the feature entirely since there is no current use case.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Update view permissions to require `create_post` instead of channel management permissions

* Remove obsolete view management error messages for direct and group messages

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* feat(migrations): add user tracking and object type to property fields

- Introduced user tracking columns (CreatedBy, UpdatedBy) to PropertyFields and PropertyValues.
- Added ObjectType column to PropertyFields with associated unique indexes for legacy and typed properties.
- Created new migration scripts for adding and dropping these features, including necessary indexes for data integrity.
- Established views for managing property fields with new attributes.

This update enhances the schema to support better tracking and categorization of property fields.

* Add Property System Architecture v2 API endpoints (#35583)

* Adds uniqueness mechanisms to the property fields

After adding ObjectType, this commit ensures that both the PSAv1 and
PSAv2 schemas are supported, and enforces property uniqueness through
both database indexes and a logical check when creating new property
fields.

* Adds uniqueness check to property updates

Updates are covered on this commit and we refactor as well the SQL
code to use the squirrel builder and work better with the conditional
addition of the `existingID` piece of the query.

* Add translations to error messages

* Add the permissions to the migrations, model and update the store calls

* Adds the property field and property group app layer

* Adds authorization helpers for property fields and values

* Make sure that users cannot lock themselves out of property fields

* Migrate permissions from a JSON column to three normalized columns

* Remove the audit comment

* Use target level constants in authorization

* Log authorization membership failures

* Rename admin to sysadmin

* Adds the Property System Architecture v2 API endpoints

* Adds permission checks to the create field endpoint

* Add target access checks to value endpoints

* Add default branches for object_type and target_type and extra guards for cursor client4 methods

* Fix vet API mismatch

* Fix error checks

* Fix linter

* Add merge semantics for property patch logic and API endpoint

* Fix i18n

* Fix duplicated patch elements and early return on bad cursor

* Update docs to use enums

* Fix i18n sorting

* Update app layer to return model.AppError

* Adds a limit to the number of property values that can be patched in the same request

* Require target_type filter when searching property fields

* Add objectType validation as part of field.IsValid()

* Fix linter

* Fix test with bad objecttpye

* Fix test grouping

---------

Co-authored-by: Miguel de la Cruz <miguel@ctrlz.es>

* MM-67968: Flatten view model — remove icon, subviews, typed board props (#35726)

* feat(views): flatten view model by removing icon, subview, and board props

Simplifies the View data model as part of MM-67968: removes Icon, Subview,
and ViewBoardProps types; renames ViewTypeBoard to ViewTypeKanban; replaces
typed Props with StringInterface (map[string]any); adds migration 000167
to drop the Icon column from the Views table.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>

* feat(api): update views OpenAPI spec to reflect flattened model

Removes ViewBoardProps, Subview, and icon from the View and ViewPatch
schemas. Changes type enum from board to kanban. Replaces typed props
with a free-form StringInterface object. Aligns with MM-67968.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>

* refactor(views): simplify store by dropping dbView and marshalViewProps

StringInterface already implements driver.Valuer and sql.Scanner, so the
manual JSON marshal/unmarshal and the dbView intermediate struct were
redundant. model.View now scans directly from the database. Also removes
the dead ViewMaxLinkedProperties constant and wraps the Commit() error in
UpdateSortOrder.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>

* fix(api): allow arbitrary JSON in view props OpenAPI schema

The props field was restricted to string values via
additionalProperties: { type: string }, conflicting with the Go model's
StringInterface (map[string]any). Changed to additionalProperties: true
in View, ViewPatch, and inline POST schemas.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>

* Adds basic implementation of the generic redux store for PSAv2 (#35512)

* Adds basic implementation of the generic redux store for PSAv2

* Add created_by and updated_by to the test fixtures

* Make target_id, target_type and object_type mandatory

* Wrap getPropertyFieldsByIds and getPropertyValuesForTargetByFieldIds with createSelector

* Address PR comments

---------

Co-authored-by: Miguel de la Cruz <miguel@ctrlz.es>

* Adds websocket messages for the PSAv2 API events (#35696)

* Adds uniqueness mechanisms to the property fields

After adding ObjectType, this commit ensures that both the PSAv1 and
PSAv2 schemas are supported, and enforces property uniqueness through
both database indexes and a logical check when creating new property
fields.

* Adds uniqueness check to property updates

Updates are covered on this commit and we refactor as well the SQL
code to use the squirrel builder and work better with the conditional
addition of the `existingID` piece of the query.

* Add translations to error messages

* Add the permissions to the migrations, model and update the store calls

* Adds the property field and property group app layer

* Adds authorization helpers for property fields and values

* Make sure that users cannot lock themselves out of property fields

* Migrate permissions from a JSON column to three normalized columns

* Remove the audit comment

* Use target level constants in authorization

* Log authorization membership failures

* Rename admin to sysadmin

* Adds the Property System Architecture v2 API endpoints

* Adds permission checks to the create field endpoint

* Add target access checks to value endpoints

* Add default branches for object_type and target_type and extra guards for cursor client4 methods

* Fix vet API mismatch

* Fix error checks

* Fix linter

* Add merge semantics for property patch logic and API endpoint

* Fix i18n

* Fix duplicated patch elements and early return on bad cursor

* Update docs to use enums

* Fix i18n sorting

* Update app layer to return model.AppError

* Adds a limit to the number of property values that can be patched in the same request

* Adds websocket messages for the PSAv2 API events

* Add IsPSAv2 helper to the property field for clarity

* Add guard against nil returns on field deletion

* Add docs to the websocket endpoints

---------

Co-authored-by: Miguel de la Cruz <miguel@ctrlz.es>

* migrations: consolidate views migrations and reorder after master

- Merged 000165 (create Views) with 000167 (drop Icon) since Icon was never needed
- Renumbered branch migrations 159-166 → 160-167 so master's 000159 (deduplicate_policy_names) runs first
- Regenerated migrations.list

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add API endpoint to retrieve posts for a specific view (#35604)

Automatic Merge

* Apply fixes after merge

* Return a more specific error from getting multiple fields

* Prevent getting broadcast params on field deletion if not needed

* Remove duplicated migration code

* Update property conflict code to always use master

* Adds nil guard when iterating on property fields

* Check that permission level is valid before getting rejected by the database

* Validate correctness on TargetID for PSAv2 fields

* Avoid PSAv1 using permissions or protected

* Fix test data after validation change

* Fix flaky search test

* Adds more posts for filter use cases to properly test exclusions

---------

Co-authored-by: Miguel de la Cruz <miguel@ctrlz.es>
Co-authored-by: Alejandro García Montoro <alejandro.garciamontoro@gmail.com>
Co-authored-by: Julien Tant <julien@craftyx.fr>
Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Julien Tant <785518+JulienTant@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-27 10:36:35 +01:00

2625 lines
81 KiB
YAML

/api/v4/channels:
get:
tags:
- channels
summary: Get a list of all channels
description: |
##### Permissions
`manage_system`
operationId: GetAllChannels
parameters:
- name: not_associated_to_group
in: query
description: A group id to exclude channels that are associated with that group via GroupChannel records. This can also be left blank with `not_associated_to_group=`.
schema:
type: string
- name: page
in: query
description: The page to select.
schema:
type: integer
default: 0
- name: per_page
in: query
description: The number of channels per page.
schema:
type: integer
default: 0
- name: exclude_default_channels
in: query
description: Whether to exclude default channels (ex Town Square, Off-Topic) from the results.
schema:
type: boolean
default: false
- name: include_deleted
in: query
description: Include channels that have been archived. This correlates to the `DeleteAt` flag being set in the database.
schema:
type: boolean
default: false
- name: include_total_count
in: query
description: >-
Appends a total count of returned channels inside the response object - ex: `{ "channels": [], "total_count" : 0 }`.
schema:
type: boolean
default: false
- name: exclude_policy_constrained
in: query
schema:
type: boolean
default: false
description: >-
If set to true, channels which are part of a data retention policy will be excluded.
The `sysconsole_read_compliance` permission is required to use this parameter.
__Minimum server version__: 5.35
responses:
"200":
description: Channel list retrieval successful
content:
application/json:
schema:
$ref: "#/components/schemas/ChannelListWithTeamData"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"404":
$ref: "#/components/responses/NotFound"
post:
tags:
- channels
summary: Create a channel
description: >
Create a new channel.
##### Permissions
If creating a public channel, `create_public_channel` permission is required. If creating a private channel, `create_private_channel` permission is required.
operationId: CreateChannel
requestBody:
content:
application/json:
schema:
type: object
required:
- name
- display_name
- type
- team_id
properties:
team_id:
type: string
description: The team ID of the team to create the channel on
name:
type: string
description: The unique handle for the channel, will be present in the
channel URL
display_name:
type: string
description: The non-unique UI name for the channel
purpose:
type: string
description: A short description of the purpose of the channel
header:
type: string
description: Markdown-formatted text to display in the header of the
channel
type:
type: string
description: "'O' for a public channel, 'P' for a private channel"
description: Channel object to be created
required: true
responses:
"201":
description: Channel creation successful
content:
application/json:
schema:
$ref: "#/components/schemas/Channel"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
/api/v4/channels/direct:
post:
tags:
- channels
summary: Create a direct message channel
description: >
Create a new direct message channel between two users.
##### Permissions
Must be one of the two users and have `create_direct_channel` permission. Having the `manage_system` permission voids the previous requirements.
operationId: CreateDirectChannel
requestBody:
content:
application/json:
schema:
type: array
items:
type: string
minItems: 2
maxItems: 2
description: The two user ids to be in the direct message
required: true
responses:
"201":
description: Direct channel creation successful
content:
application/json:
schema:
$ref: "#/components/schemas/Channel"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
/api/v4/channels/group:
post:
tags:
- channels
summary: Create a group message channel
description: >
Create a new group message channel to group of users. If the logged in
user's id is not included in the list, it will be appended to the end.
##### Permissions
Must have `create_group_channel` permission.
operationId: CreateGroupChannel
requestBody:
content:
application/json:
schema:
type: array
items:
type: string
minItems: 3
maxItems: 8
description: User ids to be in the group message channel.
required: true
responses:
"201":
description: Group channel creation successful
content:
application/json:
schema:
$ref: "#/components/schemas/Channel"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
/api/v4/channels/search:
post:
tags:
- channels
summary: Search all private and open type channels across all teams
description: >
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.
operationId: SearchAllChannels
parameters:
- name: system_console
in: query
description: >
Is the request from system_console. If this is set to true, it filters channels
by the logged in user.
required: false
schema:
type: boolean
default: true
requestBody:
content:
application/json:
schema:
type: object
required:
- term
properties:
term:
type: string
description: The string to search in the channel name, display name, and
purpose.
not_associated_to_group:
type: string
description: A group id to exclude channels that are associated to that
group via GroupChannel records.
exclude_default_channels:
type: boolean
description: Exclude default channels from the results by setting this
parameter to true.
team_ids:
type: array
items:
type: string
description: >
Filters results to channels belonging to the given team ids
__Minimum server version__: 5.26
group_constrained:
type: boolean
description: >
Filters results to only return channels constrained to a group
__Minimum server version__: 5.26
exclude_group_constrained:
type: boolean
description: >
Filters results to exclude channels constrained to a group
__Minimum server version__: 5.26
public:
type: boolean
description: >
Filters results to only return Public / Open channels, can be used in conjunction
with `private` to return both `public` and `private` channels
__Minimum server version__: 5.26
private:
type: boolean
description: >
Filters results to only return Private channels, can be used in conjunction
with `public` to return both `private` and `public` channels
__Minimum server version__: 5.26
deleted:
type: boolean
description: >
Filters results to only return deleted / archived channels
__Minimum server version__: 5.26
page:
type: string
description: 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:
type: string
description: 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:
type: boolean
default: false
description: >
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.
__Minimum server version__: 5.35
include_search_by_id:
type: boolean
default: false
description: >
If set to true, returns channels where given search 'term' matches channel ID.
__Minimum server version__: 5.35
exclude_remote:
type: boolean
default: false
description: >
If set to true, only returns channels that are local to this server.
__Minimum server version__: 10.2
description: The search terms and logic to use in the search.
required: true
responses:
"200":
description: 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.)
content:
application/json:
schema:
type: object
properties:
channels:
type: array
description: The channels that matched the query.
items:
$ref: "#/components/schemas/Channel"
total_count:
type: number
description: The total number of results, regardless of page and
per_page requested.
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
/api/v4/channels/group/search:
post:
tags:
- channels
summary: Search Group Channels
description: >
Get a list of group channels for a user which members' usernames match
the search term.
__Minimum server version__: 5.14
operationId: SearchGroupChannels
requestBody:
content:
application/json:
schema:
type: object
required:
- term
properties:
term:
description: The search term to match against the members' usernames of
the group channels
type: string
description: Search criteria
required: true
responses:
"200":
description: Channels search successful
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Channel"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"/api/v4/teams/{team_id}/channels/ids":
post:
tags:
- channels
summary: Get a list of channels by ids
description: |
Get a list of public channels on a team by id.
##### Permissions
`view_team` for the team the channels are on.
operationId: GetPublicChannelsByIdsForTeam
parameters:
- name: team_id
in: path
description: Team GUID
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: array
items:
type: string
description: List of channel ids.
required: true
responses:
"200":
description: Channel list retrieval successful
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Channel"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"404":
$ref: "#/components/responses/NotFound"
"/api/v4/channels/{channel_id}/timezones":
get:
tags:
- channels
summary: Get timezones in a channel
description: |
Get a list of timezones for the users who are in this channel.
__Minimum server version__: 5.6
##### Permissions
Must have the `read_channel` permission.
operationId: GetChannelMembersTimezones
parameters:
- name: channel_id
in: path
description: Channel GUID
required: true
schema:
type: string
responses:
"200":
description: Timezone retrieval successful
content:
application/json:
schema:
type: array
items:
type: string
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"/api/v4/channels/{channel_id}":
get:
tags:
- channels
summary: Get a channel
description: |
Get channel from the provided channel id string.
##### Permissions
`read_channel` permission for the channel.
operationId: GetChannel
parameters:
- name: channel_id
in: path
description: Channel GUID
required: true
schema:
type: string
responses:
"200":
description: Channel retrieval successful
content:
application/json:
schema:
$ref: "#/components/schemas/Channel"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
put:
tags:
- channels
summary: Update a channel
description: >
Update a channel. The fields that can be updated are listed as
parameters. Omitted fields will be treated as blanks.
##### Permissions
If updating a public channel, `manage_public_channel_members` permission is required. If updating a private channel, `manage_private_channel_members` permission is required.
operationId: UpdateChannel
parameters:
- name: channel_id
in: path
description: Channel GUID
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
required:
- id
properties:
id:
type: string
description: The channel's id, not updatable
name:
type: string
description: The unique handle for the channel, will be present in the
channel URL
display_name:
type: string
description: The non-unique UI name for the channel
purpose:
type: string
description: A short description of the purpose of the channel
header:
type: string
description: Markdown-formatted text to display in the header of the
channel
description: Channel object to be updated
required: true
responses:
"200":
description: Channel update successful
content:
application/json:
schema:
$ref: "#/components/schemas/Channel"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
delete:
tags:
- channels
summary: Delete a channel
description: >
Archives a channel. This will set the `deleteAt` to the current timestamp in the database. Soft deleted channels may not be accessible in the user
interface. They can be viewed and unarchived in the **System Console > User Management > Channels** based on your license. Direct and group message channels cannot be deleted.
As of server version 5.28, optionally use the `permanent=true` query parameter to permanently delete the channel for compliance reasons. To use this feature `ServiceSettings.EnableAPIChannelDeletion` must be set to `true` in the server's configuration.
If you permanently delete a channel this action is not recoverable outside of a database backup.
##### Permissions
`delete_public_channel` permission if the channel is public,
`delete_private_channel` permission if the channel is private,
or have `manage_system` permission.
operationId: DeleteChannel
parameters:
- name: channel_id
in: path
description: Channel GUID
required: true
schema:
type: string
responses:
"200":
description: Channel deletion successful
content:
application/json:
schema:
$ref: "#/components/schemas/StatusOK"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"/api/v4/channels/{channel_id}/patch":
put:
tags:
- channels
summary: Patch a channel
description: >
Partially update a channel by providing only the fields you want to
update. Omitted fields will not be updated. At least one of the allowed
fields must be provided.
**Public and private channels:** Can update `name`, `display_name`,
`purpose`, `header`, `group_constrained`, `autotranslation`, and
`banner_info` (subject to permissions and channel type).
**Direct and group message channels:** Only `header` and (when not
restricted by config) `autotranslation` can be updated; the caller
must be a channel member. Updating `name`, `display_name`, or `purpose`
is not allowed.
The default channel (e.g. Town Square) cannot have its `name` changed.
##### Permissions
- **Public channel:** For property updates (name, display_name, purpose, header, group_constrained),
`manage_public_channel_properties` is required. For `autotranslation`, `manage_public_channel_auto_translation`
is required. For `banner_info`, `manage_public_channel_banner` is required (Channel Banner feature and
Enterprise license required).
- **Private channel:** For property updates, `manage_private_channel_properties` is required. For
`autotranslation`, `manage_private_channel_auto_translation` is required. For `banner_info`,
`manage_private_channel_banner` is required (Channel Banner feature and Enterprise license required).
- **Direct or group message channel:** Must be a member of the channel; only `header` and (when allowed)
`autotranslation` can be updated.
operationId: PatchChannel
parameters:
- name: channel_id
in: path
description: Channel ID
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
properties:
name:
type: string
description: The unique handle for the channel, will be present in the
channel URL. Cannot be updated for direct or group message channels.
Cannot be changed for the default channel (e.g. Town Square).
display_name:
type: string
description: The non-unique UI name for the channel. Cannot be updated
for direct or group message channels.
purpose:
type: string
description: A short description of the purpose of the channel. Cannot
be updated for direct or group message channels.
header:
type: string
description: Markdown-formatted text to display in the header of the
channel
group_constrained:
type: boolean
description: When true, only members of the linked LDAP groups can join
the channel. Only applicable to public and private channels.
autotranslation:
type: boolean
description: Enable or disable automatic message translation in the
channel. Requires the auto-translation feature and appropriate
channel permission. May be restricted for direct and group message
channels by server configuration.
banner_info:
$ref: "#/components/schemas/ChannelBanner"
description: Channel patch object; include only the fields to update. At least
one field must be provided.
required: true
responses:
"200":
description: Channel patch successful
content:
application/json:
schema:
$ref: "#/components/schemas/Channel"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"/api/v4/channels/{channel_id}/privacy":
put:
tags:
- channels
summary: Update channel's privacy
description: >
Updates channel's privacy allowing changing a channel from Public to
Private and back.
__Minimum server version__: 5.16
##### Permissions
`manage_team` permission for the channels team on version < 5.28.
`convert_public_channel_to_private` permission for the channel if updating privacy to 'P' on version >= 5.28.
`convert_private_channel_to_public` permission for the channel if updating privacy to 'O' on version >= 5.28.
operationId: UpdateChannelPrivacy
parameters:
- name: channel_id
in: path
description: Channel GUID
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
required:
- privacy
properties:
privacy:
type: string
description: "Channel privacy setting: 'O' for a public channel, 'P' for
a private channel"
required: true
responses:
"200":
description: Channel conversion successful
content:
application/json:
schema:
$ref: "#/components/schemas/Channel"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"/api/v4/channels/{channel_id}/restore":
post:
tags:
- channels
summary: Restore a channel
description: |
Restore channel from the provided channel id string.
__Minimum server version__: 3.10
##### Permissions
`manage_team` permission for the team of the channel.
operationId: RestoreChannel
parameters:
- name: channel_id
in: path
description: Channel GUID
required: true
schema:
type: string
responses:
"200":
description: Channel restore successful
content:
application/json:
schema:
$ref: "#/components/schemas/Channel"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"/api/v4/channels/{channel_id}/move":
post:
tags:
- channels
summary: Move a channel
description: |
Move a channel to another team.
__Minimum server version__: 5.26
##### Permissions
Must have `manage_system` permission.
operationId: MoveChannel
parameters:
- name: channel_id
in: path
description: Channel GUID
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
required:
- team_id
properties:
team_id:
type: string
force:
description: "Remove members those are not member of target team before moving the channel."
type: boolean
required: true
responses:
"200":
description: Channel move successful
content:
application/json:
schema:
$ref: "#/components/schemas/Channel"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"/api/v4/channels/{channel_id}/stats":
get:
tags:
- channels
summary: Get channel statistics
description: |
Get statistics for a channel.
##### Permissions
Must have the `read_channel` permission.
operationId: GetChannelStats
parameters:
- name: channel_id
in: path
description: Channel GUID
required: true
schema:
type: string
responses:
"200":
description: Channel statistics retrieval successful
content:
application/json:
schema:
$ref: "#/components/schemas/ChannelStats"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"/api/v4/channels/{channel_id}/pinned":
get:
tags:
- channels
summary: Get a channel's pinned posts
description: Get a list of pinned posts for channel.
operationId: GetPinnedPosts
parameters:
- name: channel_id
in: path
description: Channel GUID
required: true
schema:
type: string
responses:
"200":
description: The list of channel pinned posts
content:
application/json:
schema:
$ref: "#/components/schemas/PostList"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"/api/v4/teams/{team_id}/channels":
get:
tags:
- channels
summary: Get public channels
description: >
Get a page of public channels on a team based on query string parameters
- page and per_page.
##### Permissions
Must be authenticated and have the `list_team_channels` permission.
operationId: GetPublicChannelsForTeam
parameters:
- name: team_id
in: path
description: Team GUID
required: true
schema:
type: string
- name: page
in: query
description: The page to select.
schema:
type: integer
default: 0
- name: per_page
in: query
description: The number of public channels per page.
schema:
type: integer
default: 60
responses:
"200":
description: Channels retrieval successful
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Channel"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"/api/v4/teams/{team_id}/channels/private":
get:
tags:
- channels
summary: Get private channels
description: |
Get a page of private channels on a team based on query string
parameters - team_id, page and per_page.
__Minimum server version__: 5.26
##### Permissions
Must have `manage_system` permission.
operationId: GetPrivateChannelsForTeam
parameters:
- name: team_id
in: path
description: Team GUID
required: true
schema:
type: string
- name: page
in: query
description: The page to select.
schema:
type: integer
default: 0
- name: per_page
in: query
description: The number of private channels per page.
schema:
type: integer
default: 60
responses:
"200":
description: Channels retrieval successful
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Channel"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"/api/v4/teams/{team_id}/channels/deleted":
get:
tags:
- channels
summary: Get deleted channels
description: >
Get a page of deleted channels on a team based on query string
parameters - team_id, page and per_page.
__Minimum server version__: 3.10
operationId: GetDeletedChannelsForTeam
parameters:
- name: team_id
in: path
description: Team GUID
required: true
schema:
type: string
- name: page
in: query
description: The page to select.
schema:
type: integer
default: 0
- name: per_page
in: query
description: The number of public channels per page.
schema:
type: integer
default: 60
responses:
"200":
description: Channels retrieval successful
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Channel"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"/api/v4/teams/{team_id}/channels/autocomplete":
get:
tags:
- channels
summary: Autocomplete channels
description: >
Autocomplete public channels on a team based on the search term provided
in the request URL.
__Minimum server version__: 4.7
##### Permissions
Must have the `list_team_channels` permission.
operationId: AutocompleteChannelsForTeam
parameters:
- name: team_id
in: path
description: Team GUID
required: true
schema:
type: string
- name: name
in: query
description: Name or display name
required: true
schema:
type: string
responses:
"200":
description: Channels autocomplete successful
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Channel"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"/api/v4/teams/{team_id}/channels/search_autocomplete":
get:
tags:
- channels
summary: Autocomplete channels for search
description: >
Autocomplete your channels on a team based on the search term provided
in the request URL.
__Minimum server version__: 5.4
##### Permissions
Must have the `list_team_channels` permission.
operationId: AutocompleteChannelsForTeamForSearch
parameters:
- name: team_id
in: path
description: Team GUID
required: true
schema:
type: string
- name: name
in: query
description: Name or display name
required: true
schema:
type: string
responses:
"200":
description: Channels autocomplete successful
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Channel"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"/api/v4/teams/{team_id}/channels/search":
post:
tags:
- channels
summary: Search channels
description: >
Search public channels on a team based on the search term provided in
the request body.
##### Permissions
Must have the `list_team_channels` permission.
In server version 5.16 and later, a user without the `list_team_channels` permission will be able to use this endpoint, with the search results limited to the channels that the user is a member of.
operationId: SearchChannels
parameters:
- name: team_id
in: path
description: Team GUID
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
required:
- term
properties:
term:
description: The search term to match against the name or display name of
channels
type: string
description: Search criteria
required: true
responses:
"201":
description: Channels search successful
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Channel"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"/api/v4/teams/{team_id}/channels/name/{channel_name}":
get:
tags:
- channels
summary: Get a channel by name
description: |
Gets channel from the provided team id and channel name strings.
##### Permissions
`read_channel` permission for the channel.
operationId: GetChannelByName
parameters:
- name: team_id
in: path
description: Team GUID
required: true
schema:
type: string
- name: channel_name
in: path
description: Channel Name
required: true
schema:
type: string
- name: include_deleted
in: query
description: Defines if deleted channels should be returned or not (Mattermost Server 5.26.0+)
schema:
type: boolean
default: false
responses:
"200":
description: Channel retrieval successful
content:
application/json:
schema:
$ref: "#/components/schemas/Channel"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"/api/v4/teams/name/{team_name}/channels/name/{channel_name}":
get:
tags:
- channels
summary: Get a channel by name and team name
description: |
Gets a channel from the provided team name and channel name strings.
##### Permissions
`read_channel` permission for the channel.
operationId: GetChannelByNameForTeamName
parameters:
- name: team_name
in: path
description: Team Name
required: true
schema:
type: string
- name: channel_name
in: path
description: Channel Name
required: true
schema:
type: string
- name: include_deleted
in: query
description: Defines if deleted channels should be returned or not (Mattermost Server 5.26.0+)
schema:
type: boolean
default: false
responses:
"200":
description: Channel retrieval successful
content:
application/json:
schema:
$ref: "#/components/schemas/Channel"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"/api/v4/channels/{channel_id}/members":
get:
tags:
- channels
summary: Get channel members
description: |
Get a page of members for a channel.
##### Permissions
`read_channel` permission for the channel.
operationId: GetChannelMembers
parameters:
- name: channel_id
in: path
description: Channel GUID
required: true
schema:
type: string
- name: page
in: query
description: The page to select.
schema:
type: integer
default: 0
- name: per_page
in: query
description: The number of members per page.
schema:
type: integer
default: 60
responses:
"200":
description: Channel members retrieval successful
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/ChannelMember"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
post:
tags:
- channels
summary: Add user(s) to channel
description: Add a user(s) to a channel by creating a channel member object(s).
operationId: AddChannelMember
parameters:
- name: channel_id
in: path
description: The channel ID
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
properties:
user_id:
type: string
description: The ID of user to add into the channel, for backwards compatibility.
user_ids:
type: array
items:
type: string
minItems: 1
maxItems: 1000
description: The IDs of users to add into the channel, required if 'user_id' doess not exist.
post_root_id:
type: string
description: The ID of root post where link to add channel member
originates
required: true
responses:
"201":
description: Channel member creation successful
content:
application/json:
schema:
$ref: "#/components/schemas/ChannelMember"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"/api/v4/channels/{channel_id}/members/ids":
post:
tags:
- channels
summary: Get channel members by ids
description: |
Get a list of channel members based on the provided user ids.
##### Permissions
Must have the `read_channel` permission.
operationId: GetChannelMembersByIds
parameters:
- name: channel_id
in: path
description: Channel GUID
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: array
items:
type: string
description: List of user ids.
required: true
responses:
"200":
description: Channel member list retrieval successful
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/ChannelMember"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"/api/v4/channels/{channel_id}/members/{user_id}":
get:
tags:
- channels
summary: Get channel member
description: |
Get a channel member.
##### Permissions
`read_channel` permission for the channel.
operationId: GetChannelMember
parameters:
- name: channel_id
in: path
description: Channel GUID
required: true
schema:
type: string
- name: user_id
in: path
description: User GUID
required: true
schema:
type: string
responses:
"200":
description: Channel member retrieval successful
content:
application/json:
schema:
$ref: "#/components/schemas/ChannelMember"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
delete:
tags:
- channels
summary: Remove user from channel
description: >
Delete a channel member, effectively removing them from a channel.
In server version 5.3 and later, channel members can only be deleted from public or private channels.
##### Permissions
`manage_public_channel_members` permission if the channel is public.
`manage_private_channel_members` permission if the channel is private.
operationId: RemoveUserFromChannel
parameters:
- name: channel_id
in: path
description: Channel GUID
required: true
schema:
type: string
- name: user_id
in: path
description: User GUID
required: true
schema:
type: string
responses:
"200":
description: Channel member deletion successful
content:
application/json:
schema:
$ref: "#/components/schemas/StatusOK"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"/api/v4/channels/{channel_id}/members/{user_id}/roles":
put:
tags:
- channels
summary: Update channel roles
description: |
Update a user's roles for a channel.
##### Permissions
Must have `manage_channel_roles` permission for the channel.
operationId: UpdateChannelRoles
parameters:
- name: channel_id
in: path
description: Channel GUID
required: true
schema:
type: string
- name: user_id
in: path
description: User GUID
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
required:
- roles
properties:
roles:
type: string
description: Space-delimited channel roles to assign to the user
required: true
responses:
"200":
description: Channel roles update successful
content:
application/json:
schema:
$ref: "#/components/schemas/StatusOK"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"/api/v4/channels/{channel_id}/members/{user_id}/schemeRoles":
put:
tags:
- channels
summary: Update the scheme-derived roles of a channel member.
description: >
Update a channel member's scheme_admin/scheme_user properties. Typically
this should either be `scheme_admin=false, scheme_user=true` for
ordinary channel member, or `scheme_admin=true, scheme_user=true` for a
channel admin.
__Minimum server version__: 5.0
##### Permissions
Must be authenticated and have the `manage_channel_roles` permission.
operationId: UpdateChannelMemberSchemeRoles
parameters:
- name: channel_id
in: path
description: Channel GUID
required: true
schema:
type: string
- name: user_id
in: path
description: User GUID
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
required:
- scheme_admin
- scheme_user
properties:
scheme_admin:
type: boolean
scheme_user:
type: boolean
description: Scheme properties.
required: true
responses:
"200":
description: Channel member's scheme-derived roles updated successfully.
content:
application/json:
schema:
$ref: "#/components/schemas/StatusOK"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"/api/v4/channels/{channel_id}/members/{user_id}/notify_props":
put:
tags:
- channels
summary: Update channel notifications
description: >
Update a user's notification properties for a channel. Only the provided
fields are updated.
##### Permissions
Must be logged in as the user or have `edit_other_users` permission.
operationId: UpdateChannelNotifyProps
parameters:
- name: channel_id
in: path
description: Channel GUID
required: true
schema:
type: string
- name: user_id
in: path
description: User GUID
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/ChannelNotifyProps"
required: true
responses:
"200":
description: Channel notification properties update successful
content:
application/json:
schema:
$ref: "#/components/schemas/StatusOK"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"/api/v4/channels/{channel_id}/members/{user_id}/autotranslation":
put:
tags:
- channels
summary: Update channel member autotranslation setting
description: >
Update a user's autotranslation setting for a channel. This controls whether
messages in the channel should not be automatically translated for the user.
By default, autotranslations are enabled for all users if the channel is enabled
for autotranslation.
##### Permissions
Must be logged in as the user or have `edit_other_users` permission.
operationId: UpdateChannelMemberAutotranslation
parameters:
- name: channel_id
in: path
description: Channel GUID
required: true
schema:
type: string
- name: user_id
in: path
description: User GUID
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
required:
- autotranslation_disabled
properties:
autotranslation_disabled:
type: boolean
description: Whether to disable autotranslation for the user in this channel
required: true
responses:
"200":
description: Channel member autotranslation setting update successful
content:
application/json:
schema:
$ref: "#/components/schemas/StatusOK"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"/api/v4/channels/members/{user_id}/view":
post:
tags:
- channels
summary: View channel
description: >
Perform all the actions involved in viewing a channel. This includes
marking channels as read, clearing push notifications, and updating the
active channel.
##### Permissions
Must be logged in as user or have `edit_other_users` permission.
__Response only includes `last_viewed_at_times` in Mattermost server 4.3 and newer.__
operationId: ViewChannel
parameters:
- in: path
name: user_id
description: User ID to perform the view action for
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
required:
- channel_id
properties:
channel_id:
type: string
description: The channel ID that is being viewed. Use a blank string to
indicate that all channels have lost focus.
prev_channel_id:
type: string
description: The channel ID of the previous channel, used when switching
channels. Providing this ID will cause push notifications to
clear on the channel being switched to.
description: Paremeters affecting how and which channels to view
required: true
responses:
"200":
description: Channel view successful
content:
application/json:
schema:
type: object
properties:
status:
type: string
description: Value should be "OK" if successful
last_viewed_at_times:
type: object
description: A JSON object mapping channel IDs to the channel view times
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"/api/v4/users/{user_id}/teams/{team_id}/channels/members":
get:
tags:
- channels
summary: Get channel memberships and roles for a user
description: >
Get all channel memberships and associated membership roles (i.e.
`channel_user`, `channel_admin`) for a user on a specific team.
##### Permissions
Logged in as the user and `view_team` permission for the team. Having `manage_system` permission voids the previous requirements.
operationId: GetChannelMembersForUser
parameters:
- name: user_id
in: path
description: User GUID
required: true
schema:
type: string
- name: team_id
in: path
description: Team GUID
required: true
schema:
type: string
responses:
"200":
description: Channel members retrieval successful
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/ChannelMember"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"/api/v4/users/{user_id}/teams/{team_id}/channels":
get:
tags:
- channels
summary: Get channels for user
description: >
Get all the channels on a team for a user.
##### Permissions
Logged in as the user, or have `edit_other_users` permission, and `view_team` permission for the team.
operationId: GetChannelsForTeamForUser
parameters:
- name: user_id
in: path
description: User GUID
required: true
schema:
type: string
- name: team_id
in: path
description: Team GUID
required: true
schema:
type: string
- name: include_deleted
in: query
description: Defines if deleted channels should be returned or not
schema:
type: boolean
default: false
- name: last_delete_at
in: query
description: Filters the deleted channels by this time in epoch format. Does not have any effect if include_deleted is set to false.
schema:
type: integer
default: 0
responses:
"200":
description: Channels retrieval successful
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Channel"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"/api/v4/users/{user_id}/channels":
get:
tags:
- channels
summary: Get all channels from all teams
description: |
Get all channels from all teams that a user is a member of.
__Minimum server version__: 6.1
##### Permissions
Logged in as the user, or have `edit_other_users` permission.
operationId: GetChannelsForUser
parameters:
- name: user_id
in: path
description: The ID of the user. This can also be "me" which will point to the current user.
required: true
schema:
type: string
- name: last_delete_at
in: query
description: Filters the deleted channels by this time in epoch format. Does not have any effect if include_deleted is set to false.
schema:
type: integer
default: 0
- name: include_deleted
in: query
description: Defines if deleted channels should be returned or not
schema:
type: boolean
default: false
responses:
"200":
description: Channels retrieval successful
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Channel"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"/api/v4/users/{user_id}/channels/{channel_id}/unread":
get:
tags:
- channels
summary: Get unread messages
description: >
Get the total unread messages and mentions for a channel for a user.
##### Permissions
Must be logged in as user and have the `read_channel` permission, or have `edit_other_usrs` permission.
operationId: GetChannelUnread
parameters:
- name: user_id
in: path
description: User GUID
required: true
schema:
type: string
- name: channel_id
in: path
description: Channel GUID
required: true
schema:
type: string
responses:
"200":
description: Channel unreads retrieval successful
content:
application/json:
schema:
$ref: "#/components/schemas/ChannelUnread"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"/api/v4/channels/{channel_id}/scheme":
put:
tags:
- channels
summary: Set a channel's scheme
description: >
Set a channel's scheme, more specifically sets the scheme_id value of a
channel record.
##### Permissions
Must have `manage_system` permission.
__Minimum server version__: 4.10
operationId: UpdateChannelScheme
parameters:
- name: channel_id
in: path
description: Channel GUID
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
required:
- scheme_id
properties:
scheme_id:
type: string
description: The ID of the scheme.
description: Scheme GUID
required: true
responses:
"200":
description: Update channel scheme successful
content:
application/json:
schema:
$ref: "#/components/schemas/StatusOK"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"501":
$ref: "#/components/responses/NotImplemented"
"/api/v4/channels/{channel_id}/members_minus_group_members":
get:
tags:
- channels
summary: Channel members minus group members.
description: >
Get the set of users who are members of the channel minus the set of
users who are members of the given groups.
Each user object contains an array of group objects representing the group memberships for that user.
Each user object contains the boolean fields `scheme_guest`, `scheme_user`, and `scheme_admin` representing the roles that user has for the given channel.
##### Permissions
Must have `manage_system` permission.
__Minimum server version__: 5.14
operationId: ChannelMembersMinusGroupMembers
parameters:
- name: channel_id
in: path
description: Channel GUID
required: true
schema:
type: string
- name: group_ids
in: query
description: A comma-separated list of group ids.
required: true
schema:
type: string
default: ""
- name: page
in: query
description: The page to select.
schema:
type: integer
default: 0
- name: per_page
in: query
description: The number of users per page.
schema:
type: integer
default: 0
responses:
"200":
description: Successfully returns users specified by the pagination, and the
total_count.
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"/api/v4/channels/{channel_id}/member_counts_by_group":
get:
tags:
- channels
summary: Channel members counts for each group that has atleast one member in the channel
description: >
Returns a set of ChannelMemberCountByGroup objects which contain a `group_id`, `channel_member_count` and a `channel_member_timezones_count`.
##### Permissions
Must have `read_channel` permission for the given channel.
__Minimum server version__: 5.24
operationId: GetChannelMemberCountsByGroup
parameters:
- name: channel_id
in: path
description: Channel GUID
required: true
schema:
type: string
- name: include_timezones
in: query
description: Defines if member timezone counts should be returned or not
schema:
type: boolean
default: false
responses:
"200":
description: Successfully returns member counts by group for the given channel.
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"/api/v4/channels/{channel_id}/moderations":
get:
tags:
- channels
summary: Get information about channel's moderation.
description: >
##### Permissions
Must have `manage_system` permission.
__Minimum server version__: 5.22
operationId: GetChannelModerations
parameters:
- name: channel_id
in: path
description: Channel GUID
required: true
schema:
type: string
responses:
"200":
description: "Retreived successfully"
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/ChannelModeration"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"/api/v4/channels/{channel_id}/moderations/patch":
put:
tags:
- channels
summary: Update a channel's moderation settings.
description: >
##### Permissions
Must have `manage_system` permission.
__Minimum server version__: 5.22
operationId: PatchChannelModerations
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ChannelModerationPatch"
parameters:
- name: channel_id
in: path
description: Channel GUID
required: true
schema:
type: string
responses:
"200":
description: "Patched successfully"
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/ChannelModeration"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"/api/v4/users/{user_id}/teams/{team_id}/channels/categories":
get:
tags:
- channels
summary: Get user's sidebar categories
description: >
Get a list of sidebar categories that will appear in the user's sidebar
on the given team, including a list of channel IDs in each category.
__Minimum server version__: 5.26
##### Permissions
Must be authenticated and have the `list_team_channels` permission.
operationId: GetSidebarCategoriesForTeamForUser
parameters:
- name: team_id
in: path
description: Team GUID
required: true
schema:
type: string
- name: user_id
in: path
description: User GUID
required: true
schema:
type: string
responses:
"200":
description: Category retrieval successful
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/OrderedSidebarCategories"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
post:
tags:
- channels
summary: Create user's sidebar category
description: >
Create a custom sidebar category for the user on the given team.
__Minimum server version__: 5.26
##### Permissions
Must be authenticated and have the `list_team_channels` permission.
operationId: CreateSidebarCategoryForTeamForUser
parameters:
- name: team_id
in: path
description: Team GUID
required: true
schema:
type: string
- name: user_id
in: path
description: User GUID
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/SidebarCategory"
required: true
responses:
"200":
description: Category creation successful
content:
application/json:
schema:
$ref: "#/components/schemas/SidebarCategory"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
put:
tags:
- channels
summary: Update user's sidebar categories
description: >
Update any number of sidebar categories for the user on the given team. This
can be used to reorder the channels in these categories.
__Minimum server version__: 5.26
##### Permissions
Must be authenticated and have the `list_team_channels` permission.
operationId: UpdateSidebarCategoriesForTeamForUser
parameters:
- name: team_id
in: path
description: Team GUID
required: true
schema:
type: string
- name: user_id
in: path
description: User GUID
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/SidebarCategory"
required: true
responses:
"200":
description: Category update successful
content:
application/json:
schema:
$ref: "#/components/schemas/SidebarCategory"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"/api/v4/users/{user_id}/teams/{team_id}/channels/categories/order":
get:
tags:
- channels
summary: Get user's sidebar category order
description: >
Returns the order of the sidebar categories for a user on the given team as
an array of IDs.
__Minimum server version__: 5.26
##### Permissions
Must be authenticated and have the `list_team_channels` permission.
operationId: GetSidebarCategoryOrderForTeamForUser
parameters:
- name: team_id
in: path
description: Team GUID
required: true
schema:
type: string
- name: user_id
in: path
description: User GUID
required: true
schema:
type: string
responses:
"200":
description: Order retrieval successful
content:
application/json:
schema:
type: array
items:
type: string
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
put:
tags:
- channels
summary: Update user's sidebar category order
description: >
Updates the order of the sidebar categories for a user on the given team.
The provided array must include the IDs of all categories on the team.
__Minimum server version__: 5.26
##### Permissions
Must be authenticated and have the `list_team_channels` permission.
operationId: UpdateSidebarCategoryOrderForTeamForUser
parameters:
- name: team_id
in: path
description: Team GUID
required: true
schema:
type: string
- name: user_id
in: path
description: User GUID
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: array
items:
type: string
required: true
responses:
"200":
description: Order update successful
content:
application/json:
schema:
type: array
items:
type: string
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"/api/v4/users/{user_id}/teams/{team_id}/channels/categories/{category_id}":
get:
tags:
- channels
summary: Get sidebar category
description: >
Returns a single sidebar category for the user on the given team.
__Minimum server version__: 5.26
##### Permissions
Must be authenticated and have the `list_team_channels` permission.
operationId: GetSidebarCategoryForTeamForUser
parameters:
- name: team_id
in: path
description: Team GUID
required: true
schema:
type: string
- name: user_id
in: path
description: User GUID
required: true
schema:
type: string
- name: category_id
in: path
description: Category GUID
required: true
schema:
type: string
responses:
"200":
description: Category retrieval successful
content:
application/json:
schema:
$ref: "#/components/schemas/SidebarCategory"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
put:
tags:
- channels
summary: Update sidebar category
description: >
Updates a single sidebar category for the user on the given team.
__Minimum server version__: 5.26
##### Permissions
Must be authenticated and have the `list_team_channels` permission.
operationId: UpdateSidebarCategoryForTeamForUser
parameters:
- name: team_id
in: path
description: Team GUID
required: true
schema:
type: string
- name: user_id
in: path
description: User GUID
required: true
schema:
type: string
- name: category_id
in: path
description: Category GUID
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/SidebarCategory"
required: true
responses:
"200":
description: Category update successful
content:
application/json:
schema:
$ref: "#/components/schemas/SidebarCategory"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
delete:
tags:
- channels
summary: Delete sidebar category
description: >
Deletes a single sidebar category for the user on the given team. Only
custom categories can be deleted.
__Minimum server version__: 5.26
##### Permissions
Must be authenticated and have the `list_team_channels` permission.
operationId: RemoveSidebarCategoryForTeamForUser
parameters:
- name: team_id
in: path
description: Team GUID
required: true
schema:
type: string
- name: user_id
in: path
description: User GUID
required: true
schema:
type: string
- name: category_id
in: path
description: Category GUID
required: true
schema:
type: string
responses:
"200":
description: Category delete successful
content:
application/json:
schema:
$ref: "#/components/schemas/SidebarCategory"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"/api/v4/sharedchannels/{channel_id}/remotes":
get:
tags:
- channels
summary: Get remote clusters for a shared channel
description: |
Gets the remote clusters information for a shared channel.
__Minimum server version__: 10.10
##### Permissions
Must be authenticated and have the `read_channel` permission for the channel.
operationId: GetSharedChannelRemotes
parameters:
- name: channel_id
in: path
description: Channel GUID
required: true
schema:
type: string
responses:
"200":
description: Remote clusters retrieval successful
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/RemoteClusterInfo"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"
"/api/v4/channels/{channel_id}/common_teams":
get:
tags:
- channels
- group message
summary: Get common teams for members of a Group Message.
description: |
Gets all the common teams for all active members of a Group Message channel.
Returns empty list of no common teams are found.
__Minimum server version__: 9.1
##### Permissions
Must be authenticated and have the `read_channel` permission for the channel.
operationId: GetGroupMessageMembersCommonTeams
parameters:
- name: channel_id
in: path
description: Channel GUID
required: true
schema:
type: string
responses:
"200":
description: Common teams retrieval successful
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Team"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
$ref: "#/components/responses/NotFound"