Guest User

Untitled

a guest
Oct 18th, 2018
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 321.83 KB | None | 0 0
  1. swagger: '2.0'
  2. info:
  3.   description: |
  4.    ### API v4 is stable with the Mattermost server 4.0 release. API v3 was deprecated on January 16th, 2018, and scheduled for removal in Mattermost v5.0. [Details here](/#tag/APIv3-Deprecation). Looking for the API v3 reference? It has moved [here](https://api.mattermost.com/v3).
  5.  
  6.   version: 4.0.0
  7.   title: Mattermost API Reference
  8.   termsOfService: 'https://about.mattermost.com/default-terms/'
  9.   contact:
  10.     email: feedback@mattermost.com
  11.   x-logo:
  12.     url: "https://www.mattermost.org/wp-content/uploads/2016/03/logoHorizontal_WS.png"
  13.     backgroundColor: "#FFFFFF"
  14. basePath: /api/v4
  15. host: your-mattermost-url.com
  16. tags:
  17. - name: introduction
  18.   description: |
  19.    The Mattermost Web Services API is used by Mattermost clients and third party applications to interact with the server. [JavaScript and Golang drivers for](/#tag/drivers) connecting to the APIs are also available.
  20.  
  21.     ### Support
  22.  
  23.     Mattermost core committers work with the community to keep the API documentation up-to-date.
  24.  
  25.     If you have questions on API routes not listed in this reference, please [join the Mattermost community server](https://pre-release.mattermost.com/signup_user_complete/?id=f1924a8db44ff3bb41c96424cdc20676) to ask questions in the Developers channel, [or post questions to our Developer Discussion forum](http://forum.mattermost.org/c/dev).
  26.  
  27.     [Bug reports](https://github.com/mattermost/mattermost-api-reference/issues) in the documentation or the API are also welcome, as are pull requests to fix the issues.
  28.  
  29.     ### Contributing
  30.  
  31.     When you have answers to API questions not addressed in our documentation we ask you to consider making a pull request to improve our reference. [Small changes](https://github.com/mattermost/mattermost-api-reference/commit/d574c0c1e95dc2228dc96663afd562f1305e3ece) and [larger changes](https://github.com/mattermost/mattermost-api-reference/commit/1ae3314f0935eebba8c885d8969dcad72f801501) are all welcome.
  32.  
  33.     We also have [Help Wanted tickets](https://github.com/mattermost/mattermost-api-reference/issues) available for community members who would like to help others more easily use the APIs. We acknowledge everyone's contribution in the [release notes of our next version](https://docs.mattermost.com/administration/changelog.html#contributors).
  34.  
  35.     The source code for this API reference is hosted at https://github.com/mattermost/mattermost-api-reference.
  36. - name: schema
  37.   description: |
  38.    All API access is through HTTP(S) requests at `your-mattermost-url.com/api/v4`. All request and response bodies are `application/json`.
  39.  
  40.     When using endpoints that require a user id, the string `me` can be used in place of the user id to indicate the action is to be taken for the logged in user.
  41. - name: drivers
  42.   description: |
  43.    The easiest way to interact with the Mattermost Web Service API is through a language specific driver.
  44.  
  45.     #### Official Drivers
  46.     * [Mattermost JavaScript Driver](https://github.com/mattermost/mattermost-redux/blob/master/src/client/client4.js)
  47.     * [Mattermost Golang Driver](https://github.com/mattermost/mattermost-server/blob/master/model/client4.go)
  48.  
  49.     #### Community-built Drivers
  50.     * [PHP Driver](https://github.com/gnello/php-mattermost-driver) - built by [@gnello](https://github.com/gnello) and [@prixone](https://github.com/prixone)
  51.     * [Python Driver](https://github.com/Vaelor/python-mattermost-driver) - built by [@Vaelor](https://github.com/Vaelor)
  52.  
  53.     For other community-built drivers and API wrappers, see [our app directory](https://about.mattermost.com/community-applications/#privateApps).
  54.  
  55. - name: authentication
  56.   description: |
  57.    There are multiple ways to authenticate against the Mattermost API.
  58.  
  59.     All examples assume there is a Mattermost instance running at http://localhost:8065.
  60.  
  61.     #### Session Token
  62.  
  63.     Make an HTTP POST to `your-mattermost-url.com/api/v4/users/login` with a JSON body indicating the user’s `login_id`, `password` and optionally the MFA `token`. The `login_id` can be an email, username or an AD/LDAP ID depending on the system's configuration.
  64.  
  65.     ```
  66.     curl -i -d '{"login_id":"someone@nowhere.com","password":"thisisabadpassword"}' http://localhost:8065/api/v4/users/login
  67.     ```
  68.  
  69.     NOTE: If you're running cURL on windows, you will have to change the single quotes to double quotes, and escape the inner double quotes with backslash, like below:
  70.  
  71.     ```
  72.     curl -i -d "{\"login_id\":\"someone@nowhere.com\",\"password\":\"thisisabadpassword\"}" http://localhost:8065/api/v4/users/login
  73.     ```
  74.  
  75.     If successful, the response will contain a `Token` header and a user object in the body.
  76.  
  77.     ```
  78.     HTTP/1.1 200 OK
  79.     Set-Cookie: MMSID=hyr5dmb1mbb49c44qmx4whniso; Path=/; Max-Age=2592000; HttpOnly
  80.     Token: hyr5dmb1mbb49c44qmx4whniso
  81.     X-Ratelimit-Limit: 10
  82.     X-Ratelimit-Remaining: 9
  83.     X-Ratelimit-Reset: 1
  84.     X-Request-Id: smda55ckcfy89b6tia58shk5fh
  85.     X-Version-Id: developer
  86.     Date: Fri, 11 Sep 2015 13:21:14 GMT
  87.     Content-Length: 657
  88.     Content-Type: application/json; charset=utf-8
  89.  
  90.     {{user object as json}}
  91.     ```
  92.  
  93.     Include the `Token` as part of the `Authorization` header on your future API requests with the `Bearer` method.
  94.  
  95.     ```
  96.     curl -i -H 'Authorization: Bearer hyr5dmb1mbb49c44qmx4whniso' http://localhost:8065/api/v4/users/me
  97.     ```
  98.  
  99.     You should now be able to access the API as the user you logged in as.
  100.  
  101.     #### Personal Access Tokens
  102.  
  103.     Using [personal access tokens](https://docs.mattermost.com/developer/personal-access-tokens.html) is very similar to using a session token. The only real difference is that session tokens will expire, while personal access tokens will live until they are manually revoked by the user or an admin.
  104.  
  105.     Just like session tokens, include the personal access token as part of the `Authorization` header in your requests using the `Bearer` method. Assuming our personal access token is `9xuqwrwgstrb3mzrxb83nb357a`, we could use it as shown below.
  106.  
  107.     ```
  108.     curl -i -H 'Authorization: Bearer 9xuqwrwgstrb3mzrxb83nb357a' http://localhost:8065/api/v4/users/me
  109.     ```
  110.  
  111.     #### OAuth 2.0
  112.  
  113.     Mattermost has the ability to act as an [OAuth 2.0](https://tools.ietf.org/html/rfc6749) service provider.
  114.  
  115.     The official documentation for [using your Mattermost server as an OAuth 2.0 service provider can be found here.](https://docs.mattermost.com/developer/oauth-2-0-applications.html)
  116.  
  117.     For an example on how to register an OAuth 2.0 app with your Mattermost instance, please see the [Mattermost-Zapier integration documentation](https://docs.mattermost.com/integrations/zapier.html#register-zapier-as-an-oauth-2-0-application).
  118.  
  119. - name: errors
  120.   description: |
  121.     All errors will return an appropriate HTTP response code along with the following JSON body:
  122.    ```
  123.     {
  124.         "id": "the.error.id",
  125.         "message": "Something went wrong", // the reason for the error
  126.         "request_id": "", // the ID of the request
  127.         "status_code": 0, // the HTTP status code
  128.         "is_oauth": false // whether the error is OAuth specific
  129.     }
  130.     ```
  131. - name: rate limiting
  132.   description: |
  133.     Whenever you make an HTTP request to the Mattermost API you might notice the following headers included in the response:
  134.    ```
  135.     X-Ratelimit-Limit: 10
  136.     X-Ratelimit-Remaining: 9
  137.     X-Ratelimit-Reset: 1441983590
  138.     ```
  139.  
  140.     These headers are telling you your current rate limit status.
  141.  
  142.     | Header | Description |
  143.    | ------ | ----------- |
  144.     | X-Ratelimit-Limit | The maximum number of requests you can make per second. |
  145.     | X-Ratelimit-Remaining | The number of requests remaining in the current window. |
  146.     | X-Ratelimit-Reset | The remaining UTC epoch seconds before the rate limit resets. |
  147.  
  148.     If you exceed your rate limit for a window you will receive the following error in the body of the response:
  149.  
  150.     ```
  151.     HTTP/1.1 429 Too Many Requests
  152.     Date: Tue, 10 Sep 2015 11:20:28 GMT
  153.     X-RateLimit-Limit: 10
  154.     X-RateLimit-Remaining: 0
  155.     X-RateLimit-Reset: 1
  156.  
  157.     limit exceeded
  158.     ```
  159. - name: WebSocket
  160.   description: |
  161.    In addition to the HTTP RESTful web service, Mattermost also offers a WebSocket event delivery system and some API functionality.
  162.  
  163.     To connect to the WebSocket follow the standard opening handshake as [defined by the RFC specification](https://tools.ietf.org/html/rfc6455#section-1.3) to the `/api/v4/websocket` endpoint of Mattermost.
  164.  
  165.     #### Authentication
  166.  
  167.     The Mattermost WebSocket can be authenticated by cookie or through an authentication challenge. If you're authenticating from a browser and have logged in with the Mattermost API, your authentication cookie should already be set, this is how the Mattermost webapp authenticates with the WebSocket.
  168.  
  169.     To authenticate with an authentication challenge, first connect the WebSocket and then send the following JSON over the connection:
  170.  
  171.     ```
  172.     {
  173.       "seq": 1,
  174.       "action": "authentication_challenge",
  175.       "data": {
  176.         "token": "mattermosttokengoeshere"
  177.       }
  178.     }
  179.     ```
  180.  
  181.     If successful, you will receive a standard OK response from the webhook:
  182.  
  183.     ```
  184.     {
  185.       "status": "OK",
  186.       "seq_reply": 1
  187.     }
  188.     ```
  189.  
  190.     Once successfully authenticated, the server will pass a `hello` WebSocket event containing server version over the connection.
  191.  
  192.     #### Events
  193.  
  194.     WebSocket events are primarily used to alert the client to changes in Mattermost, such as delivering new posts or alerting the client that another user is typing in a channel.
  195.  
  196.     Events on the WebSocket will have the form:
  197.  
  198.     ```
  199.     {
  200.       "event": "hello",
  201.       "data": {
  202.         "server_version": "3.6.0.1451.1c38da627ebb4e3635677db6939e9195"
  203.       },
  204.       "broadcast":{
  205.         "omit_users": null,
  206.         "user_id": "ay5sq51sebfh58ktrce5ijtcwy",
  207.         "channel_id": "",
  208.         "team_id": ""
  209.       }
  210.     }
  211.     ```
  212.  
  213.     The `event` field indicates the event type, `data` contains any data relevant to the event and `broadcast` contains information about who the event was sent to. For example, the above example has `user_id` set to "ay5sq51sebfh58ktrce5ijtcwy" meaning that only the user with that ID received this event broadcast. The `omit_users` field can contain an array of user IDs that were specifically omitted from receiving the event.
  214.  
  215.     The list of Mattermost WebSocket events are:
  216.     - typing
  217.     - posted
  218.     - post_edited
  219.     - post_deleted
  220.     - channel_created
  221.     - channel_deleted
  222.     - channel_updated
  223.     - channel_viewed
  224.     - direct_added
  225.     - group_added
  226.     - added_to_team
  227.     - new_user
  228.     - leave_team
  229.     - update_team
  230.     - delete_team
  231.     - user_added
  232.     - user_updated
  233.     - user_role_updated
  234.     - memberrole_updated
  235.     - user_removed
  236.     - preference_changed
  237.     - preferences_changed
  238.     - preferences_deleted
  239.     - ephemeral_message
  240.     - status_change
  241.     - hello
  242.     - webrtc
  243.     - authentication_challenge
  244.     - reaction_added
  245.     - reaction_removed
  246.     - response
  247.     - emoji_added
  248.     - license_changed
  249.     - config_changed
  250.  
  251.     #### WebSocket API
  252.  
  253.     Mattermost has some basic support for WebSocket APIs. A connected WebSocket can make requests by sending the following over the connection:
  254.  
  255.     ```
  256.     {
  257.       "action": "user_typing",
  258.       "seq": 2,
  259.       "data": {
  260.         "channel_id": "nhze199c4j87ped4wannrjdt9c",
  261.         "parent_id": ""
  262.       }
  263.     }
  264.     ```
  265.  
  266.     This is an example of making a `user_typing` request, with the purpose of alerting the server that the connected client has begun typing in a channel or thread. The `action` field indicates what is being requested, and performs a similar duty as the route in a HTTP API.
  267.  
  268.     The `seq` or sequence number is set by the client and should be incremented with every use. It is used to distinguish responses to requests that come down the WebSocket. For example, a standard response to the above request would be:
  269.  
  270.     ```
  271.     {
  272.       "status": "OK",
  273.       "seq_reply": 2
  274.     }
  275.     ```
  276.  
  277.     Notice `seq_reply` is 2, matching the `seq` of the original request. Using this a client can distinguish which request the response is meant for.
  278.  
  279.     If there was any information to respond with, it would be encapsulated in a `data` field.
  280.  
  281.     In the case of an error, the response would be:
  282.  
  283.     ```
  284.     {
  285.       "status": "FAIL",
  286.       "seq_reply": 2,
  287.       "error": {
  288.         "id": "some.error.id.here",
  289.         "message": "Some error message here"
  290.       }
  291.     }
  292.     ```
  293.  
  294.     The list of WebSocket API actions is:
  295.     - user_typing
  296.     - get_statuses
  297.     - get_statuses_by_ids
  298.  
  299.     To see how these actions work, please refer to either the [Golang WebSocket driver](https://github.com/mattermost/mattermost-server/blob/master/model/websocket_client.go) or our [JavaScript WebSocket driver](https://github.com/mattermost/mattermost-driver-javascript/blob/master/websocket_client.jsx).
  300.  
  301. - name: APIv3 Deprecation
  302.   description: |
  303.    Since Mattermost 4.0, API v4 is the preferred version to be used. API v3 is unsupported since Mattermost 4.6, released on January 16, 2018. They will be removed in Mattermost 5.0.
  304.  
  305.     We advise that any new integrations use API v4 endpoints. To migrate existing integrations from API v3 to v4, follow these steps:
  306.  
  307.     1. Set your server's log level to `DEBUG` in **System Console > General > Logging > File Log Level**.
  308.     2. Search for requests hitting `/api/v3/` endpoints. Any requests hitting these endpoints are from integrations that should be migrated to API v4.
  309.       - For in-house or self-built integrations, update them to use v4 with the help of this documentation. Most v3 endpoints have direct counterparts in v4 and should be easily migrated.
  310.       - For third-party integrations, visit their homepage (on GitHub, GitLab, etc.). Check if they already have a version that uses the Mattermost v4 API. If they do not, consider opening an issue asking them if support is planned.
  311.     3. Once all integrations use v4, review the server logs with log level set to `DEBUG`. Confirm no requests hit `/api/v3/` endpoints.
  312.     4. Set **Allow use of API v3 endpoints** to `false` in **System Console > General > Configuration**, or set `EnableAPIv3` to `false` in `config.json`. This setting disables API v3 on your server, and errors are output to your server logs anytime a v3 endpoint is used.
  313.     5. Set your server's log level back to `ERROR`. Use the error logs to help track down any last uses of API v3.
  314.  
  315.     Below are the major changes made between v3 and v4:
  316.  
  317.     1. Endpoint URLs only require team IDs when necessary. For example, getting a channel by ID no longer requires a team ID in v4.
  318.     2. Collection endpoints now generally return lists and include paging as part of the query string.
  319.     3. User ID is now included in most user endpoints. This allows admins to to modify other users through v4 endpoints.
  320.  
  321.     If you have any questions about the API v3 deprecation, or about migrating from v3 to v4, [join our daily build server at pre-release.mattermost.com](https://pre-release.mattermost.com/signup_user_complete/?id=f1924a8db44ff3bb41c96424cdc20676) and ask questions in the [APIv4 channel](https://pre-release.mattermost.com/core/channels/apiv4).
  322.  
  323. - name: users
  324.   description: |
  325.    Endpoints for creating, getting and interacting with users.
  326.  
  327.     When using endpoints that require a user id, the string `me` can be used in place of the user id to indicate the action is to be taken for the logged in user.
  328. - name: teams
  329.   description: Endpoints for creating, getting and interacting with teams.
  330. - name: channels
  331.   description: Endpoints for creating, getting and interacting with channels.
  332. - name: posts
  333.   description: Endpoints for creating, getting and interacting with posts.
  334. - name: files
  335.   description: Endpoints for uploading and interacting with files.
  336. - name: preferences
  337.   description: Endpoints for saving and modifying user preferences.
  338. - name: status
  339.   description: Endpoints for getting and updating user statuses.
  340. - name: emoji
  341.   description: Endpoints for creating, getting and interacting with emojis.
  342. - name: reactions
  343.   description: Endpoints for creating, getting and removing emoji reactions.
  344. - name: webhooks
  345.   description: Endpoints for creating, getting and updating webhooks.
  346. - name: commands
  347.   description: Endpoints for creating, getting and updating slash commands.
  348. - name: OpenGraph
  349.   description: Endpoint for getting Open Graph metadata.
  350. - name: system
  351.   description: General endpoints for interating with the server, such as configuration and logging.
  352. - name: brand
  353.   description: Endpoints related to custom branding and white-labeling. See [our branding documentation](https://docs.mattermost.com/administration/branding.html) for more information.
  354. - name: OAuth
  355.   description: Endpoints for configuring and interacting with Mattermost as an OAuth 2.0 service provider.
  356. - name: SAML
  357.   description: Endpoints for configuring and interacting with SAML.
  358. - name: LDAP
  359.   description: Endpoints for configuring and interacting with LDAP.
  360. - name: compliance
  361.   description: Endpoints for creating, getting and downloading compliance reports.
  362. - name: cluster
  363.   description: Endpoints for configuring and interacting with high availability clusters.
  364. - name: elasticsearch
  365.   description: Endpoints for configuring and interacting with Elasticsearch.
  366. - name: dataretention
  367.   description: Endpoint for getting data retention policy settings.
  368. - name: jobs
  369.   description: Endpoints related to various background jobs that can be run by the server or separately by job servers.
  370. - name: plugins
  371.   description: Endpoints related to uploading and managing plugins.
  372. - name: roles
  373.   description: Endpoints for creating, getting and updating roles.
  374. - name: schemes
  375.   description: Endpoints for creating, getting and updating and deleting schemes.
  376. x-tagGroups:
  377. - name: Introduction
  378.   tags:
  379.  - introduction
  380.   - schema
  381.   - APIv3 Deprecation
  382. - name: Standard Features
  383.   tags:
  384.  - drivers
  385.   - authentication
  386.   - errors
  387.   - rate limiting
  388.   - WebSocket
  389. - name: Endpoints
  390.   tags:
  391.  - users
  392.   - teams
  393.   - channels
  394.   - posts
  395.   - files
  396.   - preferences
  397.   - status
  398.   - emoji
  399.   - reactions
  400.   - webhooks
  401.   - commands
  402.   - OpenGraph
  403.   - system
  404.   - brand
  405.   - OAuth
  406.   - SAML
  407.   - LDAP
  408.   - compliance
  409.   - cluster
  410.   - elasticsearch
  411.   - dataretention
  412.   - jobs
  413.   - plugins
  414.   - roles
  415.   - schemes
  416. schemes:
  417. - http
  418. - https
  419. consumes:
  420. - application/json
  421. produces:
  422. - application/json
  423. responses:
  424.   'Forbidden':
  425.     description: Do not have appropriate permissions
  426.     schema:
  427.       $ref: '#/definitions/AppError'
  428.   'Unauthorized':
  429.     description: No access token provided
  430.     schema:
  431.       $ref: '#/definitions/AppError'
  432.   'BadRequest':
  433.     description: Invalid or missing parameters in URL or request body
  434.     schema:
  435.       $ref: '#/definitions/AppError'
  436.   'NotFound':
  437.     description: Resource not found
  438.     schema:
  439.       $ref: '#/definitions/AppError'
  440.   'TooLarge':
  441.     description: Content too large
  442.     schema:
  443.       $ref: '#/definitions/AppError'
  444.   'NotImplemented':
  445.     description: Feature is disabled
  446.     schema:
  447.       $ref: '#/definitions/AppError'
  448.   'InternalServerError':
  449.     description: Something went wrong with the server
  450.     schema:
  451.       $ref: '#/definitions/AppError'
  452. paths:
  453.   /users:
  454.     post:
  455.       tags:
  456.      - users
  457.       summary: Create a user
  458.       description: |
  459.        Create a new user on the system.
  460.         ##### Permissions
  461.         No permission required but user creation can be controlled by server configuration.
  462.       parameters:
  463.       - name: t
  464.         in: query
  465.         description: Invitation token id
  466.         required: false
  467.         type: string
  468.       - in: body
  469.         name: body
  470.         description: User object to be created
  471.         required: true
  472.         schema:
  473.           type: object
  474.           required:
  475.          - email
  476.           - username
  477.           - password
  478.           properties:
  479.             email:
  480.               type: string
  481.             username:
  482.               type: string
  483.             first_name:
  484.               type: string
  485.             last_name:
  486.               type: string
  487.             nickname:
  488.               type: string
  489.             password:
  490.               type: string
  491.             locale:
  492.               type: string
  493.             props:
  494.               type: object
  495.             notify_props:
  496.               $ref: '#/definitions/UserNotifyProps'
  497.       responses:
  498.         '201':
  499.           description: User creation successful
  500.           schema:
  501.             $ref: '#/definitions/User'
  502.         '400':
  503.           $ref: '#/responses/BadRequest'
  504.         '403':
  505.           $ref: '#/responses/Forbidden'
  506.       x-code-samples:
  507.       - lang: 'Go'
  508.         source: |
  509.          import "github.com/mattermost/mattermost-server/model"
  510.  
  511.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  512.  
  513.           user := &model.User{
  514.               Username: "username",
  515.               Email: "email@domain.com",
  516.               Password: "Password1",
  517.           }
  518.  
  519.           createdUser, response := Client.CreateUser(user)
  520.  
  521.     get:
  522.       tags:
  523.      - users
  524.       summary: Get users
  525.       description: |
  526.        Get a page of a list of users. Based on query string parameters, select users from a team, channel, or select users not in a specific channel.
  527.  
  528.         Since server version 4.0, some basic sorting is available using the `sort` query parameter. Sorting is currently only supported when selecting users on a team.
  529.         ##### Permissions
  530.         Requires an active session and (if specified) membership to the channel or team being selected from.
  531.       parameters:
  532.       - name: page
  533.         in: query
  534.         description: The page to select.
  535.         default: "0"
  536.         type: string
  537.       - name: per_page
  538.         in: query
  539.         description: The number of users per page. There is a maximum limit of 200 users per page.
  540.         default: "60"
  541.         type: string
  542.       - name: in_team
  543.         in: query
  544.         description: The ID of the team to get users for.
  545.         type: string
  546.       - name: not_in_team
  547.         in: query
  548.         description: The ID of the team to exclude users for. Must not be used with "in_team" query parameter.
  549.         type: string
  550.       - name: in_channel
  551.         in: query
  552.         description: The ID of the channel to get users for.
  553.         type: string
  554.       - name: not_in_channel
  555.         in: query
  556.         description: The ID of the channel to exclude users for. Must be used with "in_channel" query parameter.
  557.         type: string
  558.       - name: without_team
  559.         in: query
  560.         description: Whether or not to list users that are not on any team. This option takes precendence over `in_team`, `in_channel`, and `not_in_channel`.
  561.         type: boolean
  562.       - name: sort
  563.         in: query
  564.         description: |
  565.          Sort is only available in conjunction with certain options below. The paging parameter is also always available.
  566.  
  567.           ##### `in_team`
  568.           Can be "", "last_activity_at" or "create_at".
  569.           When left blank, sorting is done by username.
  570.           __Minimum server version__: 4.0
  571.           ##### `in_channel`
  572.           Can be "", "status".
  573.           When left blank, sorting is done by username. `status` will sort by User's current status (Online, Away, DND, Offline), then by Username.
  574.           __Minimum server version__: 4.7
  575.         type: string
  576.       responses:
  577.         '200':
  578.           description: User page retrieval successful
  579.           schema:
  580.             type: array
  581.             items:
  582.               $ref: '#/definitions/User'
  583.         '400':
  584.           $ref: '#/responses/BadRequest'
  585.         '401':
  586.           $ref: '#/responses/Unauthorized'
  587.         '403':
  588.           $ref: '#/responses/Forbidden'
  589.       x-code-samples:
  590.       - lang: 'Go'
  591.         source: |
  592.          import "github.com/mattermost/mattermost-server/model"
  593.  
  594.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  595.           Client.Login("email@domain.com", "Password1")
  596.  
  597.  
  598.           // page, perPage, etag
  599.           users := Client.GetUsers(0, 60, "")
  600.           users = Client.GetUsersInChannel("channelid", 0, 60, "")
  601.           users = Client.GetUsersNotInChannel("teamid", "channelid", 0, 60, "")
  602.           users = Client.GetUsersInTeam("teamid", 0, 60, "")
  603.           users = Client.GetUsersNotInTeam("teamid", 0, 60, "")
  604.           users = Client.GetUsersWithoutTeam(0, 60, "")
  605.  
  606.   /users/ids:
  607.     post:
  608.       tags:
  609.      - users
  610.       summary: Get users by ids
  611.       description: |
  612.        Get a list of users based on a provided list of user ids.
  613.         ##### Permissions
  614.         Requires an active session but no other permissions.
  615.       parameters:
  616.       - in: body
  617.         name: body
  618.         description: List of user ids
  619.         required: true
  620.         schema:
  621.           type: array
  622.           items:
  623.             type: string
  624.       responses:
  625.         '200':
  626.           description: User list retrieval successful
  627.           schema:
  628.             type: array
  629.             items:
  630.               $ref: '#/definitions/User'
  631.         '400':
  632.           $ref: '#/responses/BadRequest'
  633.         '401':
  634.           $ref: '#/responses/Unauthorized'
  635.  
  636.   /users/usernames:
  637.     post:
  638.       tags:
  639.      - users
  640.       summary: Get users by usernames
  641.       description: |
  642.        Get a list of users based on a provided list of usernames.
  643.         ##### Permissions
  644.         Requires an active session but no other permissions.
  645.       parameters:
  646.       - in: body
  647.         name: body
  648.         description: List of usernames
  649.         required: true
  650.         schema:
  651.           type: array
  652.           items:
  653.             type: string
  654.       responses:
  655.         '200':
  656.           description: User list retrieval successful
  657.           schema:
  658.             type: array
  659.             items:
  660.               $ref: '#/definitions/User'
  661.         '400':
  662.           $ref: '#/responses/BadRequest'
  663.         '401':
  664.           $ref: '#/responses/Unauthorized'
  665.  
  666.   /users/search:
  667.     post:
  668.       tags:
  669.      - users
  670.       summary: Search users
  671.       description: |
  672.        Get a list of users based on search criteria provided in the request body. Searches are typically done against username, full name, nickname and email unless otherwise configured by the server.
  673.         ##### Permissions
  674.         Requires an active session and `read_channel` and/or `view_team` permissions for any channels or teams specified in the request body.
  675.       parameters:
  676.       - in: body
  677.         name: body
  678.         description: Search criteria
  679.         required: true
  680.         schema:
  681.           type: object
  682.           required:
  683.          - term
  684.           properties:
  685.             term:
  686.               description: The term to match against username, full name, nickname and email
  687.               type: string
  688.             team_id:
  689.               description: If provided, only search users on this team
  690.               type: string
  691.             not_in_team_id:
  692.               description: If provided, only search users not on this team
  693.               type: string
  694.             in_channel_id:
  695.               description: If provided, only search users in this channel
  696.               type: string
  697.             not_in_channel_id:
  698.               description: If provided, only search users not in this channel. Must specifiy `team_id` when using this option
  699.               type: string
  700.             allow_inactive:
  701.               description: When `true`, include deactivated users in the results
  702.               type: boolean
  703.             without_team:
  704.               type: boolean
  705.               description: Set this to `true` if you would like to search for users that are not on a team. This option takes precendence over `team_id`, `in_channel_id`, and `not_in_channel_id`.
  706.       responses:
  707.         '200':
  708.           description: User list retrieval successful
  709.           schema:
  710.             type: array
  711.             items:
  712.               $ref: '#/definitions/User'
  713.         '400':
  714.           $ref: '#/responses/BadRequest'
  715.         '401':
  716.           $ref: '#/responses/Unauthorized'
  717.         '403':
  718.           $ref: '#/responses/Forbidden'
  719.  
  720.   /users/autocomplete:
  721.     get:
  722.       tags:
  723.      - users
  724.       summary: Autocomplete users
  725.       description: |
  726.        Get a list of users for the purpose of autocompleting based on the provided search term. Specify a combination of `team_id` and `channel_id` to filter results further.
  727.         ##### Permissions
  728.         Requires an active session and `view_team` and `read_channel` on any teams or channels used to filter the results further.
  729.       parameters:
  730.       - name: team_id
  731.         in: query
  732.         description: Team ID
  733.         type: string
  734.       - name: channel_id
  735.         in: query
  736.         description: Channel ID
  737.         type: string
  738.       - name: name
  739.         in: query
  740.         description: Username, nickname first name or last name
  741.         required: true
  742.         type: string
  743.       responses:
  744.         '200':
  745.           description: User autocomplete successful
  746.           schema:
  747.             $ref: '#/definitions/UserAutocomplete'
  748.         '400':
  749.           $ref: '#/responses/BadRequest'
  750.         '401':
  751.           $ref: '#/responses/Unauthorized'
  752.         '403':
  753.           $ref: '#/responses/Forbidden'
  754.  
  755.   /users/{user_id}:
  756.     get:
  757.       tags:
  758.      - users
  759.       summary: Get a user
  760.       description: |
  761.        Get a user a object. Sensitive information will be sanitized out.
  762.         ##### Permissions
  763.         Requires an active session but no other permissions.
  764.       parameters:
  765.       - name: user_id
  766.         in: path
  767.         description: User GUID
  768.         required: true
  769.         type: string
  770.       responses:
  771.         '200':
  772.           description: User retrieval successful
  773.           schema:
  774.             $ref: '#/definitions/User'
  775.         '400':
  776.           $ref: '#/responses/BadRequest'
  777.         '401':
  778.           $ref: '#/responses/Unauthorized'
  779.         '404':
  780.           $ref: '#/responses/NotFound'
  781.  
  782.     put:
  783.       tags:
  784.      - users
  785.       summary: Update a user
  786.       description: |
  787.        Update a user by providing the user object. The fields that can be updated are defined in the request body, all other provided fields will be ignored.
  788.         ##### Permissions
  789.         Must be logged in as the user being updated or have the `edit_other_users` permission.
  790.       parameters:
  791.       - name: user_id
  792.         in: path
  793.         description: User GUID
  794.         required: true
  795.         type: string
  796.       - in: body
  797.         name: body
  798.         description: User object that is to be updated
  799.         required: true
  800.         schema:
  801.           type: object
  802.           required:
  803.          - id
  804.           properties:
  805.             id:
  806.               type: string
  807.             email:
  808.               type: string
  809.             username:
  810.               type: string
  811.             first_name:
  812.               type: string
  813.             last_name:
  814.               type: string
  815.             nickname:
  816.               type: string
  817.             locale:
  818.               type: string
  819.             position:
  820.               type: string
  821.             props:
  822.               type: object
  823.             notify_props:
  824.               $ref: '#/definitions/UserNotifyProps'
  825.       responses:
  826.         '200':
  827.           description: User update successful
  828.           schema:
  829.             $ref: '#/definitions/User'
  830.         '400':
  831.           $ref: '#/responses/BadRequest'
  832.         '401':
  833.           $ref: '#/responses/Unauthorized'
  834.         '403':
  835.           $ref: '#/responses/Forbidden'
  836.  
  837.     delete:
  838.       tags:
  839.      - users
  840.       summary: Deactivate a user account.
  841.       description: |
  842.        Deactivates the user by archiving its user object.
  843.         ##### Permissions
  844.         Must be logged in as the user being deactivated or have the `edit_other_users` permission.
  845.       parameters:
  846.       - name: user_id
  847.         in: path
  848.         description: User GUID
  849.         required: true
  850.         type: string
  851.       responses:
  852.         '200':
  853.           description: User deactivation successful
  854.           schema:
  855.             $ref: '#/definitions/StatusOK'
  856.         '400':
  857.           $ref: '#/responses/BadRequest'
  858.         '401':
  859.           $ref: '#/responses/Unauthorized'
  860.         '403':
  861.           $ref: '#/responses/Forbidden'
  862.         '404':
  863.           $ref: '#/responses/NotFound'
  864.  
  865.   /users/{user_id}/patch:
  866.     put:
  867.       tags:
  868.      - users
  869.       summary: Patch a user
  870.       description: |
  871.        Partially update a user by providing only the fields you want to update. Omitted fields will not be updated. The fields that can be updated are defined in the request body, all other provided fields will be ignored.
  872.         ##### Permissions
  873.         Must be logged in as the user being updated or have the `edit_other_users` permission.
  874.       parameters:
  875.       - name: user_id
  876.         in: path
  877.         description: User GUID
  878.         required: true
  879.         type: string
  880.       - in: body
  881.         name: body
  882.         description: User object that is to be updated
  883.         required: true
  884.         schema:
  885.           type: object
  886.           properties:
  887.             email:
  888.               type: string
  889.             username:
  890.               type: string
  891.             first_name:
  892.               type: string
  893.             last_name:
  894.               type: string
  895.             nickname:
  896.               type: string
  897.             locale:
  898.               type: string
  899.             position:
  900.               type: string
  901.             props:
  902.               type: object
  903.             notify_props:
  904.               $ref: '#/definitions/UserNotifyProps'
  905.       responses:
  906.         '200':
  907.           description: User patch successful
  908.           schema:
  909.             $ref: '#/definitions/User'
  910.         '400':
  911.           $ref: '#/responses/BadRequest'
  912.         '401':
  913.           $ref: '#/responses/Unauthorized'
  914.         '403':
  915.           $ref: '#/responses/Forbidden'
  916.  
  917.   /users/{user_id}/roles:
  918.     put:
  919.       tags:
  920.      - users
  921.       summary: Update a user's roles
  922.       description: |
  923.        Update a user's system-level roles. Valid user roles are "system_user", "system_admin" or both of them. Overwrites any previously assigned system-level roles.
  924.         ##### Permissions
  925.         Must have the `manage_roles` permission.
  926.       parameters:
  927.       - name: user_id
  928.         in: path
  929.         description: User GUID
  930.         required: true
  931.         type: string
  932.       - in: body
  933.         name: roles
  934.         description: Space-delimited system roles to assign to the user
  935.         required: true
  936.         schema:
  937.           type: object
  938.           required:
  939.          - roles
  940.           properties:
  941.             roles:
  942.               type: string
  943.       responses:
  944.         '200':
  945.           description: User roles update successful
  946.           schema:
  947.             $ref: '#/definitions/StatusOK'
  948.         '400':
  949.           $ref: '#/responses/BadRequest'
  950.         '401':
  951.           $ref: '#/responses/Unauthorized'
  952.         '403':
  953.           $ref: '#/responses/Forbidden'
  954.  
  955.   /users/{user_id}/active:
  956.     put:
  957.       tags:
  958.      - users
  959.       summary: Update user active status
  960.       description: |
  961.        Update user active or inactive status.
  962.  
  963.         __Since server version 4.6, users using a SSO provider to login can be activated or deactivated with this endpoint. However, if their activation status in Mattermost does not reflect their status in the SSO provider, the next synchronization or login by that user will reset the activation status to that of their account in the SSO provider. Server versions 4.5 and before do not allow activation or deactivation of SSO users from this endpoint.__
  964.         ##### Permissions
  965.         User can deactivate themself.
  966.         User with `manage_system` permission can activate or deactivate a user.
  967.       parameters:
  968.       - name: user_id
  969.         in: path
  970.         description: User GUID
  971.         required: true
  972.         type: string
  973.       - in: body
  974.         name: body
  975.         description: Use `true` to set the user active, `false` for inactive
  976.         required: true
  977.         schema:
  978.           type: object
  979.           required:
  980.          - active
  981.           properties:
  982.             active:
  983.               type: boolean
  984.       responses:
  985.         '200':
  986.           description: User active status update successful
  987.           schema:
  988.             $ref: '#/definitions/StatusOK'
  989.         '400':
  990.           $ref: '#/responses/BadRequest'
  991.         '401':
  992.           $ref: '#/responses/Unauthorized'
  993.         '403':
  994.           $ref: '#/responses/Forbidden'
  995.  
  996.   /users/{user_id}/image:
  997.     get:
  998.       tags:
  999.      - users
  1000.       summary: Get user's profile image
  1001.       description: |
  1002.        Get a user's profile image based on user_id string parameter.
  1003.         ##### Permissions
  1004.         Must be logged in.
  1005.       parameters:
  1006.       - name: user_id
  1007.         in: path
  1008.         description: User GUID
  1009.         required: true
  1010.         type: string
  1011.       responses:
  1012.         '400':
  1013.           $ref: '#/responses/BadRequest'
  1014.         '401':
  1015.           $ref: '#/responses/Unauthorized'
  1016.         '403':
  1017.           $ref: '#/responses/Forbidden'
  1018.         '404':
  1019.           $ref: '#/responses/NotFound'
  1020.         '501':
  1021.           $ref: '#/responses/NotImplemented'
  1022.     post:
  1023.       tags:
  1024.      - users
  1025.       summary: Set user's profile image
  1026.       description: |
  1027.        Set a user's profile image based on user_id string parameter.
  1028.         ##### Permissions
  1029.         Must be logged in as the user being updated or have the `edit_other_users` permission.
  1030.       consumes: ["multipart/form-data"]
  1031.       parameters:
  1032.       - name: image
  1033.         in: formData
  1034.         description: The image to be uploaded
  1035.         required: true
  1036.         type: file
  1037.       - name: user_id
  1038.         in: path
  1039.         description: User GUID
  1040.         required: true
  1041.         type: string
  1042.       responses:
  1043.         '200':
  1044.           description: Profile image set successful
  1045.           schema:
  1046.             $ref: '#/definitions/StatusOK'
  1047.         '400':
  1048.           $ref: '#/responses/BadRequest'
  1049.         '401':
  1050.           $ref: '#/responses/Unauthorized'
  1051.         '403':
  1052.           $ref: '#/responses/Forbidden'
  1053.         '404':
  1054.           $ref: '#/responses/NotFound'
  1055.         '501':
  1056.           $ref: '#/responses/NotImplemented'
  1057.  
  1058.   /users/username/{username}:
  1059.     get:
  1060.       tags:
  1061.      - users
  1062.       summary: Get a user by username
  1063.       description: |
  1064.        Get a user object by providing a username. Sensitive information will be sanitized out.
  1065.         ##### Permissions
  1066.         Requires an active session but no other permissions.
  1067.       parameters:
  1068.       - name: username
  1069.         in: path
  1070.         description: Username
  1071.         required: true
  1072.         type: string
  1073.       responses:
  1074.         '200':
  1075.           description: User retrieval successful
  1076.           schema:
  1077.             $ref: '#/definitions/User'
  1078.         '400':
  1079.           $ref: '#/responses/BadRequest'
  1080.         '401':
  1081.           $ref: '#/responses/Unauthorized'
  1082.         '404':
  1083.           $ref: '#/responses/NotFound'
  1084.  
  1085.   /users/password/reset:
  1086.     post:
  1087.       tags:
  1088.      - users
  1089.       summary: Reset password
  1090.       description: |
  1091.        Update the password for a user using a one-use, timed recovery code tied to the user's account. Only works for non-SSO users.
  1092.         ##### Permissions
  1093.         No permissions required.
  1094.       parameters:
  1095.       - in: body
  1096.         name: body
  1097.         required: true
  1098.         schema:
  1099.           type: object
  1100.           required:
  1101.          - code
  1102.           - new_password
  1103.           properties:
  1104.             code:
  1105.               description: The recovery code
  1106.               type: string
  1107.             new_password:
  1108.               description: The new password for the user
  1109.               type: string
  1110.       responses:
  1111.         '200':
  1112.           description: User password update successful
  1113.           schema:
  1114.             $ref: '#/definitions/StatusOK'
  1115.         '400':
  1116.           $ref: '#/responses/BadRequest'
  1117.         '401':
  1118.           $ref: '#/responses/Unauthorized'
  1119.         '403':
  1120.           $ref: '#/responses/Forbidden'
  1121.  
  1122.   /users/{user_id}/mfa:
  1123.     put:
  1124.       tags:
  1125.      - users
  1126.       summary: Update a user's MFA
  1127.       description: |
  1128.        Activates multi-factor authentication for the user if `activate` is true and a valid `code` is provided. If activate is false, then `code` is not required and multi-factor authentication is disabled for the user.
  1129.         ##### Permissions
  1130.         Must be logged in as the user being updated or have the `edit_other_users` permission.
  1131.       parameters:
  1132.       - name: user_id
  1133.         in: path
  1134.         description: User GUID
  1135.         required: true
  1136.         type: string
  1137.       - in: body
  1138.         name: body
  1139.         required: true
  1140.         schema:
  1141.           type: object
  1142.           required:
  1143.          - activate
  1144.           properties:
  1145.             activate:
  1146.               description: Use `true` to activate, `false` to deactivate
  1147.               type: boolean
  1148.             code:
  1149.               description: The code produced by your MFA client. Required if `activate` is true
  1150.               type: string
  1151.       responses:
  1152.         '200':
  1153.           description: User MFA update successful
  1154.           schema:
  1155.             $ref: '#/definitions/StatusOK'
  1156.         '400':
  1157.           $ref: '#/responses/BadRequest'
  1158.         '401':
  1159.           $ref: '#/responses/Unauthorized'
  1160.         '403':
  1161.           $ref: '#/responses/Forbidden'
  1162.         '501':
  1163.           $ref: '#/responses/NotImplemented'
  1164.  
  1165.   /users/{user_id}/mfa/generate:
  1166.     post:
  1167.       tags:
  1168.      - users
  1169.       summary: Generate MFA secret
  1170.       description: |
  1171.        Generates an multi-factor authentication secret for a user and returns it as a string and as base64 encoded QR code image.
  1172.         ##### Permissions
  1173.         Must be logged in as the user or have the `edit_other_users` permission.
  1174.       parameters:
  1175.       - name: user_id
  1176.         in: path
  1177.         description: User GUID
  1178.         required: true
  1179.         type: string
  1180.       responses:
  1181.         '200':
  1182.           description: MFA secret generation successful
  1183.           schema:
  1184.             type: object
  1185.             properties:
  1186.               secret:
  1187.                 description: The MFA secret as a string
  1188.                 type: string
  1189.               qr_code:
  1190.                 description: A base64 encoded QR code image
  1191.                 type: string
  1192.         '400':
  1193.           $ref: '#/responses/BadRequest'
  1194.         '401':
  1195.           $ref: '#/responses/Unauthorized'
  1196.         '403':
  1197.           $ref: '#/responses/Forbidden'
  1198.         '404':
  1199.           $ref: '#/responses/NotFound'
  1200.         '501':
  1201.           $ref: '#/responses/NotImplemented'
  1202.  
  1203.   /users/mfa:
  1204.     post:
  1205.       tags:
  1206.      - users
  1207.       summary: Check MFA
  1208.       description: |
  1209.        Check if a user has multi-factor authentication active on their account by providing a login id. Used to check whether an MFA code needs to be provided when logging in.
  1210.         ##### Permissions
  1211.         No permission required.
  1212.       parameters:
  1213.       - in: body
  1214.         name: body
  1215.         required: true
  1216.         schema:
  1217.           type: object
  1218.           required:
  1219.          - login_id
  1220.           properties:
  1221.             login_id:
  1222.               description: The email or username used to login
  1223.               type: string
  1224.       responses:
  1225.         '200':
  1226.           description: MFA check successful
  1227.           schema:
  1228.             type: object
  1229.             properties:
  1230.               mfa_required:
  1231.                 description: Value will `true` if MFA is active, `false` otherwise
  1232.                 type: boolean
  1233.         '400':
  1234.           $ref: '#/responses/BadRequest'
  1235.  
  1236.   /users/{user_id}/password:
  1237.     put:
  1238.       tags:
  1239.      - users
  1240.       summary: Update a user's password
  1241.       description: |
  1242.        Update a user's password. New password must meet password policy set by server configuration. Current password is required if you're updating your own password.
  1243.         ##### Permissions
  1244.         Must be logged in as the user the password is being changed for or have `manage_system` permission.
  1245.       parameters:
  1246.       - name: user_id
  1247.         in: path
  1248.         description: User GUID
  1249.         required: true
  1250.         type: string
  1251.       - in: body
  1252.         name: body
  1253.         required: true
  1254.         schema:
  1255.           type: object
  1256.           required:
  1257.          - new_password
  1258.           properties:
  1259.             current_password:
  1260.               description: The current password for the user
  1261.               type: string
  1262.             new_password:
  1263.               description: The new password for the user
  1264.               type: string
  1265.       responses:
  1266.         '200':
  1267.           description: User password update successful
  1268.           schema:
  1269.             $ref: '#/definitions/StatusOK'
  1270.         '400':
  1271.           $ref: '#/responses/BadRequest'
  1272.         '401':
  1273.           $ref: '#/responses/Unauthorized'
  1274.         '403':
  1275.           $ref: '#/responses/Forbidden'
  1276.  
  1277.   /users/password/reset/send:
  1278.     post:
  1279.       tags:
  1280.      - users
  1281.       summary: Send password reset email
  1282.       description: |
  1283.        Send an email containing a link for resetting the user's password. The link will contain a one-use, timed recovery code tied to the user's account. Only works for non-SSO users.
  1284.         ##### Permissions
  1285.         No permissions required.
  1286.       parameters:
  1287.       - in: body
  1288.         name: body
  1289.         required: true
  1290.         schema:
  1291.           type: object
  1292.           required:
  1293.          - email
  1294.           properties:
  1295.             email:
  1296.               description: The email of the user
  1297.               type: string
  1298.       responses:
  1299.         '200':
  1300.           description: Email sent if account exists
  1301.           schema:
  1302.             $ref: '#/definitions/StatusOK'
  1303.         '400':
  1304.           $ref: '#/responses/BadRequest'
  1305.         '401':
  1306.           $ref: '#/responses/Unauthorized'
  1307.         '403':
  1308.           $ref: '#/responses/Forbidden'
  1309.  
  1310.   /users/email/{email}:
  1311.     get:
  1312.       tags:
  1313.      - users
  1314.       summary: Get a user by email
  1315.       description: |
  1316.        Get a user object by providing a user email. Sensitive information will be sanitized out.
  1317.         ##### Permissions
  1318.         Requires an active session but no other permissions.
  1319.       parameters:
  1320.       - name: email
  1321.         in: path
  1322.         description: User Email
  1323.         required: true
  1324.         type: string
  1325.       responses:
  1326.         '200':
  1327.           description: User retrieval successful
  1328.           schema:
  1329.             $ref: '#/definitions/User'
  1330.         '400':
  1331.           $ref: '#/responses/BadRequest'
  1332.         '401':
  1333.           $ref: '#/responses/Unauthorized'
  1334.         '404':
  1335.           $ref: '#/responses/NotFound'
  1336.  
  1337.   /users/{user_id}/sessions:
  1338.     get:
  1339.       tags:
  1340.      - users
  1341.       summary: Get user's sessions
  1342.       description: |
  1343.        Get a list of sessions by providing the user GUID. Sensitive information will be sanitized out.
  1344.         ##### Permissions
  1345.         Must be logged in as the user being updated or have the `edit_other_users` permission.
  1346.       parameters:
  1347.       - name: user_id
  1348.         in: path
  1349.         description: User GUID
  1350.         required: true
  1351.         type: string
  1352.       responses:
  1353.         '200':
  1354.           description: User session retrieval successful
  1355.           schema:
  1356.             type: array
  1357.             items:
  1358.               $ref: '#/definitions/Session'
  1359.         '400':
  1360.           $ref: '#/responses/BadRequest'
  1361.         '401':
  1362.           $ref: '#/responses/Unauthorized'
  1363.         '403':
  1364.           $ref: '#/responses/Forbidden'
  1365.  
  1366.   /users/{user_id}/sessions/revoke:
  1367.     post:
  1368.       tags:
  1369.      - users
  1370.       summary: Revoke a user session
  1371.       description: |
  1372.        Revokes a user session from the provided user id and session id strings.
  1373.         ##### Permissions
  1374.         Must be logged in as the user being updated or have the `edit_other_users` permission.
  1375.       parameters:
  1376.       - name: user_id
  1377.         in: path
  1378.         description: User GUID
  1379.         required: true
  1380.         type: string
  1381.       - in: body
  1382.         name: body
  1383.         required: true
  1384.         schema:
  1385.           type: object
  1386.           required:
  1387.          - session_id
  1388.           properties:
  1389.             session_id:
  1390.               description: The session GUID to revoke.
  1391.               type: string
  1392.       responses:
  1393.         '200':
  1394.           description: User session revoked successful
  1395.           schema:
  1396.             $ref: '#/definitions/StatusOK'
  1397.         '400':
  1398.           $ref: '#/responses/BadRequest'
  1399.         '401':
  1400.           $ref: '#/responses/Unauthorized'
  1401.         '403':
  1402.           $ref: '#/responses/Forbidden'
  1403.  
  1404.   /users/{user_id}/sessions/revoke/all:
  1405.     post:
  1406.       tags:
  1407.      - users
  1408.       summary: Revoke all active sessions for a user
  1409.       description: |
  1410.        Revokes all user sessions from the provided user id and session id strings.
  1411.         ##### Permissions
  1412.         Must be logged in as the user being updated or have the `edit_other_users` permission.
  1413.         __Minimum server version__: 4.4
  1414.       parameters:
  1415.       - name: user_id
  1416.         in: path
  1417.         description: User GUID
  1418.         required: true
  1419.         type: string
  1420.       responses:
  1421.         '200':
  1422.           description: User sessions revoked successfully
  1423.           schema:
  1424.             $ref: '#/definitions/StatusOK'
  1425.         '400':
  1426.           $ref: '#/responses/BadRequest'
  1427.         '401':
  1428.           $ref: '#/responses/Unauthorized'
  1429.         '403':
  1430.           $ref: '#/responses/Forbidden'
  1431.  
  1432.   /users/sessions/device:
  1433.     put:
  1434.       tags:
  1435.      - users
  1436.       summary: Attach mobile device
  1437.       description: |
  1438.        Attach a mobile device id to the currently logged in session. This will enable push notiofications for a user, if configured by the server.
  1439.         ##### Permissions
  1440.         Must be authenticated.
  1441.       parameters:
  1442.       - in: body
  1443.         name: body
  1444.         required: true
  1445.         schema:
  1446.           type: object
  1447.           required:
  1448.          - device_id
  1449.           properties:
  1450.             device_id:
  1451.               description: Mobile device id. For Android prefix the id with `android:` and Apple with `apple:`
  1452.               type: string
  1453.       responses:
  1454.         '200':
  1455.           description: Device id attach successful
  1456.           schema:
  1457.             $ref: '#/definitions/StatusOK'
  1458.         '400':
  1459.           $ref: '#/responses/BadRequest'
  1460.         '401':
  1461.           $ref: '#/responses/Unauthorized'
  1462.  
  1463.   /users/{user_id}/audits:
  1464.     get:
  1465.       tags:
  1466.      - users
  1467.       summary: Get user's audits
  1468.       description: |
  1469.        Get a list of audit by providing the user GUID.
  1470.         ##### Permissions
  1471.         Must be logged in as the user or have the `edit_other_users` permission.
  1472.       parameters:
  1473.       - name: user_id
  1474.         in: path
  1475.         description: User GUID
  1476.         required: true
  1477.         type: string
  1478.       responses:
  1479.         '200':
  1480.           description: User audits retrieval successful
  1481.           schema:
  1482.             type: array
  1483.             items:
  1484.               $ref: '#/definitions/Audit'
  1485.         '400':
  1486.           $ref: '#/responses/BadRequest'
  1487.         '401':
  1488.           $ref: '#/responses/Unauthorized'
  1489.         '403':
  1490.           $ref: '#/responses/Forbidden'
  1491.  
  1492.   /users/email/verify:
  1493.     post:
  1494.       tags:
  1495.      - users
  1496.       summary: Verify user email
  1497.       description: |
  1498.        Verify the email used by a user to sign-up their account with.
  1499.         ##### Permissions
  1500.         No permissions required.
  1501.       parameters:
  1502.       - in: body
  1503.         name: body
  1504.         required: true
  1505.         schema:
  1506.           type: object
  1507.           required:
  1508.          - token
  1509.           properties:
  1510.             token:
  1511.               description: The token given to validate the email
  1512.               type: string
  1513.       responses:
  1514.         '200':
  1515.           description: User email verification successful
  1516.           schema:
  1517.             $ref: '#/definitions/StatusOK'
  1518.         '400':
  1519.           $ref: '#/responses/BadRequest'
  1520.  
  1521.   /users/email/verify/send:
  1522.     post:
  1523.       tags:
  1524.      - users
  1525.       summary: Send verification email
  1526.       description: |
  1527.        Send an email with a verification link to a user that has an email matching the one in the request body. This endpoint will return success even if the email does not match any users on the system.
  1528.         ##### Permissions
  1529.         No permissions required.
  1530.       parameters:
  1531.       - in: body
  1532.         name: body
  1533.         required: true
  1534.         schema:
  1535.           type: object
  1536.           required:
  1537.          - email
  1538.           properties:
  1539.             email:
  1540.               description: Email of a user
  1541.               type: string
  1542.       responses:
  1543.         '200':
  1544.           description: Email send successful if email exists
  1545.           schema:
  1546.             $ref: '#/definitions/StatusOK'
  1547.         '400':
  1548.           $ref: '#/responses/BadRequest'
  1549.  
  1550.   /users/login/switch:
  1551.     post:
  1552.       tags:
  1553.      - users
  1554.       summary: Switch login method
  1555.       description: |
  1556.        Switch a user's login method from using email to OAuth2/SAML/LDAP or back to email. When switching to OAuth2/SAML, account switching is not complete until the user follows the returned link and completes any steps on the OAuth2/SAML service provider.
  1557.  
  1558.         To switch from email to OAuth2/SAML, specify `current_service`, `new_service`, `email` and `password`.
  1559.  
  1560.         To switch from OAuth2/SAML to email, specify `current_service`, `new_service`, `email` and `new_password`.
  1561.  
  1562.         To switch from email to LDAP/AD, specify `current_service`, `new_service`, `email`, `password`, `ldap_ip` and `new_password` (this is the user's LDAP password).
  1563.  
  1564.         To switch from LDAP/AD to email, specify `current_service`, `new_service`, `ldap_ip`, `password` (this is the user's LDAP password), `email`  and `new_password`.
  1565.  
  1566.         Additionally, specify `mfa_code` when trying to switch an account on LDAP/AD or email that has MFA activated.
  1567.  
  1568.         ##### Permissions
  1569.         No current authentication required except when switching from OAuth2/SAML to email.
  1570.       parameters:
  1571.       - in: body
  1572.         name: body
  1573.         required: true
  1574.         schema:
  1575.           type: object
  1576.           required:
  1577.          - current_service
  1578.           - new_service
  1579.           properties:
  1580.             current_service:
  1581.               description: The service the user currently uses to login
  1582.               type: string
  1583.             new_service:
  1584.               description: The service the user will use to login
  1585.               type: string
  1586.             email:
  1587.               description: The email of the user
  1588.               type: string
  1589.             password:
  1590.               description: The password used with the current service
  1591.               type: string
  1592.             mfa_code:
  1593.               description: The MFA code of the current service
  1594.               type: string
  1595.             ldap_id:
  1596.               description: The LDAP/AD id of the user
  1597.               type: string
  1598.       responses:
  1599.         '200':
  1600.           description: Login method switch or request successful
  1601.           schema:
  1602.             type: object
  1603.             properties:
  1604.               follow_link:
  1605.                 description: The link for the user to follow to login or to complete the account switching when the current service is OAuth2/SAML
  1606.                 type: string
  1607.         '400':
  1608.           $ref: '#/responses/BadRequest'
  1609.         '401':
  1610.           $ref: '#/responses/Unauthorized'
  1611.         '403':
  1612.           $ref: '#/responses/Forbidden'
  1613.         '404':
  1614.           $ref: '#/responses/NotFound'
  1615.         '501':
  1616.           $ref: '#/responses/NotImplemented'
  1617.  
  1618.   /users/{user_id}/tokens:
  1619.     post:
  1620.       tags:
  1621.      - users
  1622.       summary: Create a user access token
  1623.       description: |
  1624.        Generate a user access token that can be used to authenticate with the Mattermost REST API.
  1625.  
  1626.         __Minimum server version__: 4.1
  1627.  
  1628.         ##### Permissions
  1629.         Must have `create_user_access_token` permission. For non-self requests, must also have the `edit_other_users` permission.
  1630.       parameters:
  1631.       - name: user_id
  1632.         in: path
  1633.         description: User GUID
  1634.         required: true
  1635.         type: string
  1636.       - in: body
  1637.         name: token
  1638.         required: true
  1639.         schema:
  1640.           type: object
  1641.           required:
  1642.          - description
  1643.           properties:
  1644.             description:
  1645.               description: A description of the token usage
  1646.               type: string
  1647.       responses:
  1648.         '201':
  1649.           description: User access token creation successful
  1650.           schema:
  1651.             $ref: '#/definitions/UserAccessToken'
  1652.         '400':
  1653.           $ref: '#/responses/BadRequest'
  1654.         '401':
  1655.           $ref: '#/responses/Unauthorized'
  1656.         '403':
  1657.           $ref: '#/responses/Forbidden'
  1658.  
  1659.     get:
  1660.       tags:
  1661.      - users
  1662.       summary: Get user access tokens
  1663.       description: |
  1664.        Get a list of user access tokens for a user. Does not include the actual authentication tokens. Use query paremeters for paging.
  1665.  
  1666.         __Minimum server version__: 4.1
  1667.  
  1668.         ##### Permissions
  1669.         Must have `read_user_access_token` permission. For non-self requests, must also have the `edit_other_users` permission.
  1670.       parameters:
  1671.       - name: user_id
  1672.         in: path
  1673.         description: User GUID
  1674.         required: true
  1675.         type: string
  1676.       - name: page
  1677.         in: query
  1678.         description: The page to select.
  1679.         default: "0"
  1680.         type: string
  1681.       - name: per_page
  1682.         in: query
  1683.         description: The number of tokens per page.
  1684.         default: "60"
  1685.         type: string
  1686.       responses:
  1687.         '200':
  1688.           description: User access tokens retrieval successful
  1689.           schema:
  1690.             type: array
  1691.             items:
  1692.               $ref: '#/definitions/UserAccessTokenSanitized'
  1693.         '400':
  1694.           $ref: '#/responses/BadRequest'
  1695.         '401':
  1696.           $ref: '#/responses/Unauthorized'
  1697.         '403':
  1698.           $ref: '#/responses/Forbidden'
  1699.  
  1700.   /users/tokens:
  1701.     get:
  1702.       tags:
  1703.      - users
  1704.       summary: Get user access tokens
  1705.       description: |
  1706.        Get a page of user access tokens for users on the system. Does not include the actual authentication tokens. Use query parameters for paging.
  1707.  
  1708.         __Minimum server version__: 4.7
  1709.  
  1710.         ##### Permissions
  1711.         Must have `manage_system` permission.
  1712.       parameters:
  1713.       - name: page
  1714.         in: query
  1715.         description: The page to select.
  1716.         default: "0"
  1717.         type: string
  1718.       - name: per_page
  1719.         in: query
  1720.         description: The number of tokens per page.
  1721.         default: "60"
  1722.         type: string
  1723.       responses:
  1724.         '200':
  1725.           description: User access tokens retrieval successful
  1726.           schema:
  1727.             type: array
  1728.             items:
  1729.               $ref: '#/definitions/UserAccessTokenSanitized'
  1730.         '400':
  1731.           $ref: '#/responses/BadRequest'
  1732.         '401':
  1733.           $ref: '#/responses/Unauthorized'
  1734.         '403':
  1735.           $ref: '#/responses/Forbidden'
  1736.  
  1737.   /users/tokens/revoke:
  1738.     post:
  1739.       tags:
  1740.      - users
  1741.       summary: Revoke a user access token
  1742.       description: |
  1743.        Revoke a user access token and delete any sessions using the token.
  1744.  
  1745.         __Minimum server version__: 4.1
  1746.  
  1747.         ##### Permissions
  1748.         Must have `revoke_user_access_token` permission. For non-self requests, must also have the `edit_other_users` permission.
  1749.       parameters:
  1750.       - in: body
  1751.         name: token
  1752.         required: true
  1753.         schema:
  1754.           type: object
  1755.           required:
  1756.          - token
  1757.           properties:
  1758.             token:
  1759.               description: The token to revoke
  1760.               type: string
  1761.       responses:
  1762.         '200':
  1763.           description: User access token revoke successful
  1764.           schema:
  1765.             $ref: '#/definitions/StatusOK'
  1766.         '400':
  1767.           $ref: '#/responses/BadRequest'
  1768.         '401':
  1769.           $ref: '#/responses/Unauthorized'
  1770.         '403':
  1771.           $ref: '#/responses/Forbidden'
  1772.  
  1773.   /users/tokens/{token_id}:
  1774.     get:
  1775.       tags:
  1776.      - users
  1777.       summary: Get a user access token
  1778.       description: |
  1779.        Get a user access token. Does not include the actual authentication token.
  1780.  
  1781.         __Minimum server version__: 4.1
  1782.  
  1783.         ##### Permissions
  1784.         Must have `read_user_access_token` permission. For non-self requests, must also have the `edit_other_users` permission.
  1785.       parameters:
  1786.       - name: token_id
  1787.         in: path
  1788.         description: User access token GUID
  1789.         required: true
  1790.         type: string
  1791.       responses:
  1792.         '200':
  1793.           description: User access token retrieval successful
  1794.           schema:
  1795.             $ref: '#/definitions/UserAccessTokenSanitized'
  1796.         '400':
  1797.           $ref: '#/responses/BadRequest'
  1798.         '401':
  1799.           $ref: '#/responses/Unauthorized'
  1800.         '403':
  1801.           $ref: '#/responses/Forbidden'
  1802.         '404':
  1803.           $ref: '#/responses/NotFound'
  1804.  
  1805.   /users/tokens/disable:
  1806.     post:
  1807.       tags:
  1808.      - users
  1809.       summary: Disable personal access token
  1810.       description: |
  1811.        Disable a personal access token and delete any sessions using the token. The token can be re-enabled using `/users/tokens/enable`.
  1812.  
  1813.         __Minimum server version__: 4.4
  1814.  
  1815.         ##### Permissions
  1816.         Must have `revoke_user_access_token` permission. For non-self requests, must also have the `edit_other_users` permission.
  1817.       parameters:
  1818.       - in: body
  1819.         name: token
  1820.         required: true
  1821.         schema:
  1822.           type: object
  1823.           required:
  1824.          - token
  1825.           properties:
  1826.             token:
  1827.               description: The token to disable
  1828.               type: string
  1829.       responses:
  1830.         '200':
  1831.           description: Personal access token disable successful
  1832.           schema:
  1833.             $ref: '#/definitions/StatusOK'
  1834.         '400':
  1835.           $ref: '#/responses/BadRequest'
  1836.         '401':
  1837.           $ref: '#/responses/Unauthorized'
  1838.         '403':
  1839.           $ref: '#/responses/Forbidden'
  1840.  
  1841.   /users/tokens/enable:
  1842.     post:
  1843.       tags:
  1844.      - users
  1845.       summary: Enable personal access token
  1846.       description: |
  1847.        Re-enable a personal access token that has been disabled.
  1848.  
  1849.         __Minimum server version__: 4.4
  1850.  
  1851.         ##### Permissions
  1852.         Must have `create_user_access_token` permission. For non-self requests, must also have the `edit_other_users` permission.
  1853.       parameters:
  1854.       - in: body
  1855.         name: token
  1856.         required: true
  1857.         schema:
  1858.           type: object
  1859.           required:
  1860.          - token
  1861.           properties:
  1862.             token:
  1863.               description: The token to enable
  1864.               type: string
  1865.       responses:
  1866.         '200':
  1867.           description: Personal access token enable successful
  1868.           schema:
  1869.             $ref: '#/definitions/StatusOK'
  1870.         '400':
  1871.           $ref: '#/responses/BadRequest'
  1872.         '401':
  1873.           $ref: '#/responses/Unauthorized'
  1874.         '403':
  1875.           $ref: '#/responses/Forbidden'
  1876.  
  1877.   /users/tokens/search:
  1878.     post:
  1879.       tags:
  1880.      - users
  1881.       summary: Search tokens
  1882.       description: |
  1883.        Get a list of tokens based on search criteria provided in the request body. Searches are done against the token id, user id and username.
  1884.  
  1885.         __Minimum server version__: 4.7
  1886.  
  1887.         ##### Permissions
  1888.         Must have `manage_system` permission.
  1889.       parameters:
  1890.       - in: body
  1891.         name: body
  1892.         description: Search criteria
  1893.         required: true
  1894.         schema:
  1895.           type: object
  1896.           required:
  1897.          - term
  1898.           properties:
  1899.             term:
  1900.               description: The search term to match against the token id, user id or username.
  1901.               type: string
  1902.       responses:
  1903.         '200':
  1904.           description: Personal access token search successful
  1905.           schema:
  1906.             type: array
  1907.             items:
  1908.               $ref: '#/definitions/UserAccessTokenSanitized'
  1909.   /users/{user_id}/auth:
  1910.     put:
  1911.       tags:
  1912.      - users
  1913.       summary: Update a user's authentication method
  1914.       description: |
  1915.        Updates a user's authentication method. This can be used to change them to/from LDAP authentication for example.
  1916.  
  1917.         __Minimum server version__: 4.6
  1918.         ##### Permissions
  1919.         Must have the `edit_other_users` permission.
  1920.       parameters:
  1921.       - name: user_id
  1922.         in: path
  1923.         description: User GUID
  1924.         required: true
  1925.         type: string
  1926.       - in: body
  1927.         name: body
  1928.         required: true
  1929.         schema:
  1930.           $ref: '#/definitions/UserAuthData'
  1931.       responses:
  1932.         '200':
  1933.           description: User auth update successful
  1934.           schema:
  1935.             $ref: '#/definitions/UserAuthData'
  1936.         '400':
  1937.           $ref: '#/responses/BadRequest'
  1938.         '401':
  1939.           $ref: '#/responses/Unauthorized'
  1940.         '403':
  1941.           $ref: '#/responses/Forbidden'
  1942.         '501':
  1943.           $ref: '#/responses/NotImplemented'
  1944.   /users/{user_id}/status:
  1945.     get:
  1946.       tags:
  1947.      - status
  1948.       summary: Get user status
  1949.       description: |
  1950.        Get user status by id from the server.
  1951.         ##### Permissions
  1952.         Must be authenticated.
  1953.       parameters:
  1954.       - name: user_id
  1955.         in: path
  1956.         description: User ID
  1957.         required: true
  1958.         type: string
  1959.       responses:
  1960.         '200':
  1961.           description: User status retrieval successful
  1962.           schema:
  1963.             $ref: '#/definitions/Status'
  1964.         '400':
  1965.           $ref: '#/responses/BadRequest'
  1966.         '401':
  1967.           $ref: '#/responses/Unauthorized'
  1968.  
  1969.     put:
  1970.       tags:
  1971.      - status
  1972.       summary: Update user status
  1973.       description: |
  1974.        Manually set a user's status. When setting a user's status, the status will remain that value until set "online" again, which will return the status to being automatically updated based on user activity.
  1975.         ##### Permissions
  1976.         Must have `edit_other_users` permission for the team.
  1977.       parameters:
  1978.       - name: user_id
  1979.         in: path
  1980.         description: User ID
  1981.         required: true
  1982.         type: string
  1983.       - name: body
  1984.         in: body
  1985.         description: Status object that is to be updated
  1986.         required: true
  1987.         schema:
  1988.           type: object
  1989.           required:
  1990.          - status
  1991.           properties:
  1992.             status:
  1993.               type: string
  1994.               description: User status, can be `online`, `away`, `offline` and `dnd`
  1995.       responses:
  1996.         '200':
  1997.           description: User status update successful
  1998.           schema:
  1999.             $ref: '#/definitions/Status'
  2000.         '400':
  2001.           $ref: '#/responses/BadRequest'
  2002.         '401':
  2003.           $ref: '#/responses/Unauthorized'
  2004.  
  2005.   /users/status/ids:
  2006.     post:
  2007.       tags:
  2008.      - status
  2009.       summary: Get user statuses by id
  2010.       description: |
  2011.        Get a list of user statuses by id from the server.
  2012.         ##### Permissions
  2013.         Must be authenticated.
  2014.       parameters:
  2015.       - name: post
  2016.         in: body
  2017.         description: List of user ids to fetch
  2018.         required: true
  2019.         schema:
  2020.           type: array
  2021.           items:
  2022.             type: string
  2023.       responses:
  2024.         '200':
  2025.           description: User statuses retrieval successful
  2026.           schema:
  2027.             type: array
  2028.             items:
  2029.               $ref: '#/definitions/Status'
  2030.         '400':
  2031.           $ref: '#/responses/BadRequest'
  2032.         '401':
  2033.           $ref: '#/responses/Unauthorized'
  2034.   /teams:
  2035.     post:
  2036.       tags:
  2037.      - teams
  2038.       summary: Create a team
  2039.       description: |
  2040.        Create a new team on the system.
  2041.         ##### Permissions
  2042.         Must be authenticated and have the `create_team` permission.
  2043.       parameters:
  2044.       - in: body
  2045.         name: body
  2046.         description: Team that is to be created
  2047.         required: true
  2048.         schema:
  2049.           type: object
  2050.           required:
  2051.          - name
  2052.           - display_name
  2053.           - type
  2054.           properties:
  2055.             name:
  2056.               type: string
  2057.               description: Unique handler for a team, will be present in the team URL
  2058.             display_name:
  2059.               type: string
  2060.               description: Non-unique UI name for the team
  2061.             type:
  2062.               type: string
  2063.               description: "`'O'` for open, `'I'` for invite only"
  2064.       responses:
  2065.         '201':
  2066.           description: Team creation successful
  2067.           schema:
  2068.             $ref: '#/definitions/Team'
  2069.         '400':
  2070.           $ref: '#/responses/BadRequest'
  2071.         '401':
  2072.           $ref: '#/responses/Unauthorized'
  2073.         '403':
  2074.           $ref: '#/responses/Forbidden'
  2075.  
  2076.     get:
  2077.       tags:
  2078.      - teams
  2079.       summary: Get teams
  2080.       description: |
  2081.        For regular users only returns open teams. Users with the "manage_system" permission will return teams regardless of type. The result is based on query string parameters - page and per_page.
  2082.         ##### Permissions
  2083.         Must be authenticated. "manage_system" permission is required to show all teams.
  2084.       parameters:
  2085.       - name: page
  2086.         in: query
  2087.         description: The page to select.
  2088.         default: "0"
  2089.         type: string
  2090.       - name: per_page
  2091.         in: query
  2092.         description: The number of teams per page.
  2093.         default: "60"
  2094.         type: string
  2095.       responses:
  2096.         '200':
  2097.           description: Team list retrieval successful
  2098.           schema:
  2099.             type: array
  2100.             items:
  2101.               $ref: '#/definitions/Team'
  2102.         '400':
  2103.           $ref: '#/responses/BadRequest'
  2104.         '401':
  2105.           $ref: '#/responses/Unauthorized'
  2106.  
  2107.   '/teams/{team_id}':
  2108.     get:
  2109.       tags:
  2110.      - teams
  2111.       summary: Get a team
  2112.       description: |
  2113.        Get a team on the system.
  2114.         ##### Permissions
  2115.         Must be authenticated and have the `view_team` permission.
  2116.       parameters:
  2117.       - name: team_id
  2118.         in: path
  2119.         description: Team GUID
  2120.         required: true
  2121.         type: string
  2122.       responses:
  2123.         '200':
  2124.           description: Team retrieval successful
  2125.           schema:
  2126.             $ref: '#/definitions/Team'
  2127.         '400':
  2128.           $ref: '#/responses/BadRequest'
  2129.         '401':
  2130.           $ref: '#/responses/Unauthorized'
  2131.         '403':
  2132.           $ref: '#/responses/Forbidden'
  2133.         '404':
  2134.           $ref: '#/responses/NotFound'
  2135.  
  2136.     put:
  2137.       tags:
  2138.      - teams
  2139.       summary: Update a team
  2140.       description: |
  2141.        Update a team by providing the team object. The fields that can be updated are defined in the request body, all other provided fields will be ignored.
  2142.         ##### Permissions
  2143.         Must have the `manage_team` permission.
  2144.       parameters:
  2145.       - name: team_id
  2146.         in: path
  2147.         description: Team GUID
  2148.         required: true
  2149.         type: string
  2150.       - in: body
  2151.         name: body
  2152.         description: Team to update
  2153.         required: true
  2154.         schema:
  2155.           type: object
  2156.           required:
  2157.          - display_name
  2158.           - description
  2159.           - company_name
  2160.           - allowed_domains
  2161.           - invite_id
  2162.           - allow_open_invite
  2163.           properties:
  2164.             display_name:
  2165.               type: string
  2166.             description:
  2167.               type: string
  2168.             company_name:
  2169.               type: string
  2170.             allowed_domains:
  2171.               type: string
  2172.             invite_id:
  2173.               type: string
  2174.             allow_open_invite:
  2175.               type: string
  2176.       responses:
  2177.         '200':
  2178.           description: Team update successful
  2179.           schema:
  2180.             $ref: '#/definitions/Team'
  2181.         '400':
  2182.           $ref: '#/responses/BadRequest'
  2183.         '401':
  2184.           $ref: '#/responses/Unauthorized'
  2185.         '403':
  2186.           $ref: '#/responses/Forbidden'
  2187.         '404':
  2188.           $ref: '#/responses/NotFound'
  2189.  
  2190.     delete:
  2191.       tags:
  2192.      - teams
  2193.       summary: Delete a team
  2194.       description: |
  2195.        Soft deletes a team, by marking the team as deleted in the database. Soft deleted teams will not be accessible in the user interface.
  2196.  
  2197.         Optionally use the permanent query parameter to hard delete the team for compliance reasons.
  2198.         ##### Permissions
  2199.         Must have the `manage_team` permission.
  2200.       parameters:
  2201.       - name: team_id
  2202.         in: path
  2203.         description: Team GUID
  2204.         required: true
  2205.         type: string
  2206.       - name: permanent
  2207.         in: query
  2208.         description: Permanently delete the team, to be used for compliance reasons only.
  2209.         required: false
  2210.         default: false
  2211.         type: boolean
  2212.       responses:
  2213.         '200':
  2214.           description: Team deletion successful
  2215.           schema:
  2216.             $ref: '#/definitions/StatusOK'
  2217.         '400':
  2218.           $ref: '#/responses/BadRequest'
  2219.         '401':
  2220.           $ref: '#/responses/Unauthorized'
  2221.         '403':
  2222.           $ref: '#/responses/Forbidden'
  2223.         '404':
  2224.           $ref: '#/responses/NotFound'
  2225.  
  2226.   '/teams/{team_id}/patch':
  2227.     put:
  2228.       tags:
  2229.      - teams
  2230.       summary: Patch a team
  2231.       description: |
  2232.        Partially update a team by providing only the fields you want to update. Omitted fields will not be updated. The fields that can be updated are defined in the request body, all other provided fields will be ignored.
  2233.         ##### Permissions
  2234.         Must have the `manage_team` permission.
  2235.       parameters:
  2236.       - name: team_id
  2237.         in: path
  2238.         description: Team GUID
  2239.         required: true
  2240.         type: string
  2241.       - in: body
  2242.         name: body
  2243.         description: Team object that is to be updated
  2244.         required: true
  2245.         schema:
  2246.           type: object
  2247.           properties:
  2248.             display_name:
  2249.               type: string
  2250.             description:
  2251.               type: string
  2252.             company_name:
  2253.               type: string
  2254.             invite_id:
  2255.               type: string
  2256.             allow_open_invite:
  2257.               type: boolean
  2258.       responses:
  2259.         '200':
  2260.           description: team patch successful
  2261.           schema:
  2262.             $ref: '#/definitions/Team'
  2263.         '400':
  2264.           $ref: '#/responses/BadRequest'
  2265.         '401':
  2266.           $ref: '#/responses/Unauthorized'
  2267.         '403':
  2268.           $ref: '#/responses/Forbidden'
  2269.  
  2270.   '/teams/name/{name}':
  2271.     get:
  2272.       tags:
  2273.      - teams
  2274.       summary: Get a team by name
  2275.       description: |
  2276.        Get a team based on provided name string
  2277.         ##### Permissions
  2278.         Must be authenticated, team type is open and have the `view_team` permission.
  2279.       parameters:
  2280.       - name: name
  2281.         in: path
  2282.         description: Team Name
  2283.         required: true
  2284.         type: string
  2285.       responses:
  2286.         '200':
  2287.           description: Team retrieval successful
  2288.           schema:
  2289.             $ref: '#/definitions/Team'
  2290.         '400':
  2291.           $ref: '#/responses/BadRequest'
  2292.         '401':
  2293.           $ref: '#/responses/Unauthorized'
  2294.         '403':
  2295.           $ref: '#/responses/Forbidden'
  2296.         '404':
  2297.           $ref: '#/responses/NotFound'
  2298.  
  2299.   '/teams/search':
  2300.     post:
  2301.       tags:
  2302.      - teams
  2303.       summary: Search teams
  2304.       description: |
  2305.        Search teams based on search term provided in the request body.
  2306.         ##### Permissions
  2307.         Logged in user only shows open teams
  2308.         Logged in user with "manage_system" permission shows all teams
  2309.       parameters:
  2310.       - in: body
  2311.         name: body
  2312.         description: Search criteria
  2313.         required: true
  2314.         schema:
  2315.           type: object
  2316.           required:
  2317.          - term
  2318.           properties:
  2319.             term:
  2320.               description: The search term to match against the name or display name of teams
  2321.               type: string
  2322.       responses:
  2323.         '200':
  2324.           description: Teams search successful
  2325.           schema:
  2326.             type: array
  2327.             items:
  2328.               $ref: '#/definitions/Team'
  2329.         '400':
  2330.           $ref: '#/responses/BadRequest'
  2331.         '401':
  2332.           $ref: '#/responses/Unauthorized'
  2333.         '403':
  2334.           $ref: '#/responses/Forbidden'
  2335.         '404':
  2336.           $ref: '#/responses/NotFound'
  2337.  
  2338.   '/teams/name/{name}/exists':
  2339.     get:
  2340.       tags:
  2341.      - teams
  2342.       summary: Check if team exists
  2343.       description: |
  2344.        Check if the team exists based on a team name.
  2345.       parameters:
  2346.       - name: name
  2347.         in: path
  2348.         description: Team Name
  2349.         required: true
  2350.         type: string
  2351.       responses:
  2352.         '200':
  2353.           description: Team retrieval successful
  2354.           schema:
  2355.             $ref: '#/definitions/TeamExists'
  2356.         '400':
  2357.           $ref: '#/responses/BadRequest'
  2358.         '401':
  2359.           $ref: '#/responses/Unauthorized'
  2360.         '404':
  2361.           $ref: '#/responses/NotFound'
  2362.  
  2363.   '/users/{user_id}/teams':
  2364.     get:
  2365.       tags:
  2366.      - teams
  2367.       summary: Get a user's teams
  2368.       description: |
  2369.        Get a list of teams that a user is on.
  2370.         ##### Permissions
  2371.         Must be authenticated as the user or have the `manage_system` permission.
  2372.       parameters:
  2373.       - name: user_id
  2374.         in: path
  2375.         description: User GUID
  2376.         required: true
  2377.         type: string
  2378.       responses:
  2379.         '200':
  2380.           description: Team list retrieval successful
  2381.           schema:
  2382.             type: array
  2383.             items:
  2384.               $ref: '#/definitions/Team'
  2385.         '400':
  2386.           $ref: '#/responses/BadRequest'
  2387.         '401':
  2388.           $ref: '#/responses/Unauthorized'
  2389.         '403':
  2390.           $ref: '#/responses/Forbidden'
  2391.  
  2392.   '/teams/{team_id}/members':
  2393.     get:
  2394.       tags:
  2395.      - teams
  2396.       summary: Get team members
  2397.       description: |
  2398.        Get a page team members list based on query string parameters - team id, page and per page.
  2399.         ##### Permissions
  2400.         Must be authenticated and have the `view_team` permission.
  2401.       parameters:
  2402.       - name: team_id
  2403.         in: path
  2404.         description: Team GUID
  2405.         required: true
  2406.         type: string
  2407.       - name: page
  2408.         in: query
  2409.         description: The page to select.
  2410.         default: "0"
  2411.         type: string
  2412.       - name: per_page
  2413.         in: query
  2414.         description: The number of users per page.
  2415.         default: "60"
  2416.         type: string
  2417.       responses:
  2418.         '200':
  2419.           description: Team members retrieval successful
  2420.           schema:
  2421.             type: array
  2422.             items:
  2423.               $ref: '#/definitions/TeamMember'
  2424.         '400':
  2425.           $ref: '#/responses/BadRequest'
  2426.         '401':
  2427.           $ref: '#/responses/Unauthorized'
  2428.         '403':
  2429.           $ref: '#/responses/Forbidden'
  2430.         '404':
  2431.           $ref: '#/responses/NotFound'
  2432.  
  2433.     post:
  2434.       tags:
  2435.      - teams
  2436.       summary: Add user to team
  2437.       description: |
  2438.        Add user to the team by user_id.
  2439.         ##### Permissions
  2440.         Must be authenticated and team be open to add self. For adding another user, authenticated user must have the `add_user_to_team` permission.
  2441.       parameters:
  2442.       - name: team_id
  2443.         in: path
  2444.         description: Team GUID
  2445.         required: true
  2446.         type: string
  2447.       - in: body
  2448.         name: body
  2449.         required: true
  2450.         schema:
  2451.           $ref: '#/definitions/TeamMember'
  2452.       responses:
  2453.         '201':
  2454.           description: Team member creation successful
  2455.           schema:
  2456.             $ref: '#/definitions/TeamMember'
  2457.         '400':
  2458.           $ref: '#/responses/BadRequest'
  2459.         '401':
  2460.           $ref: '#/responses/Unauthorized'
  2461.         '403':
  2462.           $ref: '#/responses/Forbidden'
  2463.         '404':
  2464.           $ref: '#/responses/NotFound'
  2465.  
  2466.   '/teams/members/invite':
  2467.     post:
  2468.       tags:
  2469.      - teams
  2470.       summary: Add user to team from invite
  2471.       description: |
  2472.        Using either an invite id or hash/data pair from an email invite link, add a user to a team.
  2473.         ##### Permissions
  2474.         Must be authenticated.
  2475.       parameters:
  2476.       - name: token
  2477.         in: query
  2478.         description: AuthSettings id from the invitation
  2479.         required: true
  2480.         type: string
  2481.       responses:
  2482.         '201':
  2483.           description: Team member creation successful
  2484.           schema:
  2485.             $ref: '#/definitions/TeamMember'
  2486.         '400':
  2487.           $ref: '#/responses/BadRequest'
  2488.         '401':
  2489.           $ref: '#/responses/Unauthorized'
  2490.         '403':
  2491.           $ref: '#/responses/Forbidden'
  2492.         '404':
  2493.           $ref: '#/responses/NotFound'
  2494.  
  2495.   '/teams/{team_id}/members/batch':
  2496.     post:
  2497.       tags:
  2498.      - teams
  2499.       summary: Add multiple users to team
  2500.       description: |
  2501.        Add a number of users to the team by user_id.
  2502.         ##### Permissions
  2503.         Must be authenticated. Authenticated user must have the `add_user_to_team` permission.
  2504.       parameters:
  2505.       - name: team_id
  2506.         in: path
  2507.         description: Team GUID
  2508.         required: true
  2509.         type: string
  2510.       - in: body
  2511.         name: body
  2512.         required: true
  2513.         schema:
  2514.           type: array
  2515.           items:
  2516.             $ref: '#/definitions/TeamMember'
  2517.       responses:
  2518.         '201':
  2519.           description: Team members created successfully.
  2520.           schema:
  2521.             type: array
  2522.             items:
  2523.               $ref: '#/definitions/TeamMember'
  2524.         '400':
  2525.           $ref: '#/responses/BadRequest'
  2526.         '401':
  2527.           $ref: '#/responses/Unauthorized'
  2528.         '403':
  2529.           $ref: '#/responses/Forbidden'
  2530.         '404':
  2531.           $ref: '#/responses/NotFound'
  2532.  
  2533.   '/users/{user_id}/teams/members':
  2534.     get:
  2535.       tags:
  2536.      - teams
  2537.       summary: Get team members for a user
  2538.       description: |
  2539.        Get a list of team members for a user. Useful for getting the ids of teams the user is on and the roles they have in those teams.
  2540.         ##### Permissions
  2541.         Must be logged in as the user or have the `edit_other_users` permission.
  2542.       parameters:
  2543.       - name: user_id
  2544.         in: path
  2545.         description: User GUID
  2546.         required: true
  2547.         type: string
  2548.       responses:
  2549.         '200':
  2550.           description: Team members retrieval successful
  2551.           schema:
  2552.             type: array
  2553.             items:
  2554.               $ref: '#/definitions/TeamMember'
  2555.         '400':
  2556.           $ref: '#/responses/BadRequest'
  2557.         '401':
  2558.           $ref: '#/responses/Unauthorized'
  2559.         '403':
  2560.           $ref: '#/responses/Forbidden'
  2561.         '404':
  2562.           $ref: '#/responses/NotFound'
  2563.  
  2564.   '/teams/{team_id}/members/{user_id}':
  2565.     get:
  2566.       tags:
  2567.      - teams
  2568.       summary: Get a team member
  2569.       description: |
  2570.        Get a team member on the system.
  2571.         ##### Permissions
  2572.         Must be authenticated and have the `view_team` permission.
  2573.       parameters:
  2574.       - name: team_id
  2575.         in: path
  2576.         description: Team GUID
  2577.         required: true
  2578.         type: string
  2579.       - name: user_id
  2580.         in: path
  2581.         description: User GUID
  2582.         required: true
  2583.         type: string
  2584.       responses:
  2585.         '200':
  2586.           description: Team member retrieval successful
  2587.           schema:
  2588.             $ref: '#/definitions/TeamMember'
  2589.         '400':
  2590.           $ref: '#/responses/BadRequest'
  2591.         '401':
  2592.           $ref: '#/responses/Unauthorized'
  2593.         '403':
  2594.           $ref: '#/responses/Forbidden'
  2595.         '404':
  2596.           $ref: '#/responses/NotFound'
  2597.  
  2598.     delete:
  2599.       tags:
  2600.      - teams
  2601.       summary: Remove user from team
  2602.       description: |
  2603.        Delete the team member object for a user, effectively removing them from a team.
  2604.         ##### Permissions
  2605.         Must be logged in as the user or have the `remove_user_from_team` permission.
  2606.       parameters:
  2607.       - name: team_id
  2608.         in: path
  2609.         description: Team GUID
  2610.         required: true
  2611.         type: string
  2612.       - name: user_id
  2613.         in: path
  2614.         description: User GUID
  2615.         required: true
  2616.         type: string
  2617.       responses:
  2618.         '200':
  2619.           description: Team member deletion successful
  2620.           schema:
  2621.             $ref: '#/definitions/StatusOK'
  2622.         '400':
  2623.           $ref: '#/responses/BadRequest'
  2624.         '401':
  2625.           $ref: '#/responses/Unauthorized'
  2626.         '403':
  2627.           $ref: '#/responses/Forbidden'
  2628.         '404':
  2629.           $ref: '#/responses/NotFound'
  2630.  
  2631.   '/teams/{team_id}/members/ids':
  2632.     post:
  2633.       tags:
  2634.      - teams
  2635.       summary: Get team members by ids
  2636.       description: |
  2637.        Get a list of team members based on a provided array of user ids.
  2638.         ##### Permissions
  2639.         Must have `view_team` permission for the team.
  2640.       parameters:
  2641.       - name: team_id
  2642.         in: path
  2643.         description: Team GUID
  2644.         required: true
  2645.         type: string
  2646.       - in: body
  2647.         name: body
  2648.         description: List of user ids
  2649.         required: true
  2650.         schema:
  2651.           type: array
  2652.           items:
  2653.             type: string
  2654.       responses:
  2655.         '200':
  2656.           description: Team members retrieval successful
  2657.           schema:
  2658.             type: array
  2659.             items:
  2660.               $ref: '#/definitions/TeamMember'
  2661.         '400':
  2662.           $ref: '#/responses/BadRequest'
  2663.         '401':
  2664.           $ref: '#/responses/Unauthorized'
  2665.         '403':
  2666.           $ref: '#/responses/Forbidden'
  2667.  
  2668.   '/teams/{team_id}/stats':
  2669.     get:
  2670.       tags:
  2671.      - teams
  2672.       summary: Get a team stats
  2673.       description: |
  2674.        Get a team stats on the system.
  2675.         ##### Permissions
  2676.         Must be authenticated and have the `view_team` permission.
  2677.       parameters:
  2678.       - name: team_id
  2679.         in: path
  2680.         description: Team GUID
  2681.         required: true
  2682.         type: string
  2683.       responses:
  2684.         '200':
  2685.           description: Team stats retrieval successful
  2686.           schema:
  2687.             $ref: '#/definitions/TeamStats'
  2688.         '400':
  2689.           $ref: '#/responses/BadRequest'
  2690.         '401':
  2691.           $ref: '#/responses/Unauthorized'
  2692.         '403':
  2693.           $ref: '#/responses/Forbidden'
  2694.         '404':
  2695.           $ref: '#/responses/NotFound'
  2696.  
  2697.   '/teams/{team_id}/image':
  2698.     get:
  2699.       tags:
  2700.      - teams
  2701.       summary: Get the team icon
  2702.       description: |
  2703.        Get the team icon of the team.
  2704.  
  2705.         __Minimum server version__: 4.9
  2706.  
  2707.         ##### Permissions
  2708.         User must be authenticated. In addition, team must be open or the user must have the `view_team` permission.
  2709.       parameters:
  2710.       - name: team_id
  2711.         in: path
  2712.         description: Team GUID
  2713.         required: true
  2714.         type: string
  2715.       responses:
  2716.         '200':
  2717.           description: Team icon retrieval successful
  2718.         '400':
  2719.           $ref: '#/responses/BadRequest'
  2720.         '401':
  2721.           $ref: '#/responses/Unauthorized'
  2722.         '403':
  2723.           $ref: '#/responses/Forbidden'
  2724.         '404':
  2725.           $ref: '#/responses/NotFound'
  2726.         '501':
  2727.           $ref: '#/responses/NotImplemented'
  2728.     post:
  2729.       tags:
  2730.      - teams
  2731.       summary: Sets the team icon
  2732.       description: |
  2733.        Sets the team icon for the team.
  2734.  
  2735.         __Minimum server version__: 4.9
  2736.  
  2737.         ##### Permissions
  2738.         Must be authenticated and have the `manage_team` permission.
  2739.       consumes: ["multipart/form-data"]
  2740.       parameters:
  2741.       - name: team_id
  2742.         in: path
  2743.         description: Team GUID
  2744.         required: true
  2745.         type: string
  2746.       - name: image
  2747.         in: formData
  2748.         description: The image to be uploaded
  2749.         required: true
  2750.         type: file
  2751.       responses:
  2752.         '200':
  2753.           description: Team icon successfully set
  2754.           schema:
  2755.             $ref: '#/definitions/StatusOK'
  2756.         '400':
  2757.           $ref: '#/responses/BadRequest'
  2758.         '401':
  2759.           $ref: '#/responses/Unauthorized'
  2760.         '403':
  2761.           $ref: '#/responses/Forbidden'
  2762.         '500':
  2763.           $ref: '#/responses/InternalServerError'
  2764.         '501':
  2765.           $ref: '#/responses/NotImplemented'
  2766.  
  2767.     delete:
  2768.       tags:
  2769.      - teams
  2770.       summary: Remove the team icon
  2771.       description: |
  2772.        Remove the team icon for the team.
  2773.  
  2774.         __Minimum server version__: 4.10
  2775.  
  2776.         ##### Permissions
  2777.         Must be authenticated and have the `manage_team` permission.
  2778.       parameters:
  2779.       - name: team_id
  2780.         in: path
  2781.         description: Team GUID
  2782.         required: true
  2783.         type: string
  2784.       responses:
  2785.         '200':
  2786.           description: Team icon successfully remove
  2787.           schema:
  2788.             $ref: '#/definitions/StatusOK'
  2789.         '400':
  2790.           $ref: '#/responses/BadRequest'
  2791.         '401':
  2792.           $ref: '#/responses/Unauthorized'
  2793.         '403':
  2794.           $ref: '#/responses/Forbidden'
  2795.         '500':
  2796.           $ref: '#/responses/InternalServerError'
  2797.         '501':
  2798.           $ref: '#/responses/NotImplemented'
  2799.  
  2800.   '/teams/{team_id}/members/{user_id}/roles':
  2801.     put:
  2802.       tags:
  2803.      - teams
  2804.       summary: Update a team member roles
  2805.       description: |
  2806.        Update a team member roles. Valid team roles are "team_user", "team_admin" or both of them. Overwrites any previously assigned team roles.
  2807.         ##### Permissions
  2808.         Must be authenticated and have the `manage_team_roles` permission.
  2809.       parameters:
  2810.       - name: team_id
  2811.         in: path
  2812.         description: Team GUID
  2813.         required: true
  2814.         type: string
  2815.       - name: user_id
  2816.         in: path
  2817.         description: User GUID
  2818.         required: true
  2819.         type: string
  2820.       - in: body
  2821.         name: body
  2822.         description: Space-delimited team roles to assign to the user
  2823.         required: true
  2824.         schema:
  2825.           type: object
  2826.           required:
  2827.          - roles
  2828.           properties:
  2829.             roles:
  2830.               type: string
  2831.       responses:
  2832.         '200':
  2833.           description: Team member roles update successful
  2834.           schema:
  2835.             $ref: '#/definitions/StatusOK'
  2836.         '400':
  2837.           $ref: '#/responses/BadRequest'
  2838.         '401':
  2839.           $ref: '#/responses/Unauthorized'
  2840.         '403':
  2841.           $ref: '#/responses/Forbidden'
  2842.         '404':
  2843.           $ref: '#/responses/NotFound'
  2844.  
  2845.   '/users/{user_id}/teams/unread':
  2846.     get:
  2847.       tags:
  2848.      - teams
  2849.       summary: Get team unreads for a user
  2850.       description: |
  2851.        Get the count for unread messages and mentions in the teams the user is a member of.
  2852.         ##### Permissions
  2853.         Must be logged in.
  2854.       parameters:
  2855.       - name: user_id
  2856.         in: path
  2857.         description: User GUID
  2858.         required: true
  2859.         type: string
  2860.       - name: exclude_team
  2861.         in: query
  2862.         description: Optional team id to be excluded from the results
  2863.         required: true
  2864.         type: string
  2865.       responses:
  2866.         '200':
  2867.           description: Team unreads retrieval successful
  2868.           schema:
  2869.             type: array
  2870.             items:
  2871.               $ref: '#/definitions/TeamUnread'
  2872.         '400':
  2873.           $ref: '#/responses/BadRequest'
  2874.         '401':
  2875.           $ref: '#/responses/Unauthorized'
  2876.         '403':
  2877.           $ref: '#/responses/Forbidden'
  2878.  
  2879.   '/users/{user_id}/teams/{team_id}/unread':
  2880.     get:
  2881.       tags:
  2882.      - teams
  2883.       summary: Get unreads for a team
  2884.       description: |
  2885.        Get the unread mention and message counts for a team for the specified user.
  2886.         ##### Permissions
  2887.         Must be the user or have `edit_other_users` permission and have `view_team` permission for the team.
  2888.       parameters:
  2889.       - name: user_id
  2890.         in: path
  2891.         description: User GUID
  2892.         required: true
  2893.         type: string
  2894.       - name: team_id
  2895.         in: path
  2896.         description: Team GUID
  2897.         required: true
  2898.         type: string
  2899.       responses:
  2900.         '200':
  2901.           description: Team unread count retrieval successful
  2902.           schema:
  2903.             $ref: '#/definitions/TeamUnread'
  2904.         '400':
  2905.           $ref: '#/responses/BadRequest'
  2906.         '401':
  2907.           $ref: '#/responses/Unauthorized'
  2908.         '403':
  2909.           $ref: '#/responses/Forbidden'
  2910.         '404':
  2911.           $ref: '#/responses/NotFound'
  2912.  
  2913.   '/teams/{team_id}/invite/email':
  2914.     post:
  2915.       tags:
  2916.      - teams
  2917.       summary: Invite users to the team by email
  2918.       description: |
  2919.        Invite users to the existing team usign the user's email.
  2920.         ##### Permissions
  2921.         Must have `invite_to_team` permission for the team.
  2922.       parameters:
  2923.       - name: team_id
  2924.         in: path
  2925.         description: Team GUID
  2926.         required: true
  2927.         type: string
  2928.       - in: body
  2929.         name: body
  2930.         description: List of user's email
  2931.         required: true
  2932.         schema:
  2933.           type: array
  2934.           items:
  2935.             type: string
  2936.       responses:
  2937.         '200':
  2938.           description: Users invite successful
  2939.           schema:
  2940.             $ref: '#/definitions/StatusOK'
  2941.         '400':
  2942.           $ref: '#/responses/BadRequest'
  2943.         '401':
  2944.           $ref: '#/responses/Unauthorized'
  2945.         '403':
  2946.           $ref: '#/responses/Forbidden'
  2947.  
  2948.   '/teams/{team_id}/import':
  2949.     post:
  2950.       tags:
  2951.      - teams
  2952.       summary: Import a Team from other application
  2953.       description: |
  2954.        Import a team into a existing team. Import users, channels, posts, hooks.
  2955.         ##### Permissions
  2956.         Must have `permission_import_team` permission.
  2957.       consumes: ["multipart/form-data"]
  2958.       parameters:
  2959.       - name: file
  2960.         in: formData
  2961.         description: A file to be uploaded in zip format.
  2962.         required: true
  2963.         type: file
  2964.       - name: filesize
  2965.         in: formData
  2966.         description: The size of the zip file to be imported.
  2967.         required: true
  2968.         type: integer
  2969.       - name: importFrom
  2970.         in: formData
  2971.         description: String that defines from which application the team was exported to be imported into Mattermost.
  2972.         required: true
  2973.         allowEmptyValue: false
  2974.         type: string
  2975.       - name: team_id
  2976.         in: path
  2977.         description: Team GUID
  2978.         required: true
  2979.         type: string
  2980.       responses:
  2981.         '200':
  2982.           description: JSON object containing a base64 encoded text file of the import logs in its `results` property.
  2983.           schema:
  2984.             type: object
  2985.             properties:
  2986.               results:
  2987.                 type: string
  2988.         '400':
  2989.           $ref: '#/responses/BadRequest'
  2990.         '403':
  2991.           $ref: '#/responses/Forbidden'
  2992.  
  2993.   '/teams/invite/{invite_id}':
  2994.     get:
  2995.       tags:
  2996.      - teams
  2997.       summary: Get invite info for a team
  2998.       description: |
  2999.        Get the `name`, `display_name`, `description` and `id` for a team from the invite id.
  3000.  
  3001.         __Minimum server version__: 4.0
  3002.  
  3003.         ##### Permissions
  3004.         No authentication required.
  3005.       parameters:
  3006.       - name: invite_id
  3007.         in: path
  3008.         description: Invite id for a team
  3009.         required: true
  3010.         type: string
  3011.       responses:
  3012.         '200':
  3013.           description: Team invite info retrieval successful
  3014.           schema:
  3015.             type: object
  3016.             properties:
  3017.               id:
  3018.                 type: string
  3019.               name:
  3020.                 type: string
  3021.               display_name:
  3022.                 type: string
  3023.               description:
  3024.                 type: string
  3025.         '400':
  3026.           $ref: '#/responses/BadRequest'
  3027.  
  3028.   '/teams/{team_id}/scheme':
  3029.     put:
  3030.       tags:
  3031.      - teams
  3032.       summary: Set a team's scheme
  3033.       description: |
  3034.        Set a team's scheme, more specifically sets the scheme_id value of a team record.
  3035.  
  3036.         ##### Permissions
  3037.         Must have `manage_system` permission.
  3038.  
  3039.         __Minimum server version__: 4.10
  3040.       parameters:
  3041.       - name: team_id
  3042.         in: path
  3043.         description: Team GUID
  3044.         required: true
  3045.         type: string
  3046.       - in: body
  3047.         name: body
  3048.         description: Scheme GUID
  3049.         required: true
  3050.         schema:
  3051.           type: object
  3052.           required:
  3053.          - scheme_id
  3054.           properties:
  3055.             scheme_id:
  3056.               type: string
  3057.               description: The ID of the scheme.
  3058.       responses:
  3059.         '200':
  3060.           description: Update team scheme successful
  3061.           schema:
  3062.             $ref: '#/definitions/StatusOK'
  3063.         '400':
  3064.           $ref: '#/responses/BadRequest'
  3065.         '401':
  3066.           $ref: '#/responses/Unauthorized'
  3067.         '403':
  3068.           $ref: '#/responses/Forbidden'
  3069.         '501':
  3070.           $ref: '#/responses/NotImplemented'
  3071.       x-code-samples:
  3072.       - lang: 'Go'
  3073.         source: |
  3074.          import "github.com/mattermost/mattermost-server/model"
  3075.  
  3076.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  3077.           Client.Login("email@domain.com", "Password1")
  3078.  
  3079.           teamID := "4xp9fdt77pncbef59f4k1qe83o"
  3080.           schemeID := "qjda3stwafbgpqjaxej3k76sga"
  3081.  
  3082.           ok, resp := UpdateTeamScheme(teamID, schemeID)
  3083.       - lang: 'curl'
  3084.         source: |
  3085.          curl -X PUT \
  3086.             https://your-mattermost-url.com/api/v4/teams/4xp9fdt77pncbef59f4k1qe83o/scheme \
  3087.             -H 'Authorization: Bearer frn8fu5rtpyc5m4xy6q3oj4yur' \
  3088.             -H 'Content-Type: application/json' \
  3089.             -d '{"scheme_id": "qjda3stwafbgpqjaxej3k76sga"}'
  3090.   /channels:
  3091.     post:
  3092.       tags:
  3093.      - channels
  3094.       summary: Create a channel
  3095.       description: |
  3096.        Create a new channel.
  3097.         ##### Permissions
  3098.         If creating a public channel, `create_public_channel` permission is required. If creating a private channel, `create_private_channel` permission is required.
  3099.       parameters:
  3100.       - in: body
  3101.         name: body
  3102.         description: Channel object to be created
  3103.         required: true
  3104.         schema:
  3105.           type: object
  3106.           required:
  3107.          - name
  3108.           - display_name
  3109.           - type
  3110.           - team_id
  3111.           properties:
  3112.             team_id:
  3113.               type: string
  3114.               description: The team ID of the team to create the channel on
  3115.             name:
  3116.               type: string
  3117.               description: The unique handle for the channel, will be present in the channel URL
  3118.             display_name:
  3119.               type: string
  3120.               description: The non-unique UI name for the channel
  3121.             purpose:
  3122.               type: string
  3123.               description: A short description of the purpose of the channel
  3124.             header:
  3125.               type: string
  3126.               description: Markdown-formatted text to display in the header of the channel
  3127.             type:
  3128.               type: string
  3129.               description: "'O' for a public channel, 'P' for a private channel"
  3130.       responses:
  3131.         '201':
  3132.           description: Channel creation successful
  3133.           schema:
  3134.             $ref: '#/definitions/Channel'
  3135.         '400':
  3136.           $ref: '#/responses/BadRequest'
  3137.         '401':
  3138.           $ref: '#/responses/Unauthorized'
  3139.         '403':
  3140.           $ref: '#/responses/Forbidden'
  3141.       x-code-samples:
  3142.       - lang: 'Go'
  3143.         source: |
  3144.          import "github.com/mattermost/mattermost-server/model"
  3145.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  3146.           Client.Login("email@domain.com", "Password1")
  3147.  
  3148.           channel := &model.Channel{DisplayName: <YOUR CHANNEL DISPLAYNAME>, Name: <YOUR CHANNEL NAME>, Type: <CHANNEL TYPE OPEN/PRIVATE>, TeamId: <YOUR TEAM ID>}
  3149.  
  3150.           // CreateChannel
  3151.           rchannel, resp := Client.CreateChannel(channel)
  3152.  
  3153.   /channels/direct:
  3154.     post:
  3155.       tags:
  3156.      - channels
  3157.       summary: Create a direct message channel
  3158.       description: |
  3159.        Create a new direct message channel between two users.
  3160.         ##### Permissions
  3161.         Must be one of the two users and have `create_direct_channel` permission. Having the `manage_system` permission voids the previous requirements.
  3162.       parameters:
  3163.       - in: body
  3164.         name: body
  3165.         description: The two user ids to be in the direct message
  3166.         required: true
  3167.         schema:
  3168.           type: array
  3169.           items:
  3170.             type: string
  3171.       responses:
  3172.         '201':
  3173.           description: Direct channel creation successful
  3174.           schema:
  3175.             $ref: '#/definitions/Channel'
  3176.         '400':
  3177.           $ref: '#/responses/BadRequest'
  3178.         '401':
  3179.           $ref: '#/responses/Unauthorized'
  3180.         '403':
  3181.           $ref: '#/responses/Forbidden'
  3182.       x-code-samples:
  3183.       - lang: 'Go'
  3184.         source: |
  3185.          import "github.com/mattermost/mattermost-server/model"
  3186.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  3187.           Client.Login("email@domain.com", "Password1")
  3188.  
  3189.           // CreateDirectChannel
  3190.           dm, resp := Client.CreateDirectChannel(<ID OF User1>, <ID OF User2>)
  3191.  
  3192.   /channels/group:
  3193.     post:
  3194.       tags:
  3195.      - channels
  3196.       summary: Create a group message channel
  3197.       description: |
  3198.        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.
  3199.         ##### Permissions
  3200.         Must have `create_group_channel` permission.
  3201.       parameters:
  3202.       - in: body
  3203.         name: body
  3204.         description: User ids to be in the group message channel
  3205.         required: true
  3206.         schema:
  3207.           type: array
  3208.           items:
  3209.             type: string
  3210.       responses:
  3211.         '201':
  3212.           description: Group channel creation successful
  3213.           schema:
  3214.             $ref: '#/definitions/Channel'
  3215.         '400':
  3216.           $ref: '#/responses/BadRequest'
  3217.         '401':
  3218.           $ref: '#/responses/Unauthorized'
  3219.         '403':
  3220.           $ref: '#/responses/Forbidden'
  3221.       x-code-samples:
  3222.       - lang: 'Go'
  3223.         source: |
  3224.          import "github.com/mattermost/mattermost-server/model"
  3225.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  3226.           Client.Login("email@domain.com", "Password1")
  3227.  
  3228.           userIds := []string{<ID OF User1>, <ID OF User2>, <ID OF User3> ...}
  3229.  
  3230.           // CreateGroupChannel
  3231.           rgc, resp := Client.CreateGroupChannel(userIds)
  3232.  
  3233.   /teams/{team_id}/channels/ids:
  3234.     post:
  3235.       tags:
  3236.      - channels
  3237.       summary: Get a list of channels by ids
  3238.       description: |
  3239.        Get a list of public channels on a team by id.
  3240.         ##### Permissions
  3241.         `view_team` for the team the channels are on.
  3242.       parameters:
  3243.       - name: team_id
  3244.         in: path
  3245.         description: Team GUID
  3246.         required: true
  3247.         type: string
  3248.       - in: body
  3249.         name: body
  3250.         description: List of channel ids
  3251.         required: true
  3252.         schema:
  3253.           type: array
  3254.           items:
  3255.             type: string
  3256.       responses:
  3257.         '200':
  3258.           description: Channel list retrieval successful
  3259.           schema:
  3260.             type: array
  3261.             items:
  3262.               $ref: '#/definitions/Channel'
  3263.         '400':
  3264.           $ref: '#/responses/BadRequest'
  3265.         '401':
  3266.           $ref: '#/responses/Unauthorized'
  3267.         '404':
  3268.           $ref: '#/responses/NotFound'
  3269.       x-code-samples:
  3270.       - lang: 'Go'
  3271.         source: |
  3272.          import "github.com/mattermost/mattermost-server/model"
  3273.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  3274.           Client.Login("email@domain.com", "Password1")
  3275.  
  3276.           channelIds := []string{<ID OF CHANNEL1>, <ID OF CHANNEL2>, ...}
  3277.  
  3278.           // GetPublicChannelsByIdsForTeam
  3279.           channels, resp := Client.GetPublicChannelsByIdsForTeam(<TEAMID>, channelIds)
  3280.  
  3281.   '/channels/{channel_id}':
  3282.     get:
  3283.       tags:
  3284.      - channels
  3285.       summary: Get a channel
  3286.       description: |
  3287.        Get channel from the provided channel id string.
  3288.         ##### Permissions
  3289.         `read_channel` permission for the channel.
  3290.       parameters:
  3291.       - name: channel_id
  3292.         in: path
  3293.         description: Channel GUID
  3294.         required: true
  3295.         type: string
  3296.       responses:
  3297.         '200':
  3298.           description: Channel retrieval successful
  3299.           schema:
  3300.             $ref: '#/definitions/Channel'
  3301.         '401':
  3302.           $ref: '#/responses/Unauthorized'
  3303.         '403':
  3304.           $ref: '#/responses/Forbidden'
  3305.         '404':
  3306.           $ref: '#/responses/NotFound'
  3307.       x-code-samples:
  3308.       - lang: 'Go'
  3309.         source: |
  3310.          import "github.com/mattermost/mattermost-server/model"
  3311.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  3312.           Client.Login("email@domain.com", "Password1")
  3313.  
  3314.           // GetChannel
  3315.           channel, resp := Client.GetChannel(<CHANNELID>, "")
  3316.  
  3317.     put:
  3318.       tags:
  3319.      - channels
  3320.       summary: Update a channel
  3321.       description: |
  3322.        Update a channel. The fields that can be updated are listed as paramters. Omitted fields will be treated as blanks.
  3323.         ##### Permissions
  3324.         If updating a public channel, `manage_public_channel_members` permission is required. If updating a private channel, `manage_private_channel_members` permission is required.
  3325.       parameters:
  3326.       - name: channel_id
  3327.         in: path
  3328.         description: Channel GUID
  3329.         required: true
  3330.         type: string
  3331.       - in: body
  3332.         name: body
  3333.         description: Channel object to be updated
  3334.         required: true
  3335.         schema:
  3336.           type: object
  3337.           required:
  3338.          - id
  3339.           properties:
  3340.             id:
  3341.               type: string
  3342.               description: The channel's id, not updatable
  3343.             name:
  3344.               type: string
  3345.               description: The unique handle for the channel, will be present in the channel URL
  3346.             display_name:
  3347.               type: string
  3348.               description: The non-unique UI name for the channel
  3349.             purpose:
  3350.               type: string
  3351.               description: A short description of the purpose of the channel
  3352.             header:
  3353.               type: string
  3354.               description: Markdown-formatted text to display in the header of the channel
  3355.             type:
  3356.               type: string
  3357.               description: "'O' for a public channel, 'P' for a private channel"
  3358.       responses:
  3359.         '200':
  3360.           description: Channel update successful
  3361.           schema:
  3362.             $ref: '#/definitions/Channel'
  3363.         '400':
  3364.           $ref: '#/responses/BadRequest'
  3365.         '401':
  3366.           $ref: '#/responses/Unauthorized'
  3367.         '403':
  3368.           $ref: '#/responses/Forbidden'
  3369.         '404':
  3370.           $ref: '#/responses/NotFound'
  3371.       x-code-samples:
  3372.       - lang: 'Go'
  3373.         source: |
  3374.          import "github.com/mattermost/mattermost-server/model"
  3375.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  3376.           Client.Login("email@domain.com", "Password1")
  3377.  
  3378.           channel := &model.Channel{DisplayName: <YOUR CHANNEL NEW DISPLAYNAME>, ChannelId: <CHANNELID>, TeamId: <YOUR TEAM ID>}
  3379.  
  3380.           // UpdateChannel
  3381.           updatedChannel, resp := Client.UpdateChannel(channel)
  3382.  
  3383.     delete:
  3384.       tags:
  3385.      - channels
  3386.       summary: Delete a channel
  3387.       description: |
  3388.        Soft deletes a channel, by marking the channel as deleted in the database. Soft deleted channels will not be accessible in the user interface.
  3389.         ##### Permissions
  3390.         `delete_public_channel` permission if the channel is public,
  3391.         `delete_private_channel` permission if the channel is private,
  3392.         or have `manage_system` permission.
  3393.       parameters:
  3394.       - name: channel_id
  3395.         in: path
  3396.         description: Channel GUID
  3397.         required: true
  3398.         type: string
  3399.       responses:
  3400.         '200':
  3401.           description: Channel deletion successful
  3402.           schema:
  3403.             $ref: '#/definitions/StatusOK'
  3404.         '400':
  3405.           $ref: '#/responses/BadRequest'
  3406.         '401':
  3407.           $ref: '#/responses/Unauthorized'
  3408.         '403':
  3409.           $ref: '#/responses/Forbidden'
  3410.       x-code-samples:
  3411.       - lang: 'Go'
  3412.         source: |
  3413.          import "github.com/mattermost/mattermost-server/model"
  3414.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  3415.           Client.Login("email@domain.com", "Password1")
  3416.  
  3417.           // DeleteChannel
  3418.           pass, resp := Client.DeleteChannel(<CHANNELID>)
  3419.  
  3420.   '/channels/{channel_id}/patch':
  3421.     put:
  3422.       tags:
  3423.      - channels
  3424.       summary: Patch a channel
  3425.       description: |
  3426.        Partially update a channel by providing only the fields you want to update. Omitted fields will not be updated. The fields that can be updated are defined in the request body, all other provided fields will be ignored.
  3427.         ##### Permissions
  3428.         If updating a public channel, `manage_public_channel_members` permission is required. If updating a private channel, `manage_private_channel_members` permission is required.
  3429.       parameters:
  3430.       - name: channel_id
  3431.         in: path
  3432.         description: Channel GUID
  3433.         required: true
  3434.         type: string
  3435.       - in: body
  3436.         name: body
  3437.         description: Channel object to be updated
  3438.         required: true
  3439.         schema:
  3440.           type: object
  3441.           properties:
  3442.             name:
  3443.               type: string
  3444.               description: The unique handle for the channel, will be present in the channel URL
  3445.             display_name:
  3446.               type: string
  3447.               description: The non-unique UI name for the channel
  3448.             purpose:
  3449.               type: string
  3450.               description: A short description of the purpose of the channel
  3451.             header:
  3452.               type: string
  3453.               description: Markdown-formatted text to display in the header of the channel
  3454.       responses:
  3455.         '200':
  3456.           description: Channel patch successful
  3457.           schema:
  3458.             $ref: '#/definitions/Channel'
  3459.         '400':
  3460.           $ref: '#/responses/BadRequest'
  3461.         '401':
  3462.           $ref: '#/responses/Unauthorized'
  3463.         '403':
  3464.           $ref: '#/responses/Forbidden'
  3465.         '404':
  3466.           $ref: '#/responses/NotFound'
  3467.       x-code-samples:
  3468.       - lang: 'Go'
  3469.         source: |
  3470.          import "github.com/mattermost/mattermost-server/model"
  3471.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  3472.           Client.Login("email@domain.com", "Password1")
  3473.  
  3474.           patch := &model.ChannelPatch{
  3475.             Name:        new(string),
  3476.             DisplayName: new(string),
  3477.             Header:      new(string),
  3478.             Purpose:     new(string),
  3479.           }
  3480.           *patch.Name = "<SOME_NEW_NAME>"
  3481.           *patch.DisplayName = "<SOME_NEW_DISPLAYNAME>"
  3482.           *patch.Header = "<SOME_NEW_HEADER>"
  3483.           *patch.Purpose = "<SOME_NEW_PURPOSE>"
  3484.  
  3485.           // PatchChannel
  3486.           channel, resp := Client.PatchChannel(<CHANNELID>, patch)
  3487.  
  3488.   '/channels/{channel_id}/convert':
  3489.     post:
  3490.       tags:
  3491.      - channels
  3492.       summary: Convert a channel from public to private
  3493.       description: |
  3494.        Convert into private channel from the provided channel id string.
  3495.  
  3496.         __Minimum server version__: 4.10
  3497.  
  3498.         ##### Permissions
  3499.         `manage_team` permission for the team of the channel.
  3500.       parameters:
  3501.       - name: channel_id
  3502.         in: path
  3503.         description: Channel GUID
  3504.         required: true
  3505.         type: string
  3506.       responses:
  3507.         '200':
  3508.           description: Channel conversion successful
  3509.           schema:
  3510.             $ref: '#/definitions/Channel'
  3511.         '400':
  3512.           $ref: '#/responses/BadRequest'
  3513.         '401':
  3514.           $ref: '#/responses/Unauthorized'
  3515.         '403':
  3516.           $ref: '#/responses/Forbidden'
  3517.         '404':
  3518.           $ref: '#/responses/NotFound'
  3519.       x-code-samples:
  3520.       - lang: 'Go'
  3521.         source: |
  3522.          import "github.com/mattermost/mattermost-server/model"
  3523.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  3524.           Client.Login("email@domain.com", "Password1")
  3525.  
  3526.           // ConvertChannelToPrivate
  3527.           convertedChannel, resp := Client.ConvertChannelToPrivate(<CHANNELID>)
  3528.  
  3529.   '/channels/{channel_id}/restore':
  3530.     post:
  3531.       tags:
  3532.      - channels
  3533.       summary: Restore a channel
  3534.       description: |
  3535.        Restore channel from the provided channel id string.
  3536.  
  3537.         __Minimum server version__: 3.10
  3538.  
  3539.         ##### Permissions
  3540.         `manage_team` permission for the team of the channel.
  3541.       parameters:
  3542.       - name: channel_id
  3543.         in: path
  3544.         description: Channel GUID
  3545.         required: true
  3546.         type: string
  3547.       responses:
  3548.         '200':
  3549.           description: Channel restore successful
  3550.           schema:
  3551.             $ref: '#/definitions/Channel'
  3552.         '401':
  3553.           $ref: '#/responses/Unauthorized'
  3554.         '403':
  3555.           $ref: '#/responses/Forbidden'
  3556.         '404':
  3557.           $ref: '#/responses/NotFound'
  3558.  
  3559.   '/channels/{channel_id}/stats':
  3560.     get:
  3561.       tags:
  3562.      - channels
  3563.       summary: Get channel statistics
  3564.       description: |
  3565.        Get statistics for a channel.
  3566.         ##### Permissions
  3567.         Must have the `read_channel` permission.
  3568.       parameters:
  3569.       - name: channel_id
  3570.         in: path
  3571.         description: Channel GUID
  3572.         required: true
  3573.         type: string
  3574.       responses:
  3575.         '200':
  3576.           description: Channel statistics retrieval successful
  3577.           schema:
  3578.             $ref: '#/definitions/ChannelStats'
  3579.         '400':
  3580.           $ref: '#/responses/BadRequest'
  3581.         '401':
  3582.           $ref: '#/responses/Unauthorized'
  3583.         '403':
  3584.           $ref: '#/responses/Forbidden'
  3585.       x-code-samples:
  3586.       - lang: 'Go'
  3587.         source: |
  3588.          import "github.com/mattermost/mattermost-server/model"
  3589.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  3590.           Client.Login("email@domain.com", "Password1")
  3591.  
  3592.           // GetChannelStats
  3593.           stats, resp := Client.GetChannelStats(<CHANNELID>)
  3594.  
  3595.   '/channels/{channel_id}/pinned':
  3596.     get:
  3597.       tags:
  3598.      - channels
  3599.       summary: Get a channel's pinned posts
  3600.       description: Get a list of pinned posts for channel.
  3601.       parameters:
  3602.       - name: channel_id
  3603.         in: path
  3604.         description: Channel GUID
  3605.         required: true
  3606.         type: string
  3607.       responses:
  3608.         '200':
  3609.           description: The list of channel pinned posts
  3610.           schema:
  3611.             $ref: '#/definitions/PostList'
  3612.         '400':
  3613.           $ref: '#/responses/BadRequest'
  3614.         '401':
  3615.           $ref: '#/responses/Unauthorized'
  3616.         '403':
  3617.           $ref: '#/responses/Forbidden'
  3618.       x-code-samples:
  3619.       - lang: 'Go'
  3620.         source: |
  3621.          import "github.com/mattermost/mattermost-server/model"
  3622.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  3623.           Client.Login("email@domain.com", "Password1")
  3624.  
  3625.           // GetPinnedPosts
  3626.           posts, resp := Client.GetPinnedPosts(<CHANNELID>, "")
  3627.  
  3628.   '/teams/{team_id}/channels':
  3629.     get:
  3630.       tags:
  3631.      - channels
  3632.       summary: Get public channels
  3633.       description: |
  3634.        Get a page of public channels on a team based on query string parameters - page and per_page.
  3635.         ##### Permissions
  3636.         Must be authenticated and have the `list_team_channels` permission.
  3637.       parameters:
  3638.       - name: team_id
  3639.         in: path
  3640.         description: Team GUID
  3641.         required: true
  3642.         type: string
  3643.       - name: page
  3644.         in: query
  3645.         description: The page to select.
  3646.         default: "0"
  3647.         type: string
  3648.       - name: per_page
  3649.         in: query
  3650.         description: The number of public channels per page.
  3651.         default: "60"
  3652.         type: string
  3653.       responses:
  3654.         '200':
  3655.           description: Channels retrieval successful
  3656.           schema:
  3657.             type: array
  3658.             items:
  3659.               $ref: '#/definitions/Channel'
  3660.         '400':
  3661.           $ref: '#/responses/BadRequest'
  3662.         '401':
  3663.           $ref: '#/responses/Unauthorized'
  3664.         '403':
  3665.           $ref: '#/responses/Forbidden'
  3666.         '404':
  3667.           $ref: '#/responses/NotFound'
  3668.       x-code-samples:
  3669.       - lang: 'Go'
  3670.         source: |
  3671.          import "github.com/mattermost/mattermost-server/model"
  3672.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  3673.           Client.Login("email@domain.com", "Password1")
  3674.           // GetPublicChannelsForTeam
  3675.           channels, resp := Client.GetPublicChannelsForTeam(<TEAMID>, 0, 100, "")
  3676.  
  3677.   '/teams/{team_id}/channels/deleted':
  3678.     get:
  3679.       tags:
  3680.      - channels
  3681.       summary: Get deleted channels
  3682.       description: |
  3683.        Get a page of deleted channels on a team based on query string parameters - team_id, page and per_page.
  3684.  
  3685.         __Minimum server version__: 3.10
  3686.  
  3687.         ##### Permissions
  3688.         Must be authenticated and have the `manage_team` permission.
  3689.       parameters:
  3690.       - name: team_id
  3691.         in: path
  3692.         description: Team GUID
  3693.         required: true
  3694.         type: string
  3695.       - name: page
  3696.         in: query
  3697.         description: The page to select.
  3698.         default: "0"
  3699.         type: string
  3700.       - name: per_page
  3701.         in: query
  3702.         description: The number of public channels per page.
  3703.         default: "60"
  3704.         type: string
  3705.       responses:
  3706.         '200':
  3707.           description: Channels retrieval successful
  3708.           schema:
  3709.             type: array
  3710.             items:
  3711.               $ref: '#/definitions/Channel'
  3712.         '400':
  3713.           $ref: '#/responses/BadRequest'
  3714.         '401':
  3715.           $ref: '#/responses/Unauthorized'
  3716.         '403':
  3717.           $ref: '#/responses/Forbidden'
  3718.         '404':
  3719.           $ref: '#/responses/NotFound'
  3720.  
  3721.   '/teams/{team_id}/channels/autocomplete':
  3722.     get:
  3723.       tags:
  3724.      - channels
  3725.       summary: Autocomplete channels
  3726.       description: |
  3727.        Autocomplete public channels on a team based on the search term provided in the request URL.
  3728.  
  3729.         __Minimum server version__: 4.7
  3730.  
  3731.         ##### Permissions
  3732.         Must have the `list_team_channels` permission.
  3733.       parameters:
  3734.       - name: team_id
  3735.         in: path
  3736.         description: Team GUID
  3737.         required: true
  3738.         type: string
  3739.       - name: name
  3740.         in: query
  3741.         description: Name or display name
  3742.         required: true
  3743.         type: string
  3744.       responses:
  3745.         '200':
  3746.           description: Channels autocomplete successful
  3747.           schema:
  3748.             type: array
  3749.             items:
  3750.               $ref: '#/definitions/Channel'
  3751.         '400':
  3752.           $ref: '#/responses/BadRequest'
  3753.         '401':
  3754.           $ref: '#/responses/Unauthorized'
  3755.         '403':
  3756.           $ref: '#/responses/Forbidden'
  3757.         '404':
  3758.           $ref: '#/responses/NotFound'
  3759.  
  3760.   '/teams/{team_id}/channels/search':
  3761.     post:
  3762.       tags:
  3763.      - channels
  3764.       summary: Search channels
  3765.       description: |
  3766.        Search public channels on a team based on the search term provided in the request body.
  3767.         ##### Permissions
  3768.         Must have the `list_team_channels` permission.
  3769.       parameters:
  3770.       - name: team_id
  3771.         in: path
  3772.         description: Team GUID
  3773.         required: true
  3774.         type: string
  3775.       - in: body
  3776.         name: body
  3777.         description: Search criteria
  3778.         required: true
  3779.         schema:
  3780.           type: object
  3781.           required:
  3782.          - term
  3783.           properties:
  3784.             term:
  3785.               description: The search term to match against the name or display name of channels
  3786.               type: string
  3787.       responses:
  3788.         '201':
  3789.           description: Channels search successful
  3790.           schema:
  3791.             type: array
  3792.             items:
  3793.               $ref: '#/definitions/Channel'
  3794.         '400':
  3795.           $ref: '#/responses/BadRequest'
  3796.         '401':
  3797.           $ref: '#/responses/Unauthorized'
  3798.         '403':
  3799.           $ref: '#/responses/Forbidden'
  3800.         '404':
  3801.           $ref: '#/responses/NotFound'
  3802.       x-code-samples:
  3803.       - lang: 'Go'
  3804.         source: |
  3805.          import "github.com/mattermost/mattermost-server/model"
  3806.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  3807.           Client.Login("email@domain.com", "Password1")
  3808.  
  3809.           search := &model.ChannelSearch{Term: <CHANNEL DISPLAYNAME>}
  3810.  
  3811.           // SearchChannels
  3812.           channels, resp := Client.SearchChannels(<TEAMID>, search)
  3813.  
  3814.   '/teams/{team_id}/channels/name/{channel_name}?include_deleted=true':
  3815.     get:
  3816.       tags:
  3817.      - channels
  3818.       summary: Get a channel by name
  3819.       description: |
  3820.        Gets channel from the provided team id and channel name strings.
  3821.         ##### Permissions
  3822.         `read_channel` permission for the channel.
  3823.       parameters:
  3824.       - name: team_id
  3825.         in: path
  3826.         description: Team GUID
  3827.         required: true
  3828.         type: string
  3829.       - name: channel_name
  3830.         in: path
  3831.         description: Channel Name
  3832.         required: true
  3833.         type: string
  3834.       responses:
  3835.         '200':
  3836.           description: Channel retrieval successful
  3837.           schema:
  3838.             $ref: '#/definitions/Channel'
  3839.         '401':
  3840.           $ref: '#/responses/Unauthorized'
  3841.         '403':
  3842.           $ref: '#/responses/Forbidden'
  3843.         '404':
  3844.           $ref: '#/responses/NotFound'
  3845.       x-code-samples:
  3846.       - lang: 'Go'
  3847.         source: |
  3848.          import "github.com/mattermost/mattermost-server/model"
  3849.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  3850.           Client.Login("email@domain.com", "Password1")
  3851.  
  3852.           // GetChannelByName
  3853.           channel, resp := Client.GetChannelByName(<CHANNEL NAME>, <TEAMID>, "")
  3854.  
  3855.   '/teams/name/{team_name}/channels/name/{channel_name}':
  3856.     get:
  3857.       tags:
  3858.      - channels
  3859.       summary: Get a channel by name and team name
  3860.       description: |
  3861.        Gets a channel from the provided team name and channel name strings.
  3862.         ##### Permissions
  3863.         `read_channel` permission for the channel.
  3864.       parameters:
  3865.       - name: team_name
  3866.         in: path
  3867.         description: Team Name
  3868.         required: true
  3869.         type: string
  3870.       - name: channel_name
  3871.         in: path
  3872.         description: Channel Name
  3873.         required: true
  3874.         type: string
  3875.       responses:
  3876.         '200':
  3877.           description: Channel retrieval successful
  3878.           schema:
  3879.             $ref: '#/definitions/Channel'
  3880.         '401':
  3881.           $ref: '#/responses/Unauthorized'
  3882.         '403':
  3883.           $ref: '#/responses/Forbidden'
  3884.         '404':
  3885.           $ref: '#/responses/NotFound'
  3886.       x-code-samples:
  3887.       - lang: 'Go'
  3888.         source: |
  3889.          import "github.com/mattermost/mattermost-server/model"
  3890.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  3891.           Client.Login("email@domain.com", "Password1")
  3892.  
  3893.           // GetChannelByNameForTeamName
  3894.           channel, resp = Client.GetChannelByNameForTeamName(<CHANNEL NAME>, <TEAM NAME>, "")
  3895.  
  3896.   '/channels/{channel_id}/members':
  3897.     get:
  3898.       tags:
  3899.      - channels
  3900.       summary: Get channel members
  3901.       description: |
  3902.        Get a page of members for a channel.
  3903.         ##### Permissions
  3904.         `read_channel` permission for the channel.
  3905.       parameters:
  3906.       - name: channel_id
  3907.         in: path
  3908.         description: Channel GUID
  3909.         required: true
  3910.         type: string
  3911.       - name: page
  3912.         in: query
  3913.         description: The page to select.
  3914.         default: "0"
  3915.         type: string
  3916.       - name: per_page
  3917.         in: query
  3918.         description: The number of members per page.
  3919.         default: "60"
  3920.         type: string
  3921.       responses:
  3922.         '200':
  3923.           description: Channel members retrieval successful
  3924.           schema:
  3925.             type: array
  3926.             items:
  3927.               $ref: '#/definitions/ChannelMember'
  3928.         '400':
  3929.           $ref: '#/responses/BadRequest'
  3930.         '401':
  3931.           $ref: '#/responses/Unauthorized'
  3932.         '403':
  3933.           $ref: '#/responses/Forbidden'
  3934.       x-code-samples:
  3935.       - lang: 'Go'
  3936.         source: |
  3937.          import "github.com/mattermost/mattermost-server/model"
  3938.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  3939.           Client.Login("email@domain.com", "Password1")
  3940.  
  3941.           // GetChannelMembers
  3942.           members, resp := Client.GetChannelMembers(th.BasicChannel.Id, 0, 60, "")
  3943.  
  3944.     post:
  3945.       tags:
  3946.      - channels
  3947.       summary: Add user to channel
  3948.       description: Add a user to a channel by creating a channel member object.
  3949.       parameters:
  3950.       - name: channel_id
  3951.         in: path
  3952.         description: The channel ID
  3953.         required: true
  3954.         type: string
  3955.       - in: body
  3956.         name: body
  3957.         required: true
  3958.         schema:
  3959.           type: object
  3960.           required:
  3961.          - user_id
  3962.           properties:
  3963.             user_id:
  3964.               type: string
  3965.               description: The ID of user to add into the channel
  3966.             post_root_id:
  3967.               type: string
  3968.               description: The ID of root post where link to add channel member originates
  3969.       responses:
  3970.         '201':
  3971.           description: Channel member creation successful
  3972.           schema:
  3973.             $ref: '#/definitions/ChannelMember'
  3974.         '400':
  3975.           $ref: '#/responses/BadRequest'
  3976.         '401':
  3977.           $ref: '#/responses/Unauthorized'
  3978.         '403':
  3979.           $ref: '#/responses/Forbidden'
  3980.       x-code-samples:
  3981.       - lang: 'Go'
  3982.         source: |
  3983.          import "github.com/mattermost/mattermost-server/model"
  3984.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  3985.           Client.Login("email@domain.com", "Password1")
  3986.  
  3987.           // AddChannelMember
  3988.           cm, resp := Client.AddChannelMember(<CHANNEL ID>, <ID OF USER TO ADD>)
  3989.  
  3990.           // AddChannelMemberWithRootId
  3991.           cm, resp := Client.AddChannelMemberWithRootId(<CHANNEL ID>, <ID OF USER TO ADD>, <POST ROOT ID>)
  3992.  
  3993.   '/channels/{channel_id}/members/ids':
  3994.     post:
  3995.       tags:
  3996.      - channels
  3997.       summary: Get channel members by ids
  3998.       description: |
  3999.        Get a list of channel members based on the provided user ids.
  4000.         ##### Permissions
  4001.         Must have the `read_channel` permission.
  4002.       parameters:
  4003.       - name: channel_id
  4004.         in: path
  4005.         description: Channel GUID
  4006.         required: true
  4007.         type: string
  4008.       - in: body
  4009.         name: user_ids
  4010.         description: List of user ids
  4011.         required: true
  4012.         schema:
  4013.           type: array
  4014.           items:
  4015.             type: string
  4016.       responses:
  4017.         '200':
  4018.           description: Channel member list retrieval successful
  4019.           schema:
  4020.             type: array
  4021.             items:
  4022.               $ref: '#/definitions/ChannelMember'
  4023.         '400':
  4024.           $ref: '#/responses/BadRequest'
  4025.         '401':
  4026.           $ref: '#/responses/Unauthorized'
  4027.         '403':
  4028.           $ref: '#/responses/Forbidden'
  4029.         '404':
  4030.           $ref: '#/responses/NotFound'
  4031.       x-code-samples:
  4032.       - lang: 'Go'
  4033.         source: |
  4034.          import "github.com/mattermost/mattermost-server/model"
  4035.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  4036.           Client.Login("email@domain.com", "Password1")
  4037.  
  4038.           usersIds := []string{<Id of User1>, <Id of User2>, ...}
  4039.  
  4040.           // GetChannelMembersByIds
  4041.           cm, resp := Client.GetChannelMembersByIds(<CHANNELID>, usersIds)
  4042.  
  4043.   '/channels/{channel_id}/members/{user_id}':
  4044.     get:
  4045.       tags:
  4046.      - channels
  4047.       summary: Get channel member
  4048.       description: |
  4049.        Get a channel member.
  4050.         ##### Permissions
  4051.         `read_channel` permission for the channel.
  4052.       parameters:
  4053.       - name: channel_id
  4054.         in: path
  4055.         description: Channel GUID
  4056.         required: true
  4057.         type: string
  4058.       - name: user_id
  4059.         in: path
  4060.         description: User GUID
  4061.         required: true
  4062.         type: string
  4063.       responses:
  4064.         '200':
  4065.           description: Channel member retrieval successful
  4066.           schema:
  4067.             $ref: '#/definitions/ChannelMember'
  4068.         '400':
  4069.           $ref: '#/responses/BadRequest'
  4070.         '401':
  4071.           $ref: '#/responses/Unauthorized'
  4072.         '403':
  4073.           $ref: '#/responses/Forbidden'
  4074.       x-code-samples:
  4075.       - lang: 'Go'
  4076.         source: |
  4077.          import "github.com/mattermost/mattermost-server/model"
  4078.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  4079.           Client.Login("email@domain.com", "Password1")
  4080.  
  4081.           // GetChannelMember
  4082.           member, resp := Client.GetChannelMember(<CHANNELID>, <USERID>, "")
  4083.  
  4084.     delete:
  4085.       tags:
  4086.      - channels
  4087.       summary: Remove user from channel
  4088.       description: |
  4089.        Delete a channel member, effectively removing them from a channel.
  4090.         ##### Permissions
  4091.         `manage_public_channel_members` permission if the channel is public.
  4092.         `manage_private_channel_members` permission if the channel is private.
  4093.       parameters:
  4094.       - name: channel_id
  4095.         in: path
  4096.         description: Channel GUID
  4097.         required: true
  4098.         type: string
  4099.       - name: user_id
  4100.         in: path
  4101.         description: User GUID
  4102.         required: true
  4103.         type: string
  4104.       responses:
  4105.         '200':
  4106.           description: Channel member deletion successful
  4107.           schema:
  4108.             $ref: '#/definitions/StatusOK'
  4109.         '400':
  4110.           $ref: '#/responses/BadRequest'
  4111.         '401':
  4112.           $ref: '#/responses/Unauthorized'
  4113.         '403':
  4114.           $ref: '#/responses/Forbidden'
  4115.       x-code-samples:
  4116.       - lang: 'Go'
  4117.         source: |
  4118.          import "github.com/mattermost/mattermost-server/model"
  4119.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  4120.           Client.Login("email@domain.com", "Password1")
  4121.  
  4122.           // RemoveUserFromChannel
  4123.           pass, resp := Client.RemoveUserFromChannel(<CHANNELID>, <USERID>)
  4124.  
  4125.   '/channels/{channel_id}/members/{user_id}/roles':
  4126.     put:
  4127.       tags:
  4128.      - channels
  4129.       summary: Update channel roles
  4130.       description: |
  4131.        Update a user's roles for a channel.
  4132.         ##### Permissions
  4133.         Must have `manage_channel_roles` permission for the channel.
  4134.       parameters:
  4135.       - name: channel_id
  4136.         in: path
  4137.         description: Channel GUID
  4138.         required: true
  4139.         type: string
  4140.       - name: user_id
  4141.         in: path
  4142.         description: User GUID
  4143.         required: true
  4144.         type: string
  4145.       - in: body
  4146.         name: roles
  4147.         description: Space-delimited channel roles to assign to the user
  4148.         required: true
  4149.         schema:
  4150.           type: object
  4151.           required:
  4152.          - roles
  4153.           properties:
  4154.             roles:
  4155.               type: string
  4156.       responses:
  4157.         '200':
  4158.           description: Channel roles update successful
  4159.           schema:
  4160.             $ref: '#/definitions/StatusOK'
  4161.         '400':
  4162.           $ref: '#/responses/BadRequest'
  4163.         '401':
  4164.           $ref: '#/responses/Unauthorized'
  4165.         '403':
  4166.           $ref: '#/responses/Forbidden'
  4167.       x-code-samples:
  4168.       - lang: 'Go'
  4169.         source: |
  4170.          import "github.com/mattermost/mattermost-server/model"
  4171.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  4172.           Client.Login("email@domain.com", "Password1")
  4173.  
  4174.           // UpdateChannelRoles
  4175.           pass, resp := Client.UpdateChannelRoles(<CHANNELID>, <USERIDTOPROMOTE>, "channel_admin channel_user")
  4176.  
  4177.   '/channels/{channel_id}/members/{user_id}/notify_props':
  4178.     put:
  4179.       tags:
  4180.      - channels
  4181.       summary: Update channel notifications
  4182.       description: |
  4183.        Update a user's notification properties for a channel. Only the provided fields are updated.
  4184.         ##### Permissions
  4185.         Must be logged in as the user or have `edit_other_users` permission.
  4186.       parameters:
  4187.       - name: channel_id
  4188.         in: path
  4189.         description: Channel GUID
  4190.         required: true
  4191.         type: string
  4192.       - name: user_id
  4193.         in: path
  4194.         description: User GUID
  4195.         required: true
  4196.         type: string
  4197.       - in: body
  4198.         name: notify_props
  4199.         required: true
  4200.         schema:
  4201.           $ref: '#/definitions/ChannelNotifyProps'
  4202.       responses:
  4203.         '200':
  4204.           description: Channel notification properties update successful
  4205.           schema:
  4206.             $ref: '#/definitions/StatusOK'
  4207.         '400':
  4208.           $ref: '#/responses/BadRequest'
  4209.         '401':
  4210.           $ref: '#/responses/Unauthorized'
  4211.         '403':
  4212.           $ref: '#/responses/Forbidden'
  4213.         '404':
  4214.           $ref: '#/responses/NotFound'
  4215.       x-code-samples:
  4216.       - lang: 'Go'
  4217.         source: |
  4218.          import "github.com/mattermost/mattermost-server/model"
  4219.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  4220.           Client.Login("email@domain.com", "Password1")
  4221.  
  4222.           props := map[string]string{}
  4223.           props[model.DESKTOP_NOTIFY_PROP] = model.CHANNEL_NOTIFY_MENTION
  4224.           props[model.MARK_UNREAD_NOTIFY_PROP] = model.CHANNEL_MARK_UNREAD_MENTION
  4225.  
  4226.           // UpdateChannelNotifyProps
  4227.           pass, resp := Client.UpdateChannelNotifyProps(<CHANNELID>, <USERID>, props)
  4228.  
  4229.   '/channels/members/{user_id}/view':
  4230.     post:
  4231.       tags:
  4232.      - channels
  4233.       summary: View channel
  4234.       description: |
  4235.        Perform all the actions involved in viewing a channel. This includes marking channels as read, clearing push notifications, and updating the active channel.
  4236.         ##### Permissions
  4237.         Must be logged in as user or have `edit_other_users` permission.
  4238.  
  4239.         __Response only includes `last_viewed_at_times` in Mattermost server 4.3 and newer.__
  4240.       parameters:
  4241.       - in: path
  4242.         name: user_id
  4243.         description: User ID to perform the view action for
  4244.         required: true
  4245.         type: string
  4246.       - in: body
  4247.         name: body
  4248.         description: Paremeters affecting how and which channels to view
  4249.         required: true
  4250.         schema:
  4251.           type: object
  4252.           required:
  4253.          - channel_id
  4254.           properties:
  4255.             channel_id:
  4256.               type: string
  4257.               description: The channel ID that is being viewed. Use a blank string to indicate that all channels have lost focus.
  4258.             prev_channel_id:
  4259.               type: string
  4260.               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.
  4261.       responses:
  4262.         '200':
  4263.           description: Channel view successful
  4264.           schema:
  4265.             type: object
  4266.             properties:
  4267.               status:
  4268.                 type: string
  4269.                 description: Value should be "OK" if successful
  4270.               last_viewed_at_times:
  4271.                 type: object
  4272.                 description: A JSON object mapping channel IDs to the channel view times
  4273.         '400':
  4274.           $ref: '#/responses/BadRequest'
  4275.         '401':
  4276.           $ref: '#/responses/Unauthorized'
  4277.         '403':
  4278.           $ref: '#/responses/Forbidden'
  4279.       x-code-samples:
  4280.       - lang: 'Go'
  4281.         source: |
  4282.          import "github.com/mattermost/mattermost-server/model"
  4283.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  4284.           Client.Login("email@domain.com", "Password1")
  4285.  
  4286.           view := &model.ChannelView{
  4287.             ChannelId: <CHANNELID>,
  4288.           }
  4289.           // ViewChannel
  4290.           pass, resp := Client.ViewChannel(<USERID>, view)
  4291.  
  4292.   '/users/{user_id}/teams/{team_id}/channels/members':
  4293.     get:
  4294.       tags:
  4295.      - channels
  4296.       summary: Get channel members for user
  4297.       description: |
  4298.        Get all channel members on a team for a user.
  4299.         ##### Permissions
  4300.         Logged in as the user and `view_team` permission for the team. Having `manage_system` permission voids the previous requirements.
  4301.       parameters:
  4302.       - name: user_id
  4303.         in: path
  4304.         description: User GUID
  4305.         required: true
  4306.         type: string
  4307.       - name: team_id
  4308.         in: path
  4309.         description: Team GUID
  4310.         required: true
  4311.         type: string
  4312.       responses:
  4313.         '200':
  4314.           description: Channel members retrieval successful
  4315.           schema:
  4316.             type: array
  4317.             items:
  4318.               $ref: '#/definitions/ChannelMember'
  4319.         '400':
  4320.           $ref: '#/responses/BadRequest'
  4321.         '401':
  4322.           $ref: '#/responses/Unauthorized'
  4323.         '403':
  4324.           $ref: '#/responses/Forbidden'
  4325.       x-code-samples:
  4326.       - lang: 'Go'
  4327.         source: |
  4328.          import "github.com/mattermost/mattermost-server/model"
  4329.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  4330.           Client.Login("email@domain.com", "Password1")
  4331.  
  4332.           // GetChannelMembersForUser
  4333.           members, resp := Client.GetChannelMembersForUser(<USERID>, <TEAMID>, "")
  4334.  
  4335.   '/users/{user_id}/teams/{team_id}/channels':
  4336.     get:
  4337.       tags:
  4338.      - channels
  4339.       summary: Get channels for user
  4340.       description: |
  4341.        Get all the channels on a team for a user.
  4342.         ##### Permissions
  4343.         Logged in as the user, or have `edit_other_users` permission, and `view_team` permission for the team.
  4344.       parameters:
  4345.       - name: user_id
  4346.         in: path
  4347.         description: User GUID
  4348.         required: true
  4349.         type: string
  4350.       - name: team_id
  4351.         in: path
  4352.         description: Team GUID
  4353.         required: true
  4354.         type: string
  4355.       responses:
  4356.         '200':
  4357.           description: Channels retrieval successful
  4358.           schema:
  4359.             type: array
  4360.             items:
  4361.               $ref: '#/definitions/Channel'
  4362.         '400':
  4363.           $ref: '#/responses/BadRequest'
  4364.         '401':
  4365.           $ref: '#/responses/Unauthorized'
  4366.         '403':
  4367.           $ref: '#/responses/Forbidden'
  4368.         '404':
  4369.           $ref: '#/responses/NotFound'
  4370.       x-code-samples:
  4371.       - lang: 'Go'
  4372.         source: |
  4373.          import "github.com/mattermost/mattermost-server/model"
  4374.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  4375.           Client.Login("email@domain.com", "Password1")
  4376.  
  4377.           // GetChannelsForTeamForUser
  4378.           channels, resp := Client.GetChannelsForTeamForUser(<TEAMID>, <USERID>, "")
  4379.  
  4380.   '/users/{user_id}/channels/{channel_id}/unread':
  4381.     get:
  4382.       tags:
  4383.      - channels
  4384.       summary: Get unread messages
  4385.       description: |
  4386.        Get the total unread messages and mentions for a channel for a user.
  4387.         ##### Permissions
  4388.         Must be logged in as user and have the `read_channel` permission, or have `edit_other_usrs` permission.
  4389.       parameters:
  4390.       - name: user_id
  4391.         in: path
  4392.         description: User GUID
  4393.         required: true
  4394.         type: string
  4395.       - name: channel_id
  4396.         in: path
  4397.         description: Channel GUID
  4398.         required: true
  4399.         type: string
  4400.       responses:
  4401.         '200':
  4402.           description: Channel unreads retrieval successful
  4403.           schema:
  4404.             $ref: '#/definitions/ChannelUnread'
  4405.         '400':
  4406.           $ref: '#/responses/BadRequest'
  4407.         '401':
  4408.           $ref: '#/responses/Unauthorized'
  4409.         '403':
  4410.           $ref: '#/responses/Forbidden'
  4411.         '404':
  4412.           $ref: '#/responses/NotFound'
  4413.       x-code-samples:
  4414.       - lang: 'Go'
  4415.         source: |
  4416.          import "github.com/mattermost/mattermost-server/model"
  4417.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  4418.           Client.Login("email@domain.com", "Password1")
  4419.  
  4420.           // GetChannelUnread
  4421.           channelUnread, resp := Client.GetChannelUnread(<CHANNELID>, <USERID>)
  4422.   /posts:
  4423.     post:
  4424.       tags:
  4425.      - posts
  4426.       summary: Create a post
  4427.       description: |
  4428.        Create a new post in a channel. To create the post as a comment on another post, provide `root_id`.
  4429.         ##### Permissions
  4430.         Must have `create_post` permission for the channel the post is being created in.
  4431.       parameters:
  4432.       - in: body
  4433.         name: post
  4434.         description: Post object to create
  4435.         required: true
  4436.         schema:
  4437.           type: object
  4438.           required:
  4439.          - channel_id
  4440.           - message
  4441.           properties:
  4442.             channel_id:
  4443.               type: string
  4444.               description: The channel ID to post in
  4445.             message:
  4446.               type: string
  4447.               description: The message contents, can be formatted with Markdown
  4448.             root_id:
  4449.               type: string
  4450.               description: The post ID to comment on
  4451.             file_ids:
  4452.               type: array
  4453.               description: A list of file IDs to associate with the post
  4454.               items:
  4455.                 type: string
  4456.             props:
  4457.               description: A general JSON property bag to attach to the post
  4458.               type: string
  4459.       responses:
  4460.         '201':
  4461.           description: Post creation successful
  4462.           schema:
  4463.             $ref: '#/definitions/Post'
  4464.         '400':
  4465.           $ref: '#/responses/BadRequest'
  4466.         '401':
  4467.           $ref: '#/responses/Unauthorized'
  4468.         '403':
  4469.           $ref: '#/responses/Forbidden'
  4470.  
  4471.   /posts/ephemeral:
  4472.     post:
  4473.       tags:
  4474.      - posts
  4475.       summary: Create a ephemeral post
  4476.       description: |
  4477.        Create a new ephemeral post in a channel.
  4478.         ##### Permissions
  4479.         Must have `create_post_ephemeral` permission (currently only given to system admin)
  4480.       parameters:
  4481.       - in: body
  4482.         name: ephemeral_post
  4483.         description: Ephemeral Post object to send
  4484.         required: true
  4485.         schema:
  4486.           type: object
  4487.           required:
  4488.          - user_id
  4489.           - post
  4490.           properties:
  4491.             user_id:
  4492.               type: string
  4493.               description: The target user id for the ephemeral post
  4494.             post:
  4495.               type: object
  4496.               required:
  4497.              - channel_id
  4498.               - message
  4499.               description: Post object to create
  4500.               properties:
  4501.                 channel_id:
  4502.                   type: string
  4503.                   description: The channel ID to post in
  4504.                 message:
  4505.                   type: string
  4506.                   description: The message contents, can be formatted with Markdown
  4507.       responses:
  4508.         '201':
  4509.           description: Post creation successful
  4510.           schema:
  4511.             $ref: '#/definitions/Post'
  4512.         '400':
  4513.           $ref: '#/responses/BadRequest'
  4514.         '401':
  4515.           $ref: '#/responses/Unauthorized'
  4516.         '403':
  4517.           $ref: '#/responses/Forbidden'
  4518.  
  4519.   '/posts/{post_id}':
  4520.     get:
  4521.       tags:
  4522.      - posts
  4523.       summary: Get a post
  4524.       description: |
  4525.        Get a single post.
  4526.         ##### Permissions
  4527.         Must have `read_channel` permission for the channel the post is in or if the channel is public, have the `read_public_channels` permission for the team.
  4528.       parameters:
  4529.       - name: post_id
  4530.         in: path
  4531.         description: ID of the post to get
  4532.         required: true
  4533.         type: string
  4534.       responses:
  4535.         '200':
  4536.           description: Post retrieval successful
  4537.           schema:
  4538.             $ref: "#/definitions/Post"
  4539.         '400':
  4540.           $ref: '#/responses/BadRequest'
  4541.         '401':
  4542.           $ref: '#/responses/Unauthorized'
  4543.         '403':
  4544.           $ref: '#/responses/Forbidden'
  4545.  
  4546.     delete:
  4547.       tags:
  4548.      - posts
  4549.       summary: Delete a post
  4550.       description: |
  4551.        Soft deletes a post, by marking the post as deleted in the database. Soft deleted posts will not be returned in post queries.
  4552.         ##### Permissions
  4553.         Must be logged in as the user or have `delete_others_posts` permission.
  4554.       parameters:
  4555.       - name: post_id
  4556.         in: path
  4557.         description: ID of the post to delete
  4558.         required: true
  4559.         type: string
  4560.       responses:
  4561.         '200':
  4562.           description: Post deletion successful
  4563.           schema:
  4564.             $ref: "#/definitions/StatusOK"
  4565.         '400':
  4566.           $ref: '#/responses/BadRequest'
  4567.         '401':
  4568.           $ref: '#/responses/Unauthorized'
  4569.         '403':
  4570.           $ref: '#/responses/Forbidden'
  4571.  
  4572.     put:
  4573.       tags:
  4574.      - posts
  4575.       summary: Update a post
  4576.       description: |
  4577.        Update a post. Only the fields listed below are updatable, omitted fields will be treated as blank.
  4578.         ##### Permissions
  4579.         Must have `edit_post` permission for the channel the post is in.
  4580.       parameters:
  4581.       - name: post_id
  4582.         in: path
  4583.         description: ID of the post to update
  4584.         required: true
  4585.         type: string
  4586.       - in: body
  4587.         name: body
  4588.         description: Post object that is to be updated
  4589.         required: true
  4590.         schema:
  4591.           type: object
  4592.           properties:
  4593.             is_pinned:
  4594.               description: Set to `true` to pin the post to the channel it is in
  4595.               type: boolean
  4596.             message:
  4597.               description: The message text of the post
  4598.               type: string
  4599.             file_ids:
  4600.               description: The list of files attached to this post
  4601.               type: array
  4602.               items:
  4603.                 type: string
  4604.             has_reactions:
  4605.               description: Set to `true` if the post has reactions to it
  4606.               type: boolean
  4607.             props:
  4608.               description: A general JSON property bag to attach to the post
  4609.               type: string
  4610.       responses:
  4611.         '200':
  4612.           description: Post update successful
  4613.           schema:
  4614.             $ref: "#/definitions/Post"
  4615.         '400':
  4616.           $ref: '#/responses/BadRequest'
  4617.         '401':
  4618.           $ref: '#/responses/Unauthorized'
  4619.         '403':
  4620.           $ref: '#/responses/Forbidden'
  4621.  
  4622.   '/posts/{post_id}/patch':
  4623.     put:
  4624.       tags:
  4625.      - posts
  4626.       summary: Patch a post
  4627.       description: |
  4628.        Partially update a post by providing only the fields you want to update. Omitted fields will not be updated. The fields that can be updated are defined in the request body, all other provided fields will be ignored.
  4629.         ##### Permissions
  4630.         Must have the `edit_post` permission.
  4631.       parameters:
  4632.       - name: post_id
  4633.         in: path
  4634.         description: Post GUID
  4635.         required: true
  4636.         type: string
  4637.       - in: body
  4638.         name: body
  4639.         description: Post object that is to be updated
  4640.         required: true
  4641.         schema:
  4642.           type: object
  4643.           properties:
  4644.             is_pinned:
  4645.               description: Set to `true` to pin the post to the channel it is in
  4646.               type: boolean
  4647.             message:
  4648.               description: The message text of the post
  4649.               type: string
  4650.             file_ids:
  4651.               description: The list of files attached to this post
  4652.               type: array
  4653.               items:
  4654.                 type: string
  4655.             has_reactions:
  4656.               description: Set to `true` if the post has reactions to it
  4657.               type: boolean
  4658.             props:
  4659.               description: A general JSON property bag to attach to the post
  4660.               type: string
  4661.       responses:
  4662.         '200':
  4663.           description: Post patch successful
  4664.           schema:
  4665.             $ref: '#/definitions/Post'
  4666.         '400':
  4667.           $ref: '#/responses/BadRequest'
  4668.         '401':
  4669.           $ref: '#/responses/Unauthorized'
  4670.         '403':
  4671.           $ref: '#/responses/Forbidden'
  4672.  
  4673.   '/posts/{post_id}/thread':
  4674.     get:
  4675.       tags:
  4676.      - posts
  4677.       summary: Get a thread
  4678.       description: |
  4679.        Get a post and the rest of the posts in the same thread.
  4680.         ##### Permissions
  4681.         Must have `read_channel` permission for the channel the post is in or if the channel is public, have the `read_public_channels` permission for the team.
  4682.       parameters:
  4683.       - name: post_id
  4684.         in: path
  4685.         description: ID of a post in the thread
  4686.         required: true
  4687.         type: string
  4688.       responses:
  4689.         '200':
  4690.           description: Post list retrieval successful
  4691.           schema:
  4692.             $ref: "#/definitions/PostList"
  4693.         '400':
  4694.           $ref: '#/responses/BadRequest'
  4695.         '401':
  4696.           $ref: '#/responses/Unauthorized'
  4697.         '403':
  4698.           $ref: '#/responses/Forbidden'
  4699.  
  4700.   '/users/{user_id}/posts/flagged':
  4701.     get:
  4702.       tags:
  4703.      - posts
  4704.       summary: Get a list of flagged posts
  4705.       description: |
  4706.        Get a page of flagged posts of a user provided user id string. Selects from a channel, team or all flagged posts by a user.
  4707.         ##### Permissions
  4708.         Must be user or have `manage_system` permission.
  4709.       parameters:
  4710.       - name: user_id
  4711.         in: path
  4712.         description: ID of the user
  4713.         required: true
  4714.         type: string
  4715.       - name: team_id
  4716.         in: query
  4717.         description: Team ID
  4718.         type: string
  4719.       - name: channel_id
  4720.         in: query
  4721.         description: Channel ID
  4722.         type: string
  4723.       - name: page
  4724.         in: query
  4725.         description: The page to select
  4726.         default: "0"
  4727.         type: string
  4728.       - name: per_page
  4729.         in: query
  4730.         description: The number of posts per page
  4731.         default: "60"
  4732.         type: string
  4733.       responses:
  4734.         '200':
  4735.           description: Post list retrieval successful
  4736.           schema:
  4737.             type: array
  4738.             items:
  4739.               $ref: "#/definitions/PostList"
  4740.         '400':
  4741.           $ref: '#/responses/BadRequest'
  4742.         '401':
  4743.           $ref: '#/responses/Unauthorized'
  4744.         '403':
  4745.           $ref: '#/responses/Forbidden'
  4746.  
  4747.   '/posts/{post_id}/files/info':
  4748.     get:
  4749.       tags:
  4750.      - posts
  4751.       summary: Get file info for post
  4752.       description: |
  4753.        Gets a list of file information objects for the files attached to a post.
  4754.         ##### Permissions
  4755.         Must have `read_channel` permission for the channel the post is in.
  4756.       parameters:
  4757.       - name: post_id
  4758.         in: path
  4759.         description: ID of the post
  4760.         required: true
  4761.         type: string
  4762.       responses:
  4763.         '200':
  4764.           description: File info retrieval successful
  4765.           schema:
  4766.             type: array
  4767.             items:
  4768.               $ref: "#/definitions/FileInfo"
  4769.         '400':
  4770.           $ref: '#/responses/BadRequest'
  4771.         '401':
  4772.           $ref: '#/responses/Unauthorized'
  4773.         '403':
  4774.           $ref: '#/responses/Forbidden'
  4775.  
  4776.   '/channels/{channel_id}/posts':
  4777.     get:
  4778.       tags:
  4779.      - posts
  4780.       summary: Get posts for a channel
  4781.       description: |
  4782.        Get a page of posts in a channel. Use the query parameters to modify the behaviour of this endpoint. The parameters `since`, `before` and `after` must not be used together.
  4783.         ##### Permissions
  4784.         Must have `read_channel` permission for the channel.
  4785.       parameters:
  4786.       - name: channel_id
  4787.         in: path
  4788.         description: The channel ID to get the posts for
  4789.         required: true
  4790.         type: string
  4791.       - name: page
  4792.         in: query
  4793.         description: The page to select
  4794.         default: "0"
  4795.         type: string
  4796.       - name: per_page
  4797.         in: query
  4798.         description: The number of posts per page
  4799.         default: "60"
  4800.         type: string
  4801.       - name: since
  4802.         in: query
  4803.         description: Provide a non-zero value in Unix time milliseconds to select posts created after that time
  4804.         type: integer
  4805.       - name: before
  4806.         in: query
  4807.         description: A post id to select the posts that came before this one
  4808.         type: string
  4809.       - name: after
  4810.         in: query
  4811.         description: A post id to select the posts that came after this one
  4812.         type: string
  4813.       responses:
  4814.         '200':
  4815.           description: Post list retrieval successful
  4816.           schema:
  4817.             $ref: "#/definitions/PostList"
  4818.         '400':
  4819.           $ref: '#/responses/BadRequest'
  4820.         '401':
  4821.           $ref: '#/responses/Unauthorized'
  4822.         '403':
  4823.           $ref: '#/responses/Forbidden'
  4824.  
  4825.   '/teams/{team_id}/posts/search':
  4826.     post:
  4827.       tags:
  4828.      - posts
  4829.       summary: Search for team posts
  4830.       description: |
  4831.        Search posts in the team and from the provided terms string.
  4832.         ##### Permissions
  4833.         Must be authenticated and have the `view_team` permission.
  4834.       parameters:
  4835.       - name: team_id
  4836.         in: path
  4837.         description: Team GUID
  4838.         required: true
  4839.         type: string
  4840.       - name: body
  4841.         in: body
  4842.         description: The search terms and logic to use in the search.
  4843.         required: true
  4844.         schema:
  4845.           type: object
  4846.           required:
  4847.          - terms
  4848.           - is_or_search
  4849.           properties:
  4850.             terms:
  4851.               type: string
  4852.               description: 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).
  4853.             is_or_search:
  4854.               type: boolean
  4855.               description: Set to true if an Or search should be performed vs an And search.
  4856.       responses:
  4857.         '200':
  4858.           description: Post list retrieval successful
  4859.           schema:
  4860.             $ref: "#/definitions/PostList"
  4861.         '400':
  4862.           $ref: '#/responses/BadRequest'
  4863.         '401':
  4864.           $ref: '#/responses/Unauthorized'
  4865.         '403':
  4866.           $ref: '#/responses/Forbidden'
  4867.  
  4868.   '/posts/{post_id}/pin':
  4869.     post:
  4870.       tags:
  4871.      - posts
  4872.       summary: Pin a post to the channel
  4873.       description: |
  4874.        Pin a post to a channel it is in based from the provided post id string.
  4875.         ##### Permissions
  4876.         Must be authenticated and have the `read_channel` permission to the channel the post is in.
  4877.       parameters:
  4878.       - name: post_id
  4879.         in: path
  4880.         description: Post GUID
  4881.         required: true
  4882.         type: string
  4883.       responses:
  4884.         '200':
  4885.           description: Pinned post successful
  4886.           schema:
  4887.             $ref: "#/definitions/StatusOK"
  4888.         '400':
  4889.           $ref: '#/responses/BadRequest'
  4890.         '401':
  4891.           $ref: '#/responses/Unauthorized'
  4892.         '403':
  4893.           $ref: '#/responses/Forbidden'
  4894.  
  4895.   '/posts/{post_id}/unpin':
  4896.     post:
  4897.       tags:
  4898.      - posts
  4899.       summary: Unpin a post to the channel
  4900.       description: |
  4901.        Unpin a post to a channel it is in based from the provided post id string.
  4902.         ##### Permissions
  4903.         Must be authenticated and have the `read_channel` permission to the channel the post is in.
  4904.       parameters:
  4905.       - name: post_id
  4906.         in: path
  4907.         description: Post GUID
  4908.         required: true
  4909.         type: string
  4910.       responses:
  4911.         '200':
  4912.           description: Unpinned post successful
  4913.           schema:
  4914.             $ref: "#/definitions/StatusOK"
  4915.         '400':
  4916.           $ref: '#/responses/BadRequest'
  4917.         '401':
  4918.           $ref: '#/responses/Unauthorized'
  4919.         '403':
  4920.           $ref: '#/responses/Forbidden'
  4921.  
  4922.   '/posts/{post_id}/actions/{action_id}':
  4923.     post:
  4924.       tags:
  4925.      - posts
  4926.       summary: Perform a post action
  4927.       description: |
  4928.        Perform a post action, which allows users to interact with integrations through posts.
  4929.         ##### Permissions
  4930.         Must be authenticated and have the `read_channel` permission to the channel the post is in.
  4931.       parameters:
  4932.       - name: post_id
  4933.         in: path
  4934.         description: Post GUID
  4935.         required: true
  4936.         type: string
  4937.       - name: action_id
  4938.         in: path
  4939.         description: Action GUID
  4940.         required: true
  4941.         type: string
  4942.       responses:
  4943.         '200':
  4944.           description: Post action successful
  4945.           schema:
  4946.             $ref: "#/definitions/StatusOK"
  4947.         '400':
  4948.           $ref: '#/responses/BadRequest'
  4949.         '401':
  4950.           $ref: '#/responses/Unauthorized'
  4951.         '403':
  4952.           $ref: '#/responses/Forbidden'
  4953.   /users/{user_id}/preferences:
  4954.     get:
  4955.       tags:
  4956.      - preferences
  4957.       summary: Get the user's preferences
  4958.       description: |
  4959.        Get a list of the user's preferences.
  4960.         ##### Permissions
  4961.         Must be logged in as the user being updated or have the `edit_other_users` permission.
  4962.       parameters:
  4963.       - name: user_id
  4964.         in: path
  4965.         description: User GUID
  4966.         required: true
  4967.         type: string
  4968.       responses:
  4969.         '200':
  4970.           description: User preferences retrieval successful
  4971.           schema:
  4972.             type: array
  4973.             items:
  4974.               $ref: "#/definitions/Preference"
  4975.         '400':
  4976.           $ref: '#/responses/BadRequest'
  4977.         '401':
  4978.           $ref: '#/responses/Unauthorized'
  4979.         '403':
  4980.           $ref: '#/responses/Forbidden'
  4981.     put:
  4982.       tags:
  4983.      - preferences
  4984.       summary: Save the user's preferences
  4985.       description: |
  4986.        Save a list of the user's preferences.
  4987.         ##### Permissions
  4988.         Must be logged in as the user being updated or have the `edit_other_users` permission.
  4989.       parameters:
  4990.       - name: user_id
  4991.         in: path
  4992.         description: User GUID
  4993.         required: true
  4994.         type: string
  4995.       - in: body
  4996.         name: body
  4997.         description: List of preference object
  4998.         required: true
  4999.         schema:
  5000.           type: array
  5001.           items:
  5002.             $ref: '#/definitions/Preference'
  5003.       responses:
  5004.         '200':
  5005.           description: User preferences saved successful
  5006.           schema:
  5007.             $ref: "#/definitions/StatusOK"
  5008.         '400':
  5009.           $ref: '#/responses/BadRequest'
  5010.         '401':
  5011.           $ref: '#/responses/Unauthorized'
  5012.         '403':
  5013.           $ref: '#/responses/Forbidden'
  5014.         '404':
  5015.           $ref: '#/responses/NotFound'
  5016.  
  5017.   '/users/{user_id}/preferences/delete':
  5018.     post:
  5019.       tags:
  5020.      - preferences
  5021.       summary: Delete user's preferences
  5022.       description: |
  5023.        Delete a list of the user's preferences.
  5024.         ##### Permissions
  5025.         Must be logged in as the user being updated or have the `edit_other_users` permission.
  5026.       parameters:
  5027.       - name: user_id
  5028.         in: path
  5029.         description: User GUID
  5030.         required: true
  5031.         type: string
  5032.       - in: body
  5033.         name: body
  5034.         description: List of preference object
  5035.         required: true
  5036.         schema:
  5037.           type: array
  5038.           items:
  5039.             $ref: '#/definitions/Preference'
  5040.       responses:
  5041.         '200':
  5042.           description: User preferences saved successful
  5043.           schema:
  5044.             $ref: "#/definitions/StatusOK"
  5045.         '400':
  5046.           $ref: '#/responses/BadRequest'
  5047.         '401':
  5048.           $ref: '#/responses/Unauthorized'
  5049.         '403':
  5050.           $ref: '#/responses/Forbidden'
  5051.  
  5052.   '/users/{user_id}/preferences/{category}':
  5053.     get:
  5054.       tags:
  5055.      - preferences
  5056.       summary: List a user's preferences by category
  5057.       description: |
  5058.        Lists the current user's stored preferences in the given category.
  5059.         ##### Permissions
  5060.         Must be logged in as the user being updated or have the `edit_other_users` permission.
  5061.       parameters:
  5062.       - name: user_id
  5063.         in: path
  5064.         description: User GUID
  5065.         required: true
  5066.         type: string
  5067.       - name: category
  5068.         in: path
  5069.         description: The category of a group of preferences
  5070.         required: true
  5071.         type: string
  5072.       responses:
  5073.         '200':
  5074.           description: A list of all of the current user's preferences in the given category
  5075.           schema:
  5076.             type: array
  5077.             items:
  5078.               $ref: "#/definitions/Preference"
  5079.         '400':
  5080.           $ref: '#/responses/BadRequest'
  5081.         '401':
  5082.           $ref: '#/responses/Unauthorized'
  5083.         '403':
  5084.           $ref: '#/responses/Forbidden'
  5085.  
  5086.   '/users/{user_id}/preferences/{category}/name/{preference_name}':
  5087.     get:
  5088.       tags:
  5089.      - preferences
  5090.       summary: Get a specific user preference
  5091.       description: |
  5092.        Gets a single preference for the current user with the given category and name.
  5093.         ##### Permissions
  5094.         Must be logged in as the user being updated or have the `edit_other_users` permission.
  5095.       parameters:
  5096.       - name: user_id
  5097.         in: path
  5098.         description: User GUID
  5099.         required: true
  5100.         type: string
  5101.       - name: category
  5102.         in: path
  5103.         description: The category of a group of preferences
  5104.         required: true
  5105.         type: string
  5106.       - name: preference_name
  5107.         in: path
  5108.         description: The name of the preference
  5109.         required: true
  5110.         type: string
  5111.       responses:
  5112.         '200':
  5113.           description: |
  5114.            A single preference for the current user in the current categorylist of all of the current user's preferences in the given category.
  5115.           schema:
  5116.             $ref: "#/definitions/Preference"
  5117.         '400':
  5118.           $ref: '#/responses/BadRequest'
  5119.         '401':
  5120.           $ref: '#/responses/Unauthorized'
  5121.   /files:
  5122.     post:
  5123.       tags:
  5124.      - files
  5125.       summary: Upload a file
  5126.       description: |
  5127.        Uploads a file that can later be attached to a post.
  5128.  
  5129.         This request can either be a multipart/form-data request with a channel_id, files and optional
  5130.         client_ids defined in the FormData, or it can be a request with the channel_id and filename
  5131.         defined as query parameters with the contents of a single file in the body of the request.
  5132.  
  5133.         Only multipart/form-data requests are supported by server versions up to and including 4.7.
  5134.         Server versions 4.8 and higher support both types of requests.
  5135.  
  5136.         ##### Permissions
  5137.         Must have `upload_file` permission.
  5138.       consumes:
  5139.      - multipart/form-data
  5140.       - '*/*'
  5141.       produces:
  5142.      - application/json
  5143.       parameters:
  5144.       - name: files
  5145.         in: formData
  5146.         description: A file to be uploaded
  5147.         required: false
  5148.         type: file
  5149.       - name: channel_id
  5150.         in: formData
  5151.         description: The ID of the channel that this file will be uploaded to
  5152.         required: false
  5153.         type: string
  5154.       - name: client_ids
  5155.         in: formData
  5156.         description: A unique identifier for the file that will be returned in the response
  5157.         required: false
  5158.         allowEmptyValue: true
  5159.         type: string
  5160.       - name: channel_id
  5161.         in: query
  5162.         description: The ID of the channel that this file will be uploaded to
  5163.         required: false
  5164.         type: string
  5165.       - name: filename
  5166.         in: query
  5167.         description: The ID of the channel that this file will be uploaded to
  5168.         required: false
  5169.         type: string
  5170.       responses:
  5171.         '200':
  5172.           description: Corresponding lists of the provided client_ids and the metadata that has been stored in the database for each one
  5173.           schema:
  5174.             type: object
  5175.             properties:
  5176.               file_infos:
  5177.                 description: A list of file metadata that has been stored in the database
  5178.                 type: array
  5179.                 items:
  5180.                   $ref: '#/definitions/FileInfo'
  5181.               client_ids:
  5182.                 description: A list of the client_ids that were provided in the request
  5183.                 type: array
  5184.                 items:
  5185.                   type: string
  5186.         '400':
  5187.           $ref: '#/responses/BadRequest'
  5188.         '401':
  5189.           $ref: '#/responses/Unauthorized'
  5190.         '403':
  5191.           $ref: '#/responses/Forbidden'
  5192.         '413':
  5193.           $ref: '#/responses/TooLarge'
  5194.         '501':
  5195.           $ref: '#/responses/NotImplemented'
  5196.       x-code-samples:
  5197.       - lang: 'Go'
  5198.         source: |
  5199.          import "github.com/mattermost/mattermost-server/model"
  5200.  
  5201.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  5202.  
  5203.           file, err := os.Open(<IMAGE_PATH>)
  5204.           if err != nil {
  5205.             fmt.Fprintf(os.Stderr, "%v\n", err)
  5206.           }
  5207.           defer file.Close();
  5208.  
  5209.           buf := bytes.NewBuffer(nil)
  5210.           io.Copy(buf, file)
  5211.           data := buf.Bytes()
  5212.  
  5213.           channelId := "<YOUR_CHANNEL_ID>"
  5214.           filename := "<FILE_NAME>"
  5215.  
  5216.           fileUploadResponse, response := Client.UploadFile(data, channelId, filename)
  5217.  
  5218.       - lang: 'Curl'
  5219.         source: |
  5220.          curl -F 'files=@PATH/TO/LOCAL/FILE' \
  5221.           -F 'channel_id=CHANNEL_ID' \
  5222.           --header 'authorization: Bearer c49adc55z3f53ck7xtp8ebq1ir'
  5223.           https://your-mattermost-url.com/api/v4/files
  5224.  
  5225.  
  5226.   '/files/{file_id}':
  5227.     get:
  5228.       tags:
  5229.      - files
  5230.       summary: Get a file
  5231.       description: |
  5232.        Gets a file that has been uploaded previously.
  5233.         ##### Permissions
  5234.         Must have `read_channel` permission or be uploader of the file.
  5235.       parameters:
  5236.       - name: file_id
  5237.         in: path
  5238.         description: The ID of the file to get
  5239.         required: true
  5240.         type: string
  5241.       responses:
  5242.         '400':
  5243.           $ref: '#/responses/BadRequest'
  5244.         '401':
  5245.           $ref: '#/responses/Unauthorized'
  5246.         '403':
  5247.           $ref: '#/responses/Forbidden'
  5248.         '404':
  5249.           $ref: '#/responses/NotFound'
  5250.         '501':
  5251.           $ref: '#/responses/NotImplemented'
  5252.  
  5253.   '/files/{file_id}/thumbnail':
  5254.     get:
  5255.       tags:
  5256.      - files
  5257.       summary: Get a file's thumbnail
  5258.       description: |
  5259.        Gets a file's thumbnail.
  5260.         ##### Permissions
  5261.         Must have `read_channel` permission or be uploader of the file.
  5262.       parameters:
  5263.       - name: file_id
  5264.         in: path
  5265.         description: The ID of the file to get
  5266.         required: true
  5267.         type: string
  5268.       responses:
  5269.         '400':
  5270.           $ref: '#/responses/BadRequest'
  5271.         '401':
  5272.           $ref: '#/responses/Unauthorized'
  5273.         '403':
  5274.           $ref: '#/responses/Forbidden'
  5275.         '404':
  5276.           $ref: '#/responses/NotFound'
  5277.         '501':
  5278.           $ref: '#/responses/NotImplemented'
  5279.  
  5280.   '/files/{file_id}/preview':
  5281.     get:
  5282.       tags:
  5283.      - files
  5284.       summary: Get a file's preview
  5285.       description: |
  5286.        Gets a file's preview.
  5287.         ##### Permissions
  5288.         Must have `read_channel` permission or be uploader of the file.
  5289.       parameters:
  5290.       - name: file_id
  5291.         in: path
  5292.         description: The ID of the file to get
  5293.         required: true
  5294.         type: string
  5295.       responses:
  5296.         '400':
  5297.           $ref: '#/responses/BadRequest'
  5298.         '401':
  5299.           $ref: '#/responses/Unauthorized'
  5300.         '403':
  5301.           $ref: '#/responses/Forbidden'
  5302.         '404':
  5303.           $ref: '#/responses/NotFound'
  5304.         '501':
  5305.           $ref: '#/responses/NotImplemented'
  5306.  
  5307.   '/files/{file_id}/link':
  5308.     get:
  5309.       tags:
  5310.      - files
  5311.       summary: Get a public file link
  5312.       description: Gets a public link for a file that can be accessed without logging into Mattermost.
  5313.       parameters:
  5314.       - name: file_id
  5315.         in: path
  5316.         description: The ID of the file to get a link for
  5317.         required: true
  5318.         type: string
  5319.       responses:
  5320.         '200':
  5321.           description: A publicly accessible link to the given file
  5322.           schema:
  5323.             type: string
  5324.         '400':
  5325.           $ref: '#/responses/BadRequest'
  5326.         '401':
  5327.           $ref: '#/responses/Unauthorized'
  5328.         '403':
  5329.           $ref: '#/responses/Forbidden'
  5330.         '404':
  5331.           $ref: '#/responses/NotFound'
  5332.         '501':
  5333.           $ref: '#/responses/NotImplemented'
  5334.  
  5335.   '/files/{file_id}/info':
  5336.     get:
  5337.       tags:
  5338.      - files
  5339.       summary: Get metadata for a file
  5340.       description: |
  5341.        Gets a file's info.
  5342.         ##### Permissions
  5343.         Must have `read_channel` permission or be uploader of the file.
  5344.       parameters:
  5345.       - name: file_id
  5346.         in: path
  5347.         description: The ID of the file info to get
  5348.         required: true
  5349.         type: string
  5350.       responses:
  5351.         '200':
  5352.           description: The stored metadata for the given file
  5353.           schema:
  5354.             $ref: "#/definitions/FileInfo"
  5355.         '400':
  5356.           $ref: '#/responses/BadRequest'
  5357.         '401':
  5358.           $ref: '#/responses/Unauthorized'
  5359.         '403':
  5360.           $ref: '#/responses/Forbidden'
  5361.         '404':
  5362.           $ref: '#/responses/NotFound'
  5363.         '501':
  5364.           $ref: '#/responses/NotImplemented'
  5365.   '/jobs':
  5366.     get:
  5367.       tags:
  5368.      - jobs
  5369.       summary: Get the jobs.
  5370.       description: |
  5371.        Get a page of jobs. Use the query parameters to modify the behaviour of this endpoint.
  5372.         __Minimum server version: 4.1__
  5373.         ##### Permissions
  5374.         Must have `manage_jobs` permission.
  5375.       parameters:
  5376.       - name: page
  5377.         in: query
  5378.         description: The page to select.
  5379.         default: "0"
  5380.         type: string
  5381.       - name: per_page
  5382.         in: query
  5383.         description: The number of jobs per page.
  5384.         default: "60"
  5385.         type: string
  5386.       responses:
  5387.         '200':
  5388.           description: Job list retrieval successful
  5389.           schema:
  5390.             type: array
  5391.             items:
  5392.               $ref: '#/definitions/Job'
  5393.         '400':
  5394.           $ref: '#/responses/BadRequest'
  5395.         '401':
  5396.           $ref: '#/responses/Unauthorized'
  5397.         '403':
  5398.           $ref: '#/responses/Forbidden'
  5399.  
  5400.     post:
  5401.       tags:
  5402.      - jobs
  5403.       summary: Create a new job.
  5404.       description: |
  5405.        Create a new job.
  5406.         __Minimum server version: 4.1__
  5407.         ##### Permissions
  5408.         Must have `manage_jobs` permission.
  5409.       parameters:
  5410.       - in: body
  5411.         name: body
  5412.         description: Job object to be created
  5413.         required: true
  5414.         schema:
  5415.           type: object
  5416.           required:
  5417.          - type
  5418.           properties:
  5419.             type:
  5420.               type: string
  5421.               description: The type of job to create
  5422.             data:
  5423.               type: object
  5424.               description: An object containing any additional data required for this job type
  5425.       responses:
  5426.         '201':
  5427.           description: Job creation successful
  5428.           schema:
  5429.             $ref: '#/definitions/Job'
  5430.         '400':
  5431.           $ref: '#/responses/BadRequest'
  5432.         '401':
  5433.           $ref: '#/responses/Unauthorized'
  5434.         '403':
  5435.           $ref: '#/responses/Forbidden'
  5436.  
  5437.   '/jobs/{job_id}':
  5438.     get:
  5439.       tags:
  5440.      - jobs
  5441.       summary: Get a job.
  5442.       description: |
  5443.        Gets a single job.
  5444.         __Minimum server version: 4.1__
  5445.         ##### Permissions
  5446.         Must have `manage_jobs` permission.
  5447.       parameters:
  5448.       - name: job_id
  5449.         in: path
  5450.         description: Job GUID
  5451.         required: true
  5452.         type: string
  5453.       responses:
  5454.         '200':
  5455.           description: Job retrieval successful
  5456.           schema:
  5457.             $ref: '#/definitions/Job'
  5458.         '400':
  5459.           $ref: '#/responses/BadRequest'
  5460.         '401':
  5461.           $ref: '#/responses/Unauthorized'
  5462.         '403':
  5463.           $ref: '#/responses/Forbidden'
  5464.         '404':
  5465.           $ref: '#/responses/NotFound'
  5466.  
  5467.   '/jobs/{job_id}/cancel':
  5468.     post:
  5469.       tags:
  5470.      - jobs
  5471.       summary: Cancel a job.
  5472.       description: |
  5473.        Cancel a job.
  5474.         __Minimum server version: 4.1__
  5475.         ##### Permissions
  5476.         Must have `manage_jobs` permission.
  5477.       parameters:
  5478.       - name: job_id
  5479.         in: path
  5480.         description: Job GUID
  5481.         required: true
  5482.         type: string
  5483.       responses:
  5484.         '200':
  5485.           description: Job canceled successfully
  5486.           schema:
  5487.             $ref: '#/definitions/StatusOK'
  5488.         '400':
  5489.           $ref: '#/responses/BadRequest'
  5490.         '401':
  5491.           $ref: '#/responses/Unauthorized'
  5492.         '403':
  5493.           $ref: '#/responses/Forbidden'
  5494.         '404':
  5495.           $ref: '#/responses/NotFound'
  5496.  
  5497.   '/jobs/type/{type}':
  5498.     get:
  5499.       tags:
  5500.      - jobs
  5501.       summary: Get the jobs of the given type.
  5502.       description: |
  5503.        Get a page of jobs of the given type. Use the query parameters to modify the behaviour of this endpoint.
  5504.         __Minimum server version: 4.1__
  5505.         ##### Permissions
  5506.         Must have `manage_jobs` permission.
  5507.       parameters:
  5508.       - name: type
  5509.         in: path
  5510.         description: Job type
  5511.         required: true
  5512.         type: string
  5513.       - name: page
  5514.         in: query
  5515.         description: The page to select.
  5516.         default: "0"
  5517.         type: string
  5518.       - name: per_page
  5519.         in: query
  5520.         description: The number of jobs per page.
  5521.         default: "60"
  5522.         type: string
  5523.       responses:
  5524.         '200':
  5525.           description: Job list retrieval successful
  5526.           schema:
  5527.             type: array
  5528.             items:
  5529.               $ref: '#/definitions/Job'
  5530.         '400':
  5531.           $ref: '#/responses/BadRequest'
  5532.         '401':
  5533.           $ref: '#/responses/Unauthorized'
  5534.         '403':
  5535.           $ref: '#/responses/Forbidden'
  5536.   '/system/ping':
  5537.     get:
  5538.       tags:
  5539.      - system
  5540.       summary: Check system health
  5541.       description: |
  5542.        Check if the server is up and healthy based on the configuration setting `GoRoutineHealthThreshold`. If `GoRoutineHealthThreshold` and the number of goroutines on the server exceeds that threshold the server is considered unhealthy. If `GoRoutineHealthThreshold` is not set or the number of goroutines is below the threshold the server is considered healthy.
  5543.         __Minimum server version__: 3.10
  5544.         ##### Permissions
  5545.         Must be logged in.
  5546.       responses:
  5547.         '200':
  5548.           description: Status of the system
  5549.           schema:
  5550.             type: object
  5551.             items:
  5552.               type: string
  5553.         '500':
  5554.           $ref: '#/responses/InternalServerError'
  5555.           schema:
  5556.             type: object
  5557.             items:
  5558.               type: string
  5559.       x-code-samples:
  5560.       - lang: 'Go'
  5561.         source: |
  5562.          import "github.com/mattermost/mattermost-server/model"
  5563.  
  5564.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  5565.           Client.Login("email@domain.com", "Password1")
  5566.  
  5567.           // GetPing
  5568.           status, resp := Client.GetPing()
  5569.  
  5570.   '/database/recycle':
  5571.     post:
  5572.       tags:
  5573.      - system
  5574.       summary: Recycle database connections
  5575.       description: |
  5576.        Recycle database connections by closing and reconnecting all connections to master and read replica databases.
  5577.         ##### Permissions
  5578.         Must have `manage_system` permission.
  5579.       responses:
  5580.         '200':
  5581.           description: Database recycle successful
  5582.           schema:
  5583.             $ref: "#/definitions/StatusOK"
  5584.         '403':
  5585.           $ref: '#/responses/Forbidden'
  5586.       x-code-samples:
  5587.       - lang: 'Go'
  5588.         source: |
  5589.          import "github.com/mattermost/mattermost-server/model"
  5590.  
  5591.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  5592.           Client.Login("email@domain.com", "Password1")
  5593.  
  5594.           ok, resp := Client.DatabaseRecycle()
  5595.  
  5596.   '/email/test':
  5597.     post:
  5598.       tags:
  5599.      - system
  5600.       summary: Send a test email
  5601.       description: |
  5602.        Send a test email to make sure you have your email settings configured correctly. Optionally provide a configuration in the request body to test. If no valid configuration is present in the request body the current server configuration will be tested.
  5603.         ##### Permissions
  5604.         Must have `manage_system` permission.
  5605.       parameters:
  5606.       - in: body
  5607.         name: body
  5608.         description: Mattermost configuration
  5609.         required: true
  5610.         schema:
  5611.           $ref: "#/definitions/Config"
  5612.       responses:
  5613.         '200':
  5614.           description: Email successful sent
  5615.           schema:
  5616.             $ref: "#/definitions/StatusOK"
  5617.         '403':
  5618.           $ref: '#/responses/Forbidden'
  5619.         '500':
  5620.           $ref: '#/responses/InternalServerError'
  5621.       x-code-samples:
  5622.       - lang: 'Go'
  5623.         source: |
  5624.          import "github.com/mattermost/mattermost-server/model"
  5625.  
  5626.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  5627.           Client.Login("email@domain.com", "Password1")
  5628.  
  5629.           config := model.Config{
  5630.             EmailSettings: model.EmailSettings{
  5631.               SMTPServer:    <SMTPServer>,
  5632.               SMTPPort:      <SMTPPort>,
  5633.               SMTPUsername:  <SMTPUsername>,
  5634.               SMTPPassword:  <SMTPPassword>,
  5635.             },
  5636.           }
  5637.  
  5638.           // TestEmail
  5639.           ok, resp := Client.TestEmail(&config)
  5640.  
  5641.   '/file/s3_test':
  5642.     post:
  5643.       tags:
  5644.      - system
  5645.       summary: Test AWS S3 connection
  5646.       description: |
  5647.        Send a test to validate if can connect to AWS S3. Optionally provide a configuration in the request body to test. If no valid configuration is present in the request body the current server configuration will be tested.
  5648.         ##### Permissions
  5649.         Must have `manage_system` permission.
  5650.         __Minimum server version__: 4.8
  5651.       parameters:
  5652.       - in: body
  5653.         name: body
  5654.         description: Mattermost configuration
  5655.         required: true
  5656.         schema:
  5657.           $ref: "#/definitions/Config"
  5658.       responses:
  5659.         '200':
  5660.           description: S3 Test successful
  5661.           schema:
  5662.             $ref: "#/definitions/StatusOK"
  5663.         '403':
  5664.           $ref: '#/responses/Forbidden'
  5665.         '500':
  5666.           $ref: '#/responses/InternalServerError'
  5667.       x-code-samples:
  5668.       - lang: 'Go'
  5669.         source: |
  5670.          import "github.com/mattermost/mattermost-server/model"
  5671.  
  5672.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  5673.           Client.Login("email@domain.com", "Password1")
  5674.  
  5675.           config := model.Config{
  5676.             FileSettings: model.FileSettings{
  5677.               DriverName:              model.NewString(model.IMAGE_DRIVER_S3),
  5678.               AmazonS3AccessKeyId:     <AmazonS3AccessKeyId>,
  5679.               AmazonS3SecretAccessKey: <AmazonS3SecretAccessKey>,
  5680.               AmazonS3Bucket:          <AmazonS3Bucket>,
  5681.               AmazonS3Endpoint:        <AmazonS3Endpoint>
  5682.             },
  5683.           }
  5684.  
  5685.           // TestS3Connection
  5686.           ok, resp := Client.TestS3Connection(&config)
  5687.  
  5688.   '/config':
  5689.     get:
  5690.       tags:
  5691.      - system
  5692.       summary: Get configuration
  5693.       description: |
  5694.        Retrieve the current server configuration
  5695.         ##### Permissions
  5696.         Must have `manage_system` permission.
  5697.       responses:
  5698.         '200':
  5699.           description: Configuration retrieval successful
  5700.           schema:
  5701.             $ref: "#/definitions/Config"
  5702.         '400':
  5703.           $ref: '#/responses/BadRequest'
  5704.         '403':
  5705.           $ref: '#/responses/Forbidden'
  5706.       x-code-samples:
  5707.       - lang: 'Go'
  5708.         source: |
  5709.          import "github.com/mattermost/mattermost-server/model"
  5710.  
  5711.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  5712.           Client.Login("email@domain.com", "Password1")
  5713.  
  5714.           // GetConfig
  5715.           config, resp := Client.GetConfig()
  5716.  
  5717.     put:
  5718.       tags:
  5719.      - system
  5720.       summary: Update configuration
  5721.       description: |
  5722.        Submit a new configuration for the server to use. As of server version 4.8, the `PluginSettings.EnableUploads` setting cannot be modified by this endpoint.
  5723.         ##### Permissions
  5724.         Must have `manage_system` permission.
  5725.       parameters:
  5726.       - in: body
  5727.         name: body
  5728.         description: Mattermost configuration
  5729.         required: true
  5730.         schema:
  5731.           $ref: "#/definitions/Config"
  5732.       responses:
  5733.         '200':
  5734.           description: Configuration update successful
  5735.           schema:
  5736.             $ref: "#/definitions/Config"
  5737.         '400':
  5738.           $ref: '#/responses/BadRequest'
  5739.         '403':
  5740.           $ref: '#/responses/Forbidden'
  5741.       x-code-samples:
  5742.       - lang: 'Go'
  5743.         source: |
  5744.          import "github.com/mattermost/mattermost-server/model"
  5745.  
  5746.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  5747.           Client.Login("email@domain.com", "Password1")
  5748.  
  5749.           // GetConfig
  5750.           config, resp := Client.GetConfig()
  5751.  
  5752.           config.TeamSettings.SiteName = "MyFancyName"
  5753.  
  5754.           // UpdateConfig
  5755.           updatedConfig, resp := Client.UpdateConfig(config)
  5756.  
  5757.   '/config/reload':
  5758.     post:
  5759.       tags:
  5760.      - system
  5761.       summary: Reload configuration
  5762.       description: |
  5763.        Reload the configuration file to pick up on any changes made to it.
  5764.         ##### Permissions
  5765.         Must have `manage_system` permission.
  5766.       responses:
  5767.         '200':
  5768.           description: Configuration reload successful
  5769.           schema:
  5770.             $ref: "#/definitions/StatusOK"
  5771.         '400':
  5772.           $ref: '#/responses/BadRequest'
  5773.         '403':
  5774.           $ref: '#/responses/Forbidden'
  5775.       x-code-samples:
  5776.       - lang: 'Go'
  5777.         source: |
  5778.          import "github.com/mattermost/mattermost-server/model"
  5779.  
  5780.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  5781.           Client.Login("email@domain.com", "Password1")
  5782.  
  5783.           // ReloadConfig
  5784.           ok, resp := Client.ReloadConfig()
  5785.  
  5786.   '/config/client':
  5787.     get:
  5788.       tags:
  5789.      - system
  5790.       summary: Get client configuration
  5791.       description: |
  5792.        Get a subset of the server configuration needed by the client.
  5793.         ##### Permissions
  5794.         No permission required.
  5795.       parameters:
  5796.       - name: format
  5797.         in: query
  5798.         required: true
  5799.         description: Must be `old`, other formats not implemented yet
  5800.         type: string
  5801.       responses:
  5802.         '200':
  5803.           description: Configuration retrieval successful
  5804.         '400':
  5805.           $ref: '#/responses/BadRequest'
  5806.         '501':
  5807.           $ref: '#/responses/NotImplemented'
  5808.       x-code-samples:
  5809.       - lang: 'Go'
  5810.         source: |
  5811.          import "github.com/mattermost/mattermost-server/model"
  5812.  
  5813.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  5814.           Client.Login("email@domain.com", "Password1")
  5815.  
  5816.           // GetOldClientConfig
  5817.           ok, resp := Client.GetOldClientConfig()
  5818.  
  5819.   '/config/environment':
  5820.     get:
  5821.       tags:
  5822.      - system
  5823.       summary: Get configuration made through environment variables
  5824.       description: |
  5825.        Retrieve a json object mirroring the server configuration where fields are set to true
  5826.         if the corresponding config setting is set through an environment variable. Settings
  5827.         that haven't been set through environment variables will be missing from the object.
  5828.  
  5829.         __Minimum server version__: 4.10
  5830.  
  5831.         ##### Permissions
  5832.         Must have `manage_system` permission.
  5833.       responses:
  5834.         '200':
  5835.           description: Configuration retrieval successful
  5836.           schema:
  5837.             $ref: "#/definitions/EnvironmentConfig"
  5838.         '400':
  5839.           $ref: '#/responses/BadRequest'
  5840.         '401':
  5841.           $ref: '#/responses/Unauthorized'
  5842.         '403':
  5843.           $ref: '#/responses/Forbidden'
  5844.  
  5845.   '/license':
  5846.     post:
  5847.       tags:
  5848.      - system
  5849.       summary: Upload license file
  5850.       description: |
  5851.        Upload a license to enable enterprise features.
  5852.  
  5853.         __Minimum server version__: 4.0
  5854.  
  5855.         ##### Permissions
  5856.         Must have `manage_system` permission.
  5857.       consumes: ["multipart/form-data"]
  5858.       parameters:
  5859.       - name: license
  5860.         in: formData
  5861.         description: The license to be uploaded
  5862.         required: true
  5863.         type: file
  5864.       responses:
  5865.         '201':
  5866.           description: License file upload successful
  5867.           schema:
  5868.             $ref: '#/definitions/StatusOK'
  5869.         '400':
  5870.           $ref: '#/responses/BadRequest'
  5871.         '401':
  5872.           $ref: '#/responses/Unauthorized'
  5873.         '403':
  5874.           $ref: '#/responses/Forbidden'
  5875.         '413':
  5876.           $ref: '#/responses/TooLarge'
  5877.       x-code-samples:
  5878.       - lang: 'Go'
  5879.         source: |
  5880.          import "github.com/mattermost/mattermost-server/model"
  5881.  
  5882.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  5883.           Client.Login("email@domain.com", "Password1")
  5884.  
  5885.           file, err := os.Open("<Your license file>")
  5886.           if err != nil {
  5887.             return err
  5888.           }
  5889.           defer file.Close()
  5890.  
  5891.           data := &bytes.Buffer{}
  5892.           if _, err := io.Copy(data, file); err != nil {
  5893.             return err
  5894.           }
  5895.  
  5896.           ok, resp := Client.UploadLicenseFile(data.Bytes())
  5897.  
  5898.     delete:
  5899.       tags:
  5900.      - system
  5901.       summary: Remove license file
  5902.       description: |
  5903.        Remove the license file from the server. This will disable all enterprise features.
  5904.  
  5905.         __Minimum server version__: 4.0
  5906.  
  5907.         ##### Permissions
  5908.         Must have `manage_system` permission.
  5909.       responses:
  5910.         '200':
  5911.           description: License removeal successful
  5912.         '401':
  5913.           $ref: '#/responses/Unauthorized'
  5914.         '403':
  5915.           $ref: '#/responses/Forbidden'
  5916.  
  5917.   '/license/client':
  5918.     get:
  5919.       tags:
  5920.      - system
  5921.       summary: Get client license
  5922.       description: |
  5923.        Get a subset of the server license needed by the client.
  5924.         ##### Permissions
  5925.         No permission required but having the `manage_system` permission returns more information.
  5926.       parameters:
  5927.       - name: format
  5928.         in: query
  5929.         required: true
  5930.         description: Must be `old`, other formats not implemented yet
  5931.         type: string
  5932.       responses:
  5933.         '200':
  5934.           description: License retrieval successful
  5935.         '400':
  5936.           $ref: '#/responses/BadRequest'
  5937.         '501':
  5938.           $ref: '#/responses/NotImplemented'
  5939.       x-code-samples:
  5940.       - lang: 'Go'
  5941.         source: |
  5942.          import "github.com/mattermost/mattermost-server/model"
  5943.  
  5944.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  5945.           Client.Login("email@domain.com", "Password1")
  5946.  
  5947.           // GetOldClientLicense
  5948.           license, resp := Client.GetOldClientLicense()
  5949.  
  5950.   '/audits':
  5951.     get:
  5952.       tags:
  5953.      - system
  5954.       summary: Get audits
  5955.       description: |
  5956.        Get a page of audits for all users on the system, selected with `page` and `per_page` query parameters.
  5957.         ##### Permissions
  5958.         Must have `manage_system` permission.
  5959.       parameters:
  5960.       - name: page
  5961.         in: query
  5962.         description: The page to select.
  5963.         default: "0"
  5964.         type: string
  5965.       - name: per_page
  5966.         in: query
  5967.         description: The number of audits per page.
  5968.         default: "60"
  5969.         type: string
  5970.       responses:
  5971.         '200':
  5972.           description: Audits retrieval successful
  5973.           schema:
  5974.             type: array
  5975.             items:
  5976.               $ref: "#/definitions/Audit"
  5977.         '403':
  5978.           $ref: '#/responses/Forbidden'
  5979.       x-code-samples:
  5980.       - lang: 'Go'
  5981.         source: |
  5982.          import "github.com/mattermost/mattermost-server/model"
  5983.  
  5984.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  5985.           Client.Login("email@domain.com", "Password1")
  5986.  
  5987.           // GetAudits
  5988.           audits, resp := Client.GetAudits(0, 100, "")
  5989.  
  5990.   '/caches/invalidate':
  5991.     post:
  5992.       tags:
  5993.      - system
  5994.       summary: Invalidate all the caches
  5995.       description: |
  5996.        Purge all the in-memory caches for the Mattermost server. This can have a temporary negative effect on performance while the caches are re-populated.
  5997.         ##### Permissions
  5998.         Must have `manage_system` permission.
  5999.       responses:
  6000.         '200':
  6001.           description: Caches invalidate successful
  6002.           schema:
  6003.             $ref: "#/definitions/StatusOK"
  6004.         '403':
  6005.           $ref: '#/responses/Forbidden'
  6006.       x-code-samples:
  6007.       - lang: 'Go'
  6008.         source: |
  6009.          import "github.com/mattermost/mattermost-server/model"
  6010.  
  6011.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  6012.           Client.Login("email@domain.com", "Password1")
  6013.  
  6014.           // InvalidateCaches
  6015.           ok, resp := Client.InvalidateCaches()
  6016.  
  6017.   '/logs':
  6018.     get:
  6019.       tags:
  6020.      - system
  6021.       summary: Get logs
  6022.       description: |
  6023.        Get a page of server logs, selected with `page` and `logs_per_page` query parameters.
  6024.         ##### Permissions
  6025.         Must have `manage_system` permission.
  6026.       parameters:
  6027.       - name: page
  6028.         in: query
  6029.         description: The page to select.
  6030.         default: "0"
  6031.         type: string
  6032.       - name: logs_per_page
  6033.         in: query
  6034.         description: The number of logs per page. There is a maximum limit of 10000 logs per page.
  6035.         default: "10000"
  6036.         type: string
  6037.       responses:
  6038.         '200':
  6039.           description: Logs retrieval successful
  6040.           schema:
  6041.             type: array
  6042.             items:
  6043.               type: string
  6044.         '403':
  6045.           $ref: '#/responses/Forbidden'
  6046.       x-code-samples:
  6047.       - lang: 'Go'
  6048.         source: |
  6049.          import "github.com/mattermost/mattermost-server/model"
  6050.  
  6051.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  6052.           Client.Login("email@domain.com", "Password1")
  6053.  
  6054.           // GetLogs
  6055.           logs, resp := Client.GetLogs(0, 10)
  6056.  
  6057.     post:
  6058.       tags:
  6059.      - system
  6060.       summary: Add log message
  6061.       description: |
  6062.        Add log messages to the server logs.
  6063.         ##### Permissions
  6064.         Users with `manage_system` permission can log ERROR or DEBUG messages.
  6065.         Logged in users can log ERROR or DEBUG messages when `ServiceSettings.EnableDeveloper` is `true` or just DEBUG messages when `false`.
  6066.         Non-logged in users can log ERROR or DEBUG messages when `ServiceSettings.EnableDeveloper` is `true` and cannot log when `false`.
  6067.       parameters:
  6068.       - in: body
  6069.         name: body
  6070.         required: true
  6071.         schema:
  6072.           type: object
  6073.           required:
  6074.          - level
  6075.           - message
  6076.           properties:
  6077.             level:
  6078.               type: string
  6079.               description: The error level, ERROR or DEBUG
  6080.             message:
  6081.               type: string
  6082.               description: Message to send to the server logs
  6083.       responses:
  6084.         '200':
  6085.           description: Logs sent successful
  6086.           schema:
  6087.             type: object
  6088.             items:
  6089.               type: string
  6090.         '403':
  6091.           $ref: '#/responses/Forbidden'
  6092.       x-code-samples:
  6093.       - lang: 'Go'
  6094.         source: |
  6095.          import "github.com/mattermost/mattermost-server/model"
  6096.  
  6097.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  6098.           Client.Login("email@domain.com", "Password1")
  6099.  
  6100.           message := make(map[string]string)
  6101.           message["level"] = "ERROR"
  6102.           message["message"] = "this is a test"
  6103.  
  6104.           // PostLog
  6105.           _, resp := Client.PostLog(message)
  6106.  
  6107.   '/webrtc/token':
  6108.     get:
  6109.       tags:
  6110.      - system
  6111.       summary: Get WebRTC token
  6112.       description: |
  6113.        Get a valid WebRTC token, STUN and TURN server URLs along with TURN credentials to use with the Mattermost WebRTC service. See https://docs.mattermost.com/administration/config-settings.html#webrtc-beta for WebRTC configutation settings. The token returned is for the current user's session.
  6114.         ##### Permissions
  6115.         Must be authenticated.
  6116.       responses:
  6117.         '200':
  6118.           description: WebRTC AuthSettings retrieval successful
  6119.           schema:
  6120.             type: object
  6121.             properties:
  6122.               token:
  6123.                 description: The WebRTC token
  6124.                 type: string
  6125.               gateway_url:
  6126.                 description: The URL to the gateway server
  6127.                 type: string
  6128.               stun_uri:
  6129.                 description: The URI to the STUN server
  6130.                 type: string
  6131.               turn_uri:
  6132.                 description: The URI to the TURN server
  6133.                 type: string
  6134.               turn_password:
  6135.                 description: The password to use with the TURN server
  6136.                 type: string
  6137.               turn_username:
  6138.                 description: The username to use with the TURN server
  6139.                 type: string
  6140.         '400':
  6141.           $ref: '#/responses/BadRequest'
  6142.         '401':
  6143.           $ref: '#/responses/Unauthorized'
  6144.         '501':
  6145.           $ref: '#/responses/NotImplemented'
  6146.       x-code-samples:
  6147.       - lang: 'Go'
  6148.         source: |
  6149.          import "github.com/mattermost/mattermost-serverf/model"
  6150.  
  6151.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  6152.           Client.Login("email@domain.com", "Password1")
  6153.  
  6154.           // GetWebrtcToken
  6155.           token, resp := Client.GetWebrtcToken()
  6156.  
  6157.   '/analytics/old':
  6158.     get:
  6159.       tags:
  6160.      - system
  6161.       summary: Get analytics
  6162.       description: |
  6163.        Get some analytics data about the system. This endpoint uses the old format, the `/analytics` route is reserved for the new format when it gets implemented.
  6164.  
  6165.         The returned JSON changes based on the `name` query parameter but is always key/value pairs.
  6166.  
  6167.         __Minimum server version__: 4.0
  6168.  
  6169.         ##### Permissions
  6170.         Must have `manage_system` permission.
  6171.       parameters:
  6172.       - name: name
  6173.         in: query
  6174.         required: false
  6175.         description: Possible values are "standard", "post_counts_day", "user_counts_with_posts_day" or "extra_counts"
  6176.         default: "standard"
  6177.         type: string
  6178.       - name: team_id
  6179.         in: query
  6180.         required: false
  6181.         description: The team ID to filter the data by
  6182.         type: string
  6183.       responses:
  6184.         '200':
  6185.           description: Analytics retrieval successful
  6186.         '400':
  6187.           $ref: '#/responses/BadRequest'
  6188.         '401':
  6189.           $ref: '#/responses/Unauthorized'
  6190.         '403':
  6191.           $ref: '#/responses/Forbidden'
  6192.   /emoji:
  6193.     post:
  6194.       tags:
  6195.      - emoji
  6196.       summary: Create a custom emoji
  6197.       description: |
  6198.        Create a custom emoji for the team.
  6199.         ##### Permissions
  6200.         Must be authenticated.
  6201.       consumes: ["multipart/form-data"]
  6202.       parameters:
  6203.       - name: image
  6204.         in: formData
  6205.         description: A file to be uploaded
  6206.         required: true
  6207.         type: file
  6208.       - name: emoji
  6209.         in: formData
  6210.         description: A JSON object containing a `name` field with the name of the emoji and a `creator_id` field with the id of the authenticated user.
  6211.         required: true
  6212.         type: string
  6213.       responses:
  6214.         '201':
  6215.           description: Emoji creation successful
  6216.           schema:
  6217.             $ref: '#/definitions/Emoji'
  6218.         '400':
  6219.           $ref: '#/responses/BadRequest'
  6220.         '401':
  6221.           $ref: '#/responses/Unauthorized'
  6222.         '403':
  6223.           $ref: '#/responses/Forbidden'
  6224.         '413':
  6225.           $ref: '#/responses/TooLarge'
  6226.         '501':
  6227.           $ref: '#/responses/NotImplemented'
  6228.  
  6229.     get:
  6230.       tags:
  6231.      - emoji
  6232.       summary: Get a list of custom emoji
  6233.       description: |
  6234.        Get a page of metadata for custom emoji on the system. Since server version 4.7, sort using the `sort` query parameter.
  6235.         ##### Permissions
  6236.         Must be authenticated.
  6237.       parameters:
  6238.       - name: page
  6239.         in: query
  6240.         description: The page to select.
  6241.         default: "0"
  6242.         type: string
  6243.       - name: per_page
  6244.         in: query
  6245.         description: The number of users per page.
  6246.         default: "60"
  6247.         type: string
  6248.       - name: sort
  6249.         in: query
  6250.         description: Either blank for no sorting or "name" to sort by emoji names. Minimum server version for sorting is 4.7.
  6251.         default: ""
  6252.         type: string
  6253.       responses:
  6254.         '200':
  6255.           description: Emoji list retrieval successful
  6256.           schema:
  6257.             $ref: '#/definitions/Emoji'
  6258.         '400':
  6259.           $ref: '#/responses/BadRequest'
  6260.         '401':
  6261.           $ref: '#/responses/Unauthorized'
  6262.         '403':
  6263.           $ref: '#/responses/Forbidden'
  6264.         '501':
  6265.           $ref: '#/responses/NotImplemented'
  6266.  
  6267.   '/emoji/{emoji_id}':
  6268.     get:
  6269.       tags:
  6270.      - emoji
  6271.       summary: Get a custom emoji
  6272.       description: |
  6273.        Get some metadata for a custom emoji.
  6274.         ##### Permissions
  6275.         Must be authenticated.
  6276.       parameters:
  6277.       - name: emoji_id
  6278.         in: path
  6279.         description: Emoji GUID
  6280.         required: true
  6281.         type: string
  6282.       responses:
  6283.         '200':
  6284.           description: Emoji retrieval successful
  6285.           schema:
  6286.             $ref: '#/definitions/Emoji'
  6287.         '400':
  6288.           $ref: '#/responses/BadRequest'
  6289.         '401':
  6290.           $ref: '#/responses/Unauthorized'
  6291.         '404':
  6292.           $ref: '#/responses/NotFound'
  6293.         '501':
  6294.           $ref: '#/responses/NotImplemented'
  6295.  
  6296.     delete:
  6297.       tags:
  6298.      - emoji
  6299.       summary: Delete a custom emoji
  6300.       description: |
  6301.        Delete a custom emoji.
  6302.         ##### Permissions
  6303.         Must have the `manage_team` or `manage_system` permissions or be the user who created the emoji.
  6304.       parameters:
  6305.       - name: emoji_id
  6306.         in: path
  6307.         description: Emoji GUID
  6308.         required: true
  6309.         type: string
  6310.       responses:
  6311.         '200':
  6312.           description: Emoji delete successful
  6313.           schema:
  6314.             $ref: '#/definitions/Emoji'
  6315.         '400':
  6316.           $ref: '#/responses/BadRequest'
  6317.         '401':
  6318.           $ref: '#/responses/Unauthorized'
  6319.         '403':
  6320.           $ref: '#/responses/Forbidden'
  6321.         '501':
  6322.           $ref: '#/responses/NotImplemented'
  6323.  
  6324.   '/emoji/name/{emoji_name}':
  6325.     get:
  6326.       tags:
  6327.      - emoji
  6328.       summary: Get a custom emoji by name
  6329.       description: |
  6330.        Get some metadata for a custom emoji using its name.
  6331.         ##### Permissions
  6332.         Must be authenticated.
  6333.  
  6334.         __Minimum server version__: 4.7
  6335.       parameters:
  6336.       - name: emoji_name
  6337.         in: path
  6338.         description: Emoji name
  6339.         required: true
  6340.         type: string
  6341.       responses:
  6342.         '200':
  6343.           description: Emoji retrieval successful
  6344.           schema:
  6345.             $ref: '#/definitions/Emoji'
  6346.         '400':
  6347.           $ref: '#/responses/BadRequest'
  6348.         '401':
  6349.           $ref: '#/responses/Unauthorized'
  6350.         '404':
  6351.           $ref: '#/responses/NotFound'
  6352.         '501':
  6353.           $ref: '#/responses/NotImplemented'
  6354.  
  6355.   '/emoji/{emoji_id}/image':
  6356.     get:
  6357.       tags:
  6358.      - emoji
  6359.       summary: Get custom emoji image
  6360.       description: |
  6361.        Get the image for a custom emoji.
  6362.         ##### Permissions
  6363.         Must be authenticated.
  6364.       parameters:
  6365.       - name: emoji_id
  6366.         in: path
  6367.         description: Emoji GUID
  6368.         required: true
  6369.         type: string
  6370.       responses:
  6371.         '200':
  6372.           description: Emoji image retrieval successful
  6373.         '401':
  6374.           $ref: '#/responses/Unauthorized'
  6375.         '403':
  6376.           $ref: '#/responses/Forbidden'
  6377.         '404':
  6378.           $ref: '#/responses/NotFound'
  6379.         '500':
  6380.           $ref: '#/responses/InternalServerError'
  6381.         '501':
  6382.           $ref: '#/responses/NotImplemented'
  6383.  
  6384.   /emoji/search:
  6385.     post:
  6386.       tags:
  6387.      - emoji
  6388.       summary: Search custom emoji
  6389.       description: |
  6390.        Search for custom emoji by name based on search criteria provided in the request body. A maximum of 200 results are returned.
  6391.         ##### Permissions
  6392.         Must be authenticated.
  6393.  
  6394.         __Minimum server version__: 4.7
  6395.       parameters:
  6396.       - in: body
  6397.         name: body
  6398.         description: Search criteria
  6399.         required: true
  6400.         schema:
  6401.           type: object
  6402.           required:
  6403.          - term
  6404.           properties:
  6405.             term:
  6406.               description: The term to match against the emoji name.
  6407.               type: string
  6408.             prefix_only:
  6409.               description: Set to only search for names starting with the search term.
  6410.               type: string
  6411.       responses:
  6412.         '200':
  6413.           description: Emoji list retrieval successful
  6414.           schema:
  6415.             type: array
  6416.             items:
  6417.               $ref: '#/definitions/Emoji'
  6418.         '400':
  6419.           $ref: '#/responses/BadRequest'
  6420.         '401':
  6421.           $ref: '#/responses/Unauthorized'
  6422.         '403':
  6423.           $ref: '#/responses/Forbidden'
  6424.         '501':
  6425.           $ref: '#/responses/NotImplemented'
  6426.  
  6427.   /emoji/autocomplete:
  6428.     get:
  6429.       tags:
  6430.      - emoji
  6431.       summary: Autocomplete custom emoji
  6432.       description: |
  6433.        Get a list of custom emoji with names starting with or matching the provided name. Returns a maximum of 100 results.
  6434.         ##### Permissions
  6435.         Must be authenticated.
  6436.  
  6437.         __Minimum server version__: 4.7
  6438.       parameters:
  6439.       - name: name
  6440.         in: query
  6441.         description: The emoji name to search.
  6442.         type: string
  6443.         required: true
  6444.       responses:
  6445.         '200':
  6446.           description: Emoji list retrieval successful
  6447.           schema:
  6448.             $ref: '#/definitions/Emoji'
  6449.         '400':
  6450.           $ref: '#/responses/BadRequest'
  6451.         '401':
  6452.           $ref: '#/responses/Unauthorized'
  6453.         '403':
  6454.           $ref: '#/responses/Forbidden'
  6455.         '501':
  6456.           $ref: '#/responses/NotImplemented'
  6457.   /hooks/incoming:
  6458.     post:
  6459.       tags:
  6460.      - webhooks
  6461.       summary: Create an incoming webhook
  6462.       description: |
  6463.        Create an incoming webhook for a channel.
  6464.         ##### Permissions
  6465.         `manage_webhooks` for the channel the webhook is in.
  6466.       parameters:
  6467.       - in: body
  6468.         name: body
  6469.         description: Incoming webhook to be created
  6470.         required: true
  6471.         schema:
  6472.           type: object
  6473.           required:
  6474.          - channel_id
  6475.           properties:
  6476.             channel_id:
  6477.               type: string
  6478.               description: The ID of a public channel or private group that receives the webhook payloads.
  6479.             display_name:
  6480.               type: string
  6481.               description: The display name for this incoming webhook
  6482.             description:
  6483.               type: string
  6484.               description: The description for this incoming webhook
  6485.             username:
  6486.               type: string
  6487.               description: The username this incoming webhook will post as.
  6488.             icon_url:
  6489.               type: string
  6490.               description: The profile picture this incoming webhook will use when posting.
  6491.       responses:
  6492.         '201':
  6493.           description: Incoming webhook creation successful
  6494.           schema:
  6495.             $ref: "#/definitions/IncomingWebhook"
  6496.         '400':
  6497.           $ref: '#/responses/BadRequest'
  6498.         '401':
  6499.           $ref: '#/responses/Unauthorized'
  6500.         '403':
  6501.           $ref: '#/responses/Forbidden'
  6502.  
  6503.     get:
  6504.       tags:
  6505.      - webhooks
  6506.       summary: List incoming webhooks
  6507.       description: |
  6508.        Get a page of a list of incoming webhooks. Optionally filter for a specific team using query parameters.
  6509.         ##### Permissions
  6510.         `manage_webhooks` for the system or `manage_webhooks` for the specific team.
  6511.       parameters:
  6512.       - name: page
  6513.         in: query
  6514.         description: The page to select.
  6515.         default: "0"
  6516.         type: string
  6517.       - name: per_page
  6518.         in: query
  6519.         description: The number of hooks per page.
  6520.         default: "60"
  6521.         type: string
  6522.       - name: team_id
  6523.         in: query
  6524.         description: The ID of the team to get hooks for.
  6525.         type: string
  6526.       responses:
  6527.         '200':
  6528.           description: Incoming webhooks retrieval successful
  6529.           schema:
  6530.             type: array
  6531.             items:
  6532.               $ref: "#/definitions/IncomingWebhook"
  6533.         '400':
  6534.           $ref: '#/responses/BadRequest'
  6535.         '401':
  6536.           $ref: '#/responses/Unauthorized'
  6537.         '403':
  6538.           $ref: '#/responses/Forbidden'
  6539.  
  6540.   /hooks/incoming/{hook_id}:
  6541.     get:
  6542.       tags:
  6543.      - webhooks
  6544.       summary: Get an incoming webhook
  6545.       description: |
  6546.        Get an incoming webhook given the hook id.
  6547.         ##### Permissions
  6548.         `manage_webhooks` for system or `manage_webhooks` for the specific team or `manage_webhooks` for the channel.
  6549.       parameters:
  6550.       - name: hook_id
  6551.         in: path
  6552.         description: Incoming Webhook GUID
  6553.         required: true
  6554.         type: string
  6555.       responses:
  6556.         '200':
  6557.           description: Webhook retrieval successful
  6558.           schema:
  6559.             $ref: '#/definitions/IncomingWebhook'
  6560.         '400':
  6561.           $ref: '#/responses/BadRequest'
  6562.         '401':
  6563.           $ref: '#/responses/Unauthorized'
  6564.         '403':
  6565.           $ref: '#/responses/Forbidden'
  6566.         '404':
  6567.           $ref: '#/responses/NotFound'
  6568.  
  6569.     put:
  6570.       tags:
  6571.      - webhooks
  6572.       summary: Update an incoming webhook
  6573.       description: |
  6574.        Update an incoming webhook given the hook id.
  6575.         ##### Permissions
  6576.         `manage_webhooks` for system or `manage_webhooks` for the specific team or `manage_webhooks` for the channel.
  6577.       parameters:
  6578.       - name: hook_id
  6579.         in: path
  6580.         description: Incoming Webhook GUID
  6581.         required: true
  6582.         type: string
  6583.       - in: body
  6584.         name: body
  6585.         description: Incoming webhook to be updated
  6586.         required: true
  6587.         schema:
  6588.           type: object
  6589.           required:
  6590.          - hook_id
  6591.           - channel_id
  6592.           - display_name
  6593.           - description
  6594.           properties:
  6595.             hook_id:
  6596.               type: string
  6597.               description: Incoming webhook GUID
  6598.             channel_id:
  6599.               type: string
  6600.               description: The ID of a public channel or private group that receives the webhook payloads.
  6601.             display_name:
  6602.               type: string
  6603.               description: The display name for this incoming webhook
  6604.             description:
  6605.               type: string
  6606.               description: The description for this incoming webhook
  6607.             username:
  6608.               type: string
  6609.               description: The username this incoming webhook will post as.
  6610.             icon_url:
  6611.               type: string
  6612.               description: The profile picture this incoming webhook will use when posting.
  6613.       responses:
  6614.         '200':
  6615.           description: Webhook update successful
  6616.           schema:
  6617.             $ref: '#/definitions/IncomingWebhook'
  6618.         '400':
  6619.           $ref: '#/responses/BadRequest'
  6620.         '401':
  6621.           $ref: '#/responses/Unauthorized'
  6622.         '403':
  6623.           $ref: '#/responses/Forbidden'
  6624.         '404':
  6625.           $ref: '#/responses/NotFound'
  6626.  
  6627.   /hooks/outgoing:
  6628.     post:
  6629.       tags:
  6630.      - webhooks
  6631.       summary: Create an outgoing webhook
  6632.       description: |
  6633.        Create an outgoing webhook for a team.
  6634.         ##### Permissions
  6635.         `manage_webhooks` for the team the webhook is in.
  6636.       parameters:
  6637.       - in: body
  6638.         name: body
  6639.         description: Outgoing webhook to be created
  6640.         required: true
  6641.         schema:
  6642.           type: object
  6643.           required:
  6644.          - team_id
  6645.           - display_name
  6646.           - trigger_words
  6647.           - callback_urls
  6648.           properties:
  6649.             team_id:
  6650.               description: The ID of the team that the webhook watchs
  6651.               type: string
  6652.             channel_id:
  6653.               description: The ID of a public channel that the webhook watchs
  6654.               type: string
  6655.             description:
  6656.               description: The description for this outgoing webhook
  6657.               type: string
  6658.             display_name:
  6659.               description: The display name for this outgoing webhook
  6660.               type: string
  6661.             trigger_words:
  6662.               description: List of words for the webhook to trigger on
  6663.               type: array
  6664.               items:
  6665.                 type: string
  6666.             trigger_when:
  6667.               description: When to trigger the webhook, `0` when a trigger word is present at all and `1` if the message starts with a trigger word
  6668.               type: integer
  6669.             callback_urls:
  6670.               description: The URLs to POST the payloads to when the webhook is triggered
  6671.               type: array
  6672.               items:
  6673.                 type: string
  6674.             content_type:
  6675.               description: The format to POST the data in, either `application/json` or `application/x-www-form-urlencoded`
  6676.               default: "application/x-www-form-urlencoded"
  6677.               type: string
  6678.       responses:
  6679.         '201':
  6680.           description: Outgoing webhook creation successful
  6681.           schema:
  6682.             $ref: "#/definitions/OutgoingWebhook"
  6683.         '400':
  6684.           $ref: '#/responses/BadRequest'
  6685.         '401':
  6686.           $ref: '#/responses/Unauthorized'
  6687.         '403':
  6688.           $ref: '#/responses/Forbidden'
  6689.         '404':
  6690.           $ref: '#/responses/NotFound'
  6691.  
  6692.     get:
  6693.       tags:
  6694.      - webhooks
  6695.       summary: List outgoing webhooks
  6696.       description: |
  6697.        Get a page of a list of outgoing webhooks. Optionally filter for a specific team or channel using query parameters.
  6698.         ##### Permissions
  6699.         `manage_webhooks` for the system or `manage_webhooks` for the specific team/channel.
  6700.       parameters:
  6701.       - name: page
  6702.         in: query
  6703.         description: The page to select.
  6704.         default: "0"
  6705.         type: string
  6706.       - name: per_page
  6707.         in: query
  6708.         description: The number of hooks per page.
  6709.         default: "60"
  6710.         type: string
  6711.       - name: team_id
  6712.         in: query
  6713.         description: The ID of the team to get hooks for.
  6714.         type: string
  6715.       - name: channel_id
  6716.         in: query
  6717.         description: The ID of the channel to get hooks for.
  6718.         type: string
  6719.       responses:
  6720.         '200':
  6721.           description: Outgoing webhooks retrieval successful
  6722.           schema:
  6723.             type: array
  6724.             items:
  6725.               $ref: "#/definitions/OutgoingWebhook"
  6726.         '400':
  6727.           $ref: '#/responses/BadRequest'
  6728.         '401':
  6729.           $ref: '#/responses/Unauthorized'
  6730.         '403':
  6731.           $ref: '#/responses/Forbidden'
  6732.         '404':
  6733.           $ref: '#/responses/NotFound'
  6734.  
  6735.   /hooks/outgoing/{hook_id}:
  6736.     get:
  6737.       tags:
  6738.      - webhooks
  6739.       summary: Get an outgoing webhook
  6740.       description: |
  6741.        Get an outgoing webhook given the hook id.
  6742.         ##### Permissions
  6743.         `manage_webhooks` for system or `manage_webhooks` for the specific team or `manage_webhooks` for the channel.
  6744.       parameters:
  6745.       - name: hook_id
  6746.         in: path
  6747.         description: Outgoing webhook GUID
  6748.         required: true
  6749.         type: string
  6750.       responses:
  6751.         '200':
  6752.           description: Outgoing webhook retrieval successful
  6753.           schema:
  6754.             $ref: '#/definitions/OutgoingWebhook'
  6755.         '400':
  6756.           $ref: '#/responses/BadRequest'
  6757.         '401':
  6758.           $ref: '#/responses/Unauthorized'
  6759.         '403':
  6760.           $ref: '#/responses/Forbidden'
  6761.         '404':
  6762.           $ref: '#/responses/NotFound'
  6763.     delete:
  6764.       tags:
  6765.      - webhooks
  6766.       summary: Delete an outgoing webhook
  6767.       description: |
  6768.        Delete an outgoing webhook given the hook id.
  6769.         ##### Permissions
  6770.         `manage_webhooks` for system or `manage_webhooks` for the specific team or `manage_webhooks` for the channel.
  6771.       parameters:
  6772.       - name: hook_id
  6773.         in: path
  6774.         description: Outgoing webhook GUID
  6775.         required: true
  6776.         type: string
  6777.       responses:
  6778.         '200':
  6779.           description: Webhook deletion successful
  6780.           schema:
  6781.             $ref: '#/definitions/StatusOK'
  6782.         '400':
  6783.           $ref: '#/responses/BadRequest'
  6784.         '401':
  6785.           $ref: '#/responses/Unauthorized'
  6786.         '403':
  6787.           $ref: '#/responses/Forbidden'
  6788.         '404':
  6789.           $ref: '#/responses/NotFound'
  6790.     put:
  6791.       tags:
  6792.      - webhooks
  6793.       summary: Update an outgoing webhook
  6794.       description: |
  6795.        Update an outgoing webhook given the hook id.
  6796.         ##### Permissions
  6797.         `manage_webhooks` for system or `manage_webhooks` for the specific team or `manage_webhooks` for the channel.
  6798.       parameters:
  6799.       - name: hook_id
  6800.         in: path
  6801.         description: outgoing Webhook GUID
  6802.         required: true
  6803.         type: string
  6804.       - in: body
  6805.         name: body
  6806.         description: Outgoing webhook to be updated
  6807.         required: true
  6808.         schema:
  6809.           type: object
  6810.           required:
  6811.          - hook_id
  6812.           - channel_id
  6813.           - display_name
  6814.           - description
  6815.           properties:
  6816.             hook_id:
  6817.               type: string
  6818.               description: Outgoing webhook GUID
  6819.             channel_id:
  6820.               type: string
  6821.               description: The ID of a public channel or private group that receives the webhook payloads.
  6822.             display_name:
  6823.               type: string
  6824.               description: The display name for this incoming webhook
  6825.             description:
  6826.               type: string
  6827.               description: The description for this incoming webhook
  6828.       responses:
  6829.         '200':
  6830.           description: Webhook update successful
  6831.           schema:
  6832.             $ref: '#/definitions/OutgoingWebhook'
  6833.         '400':
  6834.           $ref: '#/responses/BadRequest'
  6835.         '401':
  6836.           $ref: '#/responses/Unauthorized'
  6837.         '403':
  6838.           $ref: '#/responses/Forbidden'
  6839.         '404':
  6840.           $ref: '#/responses/NotFound'
  6841.  
  6842.   /hooks/outgoing/{hook_id}/regen_token:
  6843.     post:
  6844.       tags:
  6845.      - webhooks
  6846.       summary: Regenerate the token for the outgoing webhook.
  6847.       description: |
  6848.        Regenerate the token for the outgoing webhook.
  6849.         ##### Permissions
  6850.         `manage_webhooks` for system or `manage_webhooks` for the specific team or `manage_webhooks` for the channel.
  6851.       parameters:
  6852.       - name: hook_id
  6853.         in: path
  6854.         description: Outgoing webhook GUID
  6855.         required: true
  6856.         type: string
  6857.       responses:
  6858.         '200':
  6859.           description: Webhook token regenerate successful
  6860.           schema:
  6861.             $ref: '#/definitions/StatusOK'
  6862.         '400':
  6863.           $ref: '#/responses/BadRequest'
  6864.         '401':
  6865.           $ref: '#/responses/Unauthorized'
  6866.         '403':
  6867.           $ref: '#/responses/Forbidden'
  6868.         '404':
  6869.           $ref: '#/responses/NotFound'
  6870.   /saml/metadata:
  6871.     get:
  6872.       tags:
  6873.      - SAML
  6874.       summary: Get metadata
  6875.       description: |
  6876.        Get SAML metadata from the server. SAML must be configured properly.
  6877.         ##### Permissions
  6878.         No permission required.
  6879.       responses:
  6880.         '200':
  6881.           description: SAML metadata retrieval successful
  6882.           schema:
  6883.             type: string
  6884.         '501':
  6885.           $ref: '#/responses/NotImplemented'
  6886.  
  6887.   /saml/certificate/idp:
  6888.     post:
  6889.       tags:
  6890.      - SAML
  6891.       summary: Upload IDP certificate
  6892.       description: |
  6893.        Upload the IDP certificate to be used with your SAML configuration. This will also set the filename for the IdpCertificateFile setting in your `config.json`.
  6894.         ##### Permissions
  6895.         Must have `manage_system` permission.
  6896.       consumes: ["multipart/form-data"]
  6897.       parameters:
  6898.       - name: certificate
  6899.         in: formData
  6900.         description: The IDP certificate file
  6901.         required: true
  6902.         type: file
  6903.       responses:
  6904.         '200':
  6905.           description: SAML certificate upload successful
  6906.           schema:
  6907.             $ref: '#/definitions/StatusOK'
  6908.         '400':
  6909.           $ref: '#/responses/BadRequest'
  6910.         '401':
  6911.           $ref: '#/responses/Unauthorized'
  6912.         '403':
  6913.           $ref: '#/responses/Forbidden'
  6914.         '501':
  6915.           $ref: '#/responses/NotImplemented'
  6916.  
  6917.     delete:
  6918.       tags:
  6919.      - SAML
  6920.       summary: Remove IDP certificate
  6921.       description: |
  6922.        Delete the current IDP certificate being used with your SAML configuration. This will also disable SAML on your system as this certificate is required for SAML.
  6923.         ##### Permissions
  6924.         Must have `manage_system` permission.
  6925.       responses:
  6926.         '200':
  6927.           description: SAML certificate delete successful
  6928.           schema:
  6929.             $ref: '#/definitions/StatusOK'
  6930.         '401':
  6931.           $ref: '#/responses/Unauthorized'
  6932.         '403':
  6933.           $ref: '#/responses/Forbidden'
  6934.         '501':
  6935.           $ref: '#/responses/NotImplemented'
  6936.  
  6937.   /saml/certificate/public:
  6938.     post:
  6939.       tags:
  6940.      - SAML
  6941.       summary: Upload public certificate
  6942.       description: |
  6943.        Upload the public certificate to be used for encryption with your SAML configuration. This will also set the filename for the PublicCertificateFile setting in your `config.json`.
  6944.         ##### Permissions
  6945.         Must have `manage_system` permission.
  6946.       consumes: ["multipart/form-data"]
  6947.       parameters:
  6948.       - name: certificate
  6949.         in: formData
  6950.         description: The public certificate file
  6951.         required: true
  6952.         type: file
  6953.       responses:
  6954.         '200':
  6955.           description: SAML certificate upload successful
  6956.           schema:
  6957.             $ref: '#/definitions/StatusOK'
  6958.         '400':
  6959.           $ref: '#/responses/BadRequest'
  6960.         '401':
  6961.           $ref: '#/responses/Unauthorized'
  6962.         '403':
  6963.           $ref: '#/responses/Forbidden'
  6964.         '501':
  6965.           $ref: '#/responses/NotImplemented'
  6966.  
  6967.     delete:
  6968.       tags:
  6969.      - SAML
  6970.       summary: Remove public certificate
  6971.       description: |
  6972.        Delete the current public certificate being used with your SAML configuration. This will also disable encryption for SAML on your system as this certificate is required for that.
  6973.         ##### Permissions
  6974.         Must have `manage_system` permission.
  6975.       responses:
  6976.         '200':
  6977.           description: SAML certificate delete successful
  6978.           schema:
  6979.             $ref: '#/definitions/StatusOK'
  6980.         '401':
  6981.           $ref: '#/responses/Unauthorized'
  6982.         '403':
  6983.           $ref: '#/responses/Forbidden'
  6984.         '501':
  6985.           $ref: '#/responses/NotImplemented'
  6986.  
  6987.   /saml/certificate/private:
  6988.     post:
  6989.       tags:
  6990.      - SAML
  6991.       summary: Upload private key
  6992.       description: |
  6993.        Upload the private key to be used for encryption with your SAML configuration. This will also set the filename for the PrivateKeyFile setting in your `config.json`.
  6994.         ##### Permissions
  6995.         Must have `manage_system` permission.
  6996.       consumes: ["multipart/form-data"]
  6997.       parameters:
  6998.       - name: certificate
  6999.         in: formData
  7000.         description: The private key file
  7001.         required: true
  7002.         type: file
  7003.       responses:
  7004.         '200':
  7005.           description: SAML certificate upload successful
  7006.           schema:
  7007.             $ref: '#/definitions/StatusOK'
  7008.         '400':
  7009.           $ref: '#/responses/BadRequest'
  7010.         '401':
  7011.           $ref: '#/responses/Unauthorized'
  7012.         '403':
  7013.           $ref: '#/responses/Forbidden'
  7014.         '501':
  7015.           $ref: '#/responses/NotImplemented'
  7016.  
  7017.     delete:
  7018.       tags:
  7019.      - SAML
  7020.       summary: Remove private key
  7021.       description: |
  7022.        Delete the current private key being used with your SAML configuration. This will also disable encryption for SAML on your system as this key is required for that.
  7023.         ##### Permissions
  7024.         Must have `manage_system` permission.
  7025.       responses:
  7026.         '200':
  7027.           description: SAML certificate delete successful
  7028.           schema:
  7029.             $ref: '#/definitions/StatusOK'
  7030.         '401':
  7031.           $ref: '#/responses/Unauthorized'
  7032.         '403':
  7033.           $ref: '#/responses/Forbidden'
  7034.         '501':
  7035.           $ref: '#/responses/NotImplemented'
  7036.  
  7037.   /saml/certificate/status:
  7038.     get:
  7039.       tags:
  7040.      - SAML
  7041.       summary: Get certificate status
  7042.       description: |
  7043.        Get the status of the uploaded certificates and keys in use by your SAML configuration.
  7044.         ##### Permissions
  7045.         Must have `manage_system` permission.
  7046.       responses:
  7047.         '200':
  7048.           description: SAML certificate status retrieval successful
  7049.           schema:
  7050.             $ref: '#/definitions/SamlCertificateStatus'
  7051.         '403':
  7052.           $ref: '#/responses/Forbidden'
  7053.         '501':
  7054.           $ref: '#/responses/NotImplemented'
  7055.   /compliance/reports:
  7056.     post:
  7057.       tags:
  7058.      - compliance
  7059.       summary: Create report
  7060.       description: |
  7061.        Create and save a compliance report.
  7062.         ##### Permissions
  7063.         Must have `manage_system` permission.
  7064.       responses:
  7065.         '201':
  7066.           description: Compliance report creation successful
  7067.           schema:
  7068.             $ref: '#/definitions/Compliance'
  7069.         '400':
  7070.           $ref: '#/responses/BadRequest'
  7071.         '401':
  7072.           $ref: '#/responses/Unauthorized'
  7073.         '403':
  7074.           $ref: '#/responses/Forbidden'
  7075.         '501':
  7076.           $ref: '#/responses/NotImplemented'
  7077.  
  7078.     get:
  7079.       tags:
  7080.      - compliance
  7081.       summary: Get reports
  7082.       description: |
  7083.        Get a list of compliance reports previously created by page, selected with `page` and `per_page` query parameters.
  7084.         ##### Permissions
  7085.         Must have `manage_system` permission.
  7086.       parameters:
  7087.       - name: page
  7088.         in: query
  7089.         description: The page to select.
  7090.         default: "0"
  7091.         type: string
  7092.       - name: per_page
  7093.         in: query
  7094.         description: The number of reports per page.
  7095.         default: "60"
  7096.         type: string
  7097.       responses:
  7098.         '200':
  7099.           description: Compliance reports retrieval successful
  7100.           schema:
  7101.             type: array
  7102.             items:
  7103.               $ref: '#/definitions/Compliance'
  7104.         '400':
  7105.           $ref: '#/responses/BadRequest'
  7106.         '401':
  7107.           $ref: '#/responses/Unauthorized'
  7108.         '403':
  7109.           $ref: '#/responses/Forbidden'
  7110.         '501':
  7111.           $ref: '#/responses/NotImplemented'
  7112.  
  7113.   /compliance/reports/{report_id}:
  7114.     get:
  7115.       tags:
  7116.      - compliance
  7117.       summary: Get a report
  7118.       description: |
  7119.        Get a compliance reports previously created.
  7120.         ##### Permissions
  7121.         Must have `manage_system` permission.
  7122.       parameters:
  7123.       - name: report_id
  7124.         in: path
  7125.         description: Compliance report GUID
  7126.         required: true
  7127.         type: string
  7128.       responses:
  7129.         '200':
  7130.           description: Compliance report retrieval successful
  7131.           schema:
  7132.             $ref: '#/definitions/Compliance'
  7133.         '400':
  7134.           $ref: '#/responses/BadRequest'
  7135.         '401':
  7136.           $ref: '#/responses/Unauthorized'
  7137.         '403':
  7138.           $ref: '#/responses/Forbidden'
  7139.         '501':
  7140.           $ref: '#/responses/NotImplemented'
  7141.  
  7142.   /compliance/reports/{report_id}/download:
  7143.     get:
  7144.       tags:
  7145.      - compliance
  7146.       summary: Download a report
  7147.       description: |
  7148.        Download the full contents of a report as a file.
  7149.         ##### Permissions
  7150.         Must have `manage_system` permission.
  7151.       parameters:
  7152.       - name: report_id
  7153.         in: path
  7154.         description: Compliance report GUID
  7155.         required: true
  7156.         type: string
  7157.       responses:
  7158.         '200':
  7159.           description: The compliance report file
  7160.         '400':
  7161.           $ref: '#/responses/BadRequest'
  7162.         '401':
  7163.           $ref: '#/responses/Unauthorized'
  7164.         '403':
  7165.           $ref: '#/responses/Forbidden'
  7166.         '501':
  7167.           $ref: '#/responses/NotImplemented'
  7168.   /ldap/sync:
  7169.     post:
  7170.       tags:
  7171.      - LDAP
  7172.       summary: Sync with LDAP
  7173.       description: |
  7174.        Synchronize any user attribute changes in the configured AD/LDAP server with Mattermost.
  7175.         ##### Permissions
  7176.         Must have `manage_system` permission.
  7177.       responses:
  7178.         '200':
  7179.           description: LDAP sync successful
  7180.           schema:
  7181.             $ref: '#/definitions/StatusOK'
  7182.         '501':
  7183.           $ref: '#/responses/NotImplemented'
  7184.  
  7185.   /ldap/test:
  7186.     post:
  7187.       tags:
  7188.      - LDAP
  7189.       summary: Test LDAP configuration
  7190.       description: |
  7191.        Test the current AD/LDAP configuration to see if the AD/LDAP server can be contacted successfully.
  7192.         ##### Permissions
  7193.         Must have `manage_system` permission.
  7194.       responses:
  7195.         '200':
  7196.           description: LDAP test successful
  7197.           schema:
  7198.             $ref: '#/definitions/StatusOK'
  7199.         '500':
  7200.           $ref: '#/responses/InternalServerError'
  7201.         '501':
  7202.           $ref: '#/responses/NotImplemented'
  7203.  
  7204.   /cluster/status:
  7205.     get:
  7206.       tags:
  7207.      - cluster
  7208.       summary: Get cluster status
  7209.       description: |
  7210.        Get a set of information for each node in the cluster, useful for checking the status and health of each node.
  7211.         ##### Permissions
  7212.         Must have `manage_system` permission.
  7213.       responses:
  7214.         '200':
  7215.           description: Cluster status retrieval successful
  7216.           schema:
  7217.             type: array
  7218.             items:
  7219.               $ref: '#/definitions/ClusterInfo'
  7220.         '403':
  7221.           $ref: '#/responses/Forbidden'
  7222.  
  7223.   /brand/image:
  7224.     get:
  7225.       tags:
  7226.      - brand
  7227.       summary: Get brand image
  7228.       description: |
  7229.        Get the previously uploaded brand image. Returns 404 if no brand image has been uploaded.
  7230.         ##### Permissions
  7231.         No permission required.
  7232.       responses:
  7233.         '200':
  7234.           description: Brand image retrieval successful
  7235.           schema:
  7236.             type: string
  7237.         '404':
  7238.           description: No brand image uploaded
  7239.           $ref: '#/responses/NotFound'
  7240.         '501':
  7241.           $ref: '#/responses/NotImplemented'
  7242.       x-code-samples:
  7243.       - lang: 'Go'
  7244.         source: |
  7245.          import "github.com/mattermost/mattermost-server/model"
  7246.  
  7247.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  7248.           Client.Login("email@domain.com", "Password1")
  7249.  
  7250.           // GetBrandImage
  7251.           img, err := Client.GetBrandImage()
  7252.  
  7253.     post:
  7254.       tags:
  7255.      - brand
  7256.       summary: Upload brand image
  7257.       description: |
  7258.        Uploads a brand image.
  7259.         ##### Permissions
  7260.         Must have `manage_system` permission.
  7261.       consumes: ["multipart/form-data"]
  7262.       parameters:
  7263.       - name: image
  7264.         in: formData
  7265.         description: The image to be uploaded
  7266.         required: true
  7267.         type: file
  7268.       responses:
  7269.         '201':
  7270.           description: Brand image upload successful
  7271.           schema:
  7272.             $ref: '#/definitions/StatusOK'
  7273.         '400':
  7274.           $ref: '#/responses/BadRequest'
  7275.         '401':
  7276.           $ref: '#/responses/Unauthorized'
  7277.         '403':
  7278.           $ref: '#/responses/Forbidden'
  7279.         '413':
  7280.           $ref: '#/responses/TooLarge'
  7281.         '501':
  7282.           $ref: '#/responses/NotImplemented'
  7283.       x-code-samples:
  7284.       - lang: 'Go'
  7285.         source: |
  7286.          import "github.com/mattermost/mattermost-server/model"
  7287.  
  7288.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  7289.           Client.Login("email@domain.com", "Password1")
  7290.  
  7291.           file, err := os.Open("<Your image>")
  7292.           if err != nil {
  7293.             return err
  7294.           }
  7295.           defer file.Close()
  7296.  
  7297.           data := &bytes.Buffer{}
  7298.           if _, err := io.Copy(data, file); err != nil {
  7299.             return err
  7300.           }
  7301.  
  7302.           ok, resp := Client.UploadBrandImage(data.Bytes())
  7303.   /commands:
  7304.     post:
  7305.       tags:
  7306.      - commands
  7307.       summary: Create a command
  7308.       description: |
  7309.        Create a command for a team.
  7310.         ##### Permissions
  7311.         `manage_slash_commands` for the team the command is in.
  7312.       parameters:
  7313.       - in: body
  7314.         name: body
  7315.         description: command to be created
  7316.         required: true
  7317.         schema:
  7318.           type: object
  7319.           required:
  7320.          - team_id
  7321.           - method
  7322.           - trigger
  7323.           - url
  7324.           properties:
  7325.             team_id:
  7326.               type: string
  7327.               description: Team ID to where the command should be created
  7328.             method:
  7329.               type: string
  7330.               description: "`'P'` for post request, `'G'` for get request"
  7331.             trigger:
  7332.               type: string
  7333.               description: Activation word to trigger the command
  7334.             url:
  7335.               type: string
  7336.               description: The URL that the command will make the request
  7337.       responses:
  7338.         '201':
  7339.           description: Command creation successful
  7340.           schema:
  7341.             $ref: "#/definitions/Command"
  7342.         '400':
  7343.           $ref: '#/responses/BadRequest'
  7344.         '401':
  7345.           $ref: '#/responses/Unauthorized'
  7346.         '403':
  7347.           $ref: '#/responses/Forbidden'
  7348.         '501':
  7349.           $ref: '#/responses/NotImplemented'
  7350.       x-code-samples:
  7351.       - lang: 'Go'
  7352.         source: |
  7353.          import "github.com/mattermost/mattermost-server/model"
  7354.  
  7355.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  7356.           Client.Login("email@domain.com", "Password1")
  7357.  
  7358.           newCmd := &model.Command {
  7359.             TeamId:       <TEAMID>,
  7360.             URL:          "http://nowhere.com",
  7361.             Method:       model.COMMAND_METHOD_POST,
  7362.             Trigger:      "trigger",
  7363.             AutoComplete: false,
  7364.             Description:  "Description",
  7365.             DisplayName:  "Display name",
  7366.             IconURL:      "IconURL",
  7367.             Username:     "Username"
  7368.           }
  7369.  
  7370.           // CreateCommand
  7371.           createdCmd, resp := Client.CreateCommand(newCmd)
  7372.  
  7373.     get:
  7374.       tags:
  7375.      - commands
  7376.       summary: List commands for a team
  7377.       description: |
  7378.        List commands for a team.
  7379.         ##### Permissions
  7380.         `manage_slash_commands` if need list custom commands.
  7381.       parameters:
  7382.       - name: team_id
  7383.         in: query
  7384.         description: The team id.
  7385.         type: string
  7386.       - name: custom_only
  7387.         in: query
  7388.         description: |
  7389.          To get only the custom commands. If set to false will get the custom
  7390.           if the user have access plus the system commands, otherwise just the system commands.
  7391.         default: "false"
  7392.         type: string
  7393.       responses:
  7394.         '200':
  7395.           description: List Commands retrieve successful
  7396.           schema:
  7397.             type: array
  7398.             items:
  7399.               $ref: "#/definitions/Command"
  7400.         '400':
  7401.           $ref: '#/responses/BadRequest'
  7402.         '401':
  7403.           $ref: '#/responses/Unauthorized'
  7404.         '403':
  7405.           $ref: '#/responses/Forbidden'
  7406.         '501':
  7407.           $ref: '#/responses/NotImplemented'
  7408.       x-code-samples:
  7409.       - lang: 'Go'
  7410.         source: |
  7411.          import "github.com/mattermost/mattermost-server/model"
  7412.  
  7413.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  7414.           Client.Login("email@domain.com", "Password1")
  7415.  
  7416.           // ListCommands
  7417.           // The second parameter is to set if you want only custom commands (true) or defaults commands (false)
  7418.           listCommands, resp := Client.ListCommands(<TEAMID>, true)
  7419.  
  7420.   '/teams/{team_id}/commands/autocomplete':
  7421.     get:
  7422.       tags:
  7423.      - commands
  7424.       summary: List autocomplete commands
  7425.       description: |
  7426.        List autocomplete commands in the team.
  7427.         ##### Permissions
  7428.         `view_team` for the team.
  7429.       parameters:
  7430.       - name: team_id
  7431.         in: path
  7432.         description: Team GUID
  7433.         required: true
  7434.         type: string
  7435.       responses:
  7436.         '200':
  7437.           description: Autocomplete commands retrieval successful
  7438.           schema:
  7439.             type: array
  7440.             items:
  7441.               $ref: "#/definitions/Command"
  7442.         '400':
  7443.           $ref: '#/responses/BadRequest'
  7444.         '401':
  7445.           $ref: '#/responses/Unauthorized'
  7446.         '403':
  7447.           $ref: '#/responses/Forbidden'
  7448.       x-code-samples:
  7449.       - lang: 'Go'
  7450.         source: |
  7451.          import "github.com/mattermost/mattermost-server/model"
  7452.  
  7453.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  7454.           Client.Login("email@domain.com", "Password1")
  7455.  
  7456.           // ListAutocompleteCommands
  7457.           listCommands, resp := Client.ListAutocompleteCommands(<TEAMID>)
  7458.  
  7459.   '/commands/{command_id}':
  7460.     put:
  7461.       tags:
  7462.      - commands
  7463.       summary: Update a command
  7464.       description: |
  7465.        Update a single command based on command id string and Command struct.
  7466.         ##### Permissions
  7467.         Must have `manage_slash_commands` permission for the team the command is in.
  7468.       parameters:
  7469.       - in: path
  7470.         name: command_id
  7471.         description: ID of the command to update
  7472.         required: true
  7473.         type: string
  7474.       - in: body
  7475.         name: body
  7476.         required: true
  7477.         schema:
  7478.           $ref: '#/definitions/Command'
  7479.       responses:
  7480.         '200':
  7481.           description: Command updated successful
  7482.           schema:
  7483.             $ref: "#/definitions/Command"
  7484.         '400':
  7485.           $ref: '#/responses/BadRequest'
  7486.         '401':
  7487.           $ref: '#/responses/Unauthorized'
  7488.         '403':
  7489.           $ref: '#/responses/Forbidden'
  7490.       x-code-samples:
  7491.       - lang: 'Go'
  7492.         source: |
  7493.          import "github.com/mattermost/mattermost-server/model"
  7494.  
  7495.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  7496.           Client.Login("email@domain.com", "Password1")
  7497.  
  7498.           cmdToUpdate := &model.Command{
  7499.             CreatorId: <USERID>,
  7500.             TeamId:    <TEAMID>,
  7501.             URL:       "<http://nowhere.com/change>",
  7502.             Trigger:   <NEWTRIGGERNAME>,
  7503.             Id:        <COMMANDID>,
  7504.           }
  7505.  
  7506.           // UpdateCommand
  7507.           listCommands, resp := Client.UpdateCommand(cmdToUpdate)
  7508.  
  7509.     delete:
  7510.       tags:
  7511.      - commands
  7512.       summary: Delete a command
  7513.       description: |
  7514.        Delete a command based on command id string.
  7515.         ##### Permissions
  7516.         Must have `manage_slash_commands` permission for the team the command is in.
  7517.       parameters:
  7518.       - in: path
  7519.         name: command_id
  7520.         description: ID of the command to delete
  7521.         required: true
  7522.         type: string
  7523.       responses:
  7524.         '200':
  7525.           description: Command deletion successful
  7526.           schema:
  7527.             $ref: '#/definitions/StatusOK'
  7528.         '400':
  7529.           $ref: '#/responses/BadRequest'
  7530.         '401':
  7531.           $ref: '#/responses/Unauthorized'
  7532.         '403':
  7533.           $ref: '#/responses/Forbidden'
  7534.         '404':
  7535.           $ref: '#/responses/NotFound'
  7536.       x-code-samples:
  7537.       - lang: 'Go'
  7538.         source: |
  7539.          import "github.com/mattermost/mattermost-server/model"
  7540.  
  7541.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  7542.           Client.Login("email@domain.com", "Password1")
  7543.  
  7544.           // DeleteCommand
  7545.           ok, resp := Client.DeleteCommand(<COMMANDID>)
  7546.  
  7547.   '/commands/{command_id}/regen_token':
  7548.     put:
  7549.       tags:
  7550.      - commands
  7551.       summary: Generate a new token
  7552.       description: |
  7553.        Generate a new token for the command based on command id string.
  7554.         ##### Permissions
  7555.         Must have `manage_slash_commands` permission for the team the command is in.
  7556.       parameters:
  7557.       - in: path
  7558.         name: command_id
  7559.         description: ID of the command to generate the new token
  7560.         required: true
  7561.         type: string
  7562.       responses:
  7563.         '200':
  7564.           description: AuthSettings generation successful
  7565.           schema:
  7566.             type: object
  7567.             properties:
  7568.               token:
  7569.                 description: The new token
  7570.                 type: string
  7571.         '400':
  7572.           $ref: '#/responses/BadRequest'
  7573.         '401':
  7574.           $ref: '#/responses/Unauthorized'
  7575.         '403':
  7576.           $ref: '#/responses/Forbidden'
  7577.       x-code-samples:
  7578.       - lang: 'Go'
  7579.         source: |
  7580.          import "github.com/mattermost/mattermost-server/model"
  7581.  
  7582.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  7583.           Client.Login("email@domain.com", "Password1")
  7584.  
  7585.           // RegenCommandToken
  7586.           newToken, resp := Client.RegenCommandToken(<COMMANDID>)
  7587.  
  7588.   /commands/execute:
  7589.     post:
  7590.       tags:
  7591.      - commands
  7592.       summary: Execute a command
  7593.       description: |
  7594.        Execute a command on a team.
  7595.         ##### Permissions
  7596.         Must have `use_slash_commands` permission for the team the command is in.
  7597.       parameters:
  7598.       - in: body
  7599.         name: body
  7600.         description: command to be executed
  7601.         required: true
  7602.         schema:
  7603.           type: object
  7604.           required:
  7605.          - channel_id
  7606.           - command
  7607.           properties:
  7608.             channel_id:
  7609.               type: string
  7610.               description: Channel Id where the command will execute
  7611.             command:
  7612.               type: string
  7613.               description: The slash command to execute
  7614.       responses:
  7615.         '200':
  7616.           description: Command execution successful
  7617.           schema:
  7618.             $ref: "#/definitions/CommandResponse"
  7619.         '400':
  7620.           $ref: '#/responses/BadRequest'
  7621.         '401':
  7622.           $ref: '#/responses/Unauthorized'
  7623.         '403':
  7624.           $ref: '#/responses/Forbidden'
  7625.         '501':
  7626.           $ref: '#/responses/NotImplemented'
  7627.   /oauth/apps:
  7628.     post:
  7629.       tags:
  7630.      - OAuth
  7631.       summary: Register OAuth app
  7632.       description: |
  7633.        Register an OAuth 2.0 client application with Mattermost as the service provider.
  7634.         ##### Permissions
  7635.         Must have `manage_oauth` permission.
  7636.       parameters:
  7637.       - in: body
  7638.         name: body
  7639.         description: OAuth application to register
  7640.         required: true
  7641.         schema:
  7642.           type: object
  7643.           required:
  7644.          - name
  7645.           - description
  7646.           - callback_urls
  7647.           - homepage
  7648.           properties:
  7649.             name:
  7650.               type: string
  7651.               description: The name of the client application
  7652.             description:
  7653.               type: string
  7654.               description: A short description of the application
  7655.             icon_url:
  7656.               type: string
  7657.               description: A URL to an icon to display with the application
  7658.             callback_urls:
  7659.               type: array
  7660.               items:
  7661.                 type: string
  7662.               description: A list of callback URLs for the appliation
  7663.             homepage:
  7664.               type: string
  7665.               description: A link to the website of the application
  7666.             is_trusted:
  7667.               type: boolean
  7668.               description: Set this to `true` to skip asking users for permission
  7669.       responses:
  7670.         '201':
  7671.           description: App registration successful
  7672.           schema:
  7673.             $ref: '#/definitions/OAuthApp'
  7674.         '400':
  7675.           $ref: '#/responses/BadRequest'
  7676.         '401':
  7677.           $ref: '#/responses/Unauthorized'
  7678.         '403':
  7679.           $ref: '#/responses/Forbidden'
  7680.         '501':
  7681.           $ref: '#/responses/NotImplemented'
  7682.  
  7683.     get:
  7684.       tags:
  7685.      - OAuth
  7686.       summary: Get OAuth apps
  7687.       description: |
  7688.        Get a page of OAuth 2.0 client applications registered with Mattermost.
  7689.         ##### Permissions
  7690.         With `manage_oauth` permission, the apps registered by the logged in user are returned. With `manage_system_wide_oauth` permission, all apps regardless of creator are returned.
  7691.       parameters:
  7692.       - name: page
  7693.         in: query
  7694.         description: The page to select.
  7695.         default: "0"
  7696.         type: string
  7697.       - name: per_page
  7698.         in: query
  7699.         description: The number of apps per page.
  7700.         default: "60"
  7701.         type: string
  7702.       responses:
  7703.         '200':
  7704.           description: OAuthApp list retrieval successful
  7705.           schema:
  7706.             type: array
  7707.             items:
  7708.               $ref: '#/definitions/OAuthApp'
  7709.         '400':
  7710.           $ref: '#/responses/BadRequest'
  7711.         '401':
  7712.           $ref: '#/responses/Unauthorized'
  7713.         '403':
  7714.           $ref: '#/responses/Forbidden'
  7715.         '501':
  7716.           $ref: '#/responses/NotImplemented'
  7717.  
  7718.   '/oauth/apps/{app_id}':
  7719.     get:
  7720.       tags:
  7721.      - OAuth
  7722.       summary: Get an OAuth app
  7723.       description: |
  7724.        Get an OAuth 2.0 client application registered with Mattermost.
  7725.         ##### Permissions
  7726.         If app creator, must have `mange_oauth` permission otherwise `manage_system_wide_oauth` permission is required.
  7727.       parameters:
  7728.       - name: app_id
  7729.         in: path
  7730.         description: Application client id
  7731.         required: true
  7732.         type: string
  7733.       responses:
  7734.         '200':
  7735.           description: App retrieval successful
  7736.           schema:
  7737.             $ref: '#/definitions/OAuthApp'
  7738.         '400':
  7739.           $ref: '#/responses/BadRequest'
  7740.         '401':
  7741.           $ref: '#/responses/Unauthorized'
  7742.         '403':
  7743.           $ref: '#/responses/Forbidden'
  7744.         '404':
  7745.           $ref: '#/responses/NotFound'
  7746.         '501':
  7747.           $ref: '#/responses/NotImplemented'
  7748.  
  7749.     put:
  7750.       tags:
  7751.      - OAuth
  7752.       summary: Update an OAuth app
  7753.       description: |
  7754.        Update an OAuth 2.0 client application based on OAuth struct.
  7755.         ##### Permissions
  7756.         If app creator, must have `mange_oauth` permission otherwise `manage_system_wide_oauth` permission is required.
  7757.       parameters:
  7758.       - name: app_id
  7759.         in: path
  7760.         description: Application client id
  7761.         required: true
  7762.         type: string
  7763.       - in: body
  7764.         name: body
  7765.         description: OAuth application to update
  7766.         required: true
  7767.         schema:
  7768.           type: object
  7769.           required:
  7770.          - id
  7771.           - name
  7772.           - description
  7773.           - callback_urls
  7774.           - homepage
  7775.           properties:
  7776.             id:
  7777.               type: string
  7778.               description: The id of the client application
  7779.             name:
  7780.               type: string
  7781.               description: The name of the client application
  7782.             description:
  7783.               type: string
  7784.               description: A short description of the application
  7785.             icon_url:
  7786.               type: string
  7787.               description: A URL to an icon to display with the application
  7788.             callback_urls:
  7789.               type: array
  7790.               items:
  7791.                 type: string
  7792.               description: A list of callback URLs for the appliation
  7793.             homepage:
  7794.               type: string
  7795.               description: A link to the website of the application
  7796.             is_trusted:
  7797.               type: boolean
  7798.               description: Set this to `true` to skip asking users for permission. It will be set to false if value is not provided.
  7799.       responses:
  7800.         '200':
  7801.           description: App update successful
  7802.           schema:
  7803.             $ref: '#/definitions/OAuthApp'
  7804.         '400':
  7805.           $ref: '#/responses/BadRequest'
  7806.         '401':
  7807.           $ref: '#/responses/Unauthorized'
  7808.         '403':
  7809.           $ref: '#/responses/Forbidden'
  7810.         '404':
  7811.           $ref: '#/responses/NotFound'
  7812.         '501':
  7813.           $ref: '#/responses/NotImplemented'
  7814.       x-code-samples:
  7815.       - lang: 'Go'
  7816.         source: |
  7817.          import "github.com/mattermost/platform/model"
  7818.  
  7819.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  7820.           Client.Login("email@domain.com", "Password1")
  7821.  
  7822.           appToUpdate := &model.OAuthApp{
  7823.             Id:           <APP ID>,
  7824.             Name:         <APP NAME>,
  7825.             Description:  <APP DESCRIPTION>,
  7826.             IconURL:      <URL TO APP ICON>,
  7827.             CallbackUrls: [<CALLBACK URL1>, <CALLBACK URL2>],
  7828.             Homepage:     <URL TO APP HOMEPAGE>,
  7829.             IsTrusted:    <BOOLEAN>
  7830.           }
  7831.  
  7832.           // UpdateOAuthApp
  7833.           updatedApp, resp := Client.UpdateOAuthApp(appToUpdate)
  7834.  
  7835.     delete:
  7836.       tags:
  7837.      - OAuth
  7838.       summary: Delete an OAuth app
  7839.       description: |
  7840.        Delete and unregister an OAuth 2.0 client application
  7841.         ##### Permissions
  7842.         If app creator, must have `mange_oauth` permission otherwise `manage_system_wide_oauth` permission is required.
  7843.       parameters:
  7844.       - name: app_id
  7845.         in: path
  7846.         description: Application client id
  7847.         required: true
  7848.         type: string
  7849.       responses:
  7850.         '200':
  7851.           description: App deletion successful
  7852.           schema:
  7853.             $ref: '#/definitions/StatusOK'
  7854.         '400':
  7855.           $ref: '#/responses/BadRequest'
  7856.         '401':
  7857.           $ref: '#/responses/Unauthorized'
  7858.         '403':
  7859.           $ref: '#/responses/Forbidden'
  7860.         '404':
  7861.           $ref: '#/responses/NotFound'
  7862.         '501':
  7863.           $ref: '#/responses/NotImplemented'
  7864.  
  7865.   '/oauth/apps/{app_id}/regen_secret':
  7866.     post:
  7867.       tags:
  7868.      - OAuth
  7869.       summary: Regenerate OAuth app secret
  7870.       description: |
  7871.        Regenerate the client secret for an OAuth 2.0 client application registered with Mattermost.
  7872.         ##### Permissions
  7873.         If app creator, must have `mange_oauth` permission otherwise `manage_system_wide_oauth` permission is required.
  7874.       parameters:
  7875.       - name: app_id
  7876.         in: path
  7877.         description: Application client id
  7878.         required: true
  7879.         type: string
  7880.       responses:
  7881.         '200':
  7882.           description: Secret regeneration successful
  7883.           schema:
  7884.             $ref: '#/definitions/OAuthApp'
  7885.         '400':
  7886.           $ref: '#/responses/BadRequest'
  7887.         '401':
  7888.           $ref: '#/responses/Unauthorized'
  7889.         '403':
  7890.           $ref: '#/responses/Forbidden'
  7891.         '404':
  7892.           $ref: '#/responses/NotFound'
  7893.         '501':
  7894.           $ref: '#/responses/NotImplemented'
  7895.  
  7896.   '/oauth/apps/{app_id}/info':
  7897.     get:
  7898.       tags:
  7899.      - OAuth
  7900.       summary: Get info on an OAuth app
  7901.       description: |
  7902.        Get public information about an OAuth 2.0 client application registered with Mattermost. The application's client secret will be blanked out.
  7903.         ##### Permissions
  7904.         Must be authenticated.
  7905.       parameters:
  7906.       - name: app_id
  7907.         in: path
  7908.         description: Application client id
  7909.         required: true
  7910.         type: string
  7911.       responses:
  7912.         '200':
  7913.           description: App retrieval successful
  7914.           schema:
  7915.             $ref: '#/definitions/OAuthApp'
  7916.         '400':
  7917.           $ref: '#/responses/BadRequest'
  7918.         '401':
  7919.           $ref: '#/responses/Unauthorized'
  7920.         '404':
  7921.           $ref: '#/responses/NotFound'
  7922.         '501':
  7923.           $ref: '#/responses/NotImplemented'
  7924.  
  7925.   '/users/{user_id}/oauth/apps/authorized':
  7926.     get:
  7927.       tags:
  7928.      - OAuth
  7929.       summary: Get authorized OAuth apps
  7930.       description: |
  7931.        Get a page of OAuth 2.0 client applications authorized to access a user's account.
  7932.         ##### Permissions
  7933.         Must be authenticated as the user or have `edit_other_users` permission.
  7934.       parameters:
  7935.       - name: user_id
  7936.         in: path
  7937.         description: User GUID
  7938.         required: true
  7939.         type: string
  7940.       - name: page
  7941.         in: query
  7942.         description: The page to select.
  7943.         default: "0"
  7944.         type: string
  7945.       - name: per_page
  7946.         in: query
  7947.         description: The number of apps per page.
  7948.         default: "60"
  7949.         type: string
  7950.       responses:
  7951.         '200':
  7952.           description: OAuthApp list retrieval successful
  7953.           schema:
  7954.             type: array
  7955.             items:
  7956.               $ref: '#/definitions/OAuthApp'
  7957.         '400':
  7958.           $ref: '#/responses/BadRequest'
  7959.         '401':
  7960.           $ref: '#/responses/Unauthorized'
  7961.         '403':
  7962.           $ref: '#/responses/Forbidden'
  7963.         '501':
  7964.           $ref: '#/responses/NotImplemented'
  7965.  
  7966.   /elasticsearch/test:
  7967.     post:
  7968.       tags:
  7969.      - elasticsearch
  7970.       summary: Test Elasticsearch configuration
  7971.       description: |
  7972.        Test the current Elasticsearch configuration to see if the Elasticsearch server can be contacted successfully.
  7973.         Optionally provide a configuration in the request body to test. If no valid configuration is present in the
  7974.         request body the current server configuration will be tested.
  7975.  
  7976.         __Minimum server version__: 4.1
  7977.         ##### Permissions
  7978.         Must have `manage_system` permission.
  7979.       responses:
  7980.         '200':
  7981.           description: Elasticsearch test successful
  7982.           schema:
  7983.             $ref: '#/definitions/StatusOK'
  7984.         '400':
  7985.           $ref: '#/responses/BadRequest'
  7986.         '500':
  7987.           $ref: '#/responses/InternalServerError'
  7988.         '501':
  7989.           $ref: '#/responses/NotImplemented'
  7990.  
  7991.   /elasticsearch/purge_indexes:
  7992.     post:
  7993.       tags:
  7994.      - elasticsearch
  7995.       summary: Purge all Elasticsearch indexes
  7996.       description: |
  7997.        Deletes all Elasticsearch indexes and their contents. After calling this endpoint, it is
  7998.         necessary to schedule a new Elasticsearch indexing job to repopulate the indexes.
  7999.         __Minimum server version__: 4.1
  8000.         ##### Permissions
  8001.         Must have `manage_system` permission.
  8002.       responses:
  8003.         '200':
  8004.           description: Indexes purged successfully.
  8005.           schema:
  8006.             $ref: '#/definitions/StatusOK'
  8007.         '500':
  8008.           $ref: '#/responses/InternalServerError'
  8009.         '501':
  8010.           $ref: '#/responses/NotImplemented'
  8011.   /data_retention/policy:
  8012.     get:
  8013.       tags:
  8014.      - dataretention
  8015.       summary: Get the data retention policy details.
  8016.       description: |
  8017.        Gets the current data retention policy details from the server, including what data should be purged and the cutoff times for each data type that should be purged.
  8018.         __Minimum server version__: 4.3
  8019.         ##### Permissions
  8020.         Requires an active session but no other permissions.
  8021.       responses:
  8022.         '200':
  8023.           description: Data retention policy details retrieved successfully.
  8024.           schema:
  8025.             $ref: '#/definitions/DataRetentionPolicy'
  8026.         '500':
  8027.           $ref: '#/responses/InternalServerError'
  8028.         '501':
  8029.           $ref: '#/responses/NotImplemented'
  8030.   /plugins:
  8031.     post:
  8032.       tags:
  8033.      - plugins
  8034.       summary: Upload plugin
  8035.       description: |
  8036.        Upload a plugin compressed in a .tar.gz file. Plugins and plugin uploads must be enabled in the server's config settings.
  8037.  
  8038.         ##### Permissions
  8039.         Must have `manage_system` permission.
  8040.  
  8041.         __Minimum server version__: 4.4
  8042.       consumes: ["multipart/form-data"]
  8043.       parameters:
  8044.       - name: plugin
  8045.         in: formData
  8046.         description: The plugin image to be uploaded
  8047.         required: true
  8048.         type: file
  8049.       responses:
  8050.         '201':
  8051.           description: Plugin upload successful
  8052.           schema:
  8053.             $ref: '#/definitions/StatusOK'
  8054.         '400':
  8055.           $ref: '#/responses/BadRequest'
  8056.         '401':
  8057.           $ref: '#/responses/Unauthorized'
  8058.         '403':
  8059.           $ref: '#/responses/Forbidden'
  8060.         '413':
  8061.           $ref: '#/responses/TooLarge'
  8062.         '501':
  8063.           $ref: '#/responses/NotImplemented'
  8064.  
  8065.     get:
  8066.       tags:
  8067.      - plugins
  8068.       summary: Get plugins
  8069.       description: |
  8070.        Get a list of inactive and a list of active plugin manifests. Plugins must be enabled in the server's config settings.
  8071.  
  8072.         ##### Permissions
  8073.         Must have `manage_system` permission.
  8074.  
  8075.         __Minimum server version__: 4.4
  8076.       responses:
  8077.         '200':
  8078.           description: Plugins retrieval successful
  8079.           schema:
  8080.             type: object
  8081.             properties:
  8082.               active:
  8083.                 type: array
  8084.                 items:
  8085.                   $ref: '#/definitions/PluginManifest'
  8086.               inactive:
  8087.                 type: array
  8088.                 items:
  8089.                   $ref: '#/definitions/PluginManifest'
  8090.         '400':
  8091.           $ref: '#/responses/BadRequest'
  8092.         '401':
  8093.           $ref: '#/responses/Unauthorized'
  8094.         '403':
  8095.           $ref: '#/responses/Forbidden'
  8096.         '501':
  8097.           $ref: '#/responses/NotImplemented'
  8098.  
  8099.   /plugins/{plugin_id}:
  8100.     delete:
  8101.       tags:
  8102.      - plugins
  8103.       summary: Remove plugin
  8104.       description: |
  8105.        Remove the plugin with the provided ID from the server. All plugin files are deleted. Plugins must be enabled in the server's config settings.
  8106.  
  8107.         ##### Permissions
  8108.         Must have `manage_system` permission.
  8109.  
  8110.         __Minimum server version__: 4.4
  8111.       parameters:
  8112.       - name: plugin_id
  8113.         in: path
  8114.         required: true
  8115.         type: string
  8116.       responses:
  8117.         '200':
  8118.           description: Plugin removed successfully
  8119.           schema:
  8120.             $ref: '#/definitions/StatusOK'
  8121.         '400':
  8122.           $ref: '#/responses/BadRequest'
  8123.         '401':
  8124.           $ref: '#/responses/Unauthorized'
  8125.         '403':
  8126.           $ref: '#/responses/Forbidden'
  8127.         '501':
  8128.           $ref: '#/responses/NotImplemented'
  8129.  
  8130.   /plugins/{plugin_id}/activate:
  8131.     post:
  8132.       tags:
  8133.      - plugins
  8134.       summary: Activate plugin
  8135.       description: |
  8136.        Activate a previously uploaded plugin. Plugins must be enabled in the server's config settings.
  8137.  
  8138.         ##### Permissions
  8139.         Must have `manage_system` permission.
  8140.  
  8141.         __Minimum server version__: 4.4
  8142.       parameters:
  8143.       - name: plugin_id
  8144.         in: path
  8145.         required: true
  8146.         type: string
  8147.       responses:
  8148.         '200':
  8149.           description: Plugin activated successfully
  8150.           schema:
  8151.             $ref: '#/definitions/StatusOK'
  8152.         '400':
  8153.           $ref: '#/responses/BadRequest'
  8154.         '401':
  8155.           $ref: '#/responses/Unauthorized'
  8156.         '403':
  8157.           $ref: '#/responses/Forbidden'
  8158.         '501':
  8159.           $ref: '#/responses/NotImplemented'
  8160.  
  8161.   /plugins/{plugin_id}/deactivate:
  8162.     post:
  8163.       tags:
  8164.      - plugins
  8165.       summary: Deactivate plugin
  8166.       description: |
  8167.        Deactivate a previously activated plugin. Plugins must be enabled in the server's config settings.
  8168.  
  8169.         ##### Permissions
  8170.         Must have `manage_system` permission.
  8171.  
  8172.         __Minimum server version__: 4.4
  8173.       parameters:
  8174.       - name: plugin_id
  8175.         in: path
  8176.         required: true
  8177.         type: string
  8178.       responses:
  8179.         '200':
  8180.           description: Plugin deactivated successfully
  8181.           schema:
  8182.             $ref: '#/definitions/StatusOK'
  8183.         '400':
  8184.           $ref: '#/responses/BadRequest'
  8185.         '401':
  8186.           $ref: '#/responses/Unauthorized'
  8187.         '403':
  8188.           $ref: '#/responses/Forbidden'
  8189.         '501':
  8190.           $ref: '#/responses/NotImplemented'
  8191.  
  8192.   /plugins/webapp:
  8193.     get:
  8194.       tags:
  8195.      - plugins
  8196.       summary: Get webapp plugins
  8197.       description: |
  8198.        Get a list of web app plugins installed and activated on the server.
  8199.  
  8200.         ##### Permissions
  8201.         No permissions required.
  8202.  
  8203.         __Minimum server version__: 4.4
  8204.       responses:
  8205.         '200':
  8206.           description: Plugin deactivated successfully
  8207.           schema:
  8208.             type: array
  8209.             items:
  8210.               $ref: '#/definitions/PluginManifestWebapp'
  8211.         '400':
  8212.           $ref: '#/responses/BadRequest'
  8213.         '401':
  8214.           $ref: '#/responses/Unauthorized'
  8215.         '403':
  8216.           $ref: '#/responses/Forbidden'
  8217.         '501':
  8218.           $ref: '#/responses/NotImplemented'
  8219.  
  8220.   '/roles/{role_id}':
  8221.     get:
  8222.       tags:
  8223.      - roles
  8224.       summary: Get a role
  8225.       description: |
  8226.        Get a role from the provided role id.
  8227.  
  8228.         ##### Permissions
  8229.         Requires an active session but no other permissions.
  8230.  
  8231.         __Minimum server version__: 4.9
  8232.       parameters:
  8233.       - name: role_id
  8234.         in: path
  8235.         description: Role GUID
  8236.         required: true
  8237.         type: string
  8238.       responses:
  8239.         '200':
  8240.           description: Role retrieval successful
  8241.           schema:
  8242.             $ref: '#/definitions/Role'
  8243.         '401':
  8244.           $ref: '#/responses/Unauthorized'
  8245.         '404':
  8246.           $ref: '#/responses/NotFound'
  8247.       x-code-samples:
  8248.       - lang: 'Go'
  8249.         source: |
  8250.          import "github.com/mattermost/mattermost-server/model"
  8251.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  8252.           Client.Login("email@domain.com", "Password1")
  8253.  
  8254.           role, resp := Client.GetRole(<ROLEID>, "")
  8255.  
  8256.   '/roles/name/{role_name}':
  8257.     get:
  8258.       tags:
  8259.      - roles
  8260.       summary: Get a role
  8261.       description: |
  8262.        Get a role from the provided role name.
  8263.  
  8264.         ##### Permissions
  8265.         Requires an active session but no other permissions.
  8266.  
  8267.         __Minimum server version__: 4.9
  8268.       parameters:
  8269.       - name: role_name
  8270.         in: path
  8271.         description: Role Name
  8272.         required: true
  8273.         type: string
  8274.       responses:
  8275.         '200':
  8276.           description: Role retrieval successful
  8277.           schema:
  8278.             $ref: '#/definitions/Role'
  8279.         '401':
  8280.           $ref: '#/responses/Unauthorized'
  8281.         '404':
  8282.           $ref: '#/responses/NotFound'
  8283.       x-code-samples:
  8284.       - lang: 'Go'
  8285.         source: |
  8286.          import "github.com/mattermost/mattermost-server/model"
  8287.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  8288.           Client.Login("email@domain.com", "Password1")
  8289.  
  8290.           role, resp := Client.GetRoleByName(<ROLENAME>, "")
  8291.  
  8292.   '/roles/{role_id}/patch':
  8293.     put:
  8294.       tags:
  8295.      - roles
  8296.       summary: Patch a role
  8297.       description: |
  8298.        Partially update a role by providing only the fields you want to update. Omitted fields will not be updated. The fields that can be updated are defined in the request body, all other provided fields will be ignored.
  8299.  
  8300.         ##### Permissions
  8301.         `manage_system` permission is required.
  8302.  
  8303.         __Minimum server version__: 4.9
  8304.       parameters:
  8305.       - name: role_id
  8306.         in: path
  8307.         description: Role GUID
  8308.         required: true
  8309.         type: string
  8310.       - in: body
  8311.         name: body
  8312.         description: Role object to be updated
  8313.         required: true
  8314.         schema:
  8315.           type: object
  8316.           properties:
  8317.             permissions:
  8318.               type: array
  8319.               items:
  8320.                 type: string
  8321.               description: The permissions the role should grant.
  8322.       responses:
  8323.         '200':
  8324.           description: Role patch successful
  8325.           schema:
  8326.             $ref: '#/definitions/Role'
  8327.         '400':
  8328.           $ref: '#/responses/BadRequest'
  8329.         '401':
  8330.           $ref: '#/responses/Unauthorized'
  8331.         '403':
  8332.           $ref: '#/responses/Forbidden'
  8333.         '404':
  8334.           $ref: '#/responses/NotFound'
  8335.  
  8336.   /roles/names:
  8337.     post:
  8338.       tags:
  8339.      - roles
  8340.       summary: Get a list of roles by name
  8341.       description: |
  8342.        Get a list of roles from their names.
  8343.  
  8344.         ##### Permissions
  8345.         Requires an active session but no other permissions.
  8346.  
  8347.         __Minimum server version__: 4.9
  8348.       parameters:
  8349.       - in: body
  8350.         name: body
  8351.         description: List of role names
  8352.         required: true
  8353.         schema:
  8354.           type: array
  8355.           items:
  8356.             type: string
  8357.       responses:
  8358.         '200':
  8359.           description: Role list retrieval successful
  8360.           schema:
  8361.             type: array
  8362.             items:
  8363.               $ref: '#/definitions/Role'
  8364.         '400':
  8365.           $ref: '#/responses/BadRequest'
  8366.         '401':
  8367.           $ref: '#/responses/Unauthorized'
  8368.         '404':
  8369.           $ref: '#/responses/NotFound'
  8370.       x-code-samples:
  8371.       - lang: 'Go'
  8372.         source: |
  8373.          import "github.com/mattermost/mattermost-server/model"
  8374.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  8375.           Client.Login("email@domain.com", "Password1")
  8376.  
  8377.           roleNames := []string{<NAME OF ROLE1>, <NAME OF ROLE2>, ...}
  8378.  
  8379.           roles, resp := Client.GetRolesByName(roleNames)
  8380.   '/schemes':
  8381.     get:
  8382.       tags:
  8383.      - schemes
  8384.       summary: Get the schemes.
  8385.       description: |
  8386.        Get a page of schemes. Use the query parameters to modify the behaviour of this endpoint.
  8387.  
  8388.         ##### Permissions
  8389.         Must have `manage_system` permission.
  8390.  
  8391.         __Minimum server version__: 4.10
  8392.       parameters:
  8393.       - name: scope
  8394.         in: query
  8395.         description: Limit the results returned to the provided scope, either `team` or `channel`.
  8396.         default: ""
  8397.         type: string
  8398.       - name: page
  8399.         in: query
  8400.         description: The page to select.
  8401.         default: "0"
  8402.         type: string
  8403.       - name: per_page
  8404.         in: query
  8405.         description: The number of schemes per page.
  8406.         default: "60"
  8407.         type: string
  8408.       responses:
  8409.         '200':
  8410.           description: Scheme list retrieval successful
  8411.           schema:
  8412.             type: array
  8413.             items:
  8414.               $ref: '#/definitions/Scheme'
  8415.         '400':
  8416.           $ref: '#/responses/BadRequest'
  8417.         '401':
  8418.           $ref: '#/responses/Unauthorized'
  8419.         '403':
  8420.           $ref: '#/responses/Forbidden'
  8421.  
  8422.     post:
  8423.       tags:
  8424.      - schemes
  8425.       summary: Create a scheme
  8426.       description: |
  8427.        Create a new scheme.
  8428.  
  8429.         ##### Permissions
  8430.         Must have `manage_system` permission.
  8431.  
  8432.         __Minimum server version__: 4.10
  8433.       parameters:
  8434.       - in: body
  8435.         name: scheme
  8436.         description: Scheme object to create
  8437.         required: true
  8438.         schema:
  8439.           type: object
  8440.           required:
  8441.          - name
  8442.           - scope
  8443.           properties:
  8444.             name:
  8445.               type: string
  8446.               description: The name of the scheme
  8447.             description:
  8448.               type: string
  8449.               description: The description of the scheme
  8450.             scope:
  8451.               type: string
  8452.               description: The scope of the scheme ("team" or "channel")
  8453.       responses:
  8454.         '201':
  8455.           description: Scheme creation successful
  8456.           schema:
  8457.             $ref: '#/definitions/Scheme'
  8458.         '400':
  8459.           $ref: '#/responses/BadRequest'
  8460.         '401':
  8461.           $ref: '#/responses/Unauthorized'
  8462.         '403':
  8463.           $ref: '#/responses/Forbidden'
  8464.         '501':
  8465.           $ref: '#/responses/NotImplemented'
  8466.  
  8467.   '/schemes/{scheme_id}':
  8468.     get:
  8469.       tags:
  8470.      - schemes
  8471.       summary: Get a scheme
  8472.       description: |
  8473.        Get a scheme from the provided scheme id.
  8474.  
  8475.         ##### Permissions
  8476.         Requires an active session but no other permissions.
  8477.  
  8478.         __Minimum server version__: 4.10
  8479.       parameters:
  8480.       - name: scheme_id
  8481.         in: path
  8482.         description: Scheme GUID
  8483.         required: true
  8484.         type: string
  8485.       responses:
  8486.         '200':
  8487.           description: Scheme retrieval successful
  8488.           schema:
  8489.             $ref: '#/definitions/Scheme'
  8490.         '401':
  8491.           $ref: '#/responses/Unauthorized'
  8492.         '404':
  8493.           $ref: '#/responses/NotFound'
  8494.       x-code-samples:
  8495.       - lang: 'Go'
  8496.         source: |
  8497.          import "github.com/mattermost/mattermost-server/model"
  8498.           Client := model.NewAPIv4Client("https://your-mattermost-url.com")
  8499.           Client.Login("email@domain.com", "Password1")
  8500.  
  8501.           scheme, resp := Client.GetScheme(<SCHEMEID>, "")
  8502.  
  8503.     delete:
  8504.       tags:
  8505.      - schemes
  8506.       summary: Delete a scheme
  8507.       description: |
  8508.        Soft deletes a scheme, by marking the scheme as deleted in the database.
  8509.  
  8510.         ##### Permissions
  8511.         Must have `manage_system` permission.
  8512.  
  8513.         __Minimum server version__: 4.10
  8514.       parameters:
  8515.       - name: scheme_id
  8516.         in: path
  8517.         description: ID of the scheme to delete
  8518.         required: true
  8519.         type: string
  8520.       responses:
  8521.         '200':
  8522.           description: Scheme deletion successful
  8523.           schema:
  8524.             $ref: "#/definitions/StatusOK"
  8525.         '400':
  8526.           $ref: '#/responses/BadRequest'
  8527.         '401':
  8528.           $ref: '#/responses/Unauthorized'
  8529.         '403':
  8530.           $ref: '#/responses/Forbidden'
  8531.         '501':
  8532.           $ref: '#/responses/NotImplemented'
  8533.  
  8534.   '/schemes/{scheme_id}/patch':
  8535.     put:
  8536.       tags:
  8537.      - schemes
  8538.       summary: Patch a scheme
  8539.       description: |
  8540.        Partially update a scheme by providing only the fields you want to update. Omitted fields will not be updated. The fields that can be updated are defined in the request body, all other provided fields will be ignored.
  8541.  
  8542.         ##### Permissions
  8543.         `manage_system` permission is required.
  8544.  
  8545.         __Minimum server version__: 4.10
  8546.       parameters:
  8547.       - name: scheme_id
  8548.         in: path
  8549.         description: Scheme GUID
  8550.         required: true
  8551.         type: string
  8552.       - in: body
  8553.         name: body
  8554.         description: Scheme object to be updated
  8555.         required: true
  8556.         schema:
  8557.           type: object
  8558.           properties:
  8559.             name:
  8560.               type: string
  8561.               description: The human readable name of the scheme
  8562.             description:
  8563.               type: string
  8564.               description: The description of the scheme
  8565.       responses:
  8566.         '200':
  8567.           description: Scheme patch successful
  8568.           schema:
  8569.             $ref: '#/definitions/Scheme'
  8570.         '400':
  8571.           $ref: '#/responses/BadRequest'
  8572.         '401':
  8573.           $ref: '#/responses/Unauthorized'
  8574.         '403':
  8575.           $ref: '#/responses/Forbidden'
  8576.         '404':
  8577.           $ref: '#/responses/NotFound'
  8578.         '501':
  8579.           $ref: '#/responses/NotImplemented'
  8580.  
  8581.   '/schemes/{scheme_id}/teams':
  8582.     get:
  8583.       tags:
  8584.      - schemes
  8585.       summary: Get a page of teams which use this scheme.
  8586.       description: |
  8587.        Get a page of teams which use this scheme. The provided Scheme ID should be for a Team-scoped Scheme.
  8588.         Use the query parameters to modify the behaviour of this endpoint.
  8589.  
  8590.         ##### Permissions
  8591.         `manage_system` permission is required.
  8592.  
  8593.         __Minimum server version__: 4.10
  8594.       parameters:
  8595.       - name: scheme_id
  8596.         in: path
  8597.         description: Scheme GUID
  8598.         required: true
  8599.         type: string
  8600.       - name: page
  8601.         in: query
  8602.         description: The page to select.
  8603.         default: "0"
  8604.         type: string
  8605.       - name: per_page
  8606.         in: query
  8607.         description: The number of teams per page.
  8608.         default: "60"
  8609.         type: string
  8610.       responses:
  8611.         '200':
  8612.           description: Team list retrieval successful
  8613.           schema:
  8614.             type: array
  8615.             items:
  8616.               $ref: '#/definitions/Team'
  8617.         '400':
  8618.           $ref: '#/responses/BadRequest'
  8619.         '401':
  8620.           $ref: '#/responses/Unauthorized'
  8621.         '403':
  8622.           $ref: '#/responses/Forbidden'
  8623.         '404':
  8624.           $ref: '#/responses/NotFound'
  8625.  
  8626.   '/schemes/{scheme_id}/channels':
  8627.     get:
  8628.       tags:
  8629.      - schemes
  8630.       summary: Get a page of channels which use this scheme.
  8631.       description: |
  8632.        Get a page of channels which use this scheme. The provided Scheme ID should be for a Channel-scoped Scheme.
  8633.         Use the query parameters to modify the behaviour of this endpoint.
  8634.  
  8635.         ##### Permissions
  8636.         `manage_system` permission is required.
  8637.  
  8638.         __Minimum server version__: 4.10
  8639.       parameters:
  8640.       - name: scheme_id
  8641.         in: path
  8642.         description: Scheme GUID
  8643.         required: true
  8644.         type: string
  8645.       - name: page
  8646.         in: query
  8647.         description: The page to select.
  8648.         default: "0"
  8649.         type: string
  8650.       - name: per_page
  8651.         in: query
  8652.         description: The number of channels per page.
  8653.         default: "60"
  8654.         type: string
  8655.       responses:
  8656.         '200':
  8657.           description: Channel list retrieval successful
  8658.           schema:
  8659.             type: array
  8660.             items:
  8661.               $ref: '#/definitions/Channel'
  8662.         '400':
  8663.           $ref: '#/responses/BadRequest'
  8664.         '401':
  8665.           $ref: '#/responses/Unauthorized'
  8666.         '403':
  8667.           $ref: '#/responses/Forbidden'
  8668.         '404':
  8669.           $ref: '#/responses/NotFound'
  8670. definitions:
  8671.   User:
  8672.     type: object
  8673.     properties:
  8674.       id:
  8675.         type: string
  8676.       create_at:
  8677.         type: long
  8678.       update_at:
  8679.         type: long
  8680.       delete_at:
  8681.         type: long
  8682.       username:
  8683.         type: string
  8684.       first_name:
  8685.         type: string
  8686.       last_name:
  8687.         type: string
  8688.       nickname:
  8689.         type: string
  8690.       email:
  8691.         type: string
  8692.       email_verified:
  8693.         type: boolean
  8694.       auth_service:
  8695.         type: string
  8696.       roles:
  8697.         type: string
  8698.       locale:
  8699.         type: string
  8700.       notify_props:
  8701.         description: Field only visible to self and admins
  8702.         $ref: '#/definitions/UserNotifyProps'
  8703.       props:
  8704.         type: object
  8705.       last_password_update:
  8706.         type: long
  8707.       last_picture_update:
  8708.         type: long
  8709.       failed_attempts:
  8710.         type: integer
  8711.       mfa_active:
  8712.         type: boolean
  8713.  
  8714.   Team:
  8715.     type: object
  8716.     properties:
  8717.       id:
  8718.         type: string
  8719.       create_at:
  8720.         type: long
  8721.       update_at:
  8722.         type: long
  8723.       delete_at:
  8724.         type: long
  8725.       display_name:
  8726.         type: string
  8727.       name:
  8728.         type: string
  8729.       description:
  8730.         type: string
  8731.       email:
  8732.         type: string
  8733.       type:
  8734.         type: string
  8735.       allowed_domains:
  8736.         type: string
  8737.       invite_id:
  8738.         type: string
  8739.       allow_open_invite:
  8740.         type: boolean
  8741.  
  8742.   TeamStats:
  8743.     type: object
  8744.     properties:
  8745.       team_id:
  8746.         type: string
  8747.       total_member_count:
  8748.         type: integer
  8749.       active_member_count:
  8750.         type: integer
  8751.  
  8752.   TeamExists:
  8753.     type: object
  8754.     properties:
  8755.       exists:
  8756.         type: boolean
  8757.  
  8758.   Channel:
  8759.     type: object
  8760.     properties:
  8761.       id:
  8762.         type: string
  8763.       create_at:
  8764.         type: long
  8765.       update_at:
  8766.         type: long
  8767.       delete_at:
  8768.         type: integer
  8769.       team_id:
  8770.         type: string
  8771.       type:
  8772.         type: string
  8773.       display_name:
  8774.         type: string
  8775.       name:
  8776.         type: string
  8777.       header:
  8778.         type: string
  8779.       purpose:
  8780.         type: string
  8781.       last_post_at:
  8782.         type: long
  8783.       total_msg_count:
  8784.         type: integer
  8785.       extra_update_at:
  8786.         type: long
  8787.       creator_id:
  8788.         type: string
  8789.  
  8790.   ChannelStats:
  8791.     type: object
  8792.     properties:
  8793.       channel_id:
  8794.         type: string
  8795.       member_count:
  8796.         type: integer
  8797.  
  8798.   ChannelMember:
  8799.     type: object
  8800.     properties:
  8801.       channel_id:
  8802.         type: string
  8803.       user_id:
  8804.         type: string
  8805.       roles:
  8806.         type: string
  8807.       last_viewed_at:
  8808.         type: long
  8809.       msg_count:
  8810.         type: integer
  8811.       mention_count:
  8812.         type: integer
  8813.       notify_props:
  8814.         description: Field only visible to self and admins
  8815.         $ref: '#/definitions/ChannelNotifyProps'
  8816.       last_update_at:
  8817.         type: long
  8818.  
  8819.   ChannelData:
  8820.     type: object
  8821.     properties:
  8822.       channel:
  8823.         $ref: '#/definitions/Channel'
  8824.       member:
  8825.         $ref: '#/definitions/ChannelMember'
  8826.  
  8827.   Post:
  8828.     type: object
  8829.     properties:
  8830.       id:
  8831.         type: string
  8832.       create_at:
  8833.         type: long
  8834.       update_at:
  8835.         type: long
  8836.       delete_at:
  8837.         type: long
  8838.       edit_at:
  8839.         type: long
  8840.       user_id:
  8841.         type: string
  8842.       channel_id:
  8843.         type: string
  8844.       root_id:
  8845.         type: string
  8846.       parent_id:
  8847.         type: string
  8848.       original_id:
  8849.         type: string
  8850.       message:
  8851.         type: string
  8852.       type:
  8853.         type: string
  8854.       props:
  8855.         type: object
  8856.       hashtag:
  8857.         type: string
  8858.       filenames:
  8859.         description: This field will only appear on some posts created before Mattermost 3.5 and has since been deprecated.
  8860.         type: array
  8861.         items:
  8862.           type: string
  8863.       file_ids:
  8864.         type: array
  8865.         items:
  8866.           type: string
  8867.       pending_post_id:
  8868.         type: string
  8869.  
  8870.   PostList:
  8871.     type: object
  8872.     properties:
  8873.       order:
  8874.         type: array
  8875.         items:
  8876.           type: string
  8877.         example: ["post_id1", "post_id12"]
  8878.       posts:
  8879.         type: object
  8880.         additionalProperties:
  8881.           $ref: '#/definitions/Post'
  8882.  
  8883.   TeamMap:
  8884.     type: object
  8885.     description: A mapping of teamIds to teams.
  8886.     properties:
  8887.       team_id:
  8888.         $ref: '#/definitions/Team'
  8889.  
  8890.   TeamMember:
  8891.     type: object
  8892.     properties:
  8893.       team_id:
  8894.         type: string
  8895.       user_id:
  8896.         type: string
  8897.       roles:
  8898.         type: string
  8899.  
  8900.   TeamUnread:
  8901.     type: object
  8902.     properties:
  8903.       team_id:
  8904.         type: string
  8905.       msg_count:
  8906.         type: integer
  8907.       mention_count:
  8908.         type: integer
  8909.  
  8910.   ChannelUnread:
  8911.     type: object
  8912.     properties:
  8913.       team_id:
  8914.         type: string
  8915.       channel_id:
  8916.         type: string
  8917.       msg_count:
  8918.         type: integer
  8919.       mention_count:
  8920.         type: integer
  8921.  
  8922.   Session:
  8923.     type: object
  8924.     properties:
  8925.       create_at:
  8926.         type: long
  8927.       device_id:
  8928.         type: string
  8929.       expires_at:
  8930.         type: long
  8931.       id:
  8932.         type: string
  8933.       is_oauth:
  8934.         type: boolean
  8935.       last_activity_at:
  8936.         type: long
  8937.       props:
  8938.         type: object
  8939.       roles:
  8940.         type: string
  8941.       team_members:
  8942.         type: array
  8943.         items:
  8944.           $ref: '#/definitions/TeamMember'
  8945.       token:
  8946.         type: string
  8947.       user_id:
  8948.         type: string
  8949.  
  8950.   FileInfo:
  8951.     type: object
  8952.     properties:
  8953.       id:
  8954.         description: The unique identifier for this file
  8955.         type: string
  8956.       user_id:
  8957.         description: The ID of the user that uploaded this file
  8958.         type: string
  8959.       post_id:
  8960.         description: If this file is attached to a post, the ID of that post
  8961.         type: string
  8962.       create_at:
  8963.         type: long
  8964.       update_at:
  8965.         type: long
  8966.       delete_at:
  8967.         type: long
  8968.       name:
  8969.         description: The name of the file
  8970.         type: string
  8971.       extension:
  8972.         description: The extension at the end of the file name
  8973.         type: string
  8974.       size:
  8975.         description: The size of the file in bytes
  8976.         type: integer
  8977.       mime_type:
  8978.         description: The MIME type of the file
  8979.         type: string
  8980.       width:
  8981.         description: If this file is an image, the width of the file
  8982.         type: integer
  8983.       height:
  8984.         description: If this file is an image, the height of the file
  8985.         type: integer
  8986.       has_preview_image:
  8987.         description: If this file is an image, whether or not it has a preview-sized version
  8988.         type: boolean
  8989.  
  8990.   Preference:
  8991.     type: object
  8992.     properties:
  8993.       user_id:
  8994.         description: The ID of the user that owns this preference
  8995.         type: string
  8996.       category:
  8997.         type: string
  8998.       name:
  8999.         type: string
  9000.       value:
  9001.         type: string
  9002.  
  9003.   UserAuthData:
  9004.     type: object
  9005.     properties:
  9006.       auth_data:
  9007.         description: Service-specific authentication data
  9008.         type: string
  9009.       auth_service:
  9010.         description: The authentication service such as "email", "gitlab", or "ldap"
  9011.         type: string
  9012.       password:
  9013.         description: The password used for email authentication
  9014.         type: string
  9015.  
  9016.   UserAutocomplete:
  9017.     type: object
  9018.     properties:
  9019.       users:
  9020.         description: A list of users that are the main result of the query
  9021.         type: array
  9022.         items:
  9023.           $ref: '#/definitions/User'
  9024.       out_of_channel:
  9025.         description: A special case list of users returned when autocompleting in a specific channel. Omitted when empty or not relevant
  9026.         type: array
  9027.         items:
  9028.           $ref: '#/definitions/User'
  9029.  
  9030.   UserAutocompleteInTeam:
  9031.     type: object
  9032.     properties:
  9033.       in_team:
  9034.         description: A list of user objects in the team
  9035.         type: array
  9036.         items:
  9037.           $ref: '#/definitions/User'
  9038.  
  9039.   UserAutocompleteInChannel:
  9040.     type: object
  9041.     properties:
  9042.       in_channel:
  9043.         description: A list of user objects in the channel
  9044.         type: array
  9045.         items:
  9046.           $ref: '#/definitions/User'
  9047.       out_of_channel:
  9048.         description: A list of user objects not in the channel
  9049.         type: array
  9050.         items:
  9051.           $ref: '#/definitions/User'
  9052.  
  9053.   IncomingWebhook:
  9054.     type: object
  9055.     properties:
  9056.       id:
  9057.         description: The unique identifier for this incoming webhook
  9058.         type: string
  9059.       create_at:
  9060.         type: long
  9061.       update_at:
  9062.         type: long
  9063.       delete_at:
  9064.         type: long
  9065.       channel_id:
  9066.         description: The ID of a public channel or private group that receives the webhook payloads
  9067.         type: string
  9068.       description:
  9069.         description: The description for this incoming webhook
  9070.         type: string
  9071.       display_name:
  9072.         description: The display name for this incoming webhook
  9073.         type: string
  9074.  
  9075.   OutgoingWebhook:
  9076.     type: object
  9077.     properties:
  9078.       id:
  9079.         description: The unique identifier for this outgoing webhook
  9080.         type: string
  9081.       create_at:
  9082.         type: long
  9083.       update_at:
  9084.         type: long
  9085.       delete_at:
  9086.         type: long
  9087.       creator_id:
  9088.         description: The Id of the user who created the webhook
  9089.         type: string
  9090.       team_id:
  9091.         description: The ID of the team that the webhook watchs
  9092.         type: string
  9093.       channel_id:
  9094.         description: The ID of a public channel that the webhook watchs
  9095.         type: string
  9096.       description:
  9097.         description: The description for this outgoing webhook
  9098.         type: string
  9099.       display_name:
  9100.         description: The display name for this outgoing webhook
  9101.         type: string
  9102.       trigger_words:
  9103.         description: List of words for the webhook to trigger on
  9104.         type: array
  9105.         items:
  9106.           type: string
  9107.       trigger_when:
  9108.         description: When to trigger the webhook, `0` when a trigger word is present at all and `1` if the message starts with a trigger word
  9109.         type: integer
  9110.       callback_urls:
  9111.         description: The URLs to POST the payloads to when the webhook is triggered
  9112.         type: array
  9113.         items:
  9114.           type: string
  9115.       content_type:
  9116.         description: The format to POST the data in, either `application/json` or `application/x-www-form-urlencoded`
  9117.         default: "application/x-www-form-urlencoded"
  9118.         type: string
  9119.  
  9120.   Reaction:
  9121.     type: object
  9122.     properties:
  9123.       user_id:
  9124.         description: The ID of the user that made this reaction
  9125.         type: string
  9126.       post_id:
  9127.         description: The ID of the post to which this reaction was made
  9128.         type: string
  9129.       emoji_name:
  9130.         description: The name of the emoji that was used for this reaction
  9131.         type: string
  9132.       create_at:
  9133.         description: The time at which this reaction was made
  9134.         type: long
  9135.  
  9136.   Emoji:
  9137.     type: object
  9138.     properties:
  9139.       id:
  9140.         description: The ID of the emoji
  9141.         type: string
  9142.       creator_id:
  9143.         description: The ID of the user that made the emoji
  9144.         type: string
  9145.       name:
  9146.         description: The name of the emoji
  9147.         type: string
  9148.       create_at:
  9149.         description: The time at which the emoji was made
  9150.         type: long
  9151.       update_at:
  9152.         description: The time at which the emoji was updated.
  9153.         type: long
  9154.       delete_at:
  9155.         description: The time at which the emoji was deleted.
  9156.         type: long
  9157.  
  9158.   Command:
  9159.     type: object
  9160.     properties:
  9161.       id:
  9162.         description: The ID of the slash command
  9163.         type: string
  9164.       token:
  9165.         description: The token which is used to verify the source of the payload
  9166.         type: string
  9167.       create_at:
  9168.         description: Timestamp when the command was created
  9169.         type: long
  9170.       updated_at:
  9171.         description: Timestamp when the command was last updated
  9172.         type: long
  9173.       deleted_at:
  9174.         description: Timestamp when the command was deleted, 0 if never deleted
  9175.         type: long
  9176.       creator_id:
  9177.         description: The user id for the commands creator
  9178.         type: string
  9179.       team_id:
  9180.         description: The team id for which this command is configured
  9181.         type: string
  9182.       trigger:
  9183.         description: The string that triggers this command
  9184.         type: string
  9185.       method:
  9186.         description: Is the trigger done with HTTP Get ('G') or HTTP Post ('P')
  9187.         type: string
  9188.       username:
  9189.         description: What is the username for the response post
  9190.         type: string
  9191.       icon_url:
  9192.         description: The url to find the icon for this users avatar
  9193.         type: string
  9194.       auto_complete:
  9195.         description: Use auto complete for this command
  9196.         type: boolean
  9197.       auto_complete_desc:
  9198.         description: The description for this command shown when selecting the command
  9199.         type: string
  9200.       auto_complete_hint:
  9201.         description: The hint for this command
  9202.         type: string
  9203.       display_name:
  9204.         description: Display name for the command
  9205.         type: string
  9206.       description:
  9207.         description: Description for this command
  9208.         type: string
  9209.       url:
  9210.         description: The URL that is triggered
  9211.         type: string
  9212.  
  9213.   CommandResponse:
  9214.     type: object
  9215.     properties:
  9216.       ResponseType:
  9217.         description: The response type either in_channel or ephemeral
  9218.         type: string
  9219.       Text:
  9220.         type: string
  9221.       Username:
  9222.         type: string
  9223.       IconURL:
  9224.         type: string
  9225.       GotoLocation:
  9226.         type: string
  9227.       Attachments:
  9228.         type: array
  9229.         items:
  9230.           $ref: '#/definitions/SlackAttachment'
  9231.  
  9232.   SlackAttachment:
  9233.     type: object
  9234.     properties:
  9235.       Id:
  9236.         type: string
  9237.       Fallback:
  9238.         type: string
  9239.       Color:
  9240.         type: string
  9241.       Pretext:
  9242.         type: string
  9243.       AuthorName:
  9244.         type: string
  9245.       AuthorLink:
  9246.         type: string
  9247.       AuthorIcon:
  9248.         type: string
  9249.       Title:
  9250.         type: string
  9251.       TitleLink:
  9252.         type: string
  9253.       Text:
  9254.         type: string
  9255.       Fields:
  9256.         type: array
  9257.         items:
  9258.           $ref: '#/definitions/SlackAttachmentField'
  9259.       ImageURL:
  9260.         type: string
  9261.       ThumbURL:
  9262.         type: string
  9263.       Footer:
  9264.         type: string
  9265.       FooterIcon:
  9266.         type: string
  9267.       Timestamp:
  9268.         description: The timestamp of the slack attahment, either type of string or integer
  9269.         type: string
  9270.  
  9271.   SlackAttachmentField:
  9272.     type: object
  9273.     properties:
  9274.       Title:
  9275.         type: string
  9276.       Value:
  9277.         description: The value of the attachment, set as string but capable with golang interface
  9278.         type: string
  9279.       Short:
  9280.         type: boolean
  9281.  
  9282.   StatusOK:
  9283.     type: object
  9284.     properties:
  9285.       status:
  9286.         description: Will contain "ok" if the request was successful and there was nothing else to return
  9287.         type: string
  9288.  
  9289.   OpenGraph:
  9290.     type: object
  9291.     description: OpenGraph metadata of a webpage
  9292.     properties:
  9293.       type:
  9294.         type: string
  9295.       url:
  9296.         type: string
  9297.       title:
  9298.         type: string
  9299.       description:
  9300.         type: string
  9301.       determiner:
  9302.         type: string
  9303.       site_name:
  9304.         type: string
  9305.       locale:
  9306.         type: string
  9307.       locales_alternate:
  9308.         type: array
  9309.         items:
  9310.           type: string
  9311.       images:
  9312.         type: array
  9313.         items:
  9314.           type: object
  9315.           description: Image object used in OpenGraph metadata of a webpage
  9316.           properties:
  9317.             url:
  9318.               type: string
  9319.             secure_url:
  9320.               type: string
  9321.             type:
  9322.               type: string
  9323.             width:
  9324.               type: integer
  9325.             height:
  9326.               type: integer
  9327.       videos:
  9328.         type: array
  9329.         items:
  9330.           type: object
  9331.           description: Video object used in OpenGraph metadata of a webpage
  9332.           properties:
  9333.             url:
  9334.               type: string
  9335.             secure_url:
  9336.               type: string
  9337.             type:
  9338.               type: string
  9339.             width:
  9340.               type: integer
  9341.             height:
  9342.               type: integer
  9343.  
  9344.       audios:
  9345.         type: array
  9346.         items:
  9347.           type: object
  9348.           description: Audio object used in OpenGraph metadata of a webpage
  9349.           properties:
  9350.             url:
  9351.               type: string
  9352.             secure_url:
  9353.               type: string
  9354.             type:
  9355.               type: string
  9356.       article:
  9357.         type: object
  9358.         description: Article object used in OpenGraph metadata of a webpage, if type is article
  9359.         properties:
  9360.           published_time:
  9361.             type: string
  9362.           modified_time:
  9363.             type: string
  9364.           expiration_time:
  9365.             type: string
  9366.           section:
  9367.             type: string
  9368.           tags:
  9369.             type: array
  9370.             items:
  9371.               type: string
  9372.           authors:
  9373.             type: array
  9374.             items:
  9375.               type: object
  9376.               properties:
  9377.                 first_name:
  9378.                   type: string
  9379.                 last_name:
  9380.                   type: string
  9381.                 username:
  9382.                   type: string
  9383.                 gender:
  9384.                   type: string
  9385.       book:
  9386.         type: object
  9387.         description: Book object used in OpenGraph metadata of a webpage, if type is book
  9388.         properties:
  9389.           isbn:
  9390.             type: string
  9391.           release_date:
  9392.             type: string
  9393.           tags:
  9394.             type: array
  9395.             items:
  9396.               type: string
  9397.           authors:
  9398.             type: array
  9399.             items:
  9400.               type: object
  9401.               properties:
  9402.                 first_name:
  9403.                   type: string
  9404.                 last_name:
  9405.                   type: string
  9406.                 username:
  9407.                   type: string
  9408.                 gender:
  9409.                   type: string
  9410.       profile:
  9411.         type: object
  9412.         properties:
  9413.           first_name:
  9414.             type: string
  9415.           last_name:
  9416.             type: string
  9417.           username:
  9418.             type: string
  9419.           gender:
  9420.             type: string
  9421.  
  9422.   Audit:
  9423.     type: object
  9424.     properties:
  9425.       id:
  9426.         type: string
  9427.       create_at:
  9428.         type: long
  9429.       user_id:
  9430.         type: string
  9431.       action:
  9432.         type: string
  9433.       extra_info:
  9434.         type: string
  9435.       ip_address:
  9436.         type: string
  9437.       session_id:
  9438.         type: string
  9439.  
  9440.   Config:
  9441.     type: object
  9442.     properties:
  9443.       ServiceSettings:
  9444.         type: object
  9445.         properties:
  9446.           SiteURL:
  9447.             type: string
  9448.           ListenAddress:
  9449.             type: string
  9450.           ConnectionSecurity:
  9451.             type: string
  9452.           TLSCertFile:
  9453.             type: string
  9454.           TLSKeyFile:
  9455.             type: string
  9456.           UseLetsEncrypt:
  9457.             type: boolean
  9458.           LetsEncryptCertificateCacheFile:
  9459.             type: string
  9460.           Forward80To443:
  9461.             type: boolean
  9462.           ReadTimeout:
  9463.             type: integer
  9464.           WriteTimeout:
  9465.             type: integer
  9466.           MaximumLoginAttempts:
  9467.             type: integer
  9468.           SegmentDeveloperKey:
  9469.             type: string
  9470.           GoogleDeveloperKey:
  9471.             type: string
  9472.           EnableOAuthServiceProvider:
  9473.             type: boolean
  9474.           EnableIncomingWebhooks:
  9475.             type: boolean
  9476.           EnableOutgoingWebhooks:
  9477.             type: boolean
  9478.           EnableCommands:
  9479.             type: boolean
  9480.           EnableOnlyAdminIntegrations:
  9481.             type: boolean
  9482.           EnablePostUsernameOverride:
  9483.             type: boolean
  9484.           EnablePostIconOverride:
  9485.             type: boolean
  9486.           EnableTesting:
  9487.             type: boolean
  9488.           EnableDeveloper:
  9489.             type: boolean
  9490.           EnableSecurityFixAlert:
  9491.             type: boolean
  9492.           EnableInsecureOutgoingConnections:
  9493.             type: boolean
  9494.           EnableMultifactorAuthentication:
  9495.             type: boolean
  9496.           EnforceMultifactorAuthentication:
  9497.             type: boolean
  9498.           AllowCorsFrom:
  9499.             type: string
  9500.           SessionLengthWebInDays:
  9501.             type: integer
  9502.           SessionLengthMobileInDays:
  9503.             type: integer
  9504.           SessionLengthSSOInDays:
  9505.             type: integer
  9506.           SessionCacheInMinutes:
  9507.             type: integer
  9508.           WebsocketSecurePort:
  9509.             type: integer
  9510.           WebsocketPort:
  9511.             type: integer
  9512.           WebserverMode:
  9513.             type: string
  9514.           EnableCustomEmoji:
  9515.             type: boolean
  9516.           RestrictCustomEmojiCreation:
  9517.             type: string
  9518.       TeamSettings:
  9519.         type: object
  9520.         properties:
  9521.           SiteName:
  9522.             type: string
  9523.           MaxUsersPerTeam:
  9524.             type: integer
  9525.           EnableTeamCreation:
  9526.             type: boolean
  9527.           EnableUserCreation:
  9528.             type: boolean
  9529.           EnableOpenServer:
  9530.             type: boolean
  9531.           RestrictCreationToDomains:
  9532.             type: string
  9533.           EnableCustomBrand:
  9534.             type: boolean
  9535.           CustomBrandText:
  9536.             type: string
  9537.           CustomDescriptionText:
  9538.             type: string
  9539.           RestrictDirectMessage:
  9540.             type: string
  9541.           RestrictTeamInvite:
  9542.             type: string
  9543.           RestrictPublicChannelManagement:
  9544.             type: string
  9545.           RestrictPrivateChannelManagement:
  9546.             type: string
  9547.           RestrictPublicChannelCreation:
  9548.             type: string
  9549.           RestrictPrivateChannelCreation:
  9550.             type: string
  9551.           RestrictPublicChannelDeletion:
  9552.             type: string
  9553.           RestrictPrivateChannelDeletion:
  9554.             type: string
  9555.           UserStatusAwayTimeout:
  9556.             type: integer
  9557.           MaxChannelsPerTeam:
  9558.             type: integer
  9559.           MaxNotificationsPerChannel:
  9560.             type: integer
  9561.       SqlSettings:
  9562.         type: object
  9563.         properties:
  9564.           DriverName:
  9565.             type: string
  9566.           DataSource:
  9567.             type: string
  9568.           DataSourceReplicas:
  9569.             type: array
  9570.             items:
  9571.               type: string
  9572.           MaxIdleConns:
  9573.             type: integer
  9574.           MaxOpenConns:
  9575.             type: integer
  9576.           Trace:
  9577.             type: boolean
  9578.           AtRestEncryptKey:
  9579.             type: string
  9580.       LogSettings:
  9581.         type: object
  9582.         properties:
  9583.           EnableConsole:
  9584.             type: boolean
  9585.           ConsoleLevel:
  9586.             type: string
  9587.           EnableFile:
  9588.             type: boolean
  9589.           FileLevel:
  9590.             type: string
  9591.           FileFormat:
  9592.             type: string
  9593.           FileLocation:
  9594.             type: string
  9595.           EnableWebhookDebugging:
  9596.             type: boolean
  9597.           EnableDiagnostics:
  9598.             type: boolean
  9599.       PasswordSettings:
  9600.         type: object
  9601.         properties:
  9602.           MinimumLength:
  9603.             type: integer
  9604.           Lowercase:
  9605.             type: boolean
  9606.           Number:
  9607.             type: boolean
  9608.           Uppercase:
  9609.             type: boolean
  9610.           Symbol:
  9611.             type: boolean
  9612.       FileSettings:
  9613.         type: object
  9614.         properties:
  9615.           MaxFileSize:
  9616.             type: integer
  9617.           DriverName:
  9618.             type: string
  9619.           Directory:
  9620.             type: string
  9621.           EnablePublicLink:
  9622.             type: boolean
  9623.           PublicLinkSalt:
  9624.             type: string
  9625.           ThumbnailWidth:
  9626.             type: integer
  9627.           ThumbnailHeight:
  9628.             type: integer
  9629.           PreviewWidth:
  9630.             type: integer
  9631.           PreviewHeight:
  9632.             type: integer
  9633.           ProfileWidth:
  9634.             type: integer
  9635.           ProfileHeight:
  9636.             type: integer
  9637.           InitialFont:
  9638.             type: string
  9639.           AmazonS3AccessKeyId:
  9640.             type: string
  9641.           AmazonS3SecretAccessKey:
  9642.             type: string
  9643.           AmazonS3Bucket:
  9644.             type: string
  9645.           AmazonS3Region:
  9646.             type: string
  9647.           AmazonS3Endpoint:
  9648.             type: string
  9649.           AmazonS3SSL:
  9650.             type: boolean
  9651.       EmailSettings:
  9652.         type: object
  9653.         properties:
  9654.           EnableSignUpWithEmail:
  9655.             type: boolean
  9656.           EnableSignInWithEmail:
  9657.             type: boolean
  9658.           EnableSignInWithUsername:
  9659.             type: boolean
  9660.           SendEmailNotifications:
  9661.             type: boolean
  9662.           RequireEmailVerification:
  9663.             type: boolean
  9664.           FeedbackName:
  9665.             type: string
  9666.           FeedbackEmail:
  9667.             type: string
  9668.           FeedbackOrganization:
  9669.             type: string
  9670.           SMTPUsername:
  9671.             type: string
  9672.           SMTPPassword:
  9673.             type: string
  9674.           SMTPServer:
  9675.             type: string
  9676.           SMTPPort:
  9677.             type: string
  9678.           ConnectionSecurity:
  9679.             type: string
  9680.           InviteSalt:
  9681.             type: string
  9682.           PasswordResetSalt:
  9683.             type: string
  9684.           SendPushNotifications:
  9685.             type: boolean
  9686.           PushNotificationServer:
  9687.             type: string
  9688.           PushNotificationContents:
  9689.             type: string
  9690.           EnableEmailBatching:
  9691.             type: boolean
  9692.           EmailBatchingBufferSize:
  9693.             type: integer
  9694.           EmailBatchingInterval:
  9695.             type: integer
  9696.       RateLimitSettings:
  9697.         type: object
  9698.         properties:
  9699.           Enable:
  9700.             type: boolean
  9701.           PerSec:
  9702.             type: integer
  9703.           MaxBurst:
  9704.             type: integer
  9705.           MemoryStoreSize:
  9706.             type: integer
  9707.           VaryByRemoteAddr:
  9708.             type: boolean
  9709.           VaryByHeader:
  9710.             type: string
  9711.       PrivacySettings:
  9712.         type: object
  9713.         properties:
  9714.           ShowEmailAddress:
  9715.             type: boolean
  9716.           ShowFullName:
  9717.             type: boolean
  9718.       SupportSettings:
  9719.         type: object
  9720.         properties:
  9721.           TermsOfServiceLink:
  9722.             type: string
  9723.           PrivacyPolicyLink:
  9724.             type: string
  9725.           AboutLink:
  9726.             type: string
  9727.           HelpLink:
  9728.             type: string
  9729.           ReportAProblemLink:
  9730.             type: string
  9731.           SupportEmail:
  9732.             type: string
  9733.       GitLabSettings:
  9734.         type: object
  9735.         properties:
  9736.           Enable:
  9737.             type: boolean
  9738.           Secret:
  9739.             type: string
  9740.           Id:
  9741.             type: string
  9742.           Scope:
  9743.             type: string
  9744.           AuthEndpoint:
  9745.             type: string
  9746.           TokenEndpoint:
  9747.             type: string
  9748.           UserApiEndpoint:
  9749.             type: string
  9750.       GoogleSettings:
  9751.         type: object
  9752.         properties:
  9753.           Enable:
  9754.             type: boolean
  9755.           Secret:
  9756.             type: string
  9757.           Id:
  9758.             type: string
  9759.           Scope:
  9760.             type: string
  9761.           AuthEndpoint:
  9762.             type: string
  9763.           TokenEndpoint:
  9764.             type: string
  9765.           UserApiEndpoint:
  9766.             type: string
  9767.       Office365Settings:
  9768.         type: object
  9769.         properties:
  9770.           Enable:
  9771.             type: boolean
  9772.           Secret:
  9773.             type: string
  9774.           Id:
  9775.             type: string
  9776.           Scope:
  9777.             type: string
  9778.           AuthEndpoint:
  9779.             type: string
  9780.           TokenEndpoint:
  9781.             type: string
  9782.           UserApiEndpoint:
  9783.             type: string
  9784.       LdapSettings:
  9785.         type: object
  9786.         properties:
  9787.           Enable:
  9788.             type: boolean
  9789.           LdapServer:
  9790.             type: string
  9791.           LdapPort:
  9792.             type: integer
  9793.           ConnectionSecurity:
  9794.             type: string
  9795.           BaseDN:
  9796.             type: string
  9797.           BindUsername:
  9798.             type: string
  9799.           BindPassword:
  9800.             type: string
  9801.           UserFilter:
  9802.             type: string
  9803.           FirstNameAttribute:
  9804.             type: string
  9805.           LastNameAttribute:
  9806.             type: string
  9807.           EmailAttribute:
  9808.             type: string
  9809.           UsernameAttribute:
  9810.             type: string
  9811.           NicknameAttribute:
  9812.             type: string
  9813.           IdAttribute:
  9814.             type: string
  9815.           PositionAttribute:
  9816.             type: string
  9817.           SyncIntervalMinutes:
  9818.             type: integer
  9819.           SkipCertificateVerification:
  9820.             type: boolean
  9821.           QueryTimeout:
  9822.             type: integer
  9823.           MaxPageSize:
  9824.             type: integer
  9825.           LoginFieldName:
  9826.             type: string
  9827.       ComplianceSettings:
  9828.         type: object
  9829.         properties:
  9830.           Enable:
  9831.             type: boolean
  9832.           Directory:
  9833.             type: string
  9834.           EnableDaily:
  9835.             type: boolean
  9836.       LocalizationSettings:
  9837.         type: object
  9838.         properties:
  9839.           DefaultServerLocale:
  9840.             type: string
  9841.           DefaultClientLocale:
  9842.             type: string
  9843.           AvailableLocales:
  9844.             type: string
  9845.       SamlSettings:
  9846.         type: object
  9847.         properties:
  9848.           Enable:
  9849.             type: boolean
  9850.           Verify:
  9851.             type: boolean
  9852.           Encrypt:
  9853.             type: boolean
  9854.           IdpUrl:
  9855.             type: string
  9856.           IdpDescriptorUrl:
  9857.             type: string
  9858.           AssertionConsumerServiceURL:
  9859.             type: string
  9860.           IdpCertificateFile:
  9861.             type: string
  9862.           PublicCertificateFile:
  9863.             type: string
  9864.           PrivateKeyFile:
  9865.             type: string
  9866.           FirstNameAttribute:
  9867.             type: string
  9868.           LastNameAttribute:
  9869.             type: string
  9870.           EmailAttribute:
  9871.             type: string
  9872.           UsernameAttribute:
  9873.             type: string
  9874.           NicknameAttribute:
  9875.             type: string
  9876.           LocaleAttribute:
  9877.             type: string
  9878.           PositionAttribute:
  9879.             type: string
  9880.           LoginButtonText:
  9881.             type: string
  9882.       NativeAppSettings:
  9883.         type: object
  9884.         properties:
  9885.           AppDownloadLink:
  9886.             type: string
  9887.           AndroidAppDownloadLink:
  9888.             type: string
  9889.           IosAppDownloadLink:
  9890.             type: string
  9891.       ClusterSettings:
  9892.         type: object
  9893.         properties:
  9894.           Enable:
  9895.             type: boolean
  9896.           InterNodeListenAddress:
  9897.             type: string
  9898.           InterNodeUrls:
  9899.             type: array
  9900.             items:
  9901.               type: string
  9902.       MetricsSettings:
  9903.         type: object
  9904.         properties:
  9905.           Enable:
  9906.             type: boolean
  9907.           BlockProfileRate:
  9908.             type: integer
  9909.           ListenAddress:
  9910.             type: string
  9911.       AnalyticsSettings:
  9912.         type: object
  9913.         properties:
  9914.           MaxUsersForStatistics:
  9915.             type: integer
  9916.       WebrtcSettings:
  9917.         type: object
  9918.         properties:
  9919.           Enable:
  9920.             type: boolean
  9921.           GatewayWebsocketUrl:
  9922.             type: string
  9923.           GatewayAdminUrl:
  9924.             type: string
  9925.           GatewayAdminSecret:
  9926.             type: string
  9927.           StunURI:
  9928.             type: string
  9929.           TurnURI:
  9930.             type: string
  9931.           TurnUsername:
  9932.             type: string
  9933.           TurnSharedKey:
  9934.             type: string
  9935.  
  9936.   EnvironmentConfig:
  9937.     type: object
  9938.     properties:
  9939.       ServiceSettings:
  9940.         type: object
  9941.         properties:
  9942.           SiteURL:
  9943.             type: boolean
  9944.           ListenAddress:
  9945.             type: boolean
  9946.           ConnectionSecurity:
  9947.             type: boolean
  9948.           TLSCertFile:
  9949.             type: boolean
  9950.           TLSKeyFile:
  9951.             type: boolean
  9952.           UseLetsEncrypt:
  9953.             type: boolean
  9954.           LetsEncryptCertificateCacheFile:
  9955.             type: boolean
  9956.           Forward80To443:
  9957.             type: boolean
  9958.           ReadTimeout:
  9959.             type: boolean
  9960.           WriteTimeout:
  9961.             type: boolean
  9962.           MaximumLoginAttempts:
  9963.             type: boolean
  9964.           SegmentDeveloperKey:
  9965.             type: boolean
  9966.           GoogleDeveloperKey:
  9967.             type: boolean
  9968.           EnableOAuthServiceProvider:
  9969.             type: boolean
  9970.           EnableIncomingWebhooks:
  9971.             type: boolean
  9972.           EnableOutgoingWebhooks:
  9973.             type: boolean
  9974.           EnableCommands:
  9975.             type: boolean
  9976.           EnableOnlyAdminIntegrations:
  9977.             type: boolean
  9978.           EnablePostUsernameOverride:
  9979.             type: boolean
  9980.           EnablePostIconOverride:
  9981.             type: boolean
  9982.           EnableTesting:
  9983.             type: boolean
  9984.           EnableDeveloper:
  9985.             type: boolean
  9986.           EnableSecurityFixAlert:
  9987.             type: boolean
  9988.           EnableInsecureOutgoingConnections:
  9989.             type: boolean
  9990.           EnableMultifactorAuthentication:
  9991.             type: boolean
  9992.           EnforceMultifactorAuthentication:
  9993.             type: boolean
  9994.           AllowCorsFrom:
  9995.             type: boolean
  9996.           SessionLengthWebInDays:
  9997.             type: boolean
  9998.           SessionLengthMobileInDays:
  9999.             type: boolean
  10000.           SessionLengthSSOInDays:
  10001.             type: boolean
  10002.           SessionCacheInMinutes:
  10003.             type: boolean
  10004.           WebsocketSecurePort:
  10005.             type: boolean
  10006.           WebsocketPort:
  10007.             type: boolean
  10008.           WebserverMode:
  10009.             type: boolean
  10010.           EnableCustomEmoji:
  10011.             type: boolean
  10012.           RestrictCustomEmojiCreation:
  10013.             type: boolean
  10014.       TeamSettings:
  10015.         type: object
  10016.         properties:
  10017.           SiteName:
  10018.             type: boolean
  10019.           MaxUsersPerTeam:
  10020.             type: boolean
  10021.           EnableTeamCreation:
  10022.             type: boolean
  10023.           EnableUserCreation:
  10024.             type: boolean
  10025.           EnableOpenServer:
  10026.             type: boolean
  10027.           RestrictCreationToDomains:
  10028.             type: boolean
  10029.           EnableCustomBrand:
  10030.             type: boolean
  10031.           CustomBrandText:
  10032.             type: boolean
  10033.           CustomDescriptionText:
  10034.             type: boolean
  10035.           RestrictDirectMessage:
  10036.             type: boolean
  10037.           RestrictTeamInvite:
  10038.             type: boolean
  10039.           RestrictPublicChannelManagement:
  10040.             type: boolean
  10041.           RestrictPrivateChannelManagement:
  10042.             type: boolean
  10043.           RestrictPublicChannelCreation:
  10044.             type: boolean
  10045.           RestrictPrivateChannelCreation:
  10046.             type: boolean
  10047.           RestrictPublicChannelDeletion:
  10048.             type: boolean
  10049.           RestrictPrivateChannelDeletion:
  10050.             type: boolean
  10051.           UserStatusAwayTimeout:
  10052.             type: boolean
  10053.           MaxChannelsPerTeam:
  10054.             type: boolean
  10055.           MaxNotificationsPerChannel:
  10056.             type: boolean
  10057.       SqlSettings:
  10058.         type: object
  10059.         properties:
  10060.           DriverName:
  10061.             type: boolean
  10062.           DataSource:
  10063.             type: boolean
  10064.           DataSourceReplicas:
  10065.             type: boolean
  10066.           MaxIdleConns:
  10067.             type: boolean
  10068.           MaxOpenConns:
  10069.             type: boolean
  10070.           Trace:
  10071.             type: boolean
  10072.           AtRestEncryptKey:
  10073.             type: boolean
  10074.       LogSettings:
  10075.         type: object
  10076.         properties:
  10077.           EnableConsole:
  10078.             type: boolean
  10079.           ConsoleLevel:
  10080.             type: boolean
  10081.           EnableFile:
  10082.             type: boolean
  10083.           FileLevel:
  10084.             type: boolean
  10085.           FileFormat:
  10086.             type: boolean
  10087.           FileLocation:
  10088.             type: boolean
  10089.           EnableWebhookDebugging:
  10090.             type: boolean
  10091.           EnableDiagnostics:
  10092.             type: boolean
  10093.       PasswordSettings:
  10094.         type: object
  10095.         properties:
  10096.           MinimumLength:
  10097.             type: boolean
  10098.           Lowercase:
  10099.             type: boolean
  10100.           Number:
  10101.             type: boolean
  10102.           Uppercase:
  10103.             type: boolean
  10104.           Symbol:
  10105.             type: boolean
  10106.       FileSettings:
  10107.         type: object
  10108.         properties:
  10109.           MaxFileSize:
  10110.             type: boolean
  10111.           DriverName:
  10112.             type: boolean
  10113.           Directory:
  10114.             type: boolean
  10115.           EnablePublicLink:
  10116.             type: boolean
  10117.           PublicLinkSalt:
  10118.             type: boolean
  10119.           ThumbnailWidth:
  10120.             type: boolean
  10121.           ThumbnailHeight:
  10122.             type: boolean
  10123.           PreviewWidth:
  10124.             type: boolean
  10125.           PreviewHeight:
  10126.             type: boolean
  10127.           ProfileWidth:
  10128.             type: boolean
  10129.           ProfileHeight:
  10130.             type: boolean
  10131.           InitialFont:
  10132.             type: boolean
  10133.           AmazonS3AccessKeyId:
  10134.             type: boolean
  10135.           AmazonS3SecretAccessKey:
  10136.             type: boolean
  10137.           AmazonS3Bucket:
  10138.             type: boolean
  10139.           AmazonS3Region:
  10140.             type: boolean
  10141.           AmazonS3Endpoint:
  10142.             type: boolean
  10143.           AmazonS3SSL:
  10144.             type: boolean
  10145.       EmailSettings:
  10146.         type: object
  10147.         properties:
  10148.           EnableSignUpWithEmail:
  10149.             type: boolean
  10150.           EnableSignInWithEmail:
  10151.             type: boolean
  10152.           EnableSignInWithUsername:
  10153.             type: boolean
  10154.           SendEmailNotifications:
  10155.             type: boolean
  10156.           RequireEmailVerification:
  10157.             type: boolean
  10158.           FeedbackName:
  10159.             type: boolean
  10160.           FeedbackEmail:
  10161.             type: boolean
  10162.           FeedbackOrganization:
  10163.             type: boolean
  10164.           SMTPUsername:
  10165.             type: boolean
  10166.           SMTPPassword:
  10167.             type: boolean
  10168.           SMTPServer:
  10169.             type: boolean
  10170.           SMTPPort:
  10171.             type: boolean
  10172.           ConnectionSecurity:
  10173.             type: boolean
  10174.           InviteSalt:
  10175.             type: boolean
  10176.           PasswordResetSalt:
  10177.             type: boolean
  10178.           SendPushNotifications:
  10179.             type: boolean
  10180.           PushNotificationServer:
  10181.             type: boolean
  10182.           PushNotificationContents:
  10183.             type: boolean
  10184.           EnableEmailBatching:
  10185.             type: boolean
  10186.           EmailBatchingBufferSize:
  10187.             type: boolean
  10188.           EmailBatchingInterval:
  10189.             type: boolean
  10190.       RateLimitSettings:
  10191.         type: object
  10192.         properties:
  10193.           Enable:
  10194.             type: boolean
  10195.           PerSec:
  10196.             type: boolean
  10197.           MaxBurst:
  10198.             type: boolean
  10199.           MemoryStoreSize:
  10200.             type: boolean
  10201.           VaryByRemoteAddr:
  10202.             type: boolean
  10203.           VaryByHeader:
  10204.             type: boolean
  10205.       PrivacySettings:
  10206.         type: object
  10207.         properties:
  10208.           ShowEmailAddress:
  10209.             type: boolean
  10210.           ShowFullName:
  10211.             type: boolean
  10212.       SupportSettings:
  10213.         type: object
  10214.         properties:
  10215.           TermsOfServiceLink:
  10216.             type: boolean
  10217.           PrivacyPolicyLink:
  10218.             type: boolean
  10219.           AboutLink:
  10220.             type: boolean
  10221.           HelpLink:
  10222.             type: boolean
  10223.           ReportAProblemLink:
  10224.             type: boolean
  10225.           SupportEmail:
  10226.             type: boolean
  10227.       GitLabSettings:
  10228.         type: object
  10229.         properties:
  10230.           Enable:
  10231.             type: boolean
  10232.           Secret:
  10233.             type: boolean
  10234.           Id:
  10235.             type: boolean
  10236.           Scope:
  10237.             type: boolean
  10238.           AuthEndpoint:
  10239.             type: boolean
  10240.           TokenEndpoint:
  10241.             type: boolean
  10242.           UserApiEndpoint:
  10243.             type: boolean
  10244.       GoogleSettings:
  10245.         type: object
  10246.         properties:
  10247.           Enable:
  10248.             type: boolean
  10249.           Secret:
  10250.             type: boolean
  10251.           Id:
  10252.             type: boolean
  10253.           Scope:
  10254.             type: boolean
  10255.           AuthEndpoint:
  10256.             type: boolean
  10257.           TokenEndpoint:
  10258.             type: boolean
  10259.           UserApiEndpoint:
  10260.             type: boolean
  10261.       Office365Settings:
  10262.         type: object
  10263.         properties:
  10264.           Enable:
  10265.             type: boolean
  10266.           Secret:
  10267.             type: boolean
  10268.           Id:
  10269.             type: boolean
  10270.           Scope:
  10271.             type: boolean
  10272.           AuthEndpoint:
  10273.             type: boolean
  10274.           TokenEndpoint:
  10275.             type: boolean
  10276.           UserApiEndpoint:
  10277.             type: boolean
  10278.       LdapSettings:
  10279.         type: object
  10280.         properties:
  10281.           Enable:
  10282.             type: boolean
  10283.           LdapServer:
  10284.             type: boolean
  10285.           LdapPort:
  10286.             type: boolean
  10287.           ConnectionSecurity:
  10288.             type: boolean
  10289.           BaseDN:
  10290.             type: boolean
  10291.           BindUsername:
  10292.             type: boolean
  10293.           BindPassword:
  10294.             type: boolean
  10295.           UserFilter:
  10296.             type: boolean
  10297.           FirstNameAttribute:
  10298.             type: boolean
  10299.           LastNameAttribute:
  10300.             type: boolean
  10301.           EmailAttribute:
  10302.             type: boolean
  10303.           UsernameAttribute:
  10304.             type: boolean
  10305.           NicknameAttribute:
  10306.             type: boolean
  10307.           IdAttribute:
  10308.             type: boolean
  10309.           PositionAttribute:
  10310.             type: boolean
  10311.           SyncIntervalMinutes:
  10312.             type: boolean
  10313.           SkipCertificateVerification:
  10314.             type: boolean
  10315.           QueryTimeout:
  10316.             type: boolean
  10317.           MaxPageSize:
  10318.             type: boolean
  10319.           LoginFieldName:
  10320.             type: boolean
  10321.       ComplianceSettings:
  10322.         type: object
  10323.         properties:
  10324.           Enable:
  10325.             type: boolean
  10326.           Directory:
  10327.             type: boolean
  10328.           EnableDaily:
  10329.             type: boolean
  10330.       LocalizationSettings:
  10331.         type: object
  10332.         properties:
  10333.           DefaultServerLocale:
  10334.             type: boolean
  10335.           DefaultClientLocale:
  10336.             type: boolean
  10337.           AvailableLocales:
  10338.             type: boolean
  10339.       SamlSettings:
  10340.         type: object
  10341.         properties:
  10342.           Enable:
  10343.             type: boolean
  10344.           Verify:
  10345.             type: boolean
  10346.           Encrypt:
  10347.             type: boolean
  10348.           IdpUrl:
  10349.             type: boolean
  10350.           IdpDescriptorUrl:
  10351.             type: boolean
  10352.           AssertionConsumerServiceURL:
  10353.             type: boolean
  10354.           IdpCertificateFile:
  10355.             type: boolean
  10356.           PublicCertificateFile:
  10357.             type: boolean
  10358.           PrivateKeyFile:
  10359.             type: boolean
  10360.           FirstNameAttribute:
  10361.             type: boolean
  10362.           LastNameAttribute:
  10363.             type: boolean
  10364.           EmailAttribute:
  10365.             type: boolean
  10366.           UsernameAttribute:
  10367.             type: boolean
  10368.           NicknameAttribute:
  10369.             type: boolean
  10370.           LocaleAttribute:
  10371.             type: boolean
  10372.           PositionAttribute:
  10373.             type: boolean
  10374.           LoginButtonText:
  10375.             type: boolean
  10376.       NativeAppSettings:
  10377.         type: object
  10378.         properties:
  10379.           AppDownloadLink:
  10380.             type: boolean
  10381.           AndroidAppDownloadLink:
  10382.             type: boolean
  10383.           IosAppDownloadLink:
  10384.             type: boolean
  10385.       ClusterSettings:
  10386.         type: object
  10387.         properties:
  10388.           Enable:
  10389.             type: boolean
  10390.           InterNodeListenAddress:
  10391.             type: boolean
  10392.           InterNodeUrls:
  10393.             type: boolean
  10394.       MetricsSettings:
  10395.         type: object
  10396.         properties:
  10397.           Enable:
  10398.             type: boolean
  10399.           BlockProfileRate:
  10400.             type: boolean
  10401.           ListenAddress:
  10402.             type: boolean
  10403.       AnalyticsSettings:
  10404.         type: object
  10405.         properties:
  10406.           MaxUsersForStatistics:
  10407.             type: boolean
  10408.       WebrtcSettings:
  10409.         type: object
  10410.         properties:
  10411.           Enable:
  10412.             type: boolean
  10413.           GatewayWebsocketUrl:
  10414.             type: boolean
  10415.           GatewayAdminUrl:
  10416.             type: boolean
  10417.           GatewayAdminSecret:
  10418.             type: boolean
  10419.           StunURI:
  10420.             type: boolean
  10421.           TurnURI:
  10422.             type: boolean
  10423.           TurnUsername:
  10424.             type: boolean
  10425.           TurnSharedKey:
  10426.             type: boolean
  10427.  
  10428.   SamlCertificateStatus:
  10429.     type: object
  10430.     properties:
  10431.       idp_certificate_file:
  10432.         description: Status is good when `true`
  10433.         type: boolean
  10434.       public_certificate_file:
  10435.         description: Status is good when `true`
  10436.         type: boolean
  10437.       private_key_file:
  10438.         description: Status is good when `true`
  10439.         type: boolean
  10440.  
  10441.   Compliance:
  10442.     type: object
  10443.     properties:
  10444.       id:
  10445.         type: string
  10446.       create_at:
  10447.         type: long
  10448.       user_id:
  10449.         type: string
  10450.       status:
  10451.         type: string
  10452.       count:
  10453.         type: integer
  10454.       desc:
  10455.         type: string
  10456.       type:
  10457.         type: string
  10458.       start_at:
  10459.         type: integer
  10460.       end_at:
  10461.         type: integer
  10462.       keywords:
  10463.         type: string
  10464.       emails:
  10465.         type: string
  10466.  
  10467.   ClusterInfo:
  10468.     type: object
  10469.     properties:
  10470.       id:
  10471.         description: The unique ID for the node
  10472.         type: string
  10473.       version:
  10474.         description: The server version the node is on
  10475.         type: string
  10476.       config_hash:
  10477.         description: The hash of the configuartion file the node is using
  10478.         type: string
  10479.       internode_url:
  10480.         description: The URL used to communicate with those node from other nodes
  10481.         type: string
  10482.       hostname:
  10483.         description: The hostname for this node
  10484.         type: string
  10485.       last_ping:
  10486.         description: The time of the last ping to this node
  10487.         type: integer
  10488.       is_alive:
  10489.         description: Whether or not the node is alive and well
  10490.         type: boolean
  10491.  
  10492.   AppError:
  10493.     type: object
  10494.     properties:
  10495.       status_code:
  10496.         type: integer
  10497.       id:
  10498.         type: string
  10499.       message:
  10500.         type: string
  10501.       request_id:
  10502.         type: string
  10503.  
  10504.   Status:
  10505.     type: object
  10506.     properties:
  10507.       user_id:
  10508.         type: string
  10509.       status:
  10510.         type: string
  10511.       manual:
  10512.         type: boolean
  10513.       last_activity_at:
  10514.         type: long
  10515.  
  10516.   OAuthApp:
  10517.     type: object
  10518.     properties:
  10519.       id:
  10520.         type: string
  10521.         description: The client id of the application
  10522.       client_secret:
  10523.         type: string
  10524.         description: The client secret of the application
  10525.       name:
  10526.         type: string
  10527.         description: The name of the client application
  10528.       description:
  10529.         type: string
  10530.         description: A short description of the application
  10531.       icon_url:
  10532.         type: string
  10533.         description: A URL to an icon to display with the application
  10534.       callback_urls:
  10535.         type: array
  10536.         items:
  10537.           type: string
  10538.         description: A list of callback URLs for the appliation
  10539.       homepage:
  10540.         type: string
  10541.         description: A link to the website of the application
  10542.       is_trusted:
  10543.         type: boolean
  10544.         description: Set this to `true` to skip asking users for permission
  10545.       create_at:
  10546.         type: long
  10547.         description: The time of registration for the application
  10548.       update_at:
  10549.         type: long
  10550.         description: The last time of update for the application
  10551.  
  10552.   Job:
  10553.     type: object
  10554.     properties:
  10555.       id:
  10556.         type: string
  10557.         description: The unique id of the job
  10558.       type:
  10559.         type: string
  10560.         description: The type of job
  10561.       create_at:
  10562.         type: long
  10563.         description: The time at which the job was created
  10564.       start_at:
  10565.         type: integer
  10566.         description: The time at which the job was started
  10567.       last_activity_at:
  10568.         type: integer
  10569.         description: The last time at which the job had activity
  10570.       status:
  10571.         type: string
  10572.         description: The status of the job
  10573.       progress:
  10574.         type: integer
  10575.         description: The progress (as a percentage) of the job
  10576.       data:
  10577.         type: object
  10578.         description: A freeform data field containing additional information about the job
  10579.  
  10580.   UserAccessToken:
  10581.     type: object
  10582.     properties:
  10583.       id:
  10584.         type: string
  10585.         description: Unique identifier for the token
  10586.       token:
  10587.         type: string
  10588.         description: The token used for authentication
  10589.       user_id:
  10590.         type: string
  10591.         description: The user the token authenticates for
  10592.       description:
  10593.         type: string
  10594.         description: A description of the token usage
  10595.  
  10596.   UserAccessTokenSanitized:
  10597.     type: object
  10598.     properties:
  10599.       id:
  10600.         type: string
  10601.         description: Unique identifier for the token
  10602.       user_id:
  10603.         type: string
  10604.         description: The user the token authenticates for
  10605.       description:
  10606.         type: string
  10607.         description: A description of the token usage
  10608.       is_active:
  10609.         type: boolean
  10610.         description: Indicates whether the token is active
  10611.  
  10612.   DataRetentionPolicy:
  10613.     type: object
  10614.     properties:
  10615.       message_deletion_enabled:
  10616.         type: boolean
  10617.         description: Indicates whether data retention policy deletion of messages is enabled.
  10618.       file_deletion_enabled:
  10619.         type: boolean
  10620.         description: Indicates whether data retention policy deletion of file attachments is enabled.
  10621.       message_retention_cutoff:
  10622.         type: integer
  10623.         description: The current server timestamp before which messages should be deleted.
  10624.       file_retention_cutoff:
  10625.         type: integer
  10626.         description: The current server timestamp before which files should be deleted.
  10627.  
  10628.   UserNotifyProps:
  10629.     type: object
  10630.     properties:
  10631.       email:
  10632.         type: string
  10633.         description: Set to "true" to enable email notifications, "false" to disable. Defaults to "true".
  10634.       push:
  10635.         type: string
  10636.         description: Set to "all" to receive push notifications for all activity, "mention" for mentions and direct messages only, and "none" to disable. Defaults to "mention".
  10637.       desktop:
  10638.         type: string
  10639.         description: Set to "all" to receive desktop notifications for all activity, "mention" for mentions and direct messages only, and "none" to disable. Defaults to "all".
  10640.       desktop_sound:
  10641.         type: string
  10642.         description: Set to "true" to enable sound on desktop notifications, "false" to disable. Defaults to "true".
  10643.       mention_keys:
  10644.         type: string
  10645.         description: A comma-separated list of words to count as mentions. Defaults to username and @username.
  10646.       channel:
  10647.         type: string
  10648.         description: Set to "true" to enable channel-wide notifications (@channel, @all, etc.), "false" to disable. Defaults to "true".
  10649.       first_name:
  10650.         type: string
  10651.         description: Set to "true" to enable mentions for first name. Defaults to "true" if a first name is set, "false" otherwise.
  10652.  
  10653.   ChannelNotifyProps:
  10654.     type: object
  10655.     properties:
  10656.       email:
  10657.         type: string
  10658.         description: Set to "true" to enable email notifications, "false" to disable, or "default" to use the global user notification setting.
  10659.       push:
  10660.         type: string
  10661.         description: Set to "all" to receive push notifications for all activity, "mention" for mentions and direct messages only, "none" to disable, or "default" to use the global user notification setting.
  10662.       desktop:
  10663.         type: string
  10664.         description: Set to "all" to receive desktop notifications for all activity, "mention" for mentions and direct messages only, "none" to disable, or "default" to use the global user notification setting.
  10665.       mark_unread:
  10666.         type: string
  10667.         description: Set to "all" to mark the channel unread for any new message, "mention" to mark unread for new mentions only. Defaults to "all".
  10668.  
  10669.   PluginManifest:
  10670.     type: object
  10671.     properties:
  10672.       id:
  10673.         type: string
  10674.         description: Globally unique identifier that represents the plugin.
  10675.       name:
  10676.         type: string
  10677.         description: Name of the plugin.
  10678.       description:
  10679.         type: string
  10680.         description: Description of what the plugin is and does.
  10681.       version:
  10682.         type: string
  10683.         description: Version number of the plugin.
  10684.       backend:
  10685.         type: object
  10686.         properties:
  10687.           executable:
  10688.             type: string
  10689.             description: Path to the executable binary.
  10690.       webapp:
  10691.         type: object
  10692.         properties:
  10693.           bundle_path:
  10694.             type: string
  10695.             description: Path to the webapp JavaScript bundle.
  10696.       settings_schema:
  10697.         type: object
  10698.         description: Settings schema used to define the System Console UI for the plugin.
  10699.  
  10700.   PluginManifestWebapp:
  10701.     type: object
  10702.     properties:
  10703.       id:
  10704.         type: string
  10705.         description: Globally unique identifier that represents the plugin.
  10706.       version:
  10707.         type: string
  10708.         description: Version number of the plugin.
  10709.       webapp:
  10710.         type: object
  10711.         properties:
  10712.           bundle_path:
  10713.             type: string
  10714.             description: Path to the webapp JavaScript bundle.
  10715.  
  10716.   Role:
  10717.     type: object
  10718.     properties:
  10719.       id:
  10720.         type: string
  10721.         description: The unique identifier of the role.
  10722.       name:
  10723.         type: string
  10724.         description: The unique name of the role, used when assigning roles to users/groups in contexts.
  10725.       display_name:
  10726.         type: string
  10727.         description: The human readable name for the role.
  10728.       description:
  10729.         type: string
  10730.         description: A human readable description of the role.
  10731.       permissions:
  10732.         type: array
  10733.         items:
  10734.           type: string
  10735.         description: A list of the unique names of the permissions this role grants.
  10736.       scheme_managed:
  10737.         type: boolean
  10738.         description: indicates if this role is managed by a scheme (true), or is a custom stand-alone role (false).
  10739.  
  10740.   Scheme:
  10741.     type: object
  10742.     properties:
  10743.       id:
  10744.         type: string
  10745.         description: The unique identifier of the scheme.
  10746.       name:
  10747.         type: string
  10748.         description: The human readable name for the scheme.
  10749.       description:
  10750.         type: string
  10751.         description: A human readable description of the scheme.
  10752.       create_at:
  10753.         type: long
  10754.         description: The time at which the scheme was created.
  10755.       update_at:
  10756.         type: long
  10757.         description: The time at which the scheme was last updated.
  10758.       delete_at:
  10759.         type: integer
  10760.         description: The time at which the scheme was deleted.
  10761.       scope:
  10762.         type: string
  10763.         description: The scope to which this scheme can be applied, either "team" or "channel".
  10764.       default_team_admin_role:
  10765.         type: string
  10766.         description: The id of the default team admin role for this scheme.
  10767.       default_team_user_role:
  10768.         type: string
  10769.         description: The id of the default team user role for this scheme.
  10770.       default_channel_admin_role:
  10771.         type: string
  10772.         description: The id of the default channel admin role for this scheme.
  10773.       default_channel_user_role:
  10774.         type: string
  10775.         description: The id of the default channel user role for this scheme.
  10776.  
  10777. externalDocs:
  10778.   description: Find out more about Mattermost
  10779.   url: 'https://about.mattermost.com'
Add Comment
Please, Sign In to add comment