diff --git a/api/redoc-static.html b/api/redoc-static.html deleted file mode 100644 index 0c6b2011e8..0000000000 --- a/api/redoc-static.html +++ /dev/null @@ -1,4362 +0,0 @@ - - - -
- -Download OpenAPI specification:Download
There is also a work-in-progress Postman API reference.
-The Mattermost Web Services API is used by Mattermost clients and third party applications to interact with the server. JavaScript and Golang drivers for connecting to the APIs are also available.
-Mattermost core committers work with the community to keep the API documentation up-to-date.
-If you have questions on API routes not listed in this reference, please join the Mattermost community server to ask questions in the Developers channel, or post questions to our Developer Discussion forum.
-Bug reports in the documentation or the API are also welcome, as are pull requests to fix the issues.
-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 and larger changes are all welcome.
-We also have Help Wanted tickets 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.
-The source code for this API reference is hosted at https://github.com/mattermost/mattermost-api-reference.
-All API access is through HTTP(S) requests at your-mattermost-url.com/api/v4
. All request and response bodies are application/json
.
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.
Since Mattermost 4.6 released on January 16, 2018, API v3 has no longer been supported and it will be removed in Mattermost Server v5.0 on June 16, 2018. Follow these simple steps to migrate your integrations and apps to API v4. Otherwise your integrations may break once you upgrade to Mattermost 5.0
-DEBUG
in System Console > General > Logging > File Log Level to print detailed logs for API requests./api/v3/
endpoints. Any requests hitting these endpoints are from integrations that should be migrated to API v4.DEBUG
. Confirm no requests hit /api/v3/
endpoints.false
in System Console > General > Configuration, or set EnableAPIv3
to false
in config.json
. This setting disables API v3 on your server. Any time a v3 endpoint is used, an error is logged in System Console > Logs.ERROR
. Use the error logs to help track down any remaining uses of API v3.Below are the major changes made between v3 and v4:
-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 and ask questions in the APIv4 channel.
-The easiest way to interact with the Mattermost Web Service API is through a language specific driver.
-For other community-built drivers and API wrappers, see our app directory.
-There are multiple ways to authenticate against the Mattermost API.
-All examples assume there is a Mattermost instance running at http://localhost:8065.
-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.
curl -i -d '{"login_id":"someone@nowhere.com","password":"thisisabadpassword"}' http://localhost:8065/api/v4/users/login
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:
-curl -i -d "{\"login_id\":\"someone@nowhere.com\",\"password\":\"thisisabadpassword\"}" http://localhost:8065/api/v4/users/login
If successful, the response will contain a Token
header and a user object in the body.
HTTP/1.1 200 OK
-Set-Cookie: MMSID=hyr5dmb1mbb49c44qmx4whniso; Path=/; Max-Age=2592000; HttpOnly
-Token: hyr5dmb1mbb49c44qmx4whniso
-X-Ratelimit-Limit: 10
-X-Ratelimit-Remaining: 9
-X-Ratelimit-Reset: 1
-X-Request-Id: smda55ckcfy89b6tia58shk5fh
-X-Version-Id: developer
-Date: Fri, 11 Sep 2015 13:21:14 GMT
-Content-Length: 657
-Content-Type: application/json; charset=utf-8
-
-{{user object as json}}
Include the Token
as part of the Authorization
header on your future API requests with the Bearer
method.
curl -i -H 'Authorization: Bearer hyr5dmb1mbb49c44qmx4whniso' http://localhost:8065/api/v4/users/me
You should now be able to access the API as the user you logged in as.
-Using personal access tokens 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.
-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.
curl -i -H 'Authorization: Bearer 9xuqwrwgstrb3mzrxb83nb357a' http://localhost:8065/api/v4/users/me
Mattermost has the ability to act as an OAuth 2.0 service provider.
-The official documentation for using your Mattermost server as an OAuth 2.0 service provider can be found here.
-For an example on how to register an OAuth 2.0 app with your Mattermost instance, please see the Mattermost-Zapier integration documentation.
-All errors will return an appropriate HTTP response code along with the following JSON body:
-{
- "id": "the.error.id",
- "message": "Something went wrong", // the reason for the error
- "request_id": "", // the ID of the request
- "status_code": 0, // the HTTP status code
- "is_oauth": false // whether the error is OAuth specific
-}
Whenever you make an HTTP request to the Mattermost API you might notice the following headers included in the response:
-X-Ratelimit-Limit: 10
-X-Ratelimit-Remaining: 9
-X-Ratelimit-Reset: 1441983590
These headers are telling you your current rate limit status.
-Header | -Description | -
---|---|
X-Ratelimit-Limit | -The maximum number of requests you can make per second. | -
X-Ratelimit-Remaining | -The number of requests remaining in the current window. | -
X-Ratelimit-Reset | -The remaining UTC epoch seconds before the rate limit resets. | -
If you exceed your rate limit for a window you will receive the following error in the body of the response:
-HTTP/1.1 429 Too Many Requests
-Date: Tue, 10 Sep 2015 11:20:28 GMT
-X-RateLimit-Limit: 10
-X-RateLimit-Remaining: 0
-X-RateLimit-Reset: 1
-
-limit exceeded
In addition to the HTTP RESTful web service, Mattermost also offers a WebSocket event delivery system and some API functionality.
-To connect to the WebSocket follow the standard opening handshake as defined by the RFC specification to the /api/v4/websocket
endpoint of Mattermost.
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.
-To authenticate with an authentication challenge, first connect the WebSocket and then send the following JSON over the connection:
-{
- "seq": 1,
- "action": "authentication_challenge",
- "data": {
- "token": "mattermosttokengoeshere"
- }
-}
If successful, you will receive a standard OK response over the WebSocket connection:
-{
- "status": "OK",
- "seq_reply": 1
-}
Once successfully authenticated, the server will pass a hello
WebSocket event containing server version over the connection.
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.
-Events on the WebSocket will have the form:
-{
- "event": "hello",
- "data": {
- "server_version": "3.6.0.1451.1c38da627ebb4e3635677db6939e9195"
- },
- "broadcast":{
- "omit_users": null,
- "user_id": "ay5sq51sebfh58ktrce5ijtcwy",
- "channel_id": "",
- "team_id": ""
- },
- "seq": 0
-}
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.
The list of Mattermost WebSocket events are:
-Mattermost has some basic support for WebSocket APIs. A connected WebSocket can make requests by sending the following over the connection:
-{
- "action": "user_typing",
- "seq": 2,
- "data": {
- "channel_id": "nhze199c4j87ped4wannrjdt9c",
- "parent_id": ""
- }
-}
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.
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:
{
- "status": "OK",
- "seq_reply": 2
-}
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.
If there was any information to respond with, it would be encapsulated in a data
field.
In the case of an error, the response would be:
-{
- "status": "FAIL",
- "seq_reply": 2,
- "error": {
- "id": "some.error.id.here",
- "message": "Some error message here"
- }
-}
The list of WebSocket API actions is:
-To see how these actions work, please refer to either the Golang WebSocket driver or our JavaScript WebSocket driver.
-Endpoints for creating, getting and interacting with users.
-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.
Create a new user on the system. Password is required for email login. For other authentication types such as LDAP or SAML, auth_data and auth_service fields are required.
-No permission required but user creation can be controlled by server configuration.
-t | string Token id from an email invitation - |
iid | string Token id from an invitation link - |
User object to be created
-email required | string |
username required | string |
first_name | string |
last_name | string |
nickname | string |
auth_data | string Service-specific authentication data, such as email address. - |
auth_service | string The authentication service, one of "email", "gitlab", "ldap", "saml", "office365", "google", and "". - |
password | string The password used for email authentication. - |
locale | string |
props | object |
notify_props | object (UserNotifyProps) |
User creation successful
-Invalid or missing parameters in URL or request body
-Do not have appropriate permissions
-{- "email": "string",
- "username": "string",
- "first_name": "string",
- "last_name": "string",
- "nickname": "string",
- "auth_data": "string",
- "auth_service": "string",
- "password": "string",
- "locale": "string",
- "props": { },
- "notify_props": {
- "email": true,
- "push": "string",
- "desktop": "string",
- "desktop_sound": true,
- "mention_keys": "string",
- "channel": true,
- "first_name": true
}
}
{- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "username": "string",
- "first_name": "string",
- "last_name": "string",
- "nickname": "string",
- "email": "string",
- "email_verified": true,
- "auth_service": "string",
- "roles": "string",
- "locale": "string",
- "notify_props": {
- "email": true,
- "push": "string",
- "desktop": "string",
- "desktop_sound": true,
- "mention_keys": "string",
- "channel": true,
- "first_name": true
}, - "props": { },
- "last_password_update": 0,
- "last_picture_update": 0,
- "failed_attempts": 0,
- "mfa_active": true,
- "timezone": {
- "useAutomaticTimezone": true,
- "manualTimezone": "string",
- "automaticTimezone": "string"
}, - "terms_of_service_id": "string",
- "terms_of_service_create_at": 0
}
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.
-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.
Requires an active session and (if specified) membership to the channel or team being selected from.
-page | integer Default: 0 The page to select. - |
per_page | integer Default: 60 The number of users per page. There is a maximum limit of 200 users per page. - |
in_team | string The ID of the team to get users for. - |
not_in_team | string The ID of the team to exclude users for. Must not be used with "in_team" query parameter. - |
in_channel | string The ID of the channel to get users for. - |
not_in_channel | string The ID of the channel to exclude users for. Must be used with "in_channel" query parameter. - |
group_constrained | boolean When used with |
without_team | boolean Whether or not to list users that are not on any team. This option takes precendence over |
sort | string Sort is only available in conjunction with certain options below. The paging parameter is also always available. -
- |
User page retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - - -// page, perPage, etag -users := Client.GetUsers(0, 60, "") -users = Client.GetUsersInChannel("channelid", 0, 60, "") -users = Client.GetUsersNotInChannel("teamid", "channelid", 0, 60, "") -users = Client.GetUsersInTeam("teamid", 0, 60, "") -users = Client.GetUsersNotInTeam("teamid", 0, 60, "") -users = Client.GetUsersWithoutTeam(0, 60, "") -
[- {
- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "username": "string",
- "first_name": "string",
- "last_name": "string",
- "nickname": "string",
- "email": "string",
- "email_verified": true,
- "auth_service": "string",
- "roles": "string",
- "locale": "string",
- "notify_props": {
- "email": true,
- "push": "string",
- "desktop": "string",
- "desktop_sound": true,
- "mention_keys": "string",
- "channel": true,
- "first_name": true
}, - "props": { },
- "last_password_update": 0,
- "last_picture_update": 0,
- "failed_attempts": 0,
- "mfa_active": true,
- "timezone": {
- "useAutomaticTimezone": true,
- "manualTimezone": "string",
- "automaticTimezone": "string"
}, - "terms_of_service_id": "string",
- "terms_of_service_create_at": 0
}
]
Get a list of users based on a provided list of user ids.
-Requires an active session but no other permissions.
-since | integer Only return users that have been modified since the given Unix timestamp (in milliseconds). -Minimum server version: 5.14 - |
List of user ids
-User list retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-[- "string"
]
[- {
- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "username": "string",
- "first_name": "string",
- "last_name": "string",
- "nickname": "string",
- "email": "string",
- "email_verified": true,
- "auth_service": "string",
- "roles": "string",
- "locale": "string",
- "notify_props": {
- "email": true,
- "push": "string",
- "desktop": "string",
- "desktop_sound": true,
- "mention_keys": "string",
- "channel": true,
- "first_name": true
}, - "props": { },
- "last_password_update": 0,
- "last_picture_update": 0,
- "failed_attempts": 0,
- "mfa_active": true,
- "timezone": {
- "useAutomaticTimezone": true,
- "manualTimezone": "string",
- "automaticTimezone": "string"
}, - "terms_of_service_id": "string",
- "terms_of_service_create_at": 0
}
]
Get an object containing a key per group channel id in the -query and its value as a list of users members of that group -channel.
-The user must be a member of the group ids in the query, or -they will be omitted from the response.
-Requires an active session but no other permissions.
-Minimum server version: 5.14
-List of group channel ids
-User list retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-[- "string"
]
{- "<CHANNEL_ID>": [
- {
- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "username": "string",
- "first_name": "string",
- "last_name": "string",
- "nickname": "string",
- "email": "string",
- "email_verified": true,
- "auth_service": "string",
- "roles": "string",
- "locale": "string",
- "notify_props": {
- "email": true,
- "push": "string",
- "desktop": "string",
- "desktop_sound": true,
- "mention_keys": "string",
- "channel": true,
- "first_name": true
}, - "props": { },
- "last_password_update": 0,
- "last_picture_update": 0,
- "failed_attempts": 0,
- "mfa_active": true,
- "timezone": {
- "useAutomaticTimezone": true,
- "manualTimezone": "string",
- "automaticTimezone": "string"
}, - "terms_of_service_id": "string",
- "terms_of_service_create_at": 0
}
]
}
Get a list of users based on a provided list of usernames.
-Requires an active session but no other permissions.
-List of usernames
-User list retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-[- "string"
]
[- {
- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "username": "string",
- "first_name": "string",
- "last_name": "string",
- "nickname": "string",
- "email": "string",
- "email_verified": true,
- "auth_service": "string",
- "roles": "string",
- "locale": "string",
- "notify_props": {
- "email": true,
- "push": "string",
- "desktop": "string",
- "desktop_sound": true,
- "mention_keys": "string",
- "channel": true,
- "first_name": true
}, - "props": { },
- "last_password_update": 0,
- "last_picture_update": 0,
- "failed_attempts": 0,
- "mfa_active": true,
- "timezone": {
- "useAutomaticTimezone": true,
- "manualTimezone": "string",
- "automaticTimezone": "string"
}, - "terms_of_service_id": "string",
- "terms_of_service_create_at": 0
}
]
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.
-Requires an active session and read_channel
and/or view_team
permissions for any channels or teams specified in the request body.
Search criteria
-term required | string The term to match against username, full name, nickname and email - |
team_id | string If provided, only search users on this team - |
not_in_team_id | string If provided, only search users not on this team - |
in_channel_id | string If provided, only search users in this channel - |
not_in_channel_id | string If provided, only search users not in this channel. Must specifiy |
group_constrained | boolean When used with |
allow_inactive | boolean When |
without_team | boolean Set this to |
limit | integer Default: 100 The maximum number of users to return in the results -Available as of server version 5.6. Defaults to |
User list retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "term": "string",
- "team_id": "string",
- "not_in_team_id": "string",
- "in_channel_id": "string",
- "not_in_channel_id": "string",
- "group_constrained": true,
- "allow_inactive": true,
- "without_team": true,
- "limit": 100
}
[- {
- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "username": "string",
- "first_name": "string",
- "last_name": "string",
- "nickname": "string",
- "email": "string",
- "email_verified": true,
- "auth_service": "string",
- "roles": "string",
- "locale": "string",
- "notify_props": {
- "email": true,
- "push": "string",
- "desktop": "string",
- "desktop_sound": true,
- "mention_keys": "string",
- "channel": true,
- "first_name": true
}, - "props": { },
- "last_password_update": 0,
- "last_picture_update": 0,
- "failed_attempts": 0,
- "mfa_active": true,
- "timezone": {
- "useAutomaticTimezone": true,
- "manualTimezone": "string",
- "automaticTimezone": "string"
}, - "terms_of_service_id": "string",
- "terms_of_service_create_at": 0
}
]
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.
Requires an active session and view_team
and read_channel
on any teams or channels used to filter the results further.
team_id | string Team ID - |
channel_id | string Channel ID - |
name required | string Username, nickname first name or last name - |
limit | integer Default: 100 The maximum number of users to return in each subresult -Available as of server version 5.6. Defaults to |
User autocomplete successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -teamID := "4xp9fdt77pncbef59f4k1qe83o" -channelID := "Ej3SKOHlWIKAblkUTK5Xvkj2cm" -username := "testUsername" - -users, resp := Client.AutocompleteUsersInChannel(teamID, channelID, username, 100, "") -
{- "users": [
- {
- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "username": "string",
- "first_name": "string",
- "last_name": "string",
- "nickname": "string",
- "email": "string",
- "email_verified": true,
- "auth_service": "string",
- "roles": "string",
- "locale": "string",
- "notify_props": {
- "email": true,
- "push": "string",
- "desktop": "string",
- "desktop_sound": true,
- "mention_keys": "string",
- "channel": true,
- "first_name": true
}, - "props": { },
- "last_password_update": 0,
- "last_picture_update": 0,
- "failed_attempts": 0,
- "mfa_active": true,
- "timezone": {
- "useAutomaticTimezone": true,
- "manualTimezone": "string",
- "automaticTimezone": "string"
}, - "terms_of_service_id": "string",
- "terms_of_service_create_at": 0
}
], - "out_of_channel": [
- {
- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "username": "string",
- "first_name": "string",
- "last_name": "string",
- "nickname": "string",
- "email": "string",
- "email_verified": true,
- "auth_service": "string",
- "roles": "string",
- "locale": "string",
- "notify_props": {
- "email": true,
- "push": "string",
- "desktop": "string",
- "desktop_sound": true,
- "mention_keys": "string",
- "channel": true,
- "first_name": true
}, - "props": { },
- "last_password_update": 0,
- "last_picture_update": 0,
- "failed_attempts": 0,
- "mfa_active": true,
- "timezone": {
- "useAutomaticTimezone": true,
- "manualTimezone": "string",
- "automaticTimezone": "string"
}, - "terms_of_service_id": "string",
- "terms_of_service_create_at": 0
}
]
}
Get a total count of users in the system.
-Must be authenticated.
-User stats retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -stats, resp := Client.GetTotalUsersStats("") -
{- "total_users_count": 0
}
Get a user a object. Sensitive information will be sanitized out.
-Requires an active session but no other permissions.
-user_id required | string User GUID - |
User retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Resource not found
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -userID := "4xp9fdt77pncbef59f4k1qe83o" - -user, resp := Client.GetUser(userID, "") -
{- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "username": "string",
- "first_name": "string",
- "last_name": "string",
- "nickname": "string",
- "email": "string",
- "email_verified": true,
- "auth_service": "string",
- "roles": "string",
- "locale": "string",
- "notify_props": {
- "email": true,
- "push": "string",
- "desktop": "string",
- "desktop_sound": true,
- "mention_keys": "string",
- "channel": true,
- "first_name": true
}, - "props": { },
- "last_password_update": 0,
- "last_picture_update": 0,
- "failed_attempts": 0,
- "mfa_active": true,
- "timezone": {
- "useAutomaticTimezone": true,
- "manualTimezone": "string",
- "automaticTimezone": "string"
}, - "terms_of_service_id": "string",
- "terms_of_service_create_at": 0
}
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. Any fields not included in the request body will be set to null or reverted to default values.
-Must be logged in as the user being updated or have the edit_other_users
permission.
user_id required | string User GUID - |
User object that is to be updated
-id required | string |
string | |
username | string |
first_name | string |
last_name | string |
nickname | string |
locale | string |
position | string |
props | object |
notify_props | object (UserNotifyProps) |
User update successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "id": "string",
- "email": "string",
- "username": "string",
- "first_name": "string",
- "last_name": "string",
- "nickname": "string",
- "locale": "string",
- "position": "string",
- "props": { },
- "notify_props": {
- "email": true,
- "push": "string",
- "desktop": "string",
- "desktop_sound": true,
- "mention_keys": "string",
- "channel": true,
- "first_name": true
}
}
{- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "username": "string",
- "first_name": "string",
- "last_name": "string",
- "nickname": "string",
- "email": "string",
- "email_verified": true,
- "auth_service": "string",
- "roles": "string",
- "locale": "string",
- "notify_props": {
- "email": true,
- "push": "string",
- "desktop": "string",
- "desktop_sound": true,
- "mention_keys": "string",
- "channel": true,
- "first_name": true
}, - "props": { },
- "last_password_update": 0,
- "last_picture_update": 0,
- "failed_attempts": 0,
- "mfa_active": true,
- "timezone": {
- "useAutomaticTimezone": true,
- "manualTimezone": "string",
- "automaticTimezone": "string"
}, - "terms_of_service_id": "string",
- "terms_of_service_create_at": 0
}
Deactivates the user and revokes all its sessions by archiving its user object.
-Must be logged in as the user being deactivated or have the edit_other_users
permission.
user_id required | string User GUID - |
User deactivation successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -userID := "4xp9fdt77pncbef59f4k1qe83o" - -ok, resp := Client.DeleteUser(userID) -
{- "status": "string"
}
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.
-Must be logged in as the user being updated or have the edit_other_users
permission.
user_id required | string User GUID - |
User object that is to be updated
-string | |
username | string |
first_name | string |
last_name | string |
nickname | string |
locale | string |
position | string |
props | object |
notify_props | object (UserNotifyProps) |
User patch successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "email": "string",
- "username": "string",
- "first_name": "string",
- "last_name": "string",
- "nickname": "string",
- "locale": "string",
- "position": "string",
- "props": { },
- "notify_props": {
- "email": true,
- "push": "string",
- "desktop": "string",
- "desktop_sound": true,
- "mention_keys": "string",
- "channel": true,
- "first_name": true
}
}
{- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "username": "string",
- "first_name": "string",
- "last_name": "string",
- "nickname": "string",
- "email": "string",
- "email_verified": true,
- "auth_service": "string",
- "roles": "string",
- "locale": "string",
- "notify_props": {
- "email": true,
- "push": "string",
- "desktop": "string",
- "desktop_sound": true,
- "mention_keys": "string",
- "channel": true,
- "first_name": true
}, - "props": { },
- "last_password_update": 0,
- "last_picture_update": 0,
- "failed_attempts": 0,
- "mfa_active": true,
- "timezone": {
- "useAutomaticTimezone": true,
- "manualTimezone": "string",
- "automaticTimezone": "string"
}, - "terms_of_service_id": "string",
- "terms_of_service_create_at": 0
}
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.
-Must have the manage_roles
permission.
user_id required | string User GUID - |
Space-delimited system roles to assign to the user
-roles required | string |
User roles update successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "roles": "string"
}
{- "status": "string"
}
Update user active or inactive status.
-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.
-User can deactivate themselves.
-User with manage_system
permission can activate or deactivate a user.
user_id required | string User GUID - |
Use true
to set the user active, false
for inactive
active required | boolean |
User active status update successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "active": true
}
{- "status": "string"
}
Get a user's profile image based on user_id string parameter.
-Must be logged in.
-user_id required | string User GUID - |
User's profile image
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-Feature is disabled
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -userID := "4xp9fdt77pncbef59f4k1qe83o" - -data, resp := Client.GetProfileImage(userID, "") -
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Set a user's profile image based on user_id string parameter.
-Must be logged in as the user being updated or have the edit_other_users
permission.
user_id required | string User GUID - |
image required | string <binary> The image to be uploaded - |
Profile image set successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-Feature is disabled
-import ( - "io/ioutil" - "log" - - "github.com/mattermost/mattermost-server/model" -) - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -data, err := ioutil.ReadFile("profile_pic.png") -if err != nil { - log.Fatal(err) -} - -userID := "4xp9fdt77pncbef59f4k1qe83o" - -ok, resp := Client.SetProfileImage(userID, data) -
{- "status": "string"
}
Delete user's profile image and reset to default image based on user_id string parameter.
-Must be logged in as the user being updated or have the edit_other_users
permission.
-Minimum server version: 5.5
user_id required | string User GUID - |
Profile image reset successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-Feature is disabled
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -userID := "4xp9fdt77pncbef59f4k1qe83o" - -// Deleting user's profile image consists on resetting it to default one -ok, resp := Client.SetDefaultProfileImage(userID) -
{- "status": "string"
}
Returns the default (generated) user profile image based on user_id string parameter.
-Must be logged in. -Minimum server version: 5.5
-user_id required | string User GUID - |
Default profile image
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-Feature is disabled
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -userID := "4xp9fdt77pncbef59f4k1qe83o" - -ok, resp := Client.SetDefaultProfileImage(userID) -
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Get a user object by providing a username. Sensitive information will be sanitized out.
-Requires an active session but no other permissions.
-username required | string Username - |
User retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Resource not found
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -userID := "4xp9fdt77pncbef59f4k1qe83o" - -user, resp := Client.GetUserByUsername(userID, "") -
{- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "username": "string",
- "first_name": "string",
- "last_name": "string",
- "nickname": "string",
- "email": "string",
- "email_verified": true,
- "auth_service": "string",
- "roles": "string",
- "locale": "string",
- "notify_props": {
- "email": true,
- "push": "string",
- "desktop": "string",
- "desktop_sound": true,
- "mention_keys": "string",
- "channel": true,
- "first_name": true
}, - "props": { },
- "last_password_update": 0,
- "last_picture_update": 0,
- "failed_attempts": 0,
- "mfa_active": true,
- "timezone": {
- "useAutomaticTimezone": true,
- "manualTimezone": "string",
- "automaticTimezone": "string"
}, - "terms_of_service_id": "string",
- "terms_of_service_create_at": 0
}
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.
-No permissions required.
-code required | string The recovery code - |
new_password required | string The new password for the user - |
User password update successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "code": "string",
- "new_password": "string"
}
{- "status": "string"
}
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.
Must be logged in as the user being updated or have the edit_other_users
permission.
user_id required | string User GUID - |
activate required | boolean Use |
code | string The code produced by your MFA client. Required if |
User MFA update successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-{- "activate": true,
- "code": "string"
}
{- "status": "string"
}
Generates an multi-factor authentication secret for a user and returns it as a string and as base64 encoded QR code image.
-Must be logged in as the user or have the edit_other_users
permission.
user_id required | string User GUID - |
MFA secret generation successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-Feature is disabled
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -userID := "BbaYBYDV5IDOZFiJGBSzkw1k5u" - -mfaSecret, resp = Client.GenerateMfaSecret(userID) -
{- "secret": "string",
- "qr_code": "string"
}
Convert a regular user into a guest. This will convert the user into a -guest for the whole system while retaining their existing team and -channel memberships.
-Minimum server version: 5.16
-Must be logged in as the user or have the demote_to_guest
permission.
user_id required | string User GUID - |
User successfully demoted
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-Feature is disabled
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -userID := "BbaYBYDV5IDOZFiJGBSzkw1k5u" - -ok, resp = Client.demoteUserToGuest(userID) -
{- "status": "string"
}
Convert a guest into a regular user. This will convert the guest into a -user for the whole system while retaining any team and channel -memberships and automatically joining them to the default channels.
-Minimum server version: 5.16
-Must be logged in as the user or have the promote_guest
permission.
user_id required | string User GUID - |
Guest successfully promoted
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-Feature is disabled
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -userID := "BbaYBYDV5IDOZFiJGBSzkw1k5u" - -ok, resp = Client.PromoteGuestToUser(userID) -
{- "status": "string"
}
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.
-No permission required.
-login_id required | string The email or username used to login - |
MFA check successful
-Invalid or missing parameters in URL or request body
-{- "login_id": "string"
}
{- "mfa_required": true
}
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.
-Must be logged in as the user the password is being changed for or have manage_system
permission.
user_id required | string User GUID - |
current_password | string The current password for the user - |
new_password required | string The new password for the user - |
User password update successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "current_password": "string",
- "new_password": "string"
}
{- "status": "string"
}
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.
-No permissions required.
-email required | string The email of the user - |
Email sent if account exists
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "email": "string"
}
{- "status": "string"
}
Get a user object by providing a user email. Sensitive information will be sanitized out.
-Requires an active session and for the current session to be able to view another user's email based on the server's privacy settings.
-email required | string User Email - |
User retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -email := "test@domain.com" - -user, resp := Client.GetUserByEmail(email, "") -
{- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "username": "string",
- "first_name": "string",
- "last_name": "string",
- "nickname": "string",
- "email": "string",
- "email_verified": true,
- "auth_service": "string",
- "roles": "string",
- "locale": "string",
- "notify_props": {
- "email": true,
- "push": "string",
- "desktop": "string",
- "desktop_sound": true,
- "mention_keys": "string",
- "channel": true,
- "first_name": true
}, - "props": { },
- "last_password_update": 0,
- "last_picture_update": 0,
- "failed_attempts": 0,
- "mfa_active": true,
- "timezone": {
- "useAutomaticTimezone": true,
- "manualTimezone": "string",
- "automaticTimezone": "string"
}, - "terms_of_service_id": "string",
- "terms_of_service_create_at": 0
}
Get a list of sessions by providing the user GUID. Sensitive information will be sanitized out.
-Must be logged in as the user being updated or have the edit_other_users
permission.
user_id required | string User GUID - |
User session retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -userID := "zWEyrTZ7GZ22aBSfoX60iWryTY" - -sessions, resp := Client.GetSessions(userID, "") -
[- {
- "create_at": 0,
- "device_id": "string",
- "expires_at": 0,
- "id": "string",
- "is_oauth": true,
- "last_activity_at": 0,
- "props": { },
- "roles": "string",
- "team_members": [
- {
- "team_id": "string",
- "user_id": "string",
- "roles": "string",
- "delete_at": 0,
- "scheme_user": true,
- "scheme_admin": true,
- "explicit_roles": "string"
}
], - "token": "string",
- "user_id": "string"
}
]
Revokes a user session from the provided user id and session id strings.
-Must be logged in as the user being updated or have the edit_other_users
permission.
user_id required | string User GUID - |
session_id required | string The session GUID to revoke. - |
User session revoked successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "session_id": "string"
}
{- "status": "string"
}
Revokes all user sessions from the provided user id and session id strings.
-Must be logged in as the user being updated or have the edit_other_users
permission.
-Minimum server version: 4.4
user_id required | string User GUID - |
User sessions revoked successfully
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -userID := "zWEyrTZ7GZ22aBSfoX60iWryTY" - -ok, resp := Client.RevokeAllSessions(userID) -
{- "status": "string"
}
Attach a mobile device id to the currently logged in session. This will enable push notifications for a user, if configured by the server.
-Must be authenticated.
-device_id required | string Mobile device id. For Android prefix the id with |
Device id attach successful
-Invalid or missing parameters in URL or request body
-No access token provided
-{- "device_id": "string"
}
{- "status": "string"
}
Get a list of audit by providing the user GUID.
-Must be logged in as the user or have the edit_other_users
permission.
user_id required | string User GUID - |
User audits retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -userID := "zWEyrTZ7GZ22aBSfoX60iWryTY" - -audits, resp := Client.GetUserAudits(userID, 0, 100, "") -
[- {
- "id": "string",
- "create_at": 0,
- "user_id": "string",
- "action": "string",
- "extra_info": "string",
- "ip_address": "string",
- "session_id": "string"
}
]
Verify the email used by a user to sign-up their account with.
-No permissions required.
-token required | string The token given to validate the email - |
User email verification successful
-Invalid or missing parameters in URL or request body
-{- "token": "string"
}
{- "status": "string"
}
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.
-No permissions required.
-email required | string Email of a user - |
Email send successful if email exists
-Invalid or missing parameters in URL or request body
-{- "email": "string"
}
{- "status": "string"
}
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.
-To switch from email to OAuth2/SAML, specify current_service
, new_service
, email
and password
.
To switch from OAuth2/SAML to email, specify current_service
, new_service
, email
and new_password
.
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).
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
.
Additionally, specify mfa_code
when trying to switch an account on LDAP/AD or email that has MFA activated.
No current authentication required except when switching from OAuth2/SAML to email.
-current_service required | string The service the user currently uses to login - |
new_service required | string The service the user will use to login - |
string The email of the user - | |
password | string The password used with the current service - |
mfa_code | string The MFA code of the current service - |
ldap_id | string The LDAP/AD id of the user - |
Login method switch or request successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-Feature is disabled
-{- "current_service": "string",
- "new_service": "string",
- "email": "string",
- "password": "string",
- "mfa_code": "string",
- "ldap_id": "string"
}
{- "follow_link": "string"
}
Generate a user access token that can be used to authenticate with the Mattermost REST API.
-Minimum server version: 4.1
-Must have create_user_access_token
permission. For non-self requests, must also have the edit_other_users
permission.
user_id required | string User GUID - |
description required | string A description of the token usage - |
User access token creation successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "description": "string"
}
{- "id": "string",
- "token": "string",
- "user_id": "string",
- "description": "string"
}
Get a list of user access tokens for a user. Does not include the actual authentication tokens. Use query parameters for paging.
-Minimum server version: 4.1
-Must have read_user_access_token
permission. For non-self requests, must also have the edit_other_users
permission.
user_id required | string User GUID - |
page | integer Default: 0 The page to select. - |
per_page | integer Default: 60 The number of tokens per page. - |
User access tokens retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -userID := "adWv1qPZmHdtxk7Lmqh6RtxWxS" - -tokens, resp := Client.GetUserAccessTokensForUser(userID, 0, 100) -
[- {
- "id": "string",
- "user_id": "string",
- "description": "string",
- "is_active": true
}
]
Get a page of user access tokens for users on the system. Does not include the actual authentication tokens. Use query parameters for paging.
-Minimum server version: 4.7
-Must have manage_system
permission.
page | integer Default: 0 The page to select. - |
per_page | integer Default: 60 The number of tokens per page. - |
User access tokens retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -tokens, resp := Client.GetUserAccessTokens(0, 100) -
[- {
- "id": "string",
- "user_id": "string",
- "description": "string",
- "is_active": true
}
]
Revoke a user access token and delete any sessions using the token.
-Minimum server version: 4.1
-Must have revoke_user_access_token
permission. For non-self requests, must also have the edit_other_users
permission.
token_id required | string The user access token GUID to revoke - |
User access token revoke successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "token_id": "string"
}
{- "status": "string"
}
Get a user access token. Does not include the actual authentication token.
-Minimum server version: 4.1
-Must have read_user_access_token
permission. For non-self requests, must also have the edit_other_users
permission.
token_id required | string User access token GUID - |
User access token retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -tokenID := "adWv1qPZmHdtxk7Lmqh6RtxWxS" - -token, resp := Client.GetUserAccessToken(tokenID) -
{- "id": "string",
- "user_id": "string",
- "description": "string",
- "is_active": true
}
Disable a personal access token and delete any sessions using the token. The token can be re-enabled using /users/tokens/enable
.
Minimum server version: 4.4
-Must have revoke_user_access_token
permission. For non-self requests, must also have the edit_other_users
permission.
token_id required | string The personal access token GUID to disable - |
Personal access token disable successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "token_id": "string"
}
{- "status": "string"
}
Re-enable a personal access token that has been disabled.
-Minimum server version: 4.4
-Must have create_user_access_token
permission. For non-self requests, must also have the edit_other_users
permission.
token_id required | string The personal access token GUID to enable - |
Personal access token enable successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "token_id": "string"
}
{- "status": "string"
}
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.
-Minimum server version: 4.7
-Must have manage_system
permission.
Search criteria
-term required | string The search term to match against the token id, user id or username. - |
Personal access token search successful
-{- "term": "string"
}
[- {
- "id": "string",
- "user_id": "string",
- "description": "string",
- "is_active": true
}
]
Updates a user's authentication method. This can be used to change them to/from LDAP authentication for example.
-Minimum server version: 4.6
-Must have the edit_other_users
permission.
user_id required | string User GUID - |
auth_data | string Service-specific authentication data - |
auth_service | string The authentication service such as "email", "gitlab", or "ldap" - |
password | string The password used for email authentication - |
User auth update successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-{- "auth_data": "string",
- "auth_service": "string",
- "password": "string"
}
{- "auth_data": "string",
- "auth_service": "string",
- "password": "string"
}
Records user action when they accept or decline custom terms of service. Records the action in audit table. -Updates user's last accepted terms of service ID if they accepted it.
-Minimum server version: 5.4
-Must be logged in as the user being acted on.
-user_id required | string User GUID - |
terms of service details
-serviceTermsId required | string terms of service ID on which the user is acting on - |
accepted required | string true or false, indicates whether the user accepted or rejected the terms of service. - |
Terms of service action recorded successfully
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "serviceTermsId": "string",
- "accepted": "string"
}
{- "status": "string"
}
Will be deprecated in v6.0 -Fetches user's latest terms of service action if the latest action was for acceptance.
-Minimum server version: 5.6
-Must be logged in as the user being acted on.
-user_id required | string User GUID - |
User's accepted terms of service action
-Invalid or missing parameters in URL or request body
-No access token provided
-User hasn't performed an action or the latest action was a rejection.
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -userID := "adWv1qPZmHdtxk7Lmqh6RtxWxS" - -userTermsOfService, resp := Client.GetUserTermsOfService(userID, "") -
{- "user_id": "string",
- "terms_of_service_id": "string",
- "create_at": 0
}
For any session currently on the server (including admin) it will be revoked. -Clients will be notified to log out users.
-Minimum server version: 5.14
-Must have manage_system
permission.
Sessions successfully revoked.
-No access token provided
-Do not have appropriate permissions
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -response, err := Client.RevokeSessionsFromAllUsers() -
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Create a new bot account on the system. Username is required.
-Must have create_bot
permission.
-Minimum server version: 5.10
Bot to be created
-username required | string |
display_name | string |
description | string |
Bot creation successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "username": "string",
- "display_name": "string",
- "description": "string"
}
{- "user_id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "username": "string",
- "display_name": "string",
- "description": "string",
- "owner_id": "string"
}
Get a page of a list of bots.
-Must have read_bots
permission for bots you are managing, and read_others_bots
permission for bots others are managing.
-Minimum server version: 5.10
page | integer Default: 0 The page to select. - |
per_page | integer Default: 60 The number of users per page. There is a maximum limit of 200 users per page. - |
include_deleted | boolean If deleted bots should be returned. - |
only_orphaned | boolean When true, only orphaned bots will be returned. A bot is consitered orphaned if it's owner has been deactivated. - |
Bot page retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-[- {
- "user_id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "username": "string",
- "display_name": "string",
- "description": "string",
- "owner_id": "string"
}
]
Partially update a bot 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.
-Must have manage_bots
permission.
-Minimum server version: 5.10
bot_user_id required | string Bot user ID - |
Bot to be created
-username required | string |
display_name | string |
description | string |
Bot patch successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "username": "string",
- "display_name": "string",
- "description": "string"
}
{- "user_id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "username": "string",
- "display_name": "string",
- "description": "string",
- "owner_id": "string"
}
Get a bot specified by its bot id.
-Must have read_bots
permission for bots you are managing, and read_others_bots
permission for bots others are managing.
-Minimum server version: 5.10
bot_user_id required | string Bot user ID - |
include_deleted | boolean If deleted bots should be returned. - |
Bot successfully retrieved.
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "user_id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "username": "string",
- "display_name": "string",
- "description": "string",
- "owner_id": "string"
}
Disable a bot.
-Must have manage_bots
permission.
-Minimum server version: 5.10
bot_user_id required | string Bot user ID - |
Bot successfully disabled.
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "user_id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "username": "string",
- "display_name": "string",
- "description": "string",
- "owner_id": "string"
}
Enable a bot.
-Must have manage_bots
permission.
-Minimum server version: 5.10
bot_user_id required | string Bot user ID - |
Bot successfully enabled.
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "user_id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "username": "string",
- "display_name": "string",
- "description": "string",
- "owner_id": "string"
}
Assign a bot to a specified user.
-Must have manage_bots
permission.
-Minimum server version: 5.10
bot_user_id required | string Bot user ID - |
user_id required | string The user ID to assign the bot to. - |
Bot successfully assigned.
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "user_id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "username": "string",
- "display_name": "string",
- "description": "string",
- "owner_id": "string"
}
Get a bot's LHS icon image based on bot_user_id string parameter.
-Must be logged in. -Minimum server version: 5.14
-bot_user_id required | string Bot user ID - |
Bot's LHS icon image
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-Something went wrong with the server
-Feature is disabled
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -botUserID := "4xp9fdt77pncbef59f4k1qe83o" - -data, resp := Client.GetBotIconImage(botUserID) -
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Set a bot's LHS icon image based on bot_user_id string parameter. Icon image must be SVG format, all other formats are rejected.
-Must have manage_bots
permission.
-Minimum server version: 5.14
bot_user_id required | string Bot user ID - |
image required | string <binary> SVG icon image to be uploaded - |
SVG icon image set successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Content too large
-Something went wrong with the server
-Feature is disabled
-import ( - "io/ioutil" - "log" - - "github.com/mattermost/mattermost-server/model" -) - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -data, err := ioutil.ReadFile("icon_image.svg") -if err != nil { - log.Fatal(err) -} - -botUserID := "4xp9fdt77pncbef59f4k1qe83o" - -ok, resp := Client.SetBotIconImage(botUserID, data) -
{- "status": "string"
}
Delete bot's LHS icon image based on bot_user_id string parameter.
-Must have manage_bots
permission.
-Minimum server version: 5.14
bot_user_id required | string Bot user ID - |
Icon image deletion successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-Something went wrong with the server
-Feature is disabled
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -botUserID := "4xp9fdt77pncbef59f4k1qe83o" - -ok, resp := Client.DeleteBotIconImage(botUserID) -
{- "status": "string"
}
Create a new team on the system.
-Must be authenticated and have the create_team
permission.
Team that is to be created
-name required | string Unique handler for a team, will be present in the team URL - |
display_name required | string Non-unique UI name for the team - |
type required | string
|
Team creation successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "name": "string",
- "display_name": "string",
- "type": "string"
}
{- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "display_name": "string",
- "name": "string",
- "description": "string",
- "email": "string",
- "type": "string",
- "allowed_domains": "string",
- "invite_id": "string",
- "allow_open_invite": true
}
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.
-Must be authenticated. "manage_system" permission is required to show all teams.
-page | integer Default: 0 The page to select. - |
per_page | integer Default: 60 The number of teams per page. - |
include_total_count | boolean Default: false |
Team list retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -teams, resp := Client.GetAllTeams("", 0, 100) -
[- {
- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "display_name": "string",
- "name": "string",
- "description": "string",
- "email": "string",
- "type": "string",
- "allowed_domains": "string",
- "invite_id": "string",
- "allow_open_invite": true
}
]
Get a team on the system.
-Must be authenticated and have the view_team
permission.
team_id required | string Team GUID - |
Team retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -teamID := "4xp9fdt77pncbef59f4k1qe83o" - -t, err := Client.GetTeam(teamID, "") -
{- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "display_name": "string",
- "name": "string",
- "description": "string",
- "email": "string",
- "type": "string",
- "allowed_domains": "string",
- "invite_id": "string",
- "allow_open_invite": true
}
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.
-Must have the manage_team
permission.
team_id required | string Team GUID - |
Team to update
-id required | string |
display_name required | string |
description required | string |
company_name required | string |
allowed_domains required | string |
invite_id required | string |
allow_open_invite required | string |
Team update successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-{- "id": "string",
- "display_name": "string",
- "description": "string",
- "company_name": "string",
- "allowed_domains": "string",
- "invite_id": "string",
- "allow_open_invite": "string"
}
{- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "display_name": "string",
- "name": "string",
- "description": "string",
- "email": "string",
- "type": "string",
- "allowed_domains": "string",
- "invite_id": "string",
- "allow_open_invite": true
}
Soft deletes a team, by marking the team as deleted in the database. Soft deleted teams will not be accessible in the user interface.
-Optionally use the permanent query parameter to hard delete the team for compliance reasons. As of server version 5.0, to use this feature ServiceSettings.EnableAPITeamDeletion
must be set to true
in the server's configuration.
Must have the manage_team
permission.
team_id required | string Team GUID - |
permanent | boolean Default: false Permanently delete the team, to be used for compliance reasons only. As of server version 5.0, |
Team deletion successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -teamID := "4xp9fdt77pncbef59f4k1qe83o" - -// Non-permanent deletion -ok, resp := Client.SoftDeleteTeam(&model.Team{Id: teamID}) - -// Permanent deletion -ok, resp := Client.PermanentDeleteTeam(&model.Team{Id: teamID}) -
{- "status": "string"
}
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.
-Must have the manage_team
permission.
team_id required | string Team GUID - |
Team object that is to be updated
-display_name | string |
description | string |
company_name | string |
invite_id | string |
allow_open_invite | boolean |
team patch successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "display_name": "string",
- "description": "string",
- "company_name": "string",
- "invite_id": "string",
- "allow_open_invite": true
}
{- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "display_name": "string",
- "name": "string",
- "description": "string",
- "email": "string",
- "type": "string",
- "allowed_domains": "string",
- "invite_id": "string",
- "allow_open_invite": true
}
Get a team based on provided name string
-Must be authenticated, team type is open and have the view_team
permission.
name required | string Team Name - |
Team retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -team, resp := Client.GetTeamByName("teamName", "") -
{- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "display_name": "string",
- "name": "string",
- "description": "string",
- "email": "string",
- "type": "string",
- "allowed_domains": "string",
- "invite_id": "string",
- "allow_open_invite": true
}
Search teams based on search term provided in the request body.
-Logged in user only shows open teams -Logged in user with "manage_system" permission shows all teams
-Search criteria
-term required | string The search term to match against the name or display name of teams - |
page | string The page number to return, if paginated. If this parameter is not present with the |
per_page | string The number of entries to return per page, if paginated. If this parameter is not present with the |
Paginated teams response. (Note that the non-paginated response—returned if the request body does not contain both page
and per_page
fields—is a simple array of teams.)
Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-{- "term": "string",
- "page": "string",
- "per_page": "string"
}
{- "teams": [
- {
- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "display_name": "string",
- "name": "string",
- "description": "string",
- "email": "string",
- "type": "string",
- "allowed_domains": "string",
- "invite_id": "string",
- "allow_open_invite": true
}
], - "total_count": 0
}
Check if the team exists based on a team name.
-Must be authenticated.
-name required | string Team Name - |
Team retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Resource not found
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -exists, resp := Client.TeamExists("teamName", "") -
{- "exists": true
}
Get a list of teams that a user is on.
-Must be authenticated as the user or have the manage_system
permission.
user_id required | string User GUID - |
Team list retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -userID := "4xp9fdt77pncbef59f4k1qe83o" - -teams, resp := Client.GetTeamsForUser(userID, "") -
[- {
- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "display_name": "string",
- "name": "string",
- "description": "string",
- "email": "string",
- "type": "string",
- "allowed_domains": "string",
- "invite_id": "string",
- "allow_open_invite": true
}
]
Get a page team members list based on query string parameters - team id, page and per page.
-Must be authenticated and have the view_team
permission.
team_id required | string Team GUID - |
page | integer Default: 0 The page to select. - |
per_page | integer Default: 60 The number of users per page. - |
Team members retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -teamID := "4xp9fdt77pncbef59f4k1qe83o" - -members, resp := Client.GetTeamMembers(teamID, 0, 100, "") -
[- {
- "team_id": "string",
- "user_id": "string",
- "roles": "string",
- "delete_at": 0,
- "scheme_user": true,
- "scheme_admin": true,
- "explicit_roles": "string"
}
]
Add user to the team by user_id.
-Must be authenticated and team be open to add self. For adding another user, authenticated user must have the add_user_to_team
permission.
team_id required | string Team GUID - |
team_id | string |
user_id | string |
Team member creation successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-{- "team_id": "string",
- "user_id": "string"
}
{- "team_id": "string",
- "user_id": "string",
- "roles": "string",
- "delete_at": 0,
- "scheme_user": true,
- "scheme_admin": true,
- "explicit_roles": "string"
}
Using either an invite id or hash/data pair from an email invite link, add a user to a team.
-Must be authenticated.
-token required | string Token id from the invitation - |
Team member creation successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -tokenID := "qjda3stwafbgpqjaxej3k76sga" - -tm, resp = Client.AddTeamMemberFromInvite(tokenID, "") -
{- "team_id": "string",
- "user_id": "string",
- "roles": "string",
- "delete_at": 0,
- "scheme_user": true,
- "scheme_admin": true,
- "explicit_roles": "string"
}
Add a number of users to the team by user_id.
-Must be authenticated. Authenticated user must have the add_user_to_team
permission.
team_id required | string Team GUID - |
graceful | boolean Instead of aborting the operation if a user cannot be added, return an arrray that will contain both the success and added members and the ones with error, in form of |
team_id | string The ID of the team this member belongs to. - |
user_id | string The ID of the user this member relates to. - |
roles | string The complete list of roles assigned to this team member, as a space-separated list of role names, including any roles granted implicitly through permissions schemes. - |
delete_at | integer The time in milliseconds that this team member was deleted. - |
scheme_user | boolean Whether this team member holds the default user role defined by the team's permissions scheme. - |
scheme_admin | boolean Whether this team member holds the default admin role defined by the team's permissions scheme. - |
explicit_roles | string The list of roles explicitly assigned to this team member, as a space separated list of role names. This list does not include any roles granted implicitly through permissions schemes. - |
Team members created successfully.
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-[- {
- "team_id": "string",
- "user_id": "string",
- "roles": "string",
- "delete_at": 0,
- "scheme_user": true,
- "scheme_admin": true,
- "explicit_roles": "string"
}
]
[- {
- "team_id": "string",
- "user_id": "string",
- "roles": "string",
- "delete_at": 0,
- "scheme_user": true,
- "scheme_admin": true,
- "explicit_roles": "string"
}
]
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.
-Must be logged in as the user or have the edit_other_users
permission.
user_id required | string User GUID - |
Team members retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -userID := "zWEyrTZ7GZ22aBSfoX60iWryTY" - -teamMembers, resp = Client.GetTeamMembersForUser(userID, "") -
[- {
- "team_id": "string",
- "user_id": "string",
- "roles": "string",
- "delete_at": 0,
- "scheme_user": true,
- "scheme_admin": true,
- "explicit_roles": "string"
}
]
Get a team member on the system.
-Must be authenticated and have the view_team
permission.
team_id required | string Team GUID - |
user_id required | string User GUID - |
Team member retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -teamID := "zWEyrTZ7GZ22aBSfoX60iWryTY" -userID := "NqCSr5HMDZjrWS74IEmedvlOYf" - -teamMember, resp = Client.GetTeamMember(teamID, userID, "") -
{- "team_id": "string",
- "user_id": "string",
- "roles": "string",
- "delete_at": 0,
- "scheme_user": true,
- "scheme_admin": true,
- "explicit_roles": "string"
}
Delete the team member object for a user, effectively removing them from a team.
-Must be logged in as the user or have the remove_user_from_team
permission.
team_id required | string Team GUID - |
user_id required | string User GUID - |
Team member deletion successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -teamID := "zWEyrTZ7GZ22aBSfoX60iWryTY" -userID := "NqCSr5HMDZjrWS74IEmedvlOYf" - -ok, resp = Client.RemoveTeamMember(teamID, userID) -
{- "status": "string"
}
Get a list of team members based on a provided array of user ids.
-Must have view_team
permission for the team.
team_id required | string Team GUID - |
List of user ids
-Team members retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-[- "string"
]
[- {
- "team_id": "string",
- "user_id": "string",
- "roles": "string",
- "delete_at": 0,
- "scheme_user": true,
- "scheme_admin": true,
- "explicit_roles": "string"
}
]
Get a team stats on the system.
-Must be authenticated and have the view_team
permission.
team_id required | string Team GUID - |
Team stats retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -teamID := "zWEyrTZ7GZ22aBSfoX60iWryTY" - -stats, resp := Client.GetTeamStats(teamID, "") -
{- "team_id": "string",
- "total_member_count": 0,
- "active_member_count": 0
}
Regenerates the invite ID used in invite links of a team
-Must be authenticated and have the manage_team
permission.
team_id required | string Team GUID - |
Team Invite ID regenerated
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -teamID := "zWEyrTZ7GZ22aBSfoX60iWryTY" - -team, resp := Client.RegenerateTeamInviteId(teamID) -
{- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "display_name": "string",
- "name": "string",
- "description": "string",
- "email": "string",
- "type": "string",
- "allowed_domains": "string",
- "invite_id": "string",
- "allow_open_invite": true
}
Get the team icon of the team.
-Minimum server version: 4.9
-User must be authenticated. In addition, team must be open or the user must have the view_team
permission.
team_id required | string Team GUID - |
Team icon retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-Feature is disabled
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -teamID := "zWEyrTZ7GZ22aBSfoX60iWryTY" - -icon, resp = Client.GetTeamIcon(teamID, "") -
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Sets the team icon for the team.
-Minimum server version: 4.9
-Must be authenticated and have the manage_team
permission.
team_id required | string Team GUID - |
image required | string <binary> The image to be uploaded - |
Team icon successfully set
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Something went wrong with the server
-Feature is disabled
-import ( - "io/ioutil" - "log" - - "github.com/mattermost/mattermost-server/model" -) - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -data, err := ioutil.ReadFile("icon.png") -if err != nil { - log.Fatal(err) -} - -teamID := "zWEyrTZ7GZ22aBSfoX60iWryTY" - -ok, resp := Client.SetTeamIcon(teamID, data) -
{- "status": "string"
}
Remove the team icon for the team.
-Minimum server version: 4.10
-Must be authenticated and have the manage_team
permission.
team_id required | string Team GUID - |
Team icon successfully remove
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Something went wrong with the server
-Feature is disabled
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -teamID := "zWEyrTZ7GZ22aBSfoX60iWryTY" - -ok, resp = Client.RemoveTeamIcon(teamID) -
{- "status": "string"
}
Update a team member roles. Valid team roles are "team_user", "team_admin" or both of them. Overwrites any previously assigned team roles.
-Must be authenticated and have the manage_team_roles
permission.
team_id required | string Team GUID - |
user_id required | string User GUID - |
Space-delimited team roles to assign to the user
-roles required | string |
Team member roles update successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-{- "roles": "string"
}
{- "status": "string"
}
Update a team member's scheme_admin/scheme_user properties. Typically this should either be scheme_admin=false, scheme_user=true
for ordinary team member, or scheme_admin=true, scheme_user=true
for a team admin.
Minimum server version: 5.0
-Must be authenticated and have the manage_team_roles
permission.
team_id required | string Team GUID - |
user_id required | string User GUID - |
Scheme properties.
-scheme_admin required | boolean |
scheme_user required | boolean |
Team member's scheme-derived roles updated successfully.
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-{- "scheme_admin": true,
- "scheme_user": true
}
{- "status": "string"
}
Get the count for unread messages and mentions in the teams the user is a member of.
-Must be logged in.
-user_id required | string User GUID - |
exclude_team required | string Optional team id to be excluded from the results - |
Team unreads retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -userID := "NqCSr5HMDZjrWS74IEmedvlOYf" -teamID := "zWEyrTZ7GZ22aBSfoX60iWryTY" - -teams, resp := Client.GetTeamsUnreadForUser(userID, teamID) -
[- {
- "team_id": "string",
- "msg_count": 0,
- "mention_count": 0
}
]
Get the unread mention and message counts for a team for the specified user.
-Must be the user or have edit_other_users
permission and have view_team
permission for the team.
user_id required | string User GUID - |
team_id required | string Team GUID - |
Team unread count retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -userID := "NqCSr5HMDZjrWS74IEmedvlOYf" -teamID := "zWEyrTZ7GZ22aBSfoX60iWryTY" - -teamUnread, resp := Client.GetTeamUnread(userID, teamID) -
{- "team_id": "string",
- "msg_count": 0,
- "mention_count": 0
}
Invite users to the existing team usign the user's email.
-Must have invite_to_team
permission for the team.
team_id required | string Team GUID - |
List of user's email
-Users invite successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-[- "string"
]
{- "status": "string"
}
Invite guests to existing team channels usign the user's email.
-Minimum server version: 5.16
-Must have invite_guest
permission for the team.
team_id required | string Team GUID - |
Guests invite information
-emails required | Array of strings List of emails - |
channels required | Array of strings List of channel ids - |
message | string Message to include in the invite - |
Guests invite successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "emails": [
- "string"
], - "channels": [
- "string"
], - "message": "string"
}
{- "status": "string"
}
Invalidate active email invitations that have not been accepted by the user.
-Must have manage_system
permission.
Email invites successfully revoked
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -ok, resp := Client.InvalidateEmailInvites() -
{- "status": "string"
}
Import a team into a existing team. Import users, channels, posts, hooks.
-Must have permission_import_team
permission.
team_id required | string Team GUID - |
file required | string <binary> A file to be uploaded in zip format. - |
filesize required | integer The size of the zip file to be imported. - |
importFrom required | string String that defines from which application the team was exported to be imported into Mattermost. - |
JSON object containing a base64 encoded text file of the import logs in its results
property.
Invalid or missing parameters in URL or request body
-Do not have appropriate permissions
-import ( - "encoding/binary" - "io/ioutil" - "log" - - "github.com/mattermost/mattermost-server/model" -) - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -data, err = ioutil.ReadFile("to_import.zip") -if err != nil && len(data) == 0 { - log.Fatal("Error while reading file.") -} - -teamID := "zWEyrTZ7GZ22aBSfoX60iWryTY" - -fileResp, resp := Client.ImportTeam(data, binary.Size(data), "slack", "to_import.zip", teamID) -
{- "results": "string"
}
Get the name
, display_name
, description
and id
for a team from the invite id.
Minimum server version: 4.0
-No authentication required.
-invite_id required | string Invite id for a team - |
Team invite info retrieval successful
-Invalid or missing parameters in URL or request body
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") - -inviteID := "zWEyrTZ7GZ22aBSfoX60iWryTY" - -team, resp = Client.GetTeamInviteInfo(inviteID) -
{- "id": "string",
- "name": "string",
- "display_name": "string",
- "description": "string"
}
Set a team's scheme, more specifically sets the scheme_id value of a team record.
-Must have manage_system
permission.
Minimum server version: 5.0
-team_id required | string Team GUID - |
Scheme GUID
-scheme_id required | string The ID of the scheme. - |
Update team scheme successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-{- "scheme_id": "string"
}
{- "status": "string"
}
Get the set of users who are members of the team minus the set of users who are members of the given groups.
-Each user object contains an array of group objects representing the group memberships for that user.
-Each user object contains the boolean fields scheme_guest
, scheme_user
, and scheme_admin
representing the roles that user has for the given team.
Must have manage_system
permission.
Minimum server version: 5.14
-team_id required | string Team GUID - |
group_ids required | string Default: "" A comma-separated list of group ids. - |
page | integer Default: 0 The page to select. - |
per_page | integer Default: 0 The number of users per page. - |
Successfully returns users specified by the pagination, and the total_count.
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-curl 'http://your-mattermost-url.com/api/v4/teams/fcnst115y3y7xmzzp5uq34u8ce/members_minus_group_members?group_ids=eoezijg8zffgjmch8icy5bjd1e,ugaw6wjc3tfxpcr1eq5u5k8dhe&page=0&per_page=100' \ - -H 'Authorization: Bearer mq8rrfxpdfyafbnw3qfmhwkx6c' \ - -H 'Content-Type: application/json' \ - -H 'X-Requested-With: XMLHttpRequest' -
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Create a new channel.
-If creating a public channel, create_public_channel
permission is required. If creating a private channel, create_private_channel
permission is required.
Channel object to be created
-team_id required | string The team ID of the team to create the channel on - |
name required | string The unique handle for the channel, will be present in the channel URL - |
display_name required | string The non-unique UI name for the channel - |
purpose | string A short description of the purpose of the channel - |
header | string Markdown-formatted text to display in the header of the channel - |
type required | string 'O' for a public channel, 'P' for a private channel - |
Channel creation successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "team_id": "string",
- "name": "string",
- "display_name": "string",
- "purpose": "string",
- "header": "string",
- "type": "string"
}
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Create a new direct message channel between two users.
-Must be one of the two users and have create_direct_channel
permission. Having the manage_system
permission voids the previous requirements.
The two user ids to be in the direct message
-Direct channel creation successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-[- "string",
- "string"
]
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
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.
-Must have create_group_channel
permission.
User ids to be in the group message channel
-Group channel creation successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-[- "string"
]
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Returns all private and open type channels where 'term' matches on the name, display name, or purpose of -the channel.
-Configured 'default' channels (ex Town Square and Off-Topic) can be excluded from the results
-with the exclude_default_channels
boolean parameter.
Channels that are associated (via GroupChannel records) to a given group can be excluded from the results
-with the not_associated_to_group
parameter and a group id string.
The search terms and logic to use in the search.
-term required | string The string to search in the channel name, display name, and purpose. - |
not_associated_to_group | string A group id to exclude channels that are associated to that group via GroupChannel records. - |
exclude_default_channels | boolean Exclude default channels from the results by setting this parameter to true. - |
page | string The page number to return, if paginated. If this parameter is not present with the |
per_page | string The number of entries to return per page, if paginated. If this parameter is not present with the |
Paginated channel response. (Note that the non-paginated response—returned if the request body does not contain both page
and per_page
fields—is a simple array of channels.)
Invalid or missing parameters in URL or request body
-No access token provided
-{- "term": "string",
- "not_associated_to_group": "string",
- "exclude_default_channels": true,
- "page": "string",
- "per_page": "string"
}
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Get a list of group channels for a user which members' usernames match the search term.
-Minimum server version: 5.14
-Search criteria
-term required | string The search term to match against the members' usernames of the group channels - |
Channels search successful
-Invalid or missing parameters in URL or request body
-No access token provided
-{- "term": "string"
}
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Get a list of public channels on a team by id.
-view_team
for the team the channels are on.
team_id required | string Team GUID - |
List of channel ids
-Channel list retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Resource not found
-[- "string"
]
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Get a list of timezones for the users who are in this channel.
-Minimum server version: 5.6
-Must have the read_channel
permission.
channel_id required | string Channel GUID - |
Timezone retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-import "github.com/mattermost/mattermost-server/model" -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -// GetChannelStats -stats, resp := Client.GetChannelTimezones(<CHANNELID>) -
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Get channel from the provided channel id string.
-read_channel
permission for the channel.
channel_id required | string Channel GUID - |
Channel retrieval successful
-No access token provided
-Do not have appropriate permissions
-Resource not found
-import "github.com/mattermost/mattermost-server/model" -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -// GetChannel -channel, resp := Client.GetChannel(<CHANNELID>, "") -
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Update a channel. The fields that can be updated are listed as parameters. Omitted fields will be treated as blanks.
-If updating a public channel, manage_public_channel_members
permission is required. If updating a private channel, manage_private_channel_members
permission is required.
channel_id required | string Channel GUID - |
Channel object to be updated
-id required | string The channel's id, not updatable - |
name | string The unique handle for the channel, will be present in the channel URL - |
display_name | string The non-unique UI name for the channel - |
purpose | string A short description of the purpose of the channel - |
header | string Markdown-formatted text to display in the header of the channel - |
Channel update successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-{- "id": "string",
- "name": "string",
- "display_name": "string",
- "purpose": "string",
- "header": "string"
}
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Soft deletes a channel, by marking the channel as deleted in the database. Soft deleted channels will not be accessible in the user interface. Direct and group message channels cannot be deleted.
-delete_public_channel
permission if the channel is public,
-delete_private_channel
permission if the channel is private,
-or have manage_system
permission.
channel_id required | string Channel GUID - |
Channel deletion successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-import "github.com/mattermost/mattermost-server/model" -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -// DeleteChannel -pass, resp := Client.DeleteChannel(<CHANNELID>) -
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
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.
-If updating a public channel, manage_public_channel_members
permission is required. If updating a private channel, manage_private_channel_members
permission is required.
channel_id required | string Channel GUID - |
Channel object to be updated
-name | string The unique handle for the channel, will be present in the channel URL - |
display_name | string The non-unique UI name for the channel - |
purpose | string A short description of the purpose of the channel - |
header | string Markdown-formatted text to display in the header of the channel - |
Channel patch successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-{- "name": "string",
- "display_name": "string",
- "purpose": "string",
- "header": "string"
}
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Updates channel's privacy allowing changing a channel from Public to Private and back.
-Minimum server version: 5.16
-manage_team
permission for the team of the channel.
channel_id required | string Channel GUID - |
privacy required | string Channel privacy setting: 'O' for a public channel, 'P' for a private channel - |
Channel conversion successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-{- "privacy": "string"
}
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Will be deprecated in 6.0
-Convert into private channel from the provided channel id string.
-Minimum server version: 4.10
-manage_team
permission for the team of the channel.
channel_id required | string Channel GUID - |
Channel conversion successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-import "github.com/mattermost/mattermost-server/model" -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -// ConvertChannelToPrivate -convertedChannel, resp := Client.ConvertChannelToPrivate(<CHANNELID>) -
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Restore channel from the provided channel id string.
-Minimum server version: 3.10
-manage_team
permission for the team of the channel.
channel_id required | string Channel GUID - |
Channel restore successful
-No access token provided
-Do not have appropriate permissions
-Resource not found
-{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Get statistics for a channel.
-Must have the read_channel
permission.
channel_id required | string Channel GUID - |
Channel statistics retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-import "github.com/mattermost/mattermost-server/model" -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -// GetChannelStats -stats, resp := Client.GetChannelStats(<CHANNELID>) -
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Get a list of pinned posts for channel.
-channel_id required | string Channel GUID - |
The list of channel pinned posts
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-import "github.com/mattermost/mattermost-server/model" -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -// GetPinnedPosts -posts, resp := Client.GetPinnedPosts(<CHANNELID>, "") -
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Get a page of public channels on a team based on query string parameters - page and per_page.
-Must be authenticated and have the list_team_channels
permission.
team_id required | string Team GUID - |
page | integer Default: 0 The page to select. - |
per_page | integer Default: 60 The number of public channels per page. - |
Channels retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-import "github.com/mattermost/mattermost-server/model" -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") -// GetPublicChannelsForTeam -channels, resp := Client.GetPublicChannelsForTeam(<TEAMID>, 0, 100, "") -
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Get a page of deleted channels on a team based on query string parameters - team_id, page and per_page.
-Minimum server version: 3.10
-team_id required | string Team GUID - |
page | integer Default: 0 The page to select. - |
per_page | integer Default: 60 The number of public channels per page. - |
Channels retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Autocomplete public channels on a team based on the search term provided in the request URL.
-Minimum server version: 4.7
-Must have the list_team_channels
permission.
team_id required | string Team GUID - |
name required | string Name or display name - |
Channels autocomplete successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Autocomplete your channels on a team based on the search term provided in the request URL.
-Minimum server version: 5.4
-Must have the list_team_channels
permission.
team_id required | string Team GUID - |
name required | string Name or display name - |
Channels autocomplete successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Search public channels on a team based on the search term provided in the request body.
-Must have the list_team_channels
permission.
In server version 5.16 and later, a user without the list_team_channels
permission will be able to use this endpoint, with the search results limited to the channels that the user is a member of.
team_id required | string Team GUID - |
Search criteria
-term required | string The search term to match against the name or display name of channels - |
Channels search successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-{- "term": "string"
}
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Search archived channels on a team based on the search term provided in the request body.
-Minimum server version: 5.18
-Must have the list_team_channels
permission.
In server version 5.18 and later, a user without the list_team_channels
permission will be able to use this endpoint, with the search results limited to the channels that the user is a member of.
team_id required | string Team GUID - |
Search criteria
-term required | string The search term to match against the name or display name of archived channels - |
Channels search successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-{- "term": "string"
}
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Gets channel from the provided team id and channel name strings.
-read_channel
permission for the channel.
team_id required | string Team GUID - |
channel_name required | string Channel Name - |
include_deleted | boolean Default: false Defines if deleted channels should be returned or not - |
Channel retrieval successful
-No access token provided
-Do not have appropriate permissions
-Resource not found
-import "github.com/mattermost/mattermost-server/model" -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -// GetChannelByName -channel, resp := Client.GetChannelByName(<CHANNEL NAME>, <TEAMID>, "") -
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Gets a channel from the provided team name and channel name strings.
-read_channel
permission for the channel.
team_name required | string Team Name - |
channel_name required | string Channel Name - |
include_deleted | boolean Default: false Defines if deleted channels should be returned or not - |
Channel retrieval successful
-No access token provided
-Do not have appropriate permissions
-Resource not found
-import "github.com/mattermost/mattermost-server/model" -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -// GetChannelByNameForTeamName -channel, resp = Client.GetChannelByNameForTeamName(<CHANNEL NAME>, <TEAM NAME>, "") -
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Get a page of members for a channel.
-read_channel
permission for the channel.
channel_id required | string Channel GUID - |
page | integer Default: 0 The page to select. - |
per_page | integer Default: 60 The number of members per page. - |
Channel members retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-import "github.com/mattermost/mattermost-server/model" -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -// GetChannelMembers -members, resp := Client.GetChannelMembers(th.BasicChannel.Id, 0, 60, "") -
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Add a user to a channel by creating a channel member object.
-channel_id required | string The channel ID - |
user_id required | string The ID of user to add into the channel - |
post_root_id | string The ID of root post where link to add channel member originates - |
Channel member creation successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "user_id": "string",
- "post_root_id": "string"
}
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Get a list of channel members based on the provided user ids.
-Must have the read_channel
permission.
channel_id required | string Channel GUID - |
List of user ids
-Channel member list retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-[- "string"
]
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Get a channel member.
-read_channel
permission for the channel.
channel_id required | string Channel GUID - |
user_id required | string User GUID - |
Channel member retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-import "github.com/mattermost/mattermost-server/model" -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -// GetChannelMember -member, resp := Client.GetChannelMember(<CHANNELID>, <USERID>, "") -
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Delete a channel member, effectively removing them from a channel.
-In server version 5.3 and later, channel members can only be deleted from public or private channels.
-manage_public_channel_members
permission if the channel is public.
-manage_private_channel_members
permission if the channel is private.
channel_id required | string Channel GUID - |
user_id required | string User GUID - |
Channel member deletion successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-import "github.com/mattermost/mattermost-server/model" -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -// RemoveUserFromChannel -pass, resp := Client.RemoveUserFromChannel(<CHANNELID>, <USERID>) -
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Update a user's roles for a channel.
-Must have manage_channel_roles
permission for the channel.
channel_id required | string Channel GUID - |
user_id required | string User GUID - |
Space-delimited channel roles to assign to the user
-roles required | string |
Channel roles update successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "roles": "string"
}
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Update a channel member's scheme_admin/scheme_user properties. Typically this should either be scheme_admin=false, scheme_user=true
for ordinary channel member, or scheme_admin=true, scheme_user=true
for a channel admin.
-Minimum server version: 5.0
Must be authenticated and have the manage_channel_roles
permission.
channel_id required | string Channel GUID - |
user_id required | string User GUID - |
Scheme properties.
-scheme_admin required | boolean |
scheme_user required | boolean |
Channel member's scheme-derived roles updated successfully.
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-{- "scheme_admin": true,
- "scheme_user": true
}
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Update a user's notification properties for a channel. Only the provided fields are updated.
-Must be logged in as the user or have edit_other_users
permission.
channel_id required | string Channel GUID - |
user_id required | string User GUID - |
boolean Set to "true" to enable email notifications, "false" to disable, or "default" to use the global user notification setting. - | |
push | string 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. - |
desktop | string 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. - |
mark_unread | string Set to "all" to mark the channel unread for any new message, "mention" to mark unread for new mentions only. Defaults to "all". - |
Channel notification properties update successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-{- "email": true,
- "push": "string",
- "desktop": "string",
- "mark_unread": "string"
}
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Perform all the actions involved in viewing a channel. This includes marking channels as read, clearing push notifications, and updating the active channel.
-Must be logged in as user or have edit_other_users
permission.
Response only includes last_viewed_at_times
in Mattermost server 4.3 and newer.
user_id required | string User ID to perform the view action for - |
Paremeters affecting how and which channels to view
-channel_id required | string The channel ID that is being viewed. Use a blank string to indicate that all channels have lost focus. - |
prev_channel_id | string 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. - |
Channel view successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "channel_id": "string",
- "prev_channel_id": "string"
}
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Get all channel memberships and associated membership roles (i.e. channel_user
, channel_admin
) for a user on a specific team.
Logged in as the user and view_team
permission for the team. Having manage_system
permission voids the previous requirements.
user_id required | string User GUID - |
team_id required | string Team GUID - |
Channel members retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-import "github.com/mattermost/mattermost-server/model" -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -// GetChannelMembersForUser -members, resp := Client.GetChannelMembersForUser(<USERID>, <TEAMID>, "") -
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Get all the channels on a team for a user.
-Logged in as the user, or have edit_other_users
permission, and view_team
permission for the team.
user_id required | string User GUID - |
team_id required | string Team GUID - |
Channels retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-import "github.com/mattermost/mattermost-server/model" -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -// GetChannelsForTeamForUser -channels, resp := Client.GetChannelsForTeamForUser(<TEAMID>, <USERID>, "") -
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Get the total unread messages and mentions for a channel for a user.
-Must be logged in as user and have the read_channel
permission, or have edit_other_usrs
permission.
user_id required | string User GUID - |
channel_id required | string Channel GUID - |
Channel unreads retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-import "github.com/mattermost/mattermost-server/model" -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -// GetChannelUnread -channelUnread, resp := Client.GetChannelUnread(<CHANNELID>, <USERID>) -
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Set a channel's scheme, more specifically sets the scheme_id value of a channel record.
-Must have manage_system
permission.
Minimum server version: 4.10
-channel_id required | string Channel GUID - |
Scheme GUID
-scheme_id required | string The ID of the scheme. - |
Update channel scheme successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-{- "scheme_id": "string"
}
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Get the set of users who are members of the channel minus the set of users who are members of the given groups.
-Each user object contains an array of group objects representing the group memberships for that user.
-Each user object contains the boolean fields scheme_guest
, scheme_user
, and scheme_admin
representing the roles that user has for the given channel.
Must have manage_system
permission.
Minimum server version: 5.14
-channel_id required | string Channel GUID - |
group_ids required | string Default: "" A comma-separated list of group ids. - |
page | integer Default: 0 The page to select. - |
per_page | integer Default: 0 The number of users per page. - |
Successfully returns users specified by the pagination, and the total_count.
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-curl -X GET \ - 'http://your-mattermost-url.com/api/v4/channels/3wyp678obid8pggjmhmhwpah1r/members_minus_group_members?group_ids=eoezijg8zffgjmch8icy5bjd1e,ugaw6wjc3tfxpcr1eq5u5k8dhe&page=0&per_page=100' \ - -H 'Authorization: Bearer kno8tcdotpbx3dj1gzcbx9jrqy' \ - -H 'Content-Type: application/json' \ - -H 'X-Requested-With: XMLHttpRequest' -
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Create a new post in a channel. To create the post as a comment on another post, provide root_id
.
Must have create_post
permission for the channel the post is being created in.
set_online | boolean Whether to set the user status as online or not. - |
Post object to create
-channel_id required | string The channel ID to post in - |
message required | string The message contents, can be formatted with Markdown - |
root_id | string The post ID to comment on - |
file_ids | Array of strings A list of file IDs to associate with the post. Note that posts are limited to 5 files maximum. Please use additional posts for more files. - |
props | object A general JSON property bag to attach to the post - |
Post creation successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "channel_id": "string",
- "message": "string",
- "root_id": "string",
- "file_ids": [
- "string"
], - "props": { }
}
{- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "edit_at": 0,
- "user_id": "string",
- "channel_id": "string",
- "root_id": "string",
- "parent_id": "string",
- "original_id": "string",
- "message": "string",
- "type": "string",
- "props": { },
- "hashtag": "string",
- "filenames": [
- "string"
], - "file_ids": [
- "string"
], - "pending_post_id": "string",
- "metadata": {
- "embeds": [
- {
- "type": "image",
- "url": "string",
- "data": { }
}
], - "emojis": [
- {
- "id": "string",
- "creator_id": "string",
- "name": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0
}
], - "files": [
- {
- "id": "string",
- "user_id": "string",
- "post_id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "name": "string",
- "extension": "string",
- "size": 0,
- "mime_type": "string",
- "width": 0,
- "height": 0,
- "has_preview_image": true
}
], - "images": { },
- "reactions": [
- {
- "user_id": "string",
- "post_id": "string",
- "emoji_name": "string",
- "create_at": 0
}
]
}
}
Create a new ephemeral post in a channel.
-Must have create_post_ephemeral
permission (currently only given to system admin)
Ephemeral Post object to send
-user_id required | string The target user id for the ephemeral post - |
post required | object Post object to create - |
Post creation successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "user_id": "string",
- "post": {
- "channel_id": "string",
- "message": "string"
}
}
{- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "edit_at": 0,
- "user_id": "string",
- "channel_id": "string",
- "root_id": "string",
- "parent_id": "string",
- "original_id": "string",
- "message": "string",
- "type": "string",
- "props": { },
- "hashtag": "string",
- "filenames": [
- "string"
], - "file_ids": [
- "string"
], - "pending_post_id": "string",
- "metadata": {
- "embeds": [
- {
- "type": "image",
- "url": "string",
- "data": { }
}
], - "emojis": [
- {
- "id": "string",
- "creator_id": "string",
- "name": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0
}
], - "files": [
- {
- "id": "string",
- "user_id": "string",
- "post_id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "name": "string",
- "extension": "string",
- "size": 0,
- "mime_type": "string",
- "width": 0,
- "height": 0,
- "has_preview_image": true
}
], - "images": { },
- "reactions": [
- {
- "user_id": "string",
- "post_id": "string",
- "emoji_name": "string",
- "create_at": 0
}
]
}
}
Get a single post.
-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.
post_id required | string ID of the post to get - |
Post retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "edit_at": 0,
- "user_id": "string",
- "channel_id": "string",
- "root_id": "string",
- "parent_id": "string",
- "original_id": "string",
- "message": "string",
- "type": "string",
- "props": { },
- "hashtag": "string",
- "filenames": [
- "string"
], - "file_ids": [
- "string"
], - "pending_post_id": "string",
- "metadata": {
- "embeds": [
- {
- "type": "image",
- "url": "string",
- "data": { }
}
], - "emojis": [
- {
- "id": "string",
- "creator_id": "string",
- "name": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0
}
], - "files": [
- {
- "id": "string",
- "user_id": "string",
- "post_id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "name": "string",
- "extension": "string",
- "size": 0,
- "mime_type": "string",
- "width": 0,
- "height": 0,
- "has_preview_image": true
}
], - "images": { },
- "reactions": [
- {
- "user_id": "string",
- "post_id": "string",
- "emoji_name": "string",
- "create_at": 0
}
]
}
}
Soft deletes a post, by marking the post as deleted in the database. Soft deleted posts will not be returned in post queries.
-Must be logged in as the user or have delete_others_posts
permission.
post_id required | string ID of the post to delete - |
Post deletion successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "status": "string"
}
Update a post. Only the fields listed below are updatable, omitted fields will be treated as blank.
-Must have edit_post
permission for the channel the post is in.
post_id required | string ID of the post to update - |
Post object that is to be updated
-id required | string ID of the post to update - |
is_pinned | boolean Set to |
message | string The message text of the post - |
has_reactions | boolean Set to |
props | string A general JSON property bag to attach to the post - |
Post update successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "id": "string",
- "is_pinned": true,
- "message": "string",
- "has_reactions": true,
- "props": "string"
}
{- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "edit_at": 0,
- "user_id": "string",
- "channel_id": "string",
- "root_id": "string",
- "parent_id": "string",
- "original_id": "string",
- "message": "string",
- "type": "string",
- "props": { },
- "hashtag": "string",
- "filenames": [
- "string"
], - "file_ids": [
- "string"
], - "pending_post_id": "string",
- "metadata": {
- "embeds": [
- {
- "type": "image",
- "url": "string",
- "data": { }
}
], - "emojis": [
- {
- "id": "string",
- "creator_id": "string",
- "name": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0
}
], - "files": [
- {
- "id": "string",
- "user_id": "string",
- "post_id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "name": "string",
- "extension": "string",
- "size": 0,
- "mime_type": "string",
- "width": 0,
- "height": 0,
- "has_preview_image": true
}
], - "images": { },
- "reactions": [
- {
- "user_id": "string",
- "post_id": "string",
- "emoji_name": "string",
- "create_at": 0
}
]
}
}
Mark a channel as being unread from a given post.
-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.
-Must have edit_other_users
permission if the user is not the one marking the post for himself.
Minimum server version: 5.18
-user_id required | string User GUID - |
post_id required | string Post GUID - |
Post marked as unread successfully
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-{- "team_id": "string",
- "channel_id": "string",
- "msg_count": 0,
- "mention_count": 0,
- "last_viewed_at": 0
}
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.
-Must have the edit_post
permission.
post_id required | string Post GUID - |
Post object that is to be updated
-is_pinned | boolean Set to |
message | string The message text of the post - |
file_ids | Array of strings The list of files attached to this post - |
has_reactions | boolean Set to |
props | string A general JSON property bag to attach to the post - |
Post patch successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "is_pinned": true,
- "message": "string",
- "file_ids": [
- "string"
], - "has_reactions": true,
- "props": "string"
}
{- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "edit_at": 0,
- "user_id": "string",
- "channel_id": "string",
- "root_id": "string",
- "parent_id": "string",
- "original_id": "string",
- "message": "string",
- "type": "string",
- "props": { },
- "hashtag": "string",
- "filenames": [
- "string"
], - "file_ids": [
- "string"
], - "pending_post_id": "string",
- "metadata": {
- "embeds": [
- {
- "type": "image",
- "url": "string",
- "data": { }
}
], - "emojis": [
- {
- "id": "string",
- "creator_id": "string",
- "name": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0
}
], - "files": [
- {
- "id": "string",
- "user_id": "string",
- "post_id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "name": "string",
- "extension": "string",
- "size": 0,
- "mime_type": "string",
- "width": 0,
- "height": 0,
- "has_preview_image": true
}
], - "images": { },
- "reactions": [
- {
- "user_id": "string",
- "post_id": "string",
- "emoji_name": "string",
- "create_at": 0
}
]
}
}
Get a post and the rest of the posts in the same thread.
-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.
post_id required | string ID of a post in the thread - |
Post list retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "order": [
- "post_id1",
- "post_id12"
], - "posts": {
- "property1": {
- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "edit_at": 0,
- "user_id": "string",
- "channel_id": "string",
- "root_id": "string",
- "parent_id": "string",
- "original_id": "string",
- "message": "string",
- "type": "string",
- "props": { },
- "hashtag": "string",
- "filenames": [
- "string"
], - "file_ids": [
- "string"
], - "pending_post_id": "string",
- "metadata": {
- "embeds": [
- {
- "type": "image",
- "url": "string",
- "data": { }
}
], - "emojis": [
- {
- "id": "string",
- "creator_id": "string",
- "name": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0
}
], - "files": [
- {
- "id": "string",
- "user_id": "string",
- "post_id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "name": "string",
- "extension": "string",
- "size": 0,
- "mime_type": "string",
- "width": 0,
- "height": 0,
- "has_preview_image": true
}
], - "images": { },
- "reactions": [
- {
- "user_id": "string",
- "post_id": "string",
- "emoji_name": "string",
- "create_at": 0
}
]
}
}, - "property2": {
- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "edit_at": 0,
- "user_id": "string",
- "channel_id": "string",
- "root_id": "string",
- "parent_id": "string",
- "original_id": "string",
- "message": "string",
- "type": "string",
- "props": { },
- "hashtag": "string",
- "filenames": [
- "string"
], - "file_ids": [
- "string"
], - "pending_post_id": "string",
- "metadata": {
- "embeds": [
- {
- "type": "image",
- "url": "string",
- "data": { }
}
], - "emojis": [
- {
- "id": "string",
- "creator_id": "string",
- "name": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0
}
], - "files": [
- {
- "id": "string",
- "user_id": "string",
- "post_id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "name": "string",
- "extension": "string",
- "size": 0,
- "mime_type": "string",
- "width": 0,
- "height": 0,
- "has_preview_image": true
}
], - "images": { },
- "reactions": [
- {
- "user_id": "string",
- "post_id": "string",
- "emoji_name": "string",
- "create_at": 0
}
]
}
}
}, - "next_post_id": "string",
- "prev_post_id": "string"
}
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.
-Must be user or have manage_system
permission.
user_id required | string ID of the user - |
team_id | string Team ID - |
channel_id | string Channel ID - |
page | integer Default: 0 The page to select - |
per_page | integer Default: 60 The number of posts per page - |
Post list retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-[- {
- "order": [
- "post_id1",
- "post_id12"
], - "posts": {
- "property1": {
- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "edit_at": 0,
- "user_id": "string",
- "channel_id": "string",
- "root_id": "string",
- "parent_id": "string",
- "original_id": "string",
- "message": "string",
- "type": "string",
- "props": { },
- "hashtag": "string",
- "filenames": [
- "string"
], - "file_ids": [
- "string"
], - "pending_post_id": "string",
- "metadata": {
- "embeds": [
- {
- "type": "image",
- "url": "string",
- "data": { }
}
], - "emojis": [
- {
- "id": "string",
- "creator_id": "string",
- "name": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0
}
], - "files": [
- {
- "id": "string",
- "user_id": "string",
- "post_id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "name": "string",
- "extension": "string",
- "size": 0,
- "mime_type": "string",
- "width": 0,
- "height": 0,
- "has_preview_image": true
}
], - "images": { },
- "reactions": [
- {
- "user_id": "string",
- "post_id": "string",
- "emoji_name": "string",
- "create_at": 0
}
]
}
}, - "property2": {
- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "edit_at": 0,
- "user_id": "string",
- "channel_id": "string",
- "root_id": "string",
- "parent_id": "string",
- "original_id": "string",
- "message": "string",
- "type": "string",
- "props": { },
- "hashtag": "string",
- "filenames": [
- "string"
], - "file_ids": [
- "string"
], - "pending_post_id": "string",
- "metadata": {
- "embeds": [
- {
- "type": "image",
- "url": "string",
- "data": { }
}
], - "emojis": [
- {
- "id": "string",
- "creator_id": "string",
- "name": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0
}
], - "files": [
- {
- "id": "string",
- "user_id": "string",
- "post_id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "name": "string",
- "extension": "string",
- "size": 0,
- "mime_type": "string",
- "width": 0,
- "height": 0,
- "has_preview_image": true
}
], - "images": { },
- "reactions": [
- {
- "user_id": "string",
- "post_id": "string",
- "emoji_name": "string",
- "create_at": 0
}
]
}
}
}, - "next_post_id": "string",
- "prev_post_id": "string"
}
]
Gets a list of file information objects for the files attached to a post.
-Must have read_channel
permission for the channel the post is in.
post_id required | string ID of the post - |
File info retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-[- {
- "id": "string",
- "user_id": "string",
- "post_id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "name": "string",
- "extension": "string",
- "size": 0,
- "mime_type": "string",
- "width": 0,
- "height": 0,
- "has_preview_image": true
}
]
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.
Must have read_channel
permission for the channel.
channel_id required | string The channel ID to get the posts for - |
page | integer Default: 0 The page to select - |
per_page | integer Default: 60 The number of posts per page - |
since | integer Provide a non-zero value in Unix time milliseconds to select posts created after that time - |
before | string A post id to select the posts that came before this one - |
after | string A post id to select the posts that came after this one - |
Post list retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "order": [
- "post_id1",
- "post_id12"
], - "posts": {
- "property1": {
- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "edit_at": 0,
- "user_id": "string",
- "channel_id": "string",
- "root_id": "string",
- "parent_id": "string",
- "original_id": "string",
- "message": "string",
- "type": "string",
- "props": { },
- "hashtag": "string",
- "filenames": [
- "string"
], - "file_ids": [
- "string"
], - "pending_post_id": "string",
- "metadata": {
- "embeds": [
- {
- "type": "image",
- "url": "string",
- "data": { }
}
], - "emojis": [
- {
- "id": "string",
- "creator_id": "string",
- "name": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0
}
], - "files": [
- {
- "id": "string",
- "user_id": "string",
- "post_id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "name": "string",
- "extension": "string",
- "size": 0,
- "mime_type": "string",
- "width": 0,
- "height": 0,
- "has_preview_image": true
}
], - "images": { },
- "reactions": [
- {
- "user_id": "string",
- "post_id": "string",
- "emoji_name": "string",
- "create_at": 0
}
]
}
}, - "property2": {
- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "edit_at": 0,
- "user_id": "string",
- "channel_id": "string",
- "root_id": "string",
- "parent_id": "string",
- "original_id": "string",
- "message": "string",
- "type": "string",
- "props": { },
- "hashtag": "string",
- "filenames": [
- "string"
], - "file_ids": [
- "string"
], - "pending_post_id": "string",
- "metadata": {
- "embeds": [
- {
- "type": "image",
- "url": "string",
- "data": { }
}
], - "emojis": [
- {
- "id": "string",
- "creator_id": "string",
- "name": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0
}
], - "files": [
- {
- "id": "string",
- "user_id": "string",
- "post_id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "name": "string",
- "extension": "string",
- "size": 0,
- "mime_type": "string",
- "width": 0,
- "height": 0,
- "has_preview_image": true
}
], - "images": { },
- "reactions": [
- {
- "user_id": "string",
- "post_id": "string",
- "emoji_name": "string",
- "create_at": 0
}
]
}
}
}, - "next_post_id": "string",
- "prev_post_id": "string"
}
Get the oldest unread post in the channel for the given user as well as the posts around it.
-Must be logged in as the user or have edit_other_users
permission, and must have read_channel
permission for the channel.
-Minimum server version: 5.14
user_id required | string ID of the user - |
channel_id required | string The channel ID to get the posts for - |
limit_before | integer Default: 60 Number of posts before the last unread posts. Maximum is 200 posts if limit is set greater than that. - |
limit_after | integer Default: 60 Number of posts after and including the last unread post. Maximum is 200 posts if limit is set greater than that. - |
Post list retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "order": [
- "post_id1",
- "post_id12"
], - "posts": {
- "property1": {
- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "edit_at": 0,
- "user_id": "string",
- "channel_id": "string",
- "root_id": "string",
- "parent_id": "string",
- "original_id": "string",
- "message": "string",
- "type": "string",
- "props": { },
- "hashtag": "string",
- "filenames": [
- "string"
], - "file_ids": [
- "string"
], - "pending_post_id": "string",
- "metadata": {
- "embeds": [
- {
- "type": "image",
- "url": "string",
- "data": { }
}
], - "emojis": [
- {
- "id": "string",
- "creator_id": "string",
- "name": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0
}
], - "files": [
- {
- "id": "string",
- "user_id": "string",
- "post_id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "name": "string",
- "extension": "string",
- "size": 0,
- "mime_type": "string",
- "width": 0,
- "height": 0,
- "has_preview_image": true
}
], - "images": { },
- "reactions": [
- {
- "user_id": "string",
- "post_id": "string",
- "emoji_name": "string",
- "create_at": 0
}
]
}
}, - "property2": {
- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "edit_at": 0,
- "user_id": "string",
- "channel_id": "string",
- "root_id": "string",
- "parent_id": "string",
- "original_id": "string",
- "message": "string",
- "type": "string",
- "props": { },
- "hashtag": "string",
- "filenames": [
- "string"
], - "file_ids": [
- "string"
], - "pending_post_id": "string",
- "metadata": {
- "embeds": [
- {
- "type": "image",
- "url": "string",
- "data": { }
}
], - "emojis": [
- {
- "id": "string",
- "creator_id": "string",
- "name": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0
}
], - "files": [
- {
- "id": "string",
- "user_id": "string",
- "post_id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "name": "string",
- "extension": "string",
- "size": 0,
- "mime_type": "string",
- "width": 0,
- "height": 0,
- "has_preview_image": true
}
], - "images": { },
- "reactions": [
- {
- "user_id": "string",
- "post_id": "string",
- "emoji_name": "string",
- "create_at": 0
}
]
}
}
}, - "next_post_id": "string",
- "prev_post_id": "string"
}
Search posts in the team and from the provided terms string.
-Must be authenticated and have the view_team
permission.
team_id required | string Team GUID - |
The search terms and logic to use in the search.
-terms required | string The search terms as inputed by the user. To search for posts from a user include |
is_or_search required | boolean Set to true if an Or search should be performed vs an And search. - |
time_zone_offset | integer Default: 0 Offset from UTC of user timezone for date searches. - |
include_deleted_channels | boolean Set to true if deleted channels should be included in the search. (archived channels) - |
page | integer Default: 0 The page to select. (Only works with Elasticsearch) - |
per_page | integer Default: 60 The number of posts per page. (Only works with Elasticsearch) - |
Post list retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "terms": "string",
- "is_or_search": true,
- "time_zone_offset": 0,
- "include_deleted_channels": true,
- "page": 0,
- "per_page": 60
}
{- "order": [
- "post_id1",
- "post_id12"
], - "posts": {
- "property1": {
- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "edit_at": 0,
- "user_id": "string",
- "channel_id": "string",
- "root_id": "string",
- "parent_id": "string",
- "original_id": "string",
- "message": "string",
- "type": "string",
- "props": { },
- "hashtag": "string",
- "filenames": [
- "string"
], - "file_ids": [
- "string"
], - "pending_post_id": "string",
- "metadata": {
- "embeds": [
- {
- "type": "image",
- "url": "string",
- "data": { }
}
], - "emojis": [
- {
- "id": "string",
- "creator_id": "string",
- "name": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0
}
], - "files": [
- {
- "id": "string",
- "user_id": "string",
- "post_id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "name": "string",
- "extension": "string",
- "size": 0,
- "mime_type": "string",
- "width": 0,
- "height": 0,
- "has_preview_image": true
}
], - "images": { },
- "reactions": [
- {
- "user_id": "string",
- "post_id": "string",
- "emoji_name": "string",
- "create_at": 0
}
]
}
}, - "property2": {
- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "edit_at": 0,
- "user_id": "string",
- "channel_id": "string",
- "root_id": "string",
- "parent_id": "string",
- "original_id": "string",
- "message": "string",
- "type": "string",
- "props": { },
- "hashtag": "string",
- "filenames": [
- "string"
], - "file_ids": [
- "string"
], - "pending_post_id": "string",
- "metadata": {
- "embeds": [
- {
- "type": "image",
- "url": "string",
- "data": { }
}
], - "emojis": [
- {
- "id": "string",
- "creator_id": "string",
- "name": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0
}
], - "files": [
- {
- "id": "string",
- "user_id": "string",
- "post_id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "name": "string",
- "extension": "string",
- "size": 0,
- "mime_type": "string",
- "width": 0,
- "height": 0,
- "has_preview_image": true
}
], - "images": { },
- "reactions": [
- {
- "user_id": "string",
- "post_id": "string",
- "emoji_name": "string",
- "create_at": 0
}
]
}
}
}, - "matches": {
- "post_id1": [
- "search match 1",
- "search match 2"
]
}
}
Pin a post to a channel it is in based from the provided post id string.
-Must be authenticated and have the read_channel
permission to the channel the post is in.
post_id required | string Post GUID - |
Pinned post successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "status": "string"
}
Unpin a post to a channel it is in based from the provided post id string.
-Must be authenticated and have the read_channel
permission to the channel the post is in.
post_id required | string Post GUID - |
Unpinned post successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "status": "string"
}
Perform a post action, which allows users to interact with integrations through posts.
-Must be authenticated and have the read_channel
permission to the channel the post is in.
post_id required | string Post GUID - |
action_id required | string Action GUID - |
Post action successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "status": "string"
}
Uploads a file that can later be attached to a post.
-This request can either be a multipart/form-data request with a channel_id, files and optional -client_ids defined in the FormData, or it can be a request with the channel_id and filename -defined as query parameters with the contents of a single file in the body of the request.
-Only multipart/form-data requests are supported by server versions up to and including 4.7. -Server versions 4.8 and higher support both types of requests.
-Must have upload_file
permission.
channel_id | string The ID of the channel that this file will be uploaded to - |
filename | string The name of the file to be uploaded - |
files | string <binary> A file to be uploaded - |
channel_id | string The ID of the channel that this file will be uploaded to - |
client_ids | string A unique identifier for the file that will be returned in the response - |
Corresponding lists of the provided client_ids and the metadata that has been stored in the database for each one
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Content too large
-Feature is disabled
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -file, err := os.Open("file.png") -if err != nil { - fmt.Fprintf(os.Stderr, "%v\n", err) -} -defer file.Close(); - -buf := bytes.NewBuffer(nil) -io.Copy(buf, file) -data := buf.Bytes() - -channelID := "4xp9fdt77pncbef59f4k1qe83o" -filename := "file.png" - -fileUploadResponse, response := Client.UploadFile(data, channelID, filename) -
{- "file_infos": [
- {
- "id": "string",
- "user_id": "string",
- "post_id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "name": "string",
- "extension": "string",
- "size": 0,
- "mime_type": "string",
- "width": 0,
- "height": 0,
- "has_preview_image": true
}
], - "client_ids": [
- "string"
]
}
Gets a file that has been uploaded previously.
-Must have read_channel
permission or be uploader of the file.
file_id required | string The ID of the file to get - |
Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-Feature is disabled
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -fileID := "4xp9fdt77pncbef59f4k1qe83o" - -data, resp := Client.GetFile(fileID) -
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Gets a file's thumbnail.
-Must have read_channel
permission or be uploader of the file.
file_id required | string The ID of the file to get - |
Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-Feature is disabled
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -fileID := "4xp9fdt77pncbef59f4k1qe83o" - -data, resp := Client.GetFileThumbnail(fileID) -
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Gets a file's preview.
-Must have read_channel
permission or be uploader of the file.
file_id required | string The ID of the file to get - |
Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-Feature is disabled
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -fileID := "4xp9fdt77pncbef59f4k1qe83o" - -data, resp := Client.GetFilePreview(fileID) -
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Gets a public link for a file that can be accessed without logging into Mattermost.
-Must have read_channel
permission or be uploader of the file.
file_id required | string The ID of the file to get a link for - |
A publicly accessible link to the given file
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-Feature is disabled
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -fileID := "4xp9fdt77pncbef59f4k1qe83o" - -data, resp := Client.GetFileLink(fileID) -
{- "link": "string"
}
Gets a file's info.
-Must have read_channel
permission or be uploader of the file.
file_id required | string The ID of the file info to get - |
The stored metadata for the given file
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-Feature is disabled
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -fileID := "4xp9fdt77pncbef59f4k1qe83o" - -info, resp := Client.GetFileInfo(fileID) -
{- "id": "string",
- "user_id": "string",
- "post_id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "name": "string",
- "extension": "string",
- "size": 0,
- "mime_type": "string",
- "width": 0,
- "height": 0,
- "has_preview_image": true
}
Get a list of the user's preferences.
-Must be logged in as the user being updated or have the edit_other_users
permission.
user_id required | string User GUID - |
User preferences retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-[- {
- "user_id": "string",
- "category": "string",
- "name": "string",
- "value": "string"
}
]
Save a list of the user's preferences.
-Must be logged in as the user being updated or have the edit_other_users
permission.
user_id required | string User GUID - |
List of preference objects
-user_id | string The ID of the user that owns this preference - |
category | string |
name | string |
value | string |
User preferences saved successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-[- {
- "user_id": "string",
- "category": "string",
- "name": "string",
- "value": "string"
}
]
{- "status": "string"
}
Delete a list of the user's preferences.
-Must be logged in as the user being updated or have the edit_other_users
permission.
user_id required | string User GUID - |
List of preference objects
-user_id | string The ID of the user that owns this preference - |
category | string |
name | string |
value | string |
User preferences saved successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-[- {
- "user_id": "string",
- "category": "string",
- "name": "string",
- "value": "string"
}
]
{- "status": "string"
}
Lists the current user's stored preferences in the given category.
-Must be logged in as the user being updated or have the edit_other_users
permission.
user_id required | string User GUID - |
category required | string The category of a group of preferences - |
A list of all of the current user's preferences in the given category
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-[- {
- "user_id": "string",
- "category": "string",
- "name": "string",
- "value": "string"
}
]
Gets a single preference for the current user with the given category and name.
-Must be logged in as the user being updated or have the edit_other_users
permission.
user_id required | string User GUID - |
category required | string The category of a group of preferences - |
preference_name required | string The name of the preference - |
A single preference for the current user in the current categorylist of all of the current user's preferences in the given category.
-Invalid or missing parameters in URL or request body
-No access token provided
-{- "user_id": "string",
- "category": "string",
- "name": "string",
- "value": "string"
}
Get user status by id from the server.
-Must be authenticated.
-user_id required | string User ID - |
User status retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-{- "user_id": "string",
- "status": "string",
- "manual": true,
- "last_activity_at": 0
}
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.
-Must have edit_other_users
permission for the team.
user_id required | string User ID - |
Status object that is to be updated
-user_id required | string User ID - |
status required | string User status, can be |
User status update successful
-Invalid or missing parameters in URL or request body
-No access token provided
-{- "user_id": "string",
- "status": "string"
}
{- "user_id": "string",
- "status": "string",
- "manual": true,
- "last_activity_at": 0
}
Get a list of user statuses by id from the server.
-Must be authenticated.
-List of user ids to fetch
-User statuses retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-[- "string"
]
[- {
- "user_id": "string",
- "status": "string",
- "manual": true,
- "last_activity_at": 0
}
]
Create a custom emoji for the team.
-Must be authenticated.
-image required | string <binary> A file to be uploaded - |
emoji required | string A JSON object containing a |
Emoji creation successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Content too large
-Feature is disabled
-{- "id": "string",
- "creator_id": "string",
- "name": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0
}
Get a page of metadata for custom emoji on the system. Since server version 4.7, sort using the sort
query parameter.
Must be authenticated.
-page | integer Default: 0 The page to select. - |
per_page | integer Default: 60 The number of users per page. - |
sort | string Default: "" Either blank for no sorting or "name" to sort by emoji names. Minimum server version for sorting is 4.7. - |
Emoji list retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-{- "id": "string",
- "creator_id": "string",
- "name": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0
}
Get some metadata for a custom emoji.
-Must be authenticated.
-emoji_id required | string Emoji GUID - |
Emoji retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Resource not found
-Feature is disabled
-{- "id": "string",
- "creator_id": "string",
- "name": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0
}
Delete a custom emoji.
-Must have the manage_team
or manage_system
permissions or be the user who created the emoji.
emoji_id required | string Emoji GUID - |
Emoji delete successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-{- "id": "string",
- "creator_id": "string",
- "name": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0
}
Get some metadata for a custom emoji using its name.
-Must be authenticated.
-Minimum server version: 4.7
-emoji_name required | string Emoji name - |
Emoji retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Resource not found
-Feature is disabled
-{- "id": "string",
- "creator_id": "string",
- "name": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0
}
Get the image for a custom emoji.
-Must be authenticated.
-emoji_id required | string Emoji GUID - |
Emoji image retrieval successful
-No access token provided
-Do not have appropriate permissions
-Resource not found
-Something went wrong with the server
-Feature is disabled
-{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Search for custom emoji by name based on search criteria provided in the request body. A maximum of 200 results are returned.
-Must be authenticated.
-Minimum server version: 4.7
-Search criteria
-term required | string The term to match against the emoji name. - |
prefix_only | string Set to only search for names starting with the search term. - |
Emoji list retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-{- "term": "string",
- "prefix_only": "string"
}
[- {
- "id": "string",
- "creator_id": "string",
- "name": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0
}
]
Get a list of custom emoji with names starting with or matching the provided name. Returns a maximum of 100 results.
-Must be authenticated.
-Minimum server version: 4.7
-name required | string The emoji name to search. - |
Emoji list retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-{- "id": "string",
- "creator_id": "string",
- "name": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0
}
Create a reaction.
-Must have read_channel
permission for the channel the post is in.
The user's reaction with its post_id, user_id, and emoji_name fields set
-user_id | string The ID of the user that made this reaction - |
post_id | string The ID of the post to which this reaction was made - |
emoji_name | string The name of the emoji that was used for this reaction - |
create_at | integer <int64> The time in milliseconds this reaction was made - |
Reaction creation successful
-Invalid or missing parameters in URL or request body
-Do not have appropriate permissions
-{- "user_id": "string",
- "post_id": "string",
- "emoji_name": "string",
- "create_at": 0
}
{- "user_id": "string",
- "post_id": "string",
- "emoji_name": "string",
- "create_at": 0
}
Get a list of reactions made by all users to a given post.
-Must have read_channel
permission for the channel the post is in.
post_id required | string ID of a post - |
List reactions retrieve successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-[- {
- "user_id": "string",
- "post_id": "string",
- "emoji_name": "string",
- "create_at": 0
}
]
Deletes a reaction made by a user from the given post.
-Must be user or have manage_system
permission.
user_id required | string ID of the user - |
post_id required | string ID of the post - |
emoji_name required | string emoji name - |
Reaction deletion successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "status": "string"
}
Get a list of reactions made by all users to a given post.
-Must have read_channel
permission for the channel the post is in.
Minimum server version: 5.8
-Array of post IDs
-Reactions retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-[- "string"
]
{- "property1": [
- {
- "user_id": "string",
- "post_id": "string",
- "emoji_name": "string",
- "create_at": 0
}
], - "property2": [
- {
- "user_id": "string",
- "post_id": "string",
- "emoji_name": "string",
- "create_at": 0
}
]
}
Create an incoming webhook for a channel.
-manage_webhooks
for the channel the webhook is in.
Incoming webhook to be created
-channel_id required | string The ID of a public channel or private group that receives the webhook payloads. - |
display_name | string The display name for this incoming webhook - |
description | string The description for this incoming webhook - |
username | string The username this incoming webhook will post as. - |
icon_url | string The profile picture this incoming webhook will use when posting. - |
Incoming webhook creation successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "channel_id": "string",
- "display_name": "string",
- "description": "string",
- "username": "string",
- "icon_url": "string"
}
{- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "channel_id": "string",
- "description": "string",
- "display_name": "string"
}
Get a page of a list of incoming webhooks. Optionally filter for a specific team using query parameters.
-manage_webhooks
for the system or manage_webhooks
for the specific team.
page | integer Default: 0 The page to select. - |
per_page | integer Default: 60 The number of hooks per page. - |
team_id | string The ID of the team to get hooks for. - |
Incoming webhooks retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-[- {
- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "channel_id": "string",
- "description": "string",
- "display_name": "string"
}
]
Get an incoming webhook given the hook id.
-manage_webhooks
for system or manage_webhooks
for the specific team or manage_webhooks
for the channel.
hook_id required | string Incoming Webhook GUID - |
Webhook retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-{- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "channel_id": "string",
- "description": "string",
- "display_name": "string"
}
Update an incoming webhook given the hook id.
-manage_webhooks
for system or manage_webhooks
for the specific team or manage_webhooks
for the channel.
hook_id required | string Incoming Webhook GUID - |
Incoming webhook to be updated
-hook_id | string Incoming webhook GUID - |
channel_id required | string The ID of a public channel or private group that receives the webhook payloads. - |
display_name required | string The display name for this incoming webhook - |
description required | string The description for this incoming webhook - |
username | string The username this incoming webhook will post as. - |
icon_url | string The profile picture this incoming webhook will use when posting. - |
Webhook update successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-{- "hook_id": "string",
- "channel_id": "string",
- "display_name": "string",
- "description": "string",
- "username": "string",
- "icon_url": "string"
}
{- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "channel_id": "string",
- "description": "string",
- "display_name": "string"
}
Create an outgoing webhook for a team.
-manage_webhooks
for the team the webhook is in.
Outgoing webhook to be created
-team_id required | string The ID of the team that the webhook watchs - |
channel_id | string The ID of a public channel that the webhook watchs - |
description | string The description for this outgoing webhook - |
display_name required | string The display name for this outgoing webhook - |
trigger_words required | Array of strings List of words for the webhook to trigger on - |
trigger_when | integer When to trigger the webhook, |
callback_urls required | Array of strings The URLs to POST the payloads to when the webhook is triggered - |
content_type | string Default: "application/x-www-form-urlencoded" The format to POST the data in, either |
Outgoing webhook creation successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-{- "team_id": "string",
- "channel_id": "string",
- "description": "string",
- "display_name": "string",
- "trigger_words": [
- "string"
], - "trigger_when": 0,
- "callback_urls": [
- "string"
], - "content_type": "application/x-www-form-urlencoded"
}
{- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "creator_id": "string",
- "team_id": "string",
- "channel_id": "string",
- "description": "string",
- "display_name": "string",
- "trigger_words": [
- "string"
], - "trigger_when": 0,
- "callback_urls": [
- "string"
], - "content_type": "application/x-www-form-urlencoded"
}
Get a page of a list of outgoing webhooks. Optionally filter for a specific team or channel using query parameters.
-manage_webhooks
for the system or manage_webhooks
for the specific team/channel.
page | integer Default: 0 The page to select. - |
per_page | integer Default: 60 The number of hooks per page. - |
team_id | string The ID of the team to get hooks for. - |
channel_id | string The ID of the channel to get hooks for. - |
Outgoing webhooks retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-[- {
- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "creator_id": "string",
- "team_id": "string",
- "channel_id": "string",
- "description": "string",
- "display_name": "string",
- "trigger_words": [
- "string"
], - "trigger_when": 0,
- "callback_urls": [
- "string"
], - "content_type": "application/x-www-form-urlencoded"
}
]
Get an outgoing webhook given the hook id.
-manage_webhooks
for system or manage_webhooks
for the specific team or manage_webhooks
for the channel.
hook_id required | string Outgoing webhook GUID - |
Outgoing webhook retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-{- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "creator_id": "string",
- "team_id": "string",
- "channel_id": "string",
- "description": "string",
- "display_name": "string",
- "trigger_words": [
- "string"
], - "trigger_when": 0,
- "callback_urls": [
- "string"
], - "content_type": "application/x-www-form-urlencoded"
}
Delete an outgoing webhook given the hook id.
-manage_webhooks
for system or manage_webhooks
for the specific team or manage_webhooks
for the channel.
hook_id required | string Outgoing webhook GUID - |
Webhook deletion successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-{- "status": "string"
}
Update an outgoing webhook given the hook id.
-manage_webhooks
for system or manage_webhooks
for the specific team or manage_webhooks
for the channel.
hook_id required | string outgoing Webhook GUID - |
Outgoing webhook to be updated
-hook_id | string Outgoing webhook GUID - |
channel_id required | string The ID of a public channel or private group that receives the webhook payloads. - |
display_name required | string The display name for this incoming webhook - |
description required | string The description for this incoming webhook - |
Webhook update successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-{- "hook_id": "string",
- "channel_id": "string",
- "display_name": "string",
- "description": "string"
}
{- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "creator_id": "string",
- "team_id": "string",
- "channel_id": "string",
- "description": "string",
- "display_name": "string",
- "trigger_words": [
- "string"
], - "trigger_when": 0,
- "callback_urls": [
- "string"
], - "content_type": "application/x-www-form-urlencoded"
}
Regenerate the token for the outgoing webhook.
-manage_webhooks
for system or manage_webhooks
for the specific team or manage_webhooks
for the channel.
hook_id required | string Outgoing webhook GUID - |
Webhook token regenerate successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-{- "status": "string"
}
Create a command for a team.
-manage_slash_commands
for the team the command is in.
command to be created
-team_id required | string Team ID to where the command should be created - |
method required | string
|
trigger required | string Activation word to trigger the command - |
url required | string The URL that the command will make the request - |
Command creation successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-{- "team_id": "string",
- "method": "string",
- "trigger": "string",
- "url": "string"
}
{- "id": "string",
- "token": "string",
- "create_at": 0,
- "update_at": 0,
- "deleted_at": 0,
- "creator_id": "string",
- "team_id": "string",
- "trigger": "string",
- "method": "string",
- "username": "string",
- "icon_url": "string",
- "auto_complete": true,
- "auto_complete_desc": "string",
- "auto_complete_hint": "string",
- "display_name": "string",
- "description": "string",
- "url": "string"
}
List commands for a team.
-manage_slash_commands
if need list custom commands.
team_id | string The team id. - |
custom_only | boolean Default: false To get only the custom commands. If set to false will get the custom -if the user have access plus the system commands, otherwise just the system commands. - |
List Commands retrieve successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -// ListCommands -// The second parameter is to set if you want only custom commands (true) or defaults commands (false) -listCommands, resp := Client.ListCommands(<TEAMID>, true) -
[- {
- "id": "string",
- "token": "string",
- "create_at": 0,
- "update_at": 0,
- "deleted_at": 0,
- "creator_id": "string",
- "team_id": "string",
- "trigger": "string",
- "method": "string",
- "username": "string",
- "icon_url": "string",
- "auto_complete": true,
- "auto_complete_desc": "string",
- "auto_complete_hint": "string",
- "display_name": "string",
- "description": "string",
- "url": "string"
}
]
List autocomplete commands in the team.
-view_team
for the team.
team_id required | string Team GUID - |
Autocomplete commands retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -// ListAutocompleteCommands -listCommands, resp := Client.ListAutocompleteCommands(<TEAMID>) -
[- {
- "id": "string",
- "token": "string",
- "create_at": 0,
- "update_at": 0,
- "deleted_at": 0,
- "creator_id": "string",
- "team_id": "string",
- "trigger": "string",
- "method": "string",
- "username": "string",
- "icon_url": "string",
- "auto_complete": true,
- "auto_complete_desc": "string",
- "auto_complete_hint": "string",
- "display_name": "string",
- "description": "string",
- "url": "string"
}
]
Get a command definition based on command id string.
-Must have manage_slash_commands
permission for the team the command is in.
Minimum server version: 5.22
-command_id required | string ID of the command to get - |
Command get successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Resource not found
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -// GetCommand -cmd, resp := Client.GetCommand(<COMMANDID>) -
{- "id": "string",
- "token": "string",
- "create_at": 0,
- "update_at": 0,
- "deleted_at": 0,
- "creator_id": "string",
- "team_id": "string",
- "trigger": "string",
- "method": "string",
- "username": "string",
- "icon_url": "string",
- "auto_complete": true,
- "auto_complete_desc": "string",
- "auto_complete_hint": "string",
- "display_name": "string",
- "description": "string",
- "url": "string"
}
Update a single command based on command id string and Command struct.
-Must have manage_slash_commands
permission for the team the command is in.
command_id required | string ID of the command to update - |
id | string The ID of the slash command - |
token | string The token which is used to verify the source of the payload - |
create_at | integer The time in milliseconds the command was created - |
update_at | integer <int64> The time in milliseconds the command was last updated - |
deleted_at | integer <int64> The time in milliseconds the command was deleted, 0 if never deleted - |
creator_id | string The user id for the commands creator - |
team_id | string The team id for which this command is configured - |
trigger | string The string that triggers this command - |
method | string Is the trigger done with HTTP Get ('G') or HTTP Post ('P') - |
username | string What is the username for the response post - |
icon_url | string The url to find the icon for this users avatar - |
auto_complete | boolean Use auto complete for this command - |
auto_complete_desc | string The description for this command shown when selecting the command - |
auto_complete_hint | string The hint for this command - |
display_name | string Display name for the command - |
description | string Description for this command - |
url | string The URL that is triggered - |
Command updated successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "id": "string",
- "token": "string",
- "create_at": 0,
- "update_at": 0,
- "deleted_at": 0,
- "creator_id": "string",
- "team_id": "string",
- "trigger": "string",
- "method": "string",
- "username": "string",
- "icon_url": "string",
- "auto_complete": true,
- "auto_complete_desc": "string",
- "auto_complete_hint": "string",
- "display_name": "string",
- "description": "string",
- "url": "string"
}
{- "id": "string",
- "token": "string",
- "create_at": 0,
- "update_at": 0,
- "deleted_at": 0,
- "creator_id": "string",
- "team_id": "string",
- "trigger": "string",
- "method": "string",
- "username": "string",
- "icon_url": "string",
- "auto_complete": true,
- "auto_complete_desc": "string",
- "auto_complete_hint": "string",
- "display_name": "string",
- "description": "string",
- "url": "string"
}
Delete a command based on command id string.
-Must have manage_slash_commands
permission for the team the command is in.
command_id required | string ID of the command to delete - |
Command deletion successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -// DeleteCommand -ok, resp := Client.DeleteCommand(<COMMANDID>) -
{- "status": "string"
}
Move a command to a different team based on command id string.
-Must have manage_slash_commands
permission for the team the command is currently in and the destination team.
Minimum server version: 5.22
-command_id required | string ID of the command to move - |
team_id | string Destination teamId - |
Command move successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-{- "team_id": "string"
}
{- "status": "string"
}
Generate a new token for the command based on command id string.
-Must have manage_slash_commands
permission for the team the command is in.
command_id required | string ID of the command to generate the new token - |
Token generation successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -// RegenCommandToken -newToken, resp := Client.RegenCommandToken(<COMMANDID>) -
{- "token": "string"
}
Execute a command on a team.
-Must have use_slash_commands
permission for the team the command is in.
command to be executed
-channel_id required | string Channel Id where the command will execute - |
command required | string The slash command to execute - |
Command execution successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-{- "channel_id": "string",
- "command": "string"
}
{- "ResponseType": "string",
- "Text": "string",
- "Username": "string",
- "IconURL": "string",
- "GotoLocation": "string",
- "Attachments": [
- {
- "Id": "string",
- "Fallback": "string",
- "Color": "string",
- "Pretext": "string",
- "AuthorName": "string",
- "AuthorLink": "string",
- "AuthorIcon": "string",
- "Title": "string",
- "TitleLink": "string",
- "Text": "string",
- "Fields": [
- {
- "Title": "string",
- "Value": "string",
- "Short": true
}
], - "ImageURL": "string",
- "ThumbURL": "string",
- "Footer": "string",
- "FooterIcon": "string",
- "Timestamp": "string"
}
]
}
Get Open Graph Metadata for a specif URL. Use the Open Graph protocol to get some generic metadata about a URL. Used for creating link previews.
-Minimum server version: 3.10
-No permission required but must be logged in.
-url required | string The URL to get Open Graph Metadata. - |
Open Graph retrieval successful
-Feature is disabled
-{- "url": "string"
}
{- "type": "string",
- "url": "string",
- "title": "string",
- "description": "string",
- "determiner": "string",
- "site_name": "string",
- "locale": "string",
- "locales_alternate": [
- "string"
], - "images": [
- {
- "url": "string",
- "secure_url": "string",
- "type": "string",
- "width": 0,
- "height": 0
}
], - "videos": [
- {
- "url": "string",
- "secure_url": "string",
- "type": "string",
- "width": 0,
- "height": 0
}
], - "audios": [
- {
- "url": "string",
- "secure_url": "string",
- "type": "string"
}
], - "article": {
- "published_time": "string",
- "modified_time": "string",
- "expiration_time": "string",
- "section": "string",
- "tags": [
- "string"
], - "authors": [
- {
- "first_name": "string",
- "last_name": "string",
- "username": "string",
- "gender": "string"
}
]
}, - "book": {
- "isbn": "string",
- "release_date": "string",
- "tags": [
- "string"
], - "authors": [
- {
- "first_name": "string",
- "last_name": "string",
- "username": "string",
- "gender": "string"
}
]
}, - "profile": {
- "first_name": "string",
- "last_name": "string",
- "username": "string",
- "gender": "string"
}
}
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.
-Minimum server version: 3.10
Must be logged in.
-Status of the system
-Something went wrong with the server
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -// GetPing -status, resp := Client.GetPing() -
{- "status": "string"
}
Recycle database connections by closing and reconnecting all connections to master and read replica databases.
-Must have manage_system
permission.
Database recycle successful
-Do not have appropriate permissions
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -ok, resp := Client.DatabaseRecycle() -
{- "status": "string"
}
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.
-Must have manage_system
permission.
Mattermost configuration
-ServiceSettings | object |
TeamSettings | object |
SqlSettings | object |
LogSettings | object |
PasswordSettings | object |
FileSettings | object |
EmailSettings | object |
RateLimitSettings | object |
PrivacySettings | object |
SupportSettings | object |
GitLabSettings | object |
GoogleSettings | object |
Office365Settings | object |
LdapSettings | object |
ComplianceSettings | object |
LocalizationSettings | object |
SamlSettings | object |
NativeAppSettings | object |
ClusterSettings | object |
MetricsSettings | object |
AnalyticsSettings | object |
Email successful sent
-Do not have appropriate permissions
-Something went wrong with the server
-{- "ServiceSettings": {
- "SiteURL": "string",
- "ListenAddress": "string",
- "ConnectionSecurity": "string",
- "TLSCertFile": "string",
- "TLSKeyFile": "string",
- "UseLetsEncrypt": true,
- "LetsEncryptCertificateCacheFile": "string",
- "Forward80To443": true,
- "ReadTimeout": 0,
- "WriteTimeout": 0,
- "MaximumLoginAttempts": 0,
- "SegmentDeveloperKey": "string",
- "GoogleDeveloperKey": "string",
- "EnableOAuthServiceProvider": true,
- "EnableIncomingWebhooks": true,
- "EnableOutgoingWebhooks": true,
- "EnableCommands": true,
- "EnableOnlyAdminIntegrations": true,
- "EnablePostUsernameOverride": true,
- "EnablePostIconOverride": true,
- "EnableTesting": true,
- "EnableDeveloper": true,
- "EnableSecurityFixAlert": true,
- "EnableInsecureOutgoingConnections": true,
- "EnableMultifactorAuthentication": true,
- "EnforceMultifactorAuthentication": true,
- "AllowCorsFrom": "string",
- "SessionLengthWebInDays": 0,
- "SessionLengthMobileInDays": 0,
- "SessionLengthSSOInDays": 0,
- "SessionCacheInMinutes": 0,
- "WebsocketSecurePort": 0,
- "WebsocketPort": 0,
- "WebserverMode": "string",
- "EnableCustomEmoji": true,
- "RestrictCustomEmojiCreation": "string"
}, - "TeamSettings": {
- "SiteName": "string",
- "MaxUsersPerTeam": 0,
- "EnableTeamCreation": true,
- "EnableUserCreation": true,
- "EnableOpenServer": true,
- "RestrictCreationToDomains": "string",
- "EnableCustomBrand": true,
- "CustomBrandText": "string",
- "CustomDescriptionText": "string",
- "RestrictDirectMessage": "string",
- "RestrictTeamInvite": "string",
- "RestrictPublicChannelManagement": "string",
- "RestrictPrivateChannelManagement": "string",
- "RestrictPublicChannelCreation": "string",
- "RestrictPrivateChannelCreation": "string",
- "RestrictPublicChannelDeletion": "string",
- "RestrictPrivateChannelDeletion": "string",
- "UserStatusAwayTimeout": 0,
- "MaxChannelsPerTeam": 0,
- "MaxNotificationsPerChannel": 0
}, - "SqlSettings": {
- "DriverName": "string",
- "DataSource": "string",
- "DataSourceReplicas": [
- "string"
], - "MaxIdleConns": 0,
- "MaxOpenConns": 0,
- "Trace": true,
- "AtRestEncryptKey": "string"
}, - "LogSettings": {
- "EnableConsole": true,
- "ConsoleLevel": "string",
- "EnableFile": true,
- "FileLevel": "string",
- "FileLocation": "string",
- "EnableWebhookDebugging": true,
- "EnableDiagnostics": true
}, - "PasswordSettings": {
- "MinimumLength": 0,
- "Lowercase": true,
- "Number": true,
- "Uppercase": true,
- "Symbol": true
}, - "FileSettings": {
- "MaxFileSize": 0,
- "DriverName": "string",
- "Directory": "string",
- "EnablePublicLink": true,
- "PublicLinkSalt": "string",
- "ThumbnailWidth": 0,
- "ThumbnailHeight": 0,
- "PreviewWidth": 0,
- "PreviewHeight": 0,
- "ProfileWidth": 0,
- "ProfileHeight": 0,
- "InitialFont": "string",
- "AmazonS3AccessKeyId": "string",
- "AmazonS3SecretAccessKey": "string",
- "AmazonS3Bucket": "string",
- "AmazonS3Region": "string",
- "AmazonS3Endpoint": "string",
- "AmazonS3SSL": true
}, - "EmailSettings": {
- "EnableSignUpWithEmail": true,
- "EnableSignInWithEmail": true,
- "EnableSignInWithUsername": true,
- "SendEmailNotifications": true,
- "RequireEmailVerification": true,
- "FeedbackName": "string",
- "FeedbackEmail": "string",
- "FeedbackOrganization": "string",
- "SMTPUsername": "string",
- "SMTPPassword": "string",
- "SMTPServer": "string",
- "SMTPPort": "string",
- "ConnectionSecurity": "string",
- "InviteSalt": "string",
- "PasswordResetSalt": "string",
- "SendPushNotifications": true,
- "PushNotificationServer": "string",
- "PushNotificationContents": "string",
- "EnableEmailBatching": true,
- "EmailBatchingBufferSize": 0,
- "EmailBatchingInterval": 0
}, - "RateLimitSettings": {
- "Enable": true,
- "PerSec": 0,
- "MaxBurst": 0,
- "MemoryStoreSize": 0,
- "VaryByRemoteAddr": true,
- "VaryByHeader": "string"
}, - "PrivacySettings": {
- "ShowEmailAddress": true,
- "ShowFullName": true
}, - "SupportSettings": {
- "TermsOfServiceLink": "string",
- "PrivacyPolicyLink": "string",
- "AboutLink": "string",
- "HelpLink": "string",
- "ReportAProblemLink": "string",
- "SupportEmail": "string"
}, - "GitLabSettings": {
- "Enable": true,
- "Secret": "string",
- "Id": "string",
- "Scope": "string",
- "AuthEndpoint": "string",
- "TokenEndpoint": "string",
- "UserApiEndpoint": "string"
}, - "GoogleSettings": {
- "Enable": true,
- "Secret": "string",
- "Id": "string",
- "Scope": "string",
- "AuthEndpoint": "string",
- "TokenEndpoint": "string",
- "UserApiEndpoint": "string"
}, - "Office365Settings": {
- "Enable": true,
- "Secret": "string",
- "Id": "string",
- "Scope": "string",
- "AuthEndpoint": "string",
- "TokenEndpoint": "string",
- "UserApiEndpoint": "string"
}, - "LdapSettings": {
- "Enable": true,
- "LdapServer": "string",
- "LdapPort": 0,
- "ConnectionSecurity": "string",
- "BaseDN": "string",
- "BindUsername": "string",
- "BindPassword": "string",
- "UserFilter": "string",
- "FirstNameAttribute": "string",
- "LastNameAttribute": "string",
- "EmailAttribute": "string",
- "UsernameAttribute": "string",
- "NicknameAttribute": "string",
- "IdAttribute": "string",
- "PositionAttribute": "string",
- "SyncIntervalMinutes": 0,
- "SkipCertificateVerification": true,
- "QueryTimeout": 0,
- "MaxPageSize": 0,
- "LoginFieldName": "string"
}, - "ComplianceSettings": {
- "Enable": true,
- "Directory": "string",
- "EnableDaily": true
}, - "LocalizationSettings": {
- "DefaultServerLocale": "string",
- "DefaultClientLocale": "string",
- "AvailableLocales": "string"
}, - "SamlSettings": {
- "Enable": true,
- "Verify": true,
- "Encrypt": true,
- "IdpUrl": "string",
- "IdpDescriptorUrl": "string",
- "AssertionConsumerServiceURL": "string",
- "IdpCertificateFile": "string",
- "PublicCertificateFile": "string",
- "PrivateKeyFile": "string",
- "FirstNameAttribute": "string",
- "LastNameAttribute": "string",
- "EmailAttribute": "string",
- "UsernameAttribute": "string",
- "NicknameAttribute": "string",
- "LocaleAttribute": "string",
- "PositionAttribute": "string",
- "LoginButtonText": "string"
}, - "NativeAppSettings": {
- "AppDownloadLink": "string",
- "AndroidAppDownloadLink": "string",
- "IosAppDownloadLink": "string"
}, - "ClusterSettings": {
- "Enable": true,
- "InterNodeListenAddress": "string",
- "InterNodeUrls": [
- "string"
]
}, - "MetricsSettings": {
- "Enable": true,
- "BlockProfileRate": 0,
- "ListenAddress": "string"
}, - "AnalyticsSettings": {
- "MaxUsersForStatistics": 0
}
}
{- "status": "string"
}
Sends a Ping request to the mattermost server using the specified Site URL.
-Must have manage_system
permission.
Minimum server version: 5.16
-site_url required | string The Site URL to test - |
Site URL is valid
-Invalid or missing parameters in URL or request body
-Do not have appropriate permissions
-Something went wrong with the server
-{- "site_url": "string"
}
{- "status": "string"
}
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.
-Must have manage_system
permission.
-Minimum server version: 4.8
Mattermost configuration
-ServiceSettings | object |
TeamSettings | object |
SqlSettings | object |
LogSettings | object |
PasswordSettings | object |
FileSettings | object |
EmailSettings | object |
RateLimitSettings | object |
PrivacySettings | object |
SupportSettings | object |
GitLabSettings | object |
GoogleSettings | object |
Office365Settings | object |
LdapSettings | object |
ComplianceSettings | object |
LocalizationSettings | object |
SamlSettings | object |
NativeAppSettings | object |
ClusterSettings | object |
MetricsSettings | object |
AnalyticsSettings | object |
S3 Test successful
-Do not have appropriate permissions
-Something went wrong with the server
-{- "ServiceSettings": {
- "SiteURL": "string",
- "ListenAddress": "string",
- "ConnectionSecurity": "string",
- "TLSCertFile": "string",
- "TLSKeyFile": "string",
- "UseLetsEncrypt": true,
- "LetsEncryptCertificateCacheFile": "string",
- "Forward80To443": true,
- "ReadTimeout": 0,
- "WriteTimeout": 0,
- "MaximumLoginAttempts": 0,
- "SegmentDeveloperKey": "string",
- "GoogleDeveloperKey": "string",
- "EnableOAuthServiceProvider": true,
- "EnableIncomingWebhooks": true,
- "EnableOutgoingWebhooks": true,
- "EnableCommands": true,
- "EnableOnlyAdminIntegrations": true,
- "EnablePostUsernameOverride": true,
- "EnablePostIconOverride": true,
- "EnableTesting": true,
- "EnableDeveloper": true,
- "EnableSecurityFixAlert": true,
- "EnableInsecureOutgoingConnections": true,
- "EnableMultifactorAuthentication": true,
- "EnforceMultifactorAuthentication": true,
- "AllowCorsFrom": "string",
- "SessionLengthWebInDays": 0,
- "SessionLengthMobileInDays": 0,
- "SessionLengthSSOInDays": 0,
- "SessionCacheInMinutes": 0,
- "WebsocketSecurePort": 0,
- "WebsocketPort": 0,
- "WebserverMode": "string",
- "EnableCustomEmoji": true,
- "RestrictCustomEmojiCreation": "string"
}, - "TeamSettings": {
- "SiteName": "string",
- "MaxUsersPerTeam": 0,
- "EnableTeamCreation": true,
- "EnableUserCreation": true,
- "EnableOpenServer": true,
- "RestrictCreationToDomains": "string",
- "EnableCustomBrand": true,
- "CustomBrandText": "string",
- "CustomDescriptionText": "string",
- "RestrictDirectMessage": "string",
- "RestrictTeamInvite": "string",
- "RestrictPublicChannelManagement": "string",
- "RestrictPrivateChannelManagement": "string",
- "RestrictPublicChannelCreation": "string",
- "RestrictPrivateChannelCreation": "string",
- "RestrictPublicChannelDeletion": "string",
- "RestrictPrivateChannelDeletion": "string",
- "UserStatusAwayTimeout": 0,
- "MaxChannelsPerTeam": 0,
- "MaxNotificationsPerChannel": 0
}, - "SqlSettings": {
- "DriverName": "string",
- "DataSource": "string",
- "DataSourceReplicas": [
- "string"
], - "MaxIdleConns": 0,
- "MaxOpenConns": 0,
- "Trace": true,
- "AtRestEncryptKey": "string"
}, - "LogSettings": {
- "EnableConsole": true,
- "ConsoleLevel": "string",
- "EnableFile": true,
- "FileLevel": "string",
- "FileLocation": "string",
- "EnableWebhookDebugging": true,
- "EnableDiagnostics": true
}, - "PasswordSettings": {
- "MinimumLength": 0,
- "Lowercase": true,
- "Number": true,
- "Uppercase": true,
- "Symbol": true
}, - "FileSettings": {
- "MaxFileSize": 0,
- "DriverName": "string",
- "Directory": "string",
- "EnablePublicLink": true,
- "PublicLinkSalt": "string",
- "ThumbnailWidth": 0,
- "ThumbnailHeight": 0,
- "PreviewWidth": 0,
- "PreviewHeight": 0,
- "ProfileWidth": 0,
- "ProfileHeight": 0,
- "InitialFont": "string",
- "AmazonS3AccessKeyId": "string",
- "AmazonS3SecretAccessKey": "string",
- "AmazonS3Bucket": "string",
- "AmazonS3Region": "string",
- "AmazonS3Endpoint": "string",
- "AmazonS3SSL": true
}, - "EmailSettings": {
- "EnableSignUpWithEmail": true,
- "EnableSignInWithEmail": true,
- "EnableSignInWithUsername": true,
- "SendEmailNotifications": true,
- "RequireEmailVerification": true,
- "FeedbackName": "string",
- "FeedbackEmail": "string",
- "FeedbackOrganization": "string",
- "SMTPUsername": "string",
- "SMTPPassword": "string",
- "SMTPServer": "string",
- "SMTPPort": "string",
- "ConnectionSecurity": "string",
- "InviteSalt": "string",
- "PasswordResetSalt": "string",
- "SendPushNotifications": true,
- "PushNotificationServer": "string",
- "PushNotificationContents": "string",
- "EnableEmailBatching": true,
- "EmailBatchingBufferSize": 0,
- "EmailBatchingInterval": 0
}, - "RateLimitSettings": {
- "Enable": true,
- "PerSec": 0,
- "MaxBurst": 0,
- "MemoryStoreSize": 0,
- "VaryByRemoteAddr": true,
- "VaryByHeader": "string"
}, - "PrivacySettings": {
- "ShowEmailAddress": true,
- "ShowFullName": true
}, - "SupportSettings": {
- "TermsOfServiceLink": "string",
- "PrivacyPolicyLink": "string",
- "AboutLink": "string",
- "HelpLink": "string",
- "ReportAProblemLink": "string",
- "SupportEmail": "string"
}, - "GitLabSettings": {
- "Enable": true,
- "Secret": "string",
- "Id": "string",
- "Scope": "string",
- "AuthEndpoint": "string",
- "TokenEndpoint": "string",
- "UserApiEndpoint": "string"
}, - "GoogleSettings": {
- "Enable": true,
- "Secret": "string",
- "Id": "string",
- "Scope": "string",
- "AuthEndpoint": "string",
- "TokenEndpoint": "string",
- "UserApiEndpoint": "string"
}, - "Office365Settings": {
- "Enable": true,
- "Secret": "string",
- "Id": "string",
- "Scope": "string",
- "AuthEndpoint": "string",
- "TokenEndpoint": "string",
- "UserApiEndpoint": "string"
}, - "LdapSettings": {
- "Enable": true,
- "LdapServer": "string",
- "LdapPort": 0,
- "ConnectionSecurity": "string",
- "BaseDN": "string",
- "BindUsername": "string",
- "BindPassword": "string",
- "UserFilter": "string",
- "FirstNameAttribute": "string",
- "LastNameAttribute": "string",
- "EmailAttribute": "string",
- "UsernameAttribute": "string",
- "NicknameAttribute": "string",
- "IdAttribute": "string",
- "PositionAttribute": "string",
- "SyncIntervalMinutes": 0,
- "SkipCertificateVerification": true,
- "QueryTimeout": 0,
- "MaxPageSize": 0,
- "LoginFieldName": "string"
}, - "ComplianceSettings": {
- "Enable": true,
- "Directory": "string",
- "EnableDaily": true
}, - "LocalizationSettings": {
- "DefaultServerLocale": "string",
- "DefaultClientLocale": "string",
- "AvailableLocales": "string"
}, - "SamlSettings": {
- "Enable": true,
- "Verify": true,
- "Encrypt": true,
- "IdpUrl": "string",
- "IdpDescriptorUrl": "string",
- "AssertionConsumerServiceURL": "string",
- "IdpCertificateFile": "string",
- "PublicCertificateFile": "string",
- "PrivateKeyFile": "string",
- "FirstNameAttribute": "string",
- "LastNameAttribute": "string",
- "EmailAttribute": "string",
- "UsernameAttribute": "string",
- "NicknameAttribute": "string",
- "LocaleAttribute": "string",
- "PositionAttribute": "string",
- "LoginButtonText": "string"
}, - "NativeAppSettings": {
- "AppDownloadLink": "string",
- "AndroidAppDownloadLink": "string",
- "IosAppDownloadLink": "string"
}, - "ClusterSettings": {
- "Enable": true,
- "InterNodeListenAddress": "string",
- "InterNodeUrls": [
- "string"
]
}, - "MetricsSettings": {
- "Enable": true,
- "BlockProfileRate": 0,
- "ListenAddress": "string"
}, - "AnalyticsSettings": {
- "MaxUsersForStatistics": 0
}
}
{- "status": "string"
}
Retrieve the current server configuration
-Must have manage_system
permission.
Configuration retrieval successful
-Invalid or missing parameters in URL or request body
-Do not have appropriate permissions
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -// GetConfig -config, resp := Client.GetConfig() -
{- "ServiceSettings": {
- "SiteURL": "string",
- "ListenAddress": "string",
- "ConnectionSecurity": "string",
- "TLSCertFile": "string",
- "TLSKeyFile": "string",
- "UseLetsEncrypt": true,
- "LetsEncryptCertificateCacheFile": "string",
- "Forward80To443": true,
- "ReadTimeout": 0,
- "WriteTimeout": 0,
- "MaximumLoginAttempts": 0,
- "SegmentDeveloperKey": "string",
- "GoogleDeveloperKey": "string",
- "EnableOAuthServiceProvider": true,
- "EnableIncomingWebhooks": true,
- "EnableOutgoingWebhooks": true,
- "EnableCommands": true,
- "EnableOnlyAdminIntegrations": true,
- "EnablePostUsernameOverride": true,
- "EnablePostIconOverride": true,
- "EnableTesting": true,
- "EnableDeveloper": true,
- "EnableSecurityFixAlert": true,
- "EnableInsecureOutgoingConnections": true,
- "EnableMultifactorAuthentication": true,
- "EnforceMultifactorAuthentication": true,
- "AllowCorsFrom": "string",
- "SessionLengthWebInDays": 0,
- "SessionLengthMobileInDays": 0,
- "SessionLengthSSOInDays": 0,
- "SessionCacheInMinutes": 0,
- "WebsocketSecurePort": 0,
- "WebsocketPort": 0,
- "WebserverMode": "string",
- "EnableCustomEmoji": true,
- "RestrictCustomEmojiCreation": "string"
}, - "TeamSettings": {
- "SiteName": "string",
- "MaxUsersPerTeam": 0,
- "EnableTeamCreation": true,
- "EnableUserCreation": true,
- "EnableOpenServer": true,
- "RestrictCreationToDomains": "string",
- "EnableCustomBrand": true,
- "CustomBrandText": "string",
- "CustomDescriptionText": "string",
- "RestrictDirectMessage": "string",
- "RestrictTeamInvite": "string",
- "RestrictPublicChannelManagement": "string",
- "RestrictPrivateChannelManagement": "string",
- "RestrictPublicChannelCreation": "string",
- "RestrictPrivateChannelCreation": "string",
- "RestrictPublicChannelDeletion": "string",
- "RestrictPrivateChannelDeletion": "string",
- "UserStatusAwayTimeout": 0,
- "MaxChannelsPerTeam": 0,
- "MaxNotificationsPerChannel": 0
}, - "SqlSettings": {
- "DriverName": "string",
- "DataSource": "string",
- "DataSourceReplicas": [
- "string"
], - "MaxIdleConns": 0,
- "MaxOpenConns": 0,
- "Trace": true,
- "AtRestEncryptKey": "string"
}, - "LogSettings": {
- "EnableConsole": true,
- "ConsoleLevel": "string",
- "EnableFile": true,
- "FileLevel": "string",
- "FileLocation": "string",
- "EnableWebhookDebugging": true,
- "EnableDiagnostics": true
}, - "PasswordSettings": {
- "MinimumLength": 0,
- "Lowercase": true,
- "Number": true,
- "Uppercase": true,
- "Symbol": true
}, - "FileSettings": {
- "MaxFileSize": 0,
- "DriverName": "string",
- "Directory": "string",
- "EnablePublicLink": true,
- "PublicLinkSalt": "string",
- "ThumbnailWidth": 0,
- "ThumbnailHeight": 0,
- "PreviewWidth": 0,
- "PreviewHeight": 0,
- "ProfileWidth": 0,
- "ProfileHeight": 0,
- "InitialFont": "string",
- "AmazonS3AccessKeyId": "string",
- "AmazonS3SecretAccessKey": "string",
- "AmazonS3Bucket": "string",
- "AmazonS3Region": "string",
- "AmazonS3Endpoint": "string",
- "AmazonS3SSL": true
}, - "EmailSettings": {
- "EnableSignUpWithEmail": true,
- "EnableSignInWithEmail": true,
- "EnableSignInWithUsername": true,
- "SendEmailNotifications": true,
- "RequireEmailVerification": true,
- "FeedbackName": "string",
- "FeedbackEmail": "string",
- "FeedbackOrganization": "string",
- "SMTPUsername": "string",
- "SMTPPassword": "string",
- "SMTPServer": "string",
- "SMTPPort": "string",
- "ConnectionSecurity": "string",
- "InviteSalt": "string",
- "PasswordResetSalt": "string",
- "SendPushNotifications": true,
- "PushNotificationServer": "string",
- "PushNotificationContents": "string",
- "EnableEmailBatching": true,
- "EmailBatchingBufferSize": 0,
- "EmailBatchingInterval": 0
}, - "RateLimitSettings": {
- "Enable": true,
- "PerSec": 0,
- "MaxBurst": 0,
- "MemoryStoreSize": 0,
- "VaryByRemoteAddr": true,
- "VaryByHeader": "string"
}, - "PrivacySettings": {
- "ShowEmailAddress": true,
- "ShowFullName": true
}, - "SupportSettings": {
- "TermsOfServiceLink": "string",
- "PrivacyPolicyLink": "string",
- "AboutLink": "string",
- "HelpLink": "string",
- "ReportAProblemLink": "string",
- "SupportEmail": "string"
}, - "GitLabSettings": {
- "Enable": true,
- "Secret": "string",
- "Id": "string",
- "Scope": "string",
- "AuthEndpoint": "string",
- "TokenEndpoint": "string",
- "UserApiEndpoint": "string"
}, - "GoogleSettings": {
- "Enable": true,
- "Secret": "string",
- "Id": "string",
- "Scope": "string",
- "AuthEndpoint": "string",
- "TokenEndpoint": "string",
- "UserApiEndpoint": "string"
}, - "Office365Settings": {
- "Enable": true,
- "Secret": "string",
- "Id": "string",
- "Scope": "string",
- "AuthEndpoint": "string",
- "TokenEndpoint": "string",
- "UserApiEndpoint": "string"
}, - "LdapSettings": {
- "Enable": true,
- "LdapServer": "string",
- "LdapPort": 0,
- "ConnectionSecurity": "string",
- "BaseDN": "string",
- "BindUsername": "string",
- "BindPassword": "string",
- "UserFilter": "string",
- "FirstNameAttribute": "string",
- "LastNameAttribute": "string",
- "EmailAttribute": "string",
- "UsernameAttribute": "string",
- "NicknameAttribute": "string",
- "IdAttribute": "string",
- "PositionAttribute": "string",
- "SyncIntervalMinutes": 0,
- "SkipCertificateVerification": true,
- "QueryTimeout": 0,
- "MaxPageSize": 0,
- "LoginFieldName": "string"
}, - "ComplianceSettings": {
- "Enable": true,
- "Directory": "string",
- "EnableDaily": true
}, - "LocalizationSettings": {
- "DefaultServerLocale": "string",
- "DefaultClientLocale": "string",
- "AvailableLocales": "string"
}, - "SamlSettings": {
- "Enable": true,
- "Verify": true,
- "Encrypt": true,
- "IdpUrl": "string",
- "IdpDescriptorUrl": "string",
- "AssertionConsumerServiceURL": "string",
- "IdpCertificateFile": "string",
- "PublicCertificateFile": "string",
- "PrivateKeyFile": "string",
- "FirstNameAttribute": "string",
- "LastNameAttribute": "string",
- "EmailAttribute": "string",
- "UsernameAttribute": "string",
- "NicknameAttribute": "string",
- "LocaleAttribute": "string",
- "PositionAttribute": "string",
- "LoginButtonText": "string"
}, - "NativeAppSettings": {
- "AppDownloadLink": "string",
- "AndroidAppDownloadLink": "string",
- "IosAppDownloadLink": "string"
}, - "ClusterSettings": {
- "Enable": true,
- "InterNodeListenAddress": "string",
- "InterNodeUrls": [
- "string"
]
}, - "MetricsSettings": {
- "Enable": true,
- "BlockProfileRate": 0,
- "ListenAddress": "string"
}, - "AnalyticsSettings": {
- "MaxUsersForStatistics": 0
}
}
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.
Must have manage_system
permission.
Mattermost configuration
-ServiceSettings | object |
TeamSettings | object |
SqlSettings | object |
LogSettings | object |
PasswordSettings | object |
FileSettings | object |
EmailSettings | object |
RateLimitSettings | object |
PrivacySettings | object |
SupportSettings | object |
GitLabSettings | object |
GoogleSettings | object |
Office365Settings | object |
LdapSettings | object |
ComplianceSettings | object |
LocalizationSettings | object |
SamlSettings | object |
NativeAppSettings | object |
ClusterSettings | object |
MetricsSettings | object |
AnalyticsSettings | object |
Configuration update successful
-Invalid or missing parameters in URL or request body
-Do not have appropriate permissions
-{- "ServiceSettings": {
- "SiteURL": "string",
- "ListenAddress": "string",
- "ConnectionSecurity": "string",
- "TLSCertFile": "string",
- "TLSKeyFile": "string",
- "UseLetsEncrypt": true,
- "LetsEncryptCertificateCacheFile": "string",
- "Forward80To443": true,
- "ReadTimeout": 0,
- "WriteTimeout": 0,
- "MaximumLoginAttempts": 0,
- "SegmentDeveloperKey": "string",
- "GoogleDeveloperKey": "string",
- "EnableOAuthServiceProvider": true,
- "EnableIncomingWebhooks": true,
- "EnableOutgoingWebhooks": true,
- "EnableCommands": true,
- "EnableOnlyAdminIntegrations": true,
- "EnablePostUsernameOverride": true,
- "EnablePostIconOverride": true,
- "EnableTesting": true,
- "EnableDeveloper": true,
- "EnableSecurityFixAlert": true,
- "EnableInsecureOutgoingConnections": true,
- "EnableMultifactorAuthentication": true,
- "EnforceMultifactorAuthentication": true,
- "AllowCorsFrom": "string",
- "SessionLengthWebInDays": 0,
- "SessionLengthMobileInDays": 0,
- "SessionLengthSSOInDays": 0,
- "SessionCacheInMinutes": 0,
- "WebsocketSecurePort": 0,
- "WebsocketPort": 0,
- "WebserverMode": "string",
- "EnableCustomEmoji": true,
- "RestrictCustomEmojiCreation": "string"
}, - "TeamSettings": {
- "SiteName": "string",
- "MaxUsersPerTeam": 0,
- "EnableTeamCreation": true,
- "EnableUserCreation": true,
- "EnableOpenServer": true,
- "RestrictCreationToDomains": "string",
- "EnableCustomBrand": true,
- "CustomBrandText": "string",
- "CustomDescriptionText": "string",
- "RestrictDirectMessage": "string",
- "RestrictTeamInvite": "string",
- "RestrictPublicChannelManagement": "string",
- "RestrictPrivateChannelManagement": "string",
- "RestrictPublicChannelCreation": "string",
- "RestrictPrivateChannelCreation": "string",
- "RestrictPublicChannelDeletion": "string",
- "RestrictPrivateChannelDeletion": "string",
- "UserStatusAwayTimeout": 0,
- "MaxChannelsPerTeam": 0,
- "MaxNotificationsPerChannel": 0
}, - "SqlSettings": {
- "DriverName": "string",
- "DataSource": "string",
- "DataSourceReplicas": [
- "string"
], - "MaxIdleConns": 0,
- "MaxOpenConns": 0,
- "Trace": true,
- "AtRestEncryptKey": "string"
}, - "LogSettings": {
- "EnableConsole": true,
- "ConsoleLevel": "string",
- "EnableFile": true,
- "FileLevel": "string",
- "FileLocation": "string",
- "EnableWebhookDebugging": true,
- "EnableDiagnostics": true
}, - "PasswordSettings": {
- "MinimumLength": 0,
- "Lowercase": true,
- "Number": true,
- "Uppercase": true,
- "Symbol": true
}, - "FileSettings": {
- "MaxFileSize": 0,
- "DriverName": "string",
- "Directory": "string",
- "EnablePublicLink": true,
- "PublicLinkSalt": "string",
- "ThumbnailWidth": 0,
- "ThumbnailHeight": 0,
- "PreviewWidth": 0,
- "PreviewHeight": 0,
- "ProfileWidth": 0,
- "ProfileHeight": 0,
- "InitialFont": "string",
- "AmazonS3AccessKeyId": "string",
- "AmazonS3SecretAccessKey": "string",
- "AmazonS3Bucket": "string",
- "AmazonS3Region": "string",
- "AmazonS3Endpoint": "string",
- "AmazonS3SSL": true
}, - "EmailSettings": {
- "EnableSignUpWithEmail": true,
- "EnableSignInWithEmail": true,
- "EnableSignInWithUsername": true,
- "SendEmailNotifications": true,
- "RequireEmailVerification": true,
- "FeedbackName": "string",
- "FeedbackEmail": "string",
- "FeedbackOrganization": "string",
- "SMTPUsername": "string",
- "SMTPPassword": "string",
- "SMTPServer": "string",
- "SMTPPort": "string",
- "ConnectionSecurity": "string",
- "InviteSalt": "string",
- "PasswordResetSalt": "string",
- "SendPushNotifications": true,
- "PushNotificationServer": "string",
- "PushNotificationContents": "string",
- "EnableEmailBatching": true,
- "EmailBatchingBufferSize": 0,
- "EmailBatchingInterval": 0
}, - "RateLimitSettings": {
- "Enable": true,
- "PerSec": 0,
- "MaxBurst": 0,
- "MemoryStoreSize": 0,
- "VaryByRemoteAddr": true,
- "VaryByHeader": "string"
}, - "PrivacySettings": {
- "ShowEmailAddress": true,
- "ShowFullName": true
}, - "SupportSettings": {
- "TermsOfServiceLink": "string",
- "PrivacyPolicyLink": "string",
- "AboutLink": "string",
- "HelpLink": "string",
- "ReportAProblemLink": "string",
- "SupportEmail": "string"
}, - "GitLabSettings": {
- "Enable": true,
- "Secret": "string",
- "Id": "string",
- "Scope": "string",
- "AuthEndpoint": "string",
- "TokenEndpoint": "string",
- "UserApiEndpoint": "string"
}, - "GoogleSettings": {
- "Enable": true,
- "Secret": "string",
- "Id": "string",
- "Scope": "string",
- "AuthEndpoint": "string",
- "TokenEndpoint": "string",
- "UserApiEndpoint": "string"
}, - "Office365Settings": {
- "Enable": true,
- "Secret": "string",
- "Id": "string",
- "Scope": "string",
- "AuthEndpoint": "string",
- "TokenEndpoint": "string",
- "UserApiEndpoint": "string"
}, - "LdapSettings": {
- "Enable": true,
- "LdapServer": "string",
- "LdapPort": 0,
- "ConnectionSecurity": "string",
- "BaseDN": "string",
- "BindUsername": "string",
- "BindPassword": "string",
- "UserFilter": "string",
- "FirstNameAttribute": "string",
- "LastNameAttribute": "string",
- "EmailAttribute": "string",
- "UsernameAttribute": "string",
- "NicknameAttribute": "string",
- "IdAttribute": "string",
- "PositionAttribute": "string",
- "SyncIntervalMinutes": 0,
- "SkipCertificateVerification": true,
- "QueryTimeout": 0,
- "MaxPageSize": 0,
- "LoginFieldName": "string"
}, - "ComplianceSettings": {
- "Enable": true,
- "Directory": "string",
- "EnableDaily": true
}, - "LocalizationSettings": {
- "DefaultServerLocale": "string",
- "DefaultClientLocale": "string",
- "AvailableLocales": "string"
}, - "SamlSettings": {
- "Enable": true,
- "Verify": true,
- "Encrypt": true,
- "IdpUrl": "string",
- "IdpDescriptorUrl": "string",
- "AssertionConsumerServiceURL": "string",
- "IdpCertificateFile": "string",
- "PublicCertificateFile": "string",
- "PrivateKeyFile": "string",
- "FirstNameAttribute": "string",
- "LastNameAttribute": "string",
- "EmailAttribute": "string",
- "UsernameAttribute": "string",
- "NicknameAttribute": "string",
- "LocaleAttribute": "string",
- "PositionAttribute": "string",
- "LoginButtonText": "string"
}, - "NativeAppSettings": {
- "AppDownloadLink": "string",
- "AndroidAppDownloadLink": "string",
- "IosAppDownloadLink": "string"
}, - "ClusterSettings": {
- "Enable": true,
- "InterNodeListenAddress": "string",
- "InterNodeUrls": [
- "string"
]
}, - "MetricsSettings": {
- "Enable": true,
- "BlockProfileRate": 0,
- "ListenAddress": "string"
}, - "AnalyticsSettings": {
- "MaxUsersForStatistics": 0
}
}
{- "ServiceSettings": {
- "SiteURL": "string",
- "ListenAddress": "string",
- "ConnectionSecurity": "string",
- "TLSCertFile": "string",
- "TLSKeyFile": "string",
- "UseLetsEncrypt": true,
- "LetsEncryptCertificateCacheFile": "string",
- "Forward80To443": true,
- "ReadTimeout": 0,
- "WriteTimeout": 0,
- "MaximumLoginAttempts": 0,
- "SegmentDeveloperKey": "string",
- "GoogleDeveloperKey": "string",
- "EnableOAuthServiceProvider": true,
- "EnableIncomingWebhooks": true,
- "EnableOutgoingWebhooks": true,
- "EnableCommands": true,
- "EnableOnlyAdminIntegrations": true,
- "EnablePostUsernameOverride": true,
- "EnablePostIconOverride": true,
- "EnableTesting": true,
- "EnableDeveloper": true,
- "EnableSecurityFixAlert": true,
- "EnableInsecureOutgoingConnections": true,
- "EnableMultifactorAuthentication": true,
- "EnforceMultifactorAuthentication": true,
- "AllowCorsFrom": "string",
- "SessionLengthWebInDays": 0,
- "SessionLengthMobileInDays": 0,
- "SessionLengthSSOInDays": 0,
- "SessionCacheInMinutes": 0,
- "WebsocketSecurePort": 0,
- "WebsocketPort": 0,
- "WebserverMode": "string",
- "EnableCustomEmoji": true,
- "RestrictCustomEmojiCreation": "string"
}, - "TeamSettings": {
- "SiteName": "string",
- "MaxUsersPerTeam": 0,
- "EnableTeamCreation": true,
- "EnableUserCreation": true,
- "EnableOpenServer": true,
- "RestrictCreationToDomains": "string",
- "EnableCustomBrand": true,
- "CustomBrandText": "string",
- "CustomDescriptionText": "string",
- "RestrictDirectMessage": "string",
- "RestrictTeamInvite": "string",
- "RestrictPublicChannelManagement": "string",
- "RestrictPrivateChannelManagement": "string",
- "RestrictPublicChannelCreation": "string",
- "RestrictPrivateChannelCreation": "string",
- "RestrictPublicChannelDeletion": "string",
- "RestrictPrivateChannelDeletion": "string",
- "UserStatusAwayTimeout": 0,
- "MaxChannelsPerTeam": 0,
- "MaxNotificationsPerChannel": 0
}, - "SqlSettings": {
- "DriverName": "string",
- "DataSource": "string",
- "DataSourceReplicas": [
- "string"
], - "MaxIdleConns": 0,
- "MaxOpenConns": 0,
- "Trace": true,
- "AtRestEncryptKey": "string"
}, - "LogSettings": {
- "EnableConsole": true,
- "ConsoleLevel": "string",
- "EnableFile": true,
- "FileLevel": "string",
- "FileLocation": "string",
- "EnableWebhookDebugging": true,
- "EnableDiagnostics": true
}, - "PasswordSettings": {
- "MinimumLength": 0,
- "Lowercase": true,
- "Number": true,
- "Uppercase": true,
- "Symbol": true
}, - "FileSettings": {
- "MaxFileSize": 0,
- "DriverName": "string",
- "Directory": "string",
- "EnablePublicLink": true,
- "PublicLinkSalt": "string",
- "ThumbnailWidth": 0,
- "ThumbnailHeight": 0,
- "PreviewWidth": 0,
- "PreviewHeight": 0,
- "ProfileWidth": 0,
- "ProfileHeight": 0,
- "InitialFont": "string",
- "AmazonS3AccessKeyId": "string",
- "AmazonS3SecretAccessKey": "string",
- "AmazonS3Bucket": "string",
- "AmazonS3Region": "string",
- "AmazonS3Endpoint": "string",
- "AmazonS3SSL": true
}, - "EmailSettings": {
- "EnableSignUpWithEmail": true,
- "EnableSignInWithEmail": true,
- "EnableSignInWithUsername": true,
- "SendEmailNotifications": true,
- "RequireEmailVerification": true,
- "FeedbackName": "string",
- "FeedbackEmail": "string",
- "FeedbackOrganization": "string",
- "SMTPUsername": "string",
- "SMTPPassword": "string",
- "SMTPServer": "string",
- "SMTPPort": "string",
- "ConnectionSecurity": "string",
- "InviteSalt": "string",
- "PasswordResetSalt": "string",
- "SendPushNotifications": true,
- "PushNotificationServer": "string",
- "PushNotificationContents": "string",
- "EnableEmailBatching": true,
- "EmailBatchingBufferSize": 0,
- "EmailBatchingInterval": 0
}, - "RateLimitSettings": {
- "Enable": true,
- "PerSec": 0,
- "MaxBurst": 0,
- "MemoryStoreSize": 0,
- "VaryByRemoteAddr": true,
- "VaryByHeader": "string"
}, - "PrivacySettings": {
- "ShowEmailAddress": true,
- "ShowFullName": true
}, - "SupportSettings": {
- "TermsOfServiceLink": "string",
- "PrivacyPolicyLink": "string",
- "AboutLink": "string",
- "HelpLink": "string",
- "ReportAProblemLink": "string",
- "SupportEmail": "string"
}, - "GitLabSettings": {
- "Enable": true,
- "Secret": "string",
- "Id": "string",
- "Scope": "string",
- "AuthEndpoint": "string",
- "TokenEndpoint": "string",
- "UserApiEndpoint": "string"
}, - "GoogleSettings": {
- "Enable": true,
- "Secret": "string",
- "Id": "string",
- "Scope": "string",
- "AuthEndpoint": "string",
- "TokenEndpoint": "string",
- "UserApiEndpoint": "string"
}, - "Office365Settings": {
- "Enable": true,
- "Secret": "string",
- "Id": "string",
- "Scope": "string",
- "AuthEndpoint": "string",
- "TokenEndpoint": "string",
- "UserApiEndpoint": "string"
}, - "LdapSettings": {
- "Enable": true,
- "LdapServer": "string",
- "LdapPort": 0,
- "ConnectionSecurity": "string",
- "BaseDN": "string",
- "BindUsername": "string",
- "BindPassword": "string",
- "UserFilter": "string",
- "FirstNameAttribute": "string",
- "LastNameAttribute": "string",
- "EmailAttribute": "string",
- "UsernameAttribute": "string",
- "NicknameAttribute": "string",
- "IdAttribute": "string",
- "PositionAttribute": "string",
- "SyncIntervalMinutes": 0,
- "SkipCertificateVerification": true,
- "QueryTimeout": 0,
- "MaxPageSize": 0,
- "LoginFieldName": "string"
}, - "ComplianceSettings": {
- "Enable": true,
- "Directory": "string",
- "EnableDaily": true
}, - "LocalizationSettings": {
- "DefaultServerLocale": "string",
- "DefaultClientLocale": "string",
- "AvailableLocales": "string"
}, - "SamlSettings": {
- "Enable": true,
- "Verify": true,
- "Encrypt": true,
- "IdpUrl": "string",
- "IdpDescriptorUrl": "string",
- "AssertionConsumerServiceURL": "string",
- "IdpCertificateFile": "string",
- "PublicCertificateFile": "string",
- "PrivateKeyFile": "string",
- "FirstNameAttribute": "string",
- "LastNameAttribute": "string",
- "EmailAttribute": "string",
- "UsernameAttribute": "string",
- "NicknameAttribute": "string",
- "LocaleAttribute": "string",
- "PositionAttribute": "string",
- "LoginButtonText": "string"
}, - "NativeAppSettings": {
- "AppDownloadLink": "string",
- "AndroidAppDownloadLink": "string",
- "IosAppDownloadLink": "string"
}, - "ClusterSettings": {
- "Enable": true,
- "InterNodeListenAddress": "string",
- "InterNodeUrls": [
- "string"
]
}, - "MetricsSettings": {
- "Enable": true,
- "BlockProfileRate": 0,
- "ListenAddress": "string"
}, - "AnalyticsSettings": {
- "MaxUsersForStatistics": 0
}
}
Reload the configuration file to pick up on any changes made to it.
-Must have manage_system
permission.
Configuration reload successful
-Invalid or missing parameters in URL or request body
-Do not have appropriate permissions
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -// ReloadConfig -ok, resp := Client.ReloadConfig() -
{- "status": "string"
}
Get a subset of the server configuration needed by the client.
-No permission required.
-format required | string Must be |
Configuration retrieval successful
-Invalid or missing parameters in URL or request body
-Feature is disabled
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -// GetOldClientConfig -ok, resp := Client.GetOldClientConfig() -
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Retrieve a json object mirroring the server configuration where fields are set to true -if the corresponding config setting is set through an environment variable. Settings -that haven't been set through environment variables will be missing from the object.
-Minimum server version: 4.10
-Must have manage_system
permission.
Configuration retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "ServiceSettings": {
- "SiteURL": true,
- "ListenAddress": true,
- "ConnectionSecurity": true,
- "TLSCertFile": true,
- "TLSKeyFile": true,
- "UseLetsEncrypt": true,
- "LetsEncryptCertificateCacheFile": true,
- "Forward80To443": true,
- "ReadTimeout": true,
- "WriteTimeout": true,
- "MaximumLoginAttempts": true,
- "SegmentDeveloperKey": true,
- "GoogleDeveloperKey": true,
- "EnableOAuthServiceProvider": true,
- "EnableIncomingWebhooks": true,
- "EnableOutgoingWebhooks": true,
- "EnableCommands": true,
- "EnableOnlyAdminIntegrations": true,
- "EnablePostUsernameOverride": true,
- "EnablePostIconOverride": true,
- "EnableTesting": true,
- "EnableDeveloper": true,
- "EnableSecurityFixAlert": true,
- "EnableInsecureOutgoingConnections": true,
- "EnableMultifactorAuthentication": true,
- "EnforceMultifactorAuthentication": true,
- "AllowCorsFrom": true,
- "SessionLengthWebInDays": true,
- "SessionLengthMobileInDays": true,
- "SessionLengthSSOInDays": true,
- "SessionCacheInMinutes": true,
- "WebsocketSecurePort": true,
- "WebsocketPort": true,
- "WebserverMode": true,
- "EnableCustomEmoji": true,
- "RestrictCustomEmojiCreation": true
}, - "TeamSettings": {
- "SiteName": true,
- "MaxUsersPerTeam": true,
- "EnableTeamCreation": true,
- "EnableUserCreation": true,
- "EnableOpenServer": true,
- "RestrictCreationToDomains": true,
- "EnableCustomBrand": true,
- "CustomBrandText": true,
- "CustomDescriptionText": true,
- "RestrictDirectMessage": true,
- "RestrictTeamInvite": true,
- "RestrictPublicChannelManagement": true,
- "RestrictPrivateChannelManagement": true,
- "RestrictPublicChannelCreation": true,
- "RestrictPrivateChannelCreation": true,
- "RestrictPublicChannelDeletion": true,
- "RestrictPrivateChannelDeletion": true,
- "UserStatusAwayTimeout": true,
- "MaxChannelsPerTeam": true,
- "MaxNotificationsPerChannel": true
}, - "SqlSettings": {
- "DriverName": true,
- "DataSource": true,
- "DataSourceReplicas": true,
- "MaxIdleConns": true,
- "MaxOpenConns": true,
- "Trace": true,
- "AtRestEncryptKey": true
}, - "LogSettings": {
- "EnableConsole": true,
- "ConsoleLevel": true,
- "EnableFile": true,
- "FileLevel": true,
- "FileLocation": true,
- "EnableWebhookDebugging": true,
- "EnableDiagnostics": true
}, - "PasswordSettings": {
- "MinimumLength": true,
- "Lowercase": true,
- "Number": true,
- "Uppercase": true,
- "Symbol": true
}, - "FileSettings": {
- "MaxFileSize": true,
- "DriverName": true,
- "Directory": true,
- "EnablePublicLink": true,
- "PublicLinkSalt": true,
- "ThumbnailWidth": true,
- "ThumbnailHeight": true,
- "PreviewWidth": true,
- "PreviewHeight": true,
- "ProfileWidth": true,
- "ProfileHeight": true,
- "InitialFont": true,
- "AmazonS3AccessKeyId": true,
- "AmazonS3SecretAccessKey": true,
- "AmazonS3Bucket": true,
- "AmazonS3Region": true,
- "AmazonS3Endpoint": true,
- "AmazonS3SSL": true
}, - "EmailSettings": {
- "EnableSignUpWithEmail": true,
- "EnableSignInWithEmail": true,
- "EnableSignInWithUsername": true,
- "SendEmailNotifications": true,
- "RequireEmailVerification": true,
- "FeedbackName": true,
- "FeedbackEmail": true,
- "FeedbackOrganization": true,
- "SMTPUsername": true,
- "SMTPPassword": true,
- "SMTPServer": true,
- "SMTPPort": true,
- "ConnectionSecurity": true,
- "InviteSalt": true,
- "PasswordResetSalt": true,
- "SendPushNotifications": true,
- "PushNotificationServer": true,
- "PushNotificationContents": true,
- "EnableEmailBatching": true,
- "EmailBatchingBufferSize": true,
- "EmailBatchingInterval": true
}, - "RateLimitSettings": {
- "Enable": true,
- "PerSec": true,
- "MaxBurst": true,
- "MemoryStoreSize": true,
- "VaryByRemoteAddr": true,
- "VaryByHeader": true
}, - "PrivacySettings": {
- "ShowEmailAddress": true,
- "ShowFullName": true
}, - "SupportSettings": {
- "TermsOfServiceLink": true,
- "PrivacyPolicyLink": true,
- "AboutLink": true,
- "HelpLink": true,
- "ReportAProblemLink": true,
- "SupportEmail": true
}, - "GitLabSettings": {
- "Enable": true,
- "Secret": true,
- "Id": true,
- "Scope": true,
- "AuthEndpoint": true,
- "TokenEndpoint": true,
- "UserApiEndpoint": true
}, - "GoogleSettings": {
- "Enable": true,
- "Secret": true,
- "Id": true,
- "Scope": true,
- "AuthEndpoint": true,
- "TokenEndpoint": true,
- "UserApiEndpoint": true
}, - "Office365Settings": {
- "Enable": true,
- "Secret": true,
- "Id": true,
- "Scope": true,
- "AuthEndpoint": true,
- "TokenEndpoint": true,
- "UserApiEndpoint": true
}, - "LdapSettings": {
- "Enable": true,
- "LdapServer": true,
- "LdapPort": true,
- "ConnectionSecurity": true,
- "BaseDN": true,
- "BindUsername": true,
- "BindPassword": true,
- "UserFilter": true,
- "FirstNameAttribute": true,
- "LastNameAttribute": true,
- "EmailAttribute": true,
- "UsernameAttribute": true,
- "NicknameAttribute": true,
- "IdAttribute": true,
- "PositionAttribute": true,
- "SyncIntervalMinutes": true,
- "SkipCertificateVerification": true,
- "QueryTimeout": true,
- "MaxPageSize": true,
- "LoginFieldName": true
}, - "ComplianceSettings": {
- "Enable": true,
- "Directory": true,
- "EnableDaily": true
}, - "LocalizationSettings": {
- "DefaultServerLocale": true,
- "DefaultClientLocale": true,
- "AvailableLocales": true
}, - "SamlSettings": {
- "Enable": true,
- "Verify": true,
- "Encrypt": true,
- "IdpUrl": true,
- "IdpDescriptorUrl": true,
- "AssertionConsumerServiceURL": true,
- "IdpCertificateFile": true,
- "PublicCertificateFile": true,
- "PrivateKeyFile": true,
- "FirstNameAttribute": true,
- "LastNameAttribute": true,
- "EmailAttribute": true,
- "UsernameAttribute": true,
- "NicknameAttribute": true,
- "LocaleAttribute": true,
- "PositionAttribute": true,
- "LoginButtonText": true
}, - "NativeAppSettings": {
- "AppDownloadLink": true,
- "AndroidAppDownloadLink": true,
- "IosAppDownloadLink": true
}, - "ClusterSettings": {
- "Enable": true,
- "InterNodeListenAddress": true,
- "InterNodeUrls": true
}, - "MetricsSettings": {
- "Enable": true,
- "BlockProfileRate": true,
- "ListenAddress": true
}, - "AnalyticsSettings": {
- "MaxUsersForStatistics": true
}
}
Submit configuration to patch. As of server version 4.8, the PluginSettings.EnableUploads
setting cannot be modified by this endpoint.
Must have manage_system
permission.
-Minimum server version: 5.20
Mattermost configuration
-ServiceSettings | object |
TeamSettings | object |
SqlSettings | object |
LogSettings | object |
PasswordSettings | object |
FileSettings | object |
EmailSettings | object |
RateLimitSettings | object |
PrivacySettings | object |
SupportSettings | object |
GitLabSettings | object |
GoogleSettings | object |
Office365Settings | object |
LdapSettings | object |
ComplianceSettings | object |
LocalizationSettings | object |
SamlSettings | object |
NativeAppSettings | object |
ClusterSettings | object |
MetricsSettings | object |
AnalyticsSettings | object |
Configuration update successful
-Invalid or missing parameters in URL or request body
-Do not have appropriate permissions
-{- "ServiceSettings": {
- "SiteURL": "string",
- "ListenAddress": "string",
- "ConnectionSecurity": "string",
- "TLSCertFile": "string",
- "TLSKeyFile": "string",
- "UseLetsEncrypt": true,
- "LetsEncryptCertificateCacheFile": "string",
- "Forward80To443": true,
- "ReadTimeout": 0,
- "WriteTimeout": 0,
- "MaximumLoginAttempts": 0,
- "SegmentDeveloperKey": "string",
- "GoogleDeveloperKey": "string",
- "EnableOAuthServiceProvider": true,
- "EnableIncomingWebhooks": true,
- "EnableOutgoingWebhooks": true,
- "EnableCommands": true,
- "EnableOnlyAdminIntegrations": true,
- "EnablePostUsernameOverride": true,
- "EnablePostIconOverride": true,
- "EnableTesting": true,
- "EnableDeveloper": true,
- "EnableSecurityFixAlert": true,
- "EnableInsecureOutgoingConnections": true,
- "EnableMultifactorAuthentication": true,
- "EnforceMultifactorAuthentication": true,
- "AllowCorsFrom": "string",
- "SessionLengthWebInDays": 0,
- "SessionLengthMobileInDays": 0,
- "SessionLengthSSOInDays": 0,
- "SessionCacheInMinutes": 0,
- "WebsocketSecurePort": 0,
- "WebsocketPort": 0,
- "WebserverMode": "string",
- "EnableCustomEmoji": true,
- "RestrictCustomEmojiCreation": "string"
}, - "TeamSettings": {
- "SiteName": "string",
- "MaxUsersPerTeam": 0,
- "EnableTeamCreation": true,
- "EnableUserCreation": true,
- "EnableOpenServer": true,
- "RestrictCreationToDomains": "string",
- "EnableCustomBrand": true,
- "CustomBrandText": "string",
- "CustomDescriptionText": "string",
- "RestrictDirectMessage": "string",
- "RestrictTeamInvite": "string",
- "RestrictPublicChannelManagement": "string",
- "RestrictPrivateChannelManagement": "string",
- "RestrictPublicChannelCreation": "string",
- "RestrictPrivateChannelCreation": "string",
- "RestrictPublicChannelDeletion": "string",
- "RestrictPrivateChannelDeletion": "string",
- "UserStatusAwayTimeout": 0,
- "MaxChannelsPerTeam": 0,
- "MaxNotificationsPerChannel": 0
}, - "SqlSettings": {
- "DriverName": "string",
- "DataSource": "string",
- "DataSourceReplicas": [
- "string"
], - "MaxIdleConns": 0,
- "MaxOpenConns": 0,
- "Trace": true,
- "AtRestEncryptKey": "string"
}, - "LogSettings": {
- "EnableConsole": true,
- "ConsoleLevel": "string",
- "EnableFile": true,
- "FileLevel": "string",
- "FileLocation": "string",
- "EnableWebhookDebugging": true,
- "EnableDiagnostics": true
}, - "PasswordSettings": {
- "MinimumLength": 0,
- "Lowercase": true,
- "Number": true,
- "Uppercase": true,
- "Symbol": true
}, - "FileSettings": {
- "MaxFileSize": 0,
- "DriverName": "string",
- "Directory": "string",
- "EnablePublicLink": true,
- "PublicLinkSalt": "string",
- "ThumbnailWidth": 0,
- "ThumbnailHeight": 0,
- "PreviewWidth": 0,
- "PreviewHeight": 0,
- "ProfileWidth": 0,
- "ProfileHeight": 0,
- "InitialFont": "string",
- "AmazonS3AccessKeyId": "string",
- "AmazonS3SecretAccessKey": "string",
- "AmazonS3Bucket": "string",
- "AmazonS3Region": "string",
- "AmazonS3Endpoint": "string",
- "AmazonS3SSL": true
}, - "EmailSettings": {
- "EnableSignUpWithEmail": true,
- "EnableSignInWithEmail": true,
- "EnableSignInWithUsername": true,
- "SendEmailNotifications": true,
- "RequireEmailVerification": true,
- "FeedbackName": "string",
- "FeedbackEmail": "string",
- "FeedbackOrganization": "string",
- "SMTPUsername": "string",
- "SMTPPassword": "string",
- "SMTPServer": "string",
- "SMTPPort": "string",
- "ConnectionSecurity": "string",
- "InviteSalt": "string",
- "PasswordResetSalt": "string",
- "SendPushNotifications": true,
- "PushNotificationServer": "string",
- "PushNotificationContents": "string",
- "EnableEmailBatching": true,
- "EmailBatchingBufferSize": 0,
- "EmailBatchingInterval": 0
}, - "RateLimitSettings": {
- "Enable": true,
- "PerSec": 0,
- "MaxBurst": 0,
- "MemoryStoreSize": 0,
- "VaryByRemoteAddr": true,
- "VaryByHeader": "string"
}, - "PrivacySettings": {
- "ShowEmailAddress": true,
- "ShowFullName": true
}, - "SupportSettings": {
- "TermsOfServiceLink": "string",
- "PrivacyPolicyLink": "string",
- "AboutLink": "string",
- "HelpLink": "string",
- "ReportAProblemLink": "string",
- "SupportEmail": "string"
}, - "GitLabSettings": {
- "Enable": true,
- "Secret": "string",
- "Id": "string",
- "Scope": "string",
- "AuthEndpoint": "string",
- "TokenEndpoint": "string",
- "UserApiEndpoint": "string"
}, - "GoogleSettings": {
- "Enable": true,
- "Secret": "string",
- "Id": "string",
- "Scope": "string",
- "AuthEndpoint": "string",
- "TokenEndpoint": "string",
- "UserApiEndpoint": "string"
}, - "Office365Settings": {
- "Enable": true,
- "Secret": "string",
- "Id": "string",
- "Scope": "string",
- "AuthEndpoint": "string",
- "TokenEndpoint": "string",
- "UserApiEndpoint": "string"
}, - "LdapSettings": {
- "Enable": true,
- "LdapServer": "string",
- "LdapPort": 0,
- "ConnectionSecurity": "string",
- "BaseDN": "string",
- "BindUsername": "string",
- "BindPassword": "string",
- "UserFilter": "string",
- "FirstNameAttribute": "string",
- "LastNameAttribute": "string",
- "EmailAttribute": "string",
- "UsernameAttribute": "string",
- "NicknameAttribute": "string",
- "IdAttribute": "string",
- "PositionAttribute": "string",
- "SyncIntervalMinutes": 0,
- "SkipCertificateVerification": true,
- "QueryTimeout": 0,
- "MaxPageSize": 0,
- "LoginFieldName": "string"
}, - "ComplianceSettings": {
- "Enable": true,
- "Directory": "string",
- "EnableDaily": true
}, - "LocalizationSettings": {
- "DefaultServerLocale": "string",
- "DefaultClientLocale": "string",
- "AvailableLocales": "string"
}, - "SamlSettings": {
- "Enable": true,
- "Verify": true,
- "Encrypt": true,
- "IdpUrl": "string",
- "IdpDescriptorUrl": "string",
- "AssertionConsumerServiceURL": "string",
- "IdpCertificateFile": "string",
- "PublicCertificateFile": "string",
- "PrivateKeyFile": "string",
- "FirstNameAttribute": "string",
- "LastNameAttribute": "string",
- "EmailAttribute": "string",
- "UsernameAttribute": "string",
- "NicknameAttribute": "string",
- "LocaleAttribute": "string",
- "PositionAttribute": "string",
- "LoginButtonText": "string"
}, - "NativeAppSettings": {
- "AppDownloadLink": "string",
- "AndroidAppDownloadLink": "string",
- "IosAppDownloadLink": "string"
}, - "ClusterSettings": {
- "Enable": true,
- "InterNodeListenAddress": "string",
- "InterNodeUrls": [
- "string"
]
}, - "MetricsSettings": {
- "Enable": true,
- "BlockProfileRate": 0,
- "ListenAddress": "string"
}, - "AnalyticsSettings": {
- "MaxUsersForStatistics": 0
}
}
{- "ServiceSettings": {
- "SiteURL": "string",
- "ListenAddress": "string",
- "ConnectionSecurity": "string",
- "TLSCertFile": "string",
- "TLSKeyFile": "string",
- "UseLetsEncrypt": true,
- "LetsEncryptCertificateCacheFile": "string",
- "Forward80To443": true,
- "ReadTimeout": 0,
- "WriteTimeout": 0,
- "MaximumLoginAttempts": 0,
- "SegmentDeveloperKey": "string",
- "GoogleDeveloperKey": "string",
- "EnableOAuthServiceProvider": true,
- "EnableIncomingWebhooks": true,
- "EnableOutgoingWebhooks": true,
- "EnableCommands": true,
- "EnableOnlyAdminIntegrations": true,
- "EnablePostUsernameOverride": true,
- "EnablePostIconOverride": true,
- "EnableTesting": true,
- "EnableDeveloper": true,
- "EnableSecurityFixAlert": true,
- "EnableInsecureOutgoingConnections": true,
- "EnableMultifactorAuthentication": true,
- "EnforceMultifactorAuthentication": true,
- "AllowCorsFrom": "string",
- "SessionLengthWebInDays": 0,
- "SessionLengthMobileInDays": 0,
- "SessionLengthSSOInDays": 0,
- "SessionCacheInMinutes": 0,
- "WebsocketSecurePort": 0,
- "WebsocketPort": 0,
- "WebserverMode": "string",
- "EnableCustomEmoji": true,
- "RestrictCustomEmojiCreation": "string"
}, - "TeamSettings": {
- "SiteName": "string",
- "MaxUsersPerTeam": 0,
- "EnableTeamCreation": true,
- "EnableUserCreation": true,
- "EnableOpenServer": true,
- "RestrictCreationToDomains": "string",
- "EnableCustomBrand": true,
- "CustomBrandText": "string",
- "CustomDescriptionText": "string",
- "RestrictDirectMessage": "string",
- "RestrictTeamInvite": "string",
- "RestrictPublicChannelManagement": "string",
- "RestrictPrivateChannelManagement": "string",
- "RestrictPublicChannelCreation": "string",
- "RestrictPrivateChannelCreation": "string",
- "RestrictPublicChannelDeletion": "string",
- "RestrictPrivateChannelDeletion": "string",
- "UserStatusAwayTimeout": 0,
- "MaxChannelsPerTeam": 0,
- "MaxNotificationsPerChannel": 0
}, - "SqlSettings": {
- "DriverName": "string",
- "DataSource": "string",
- "DataSourceReplicas": [
- "string"
], - "MaxIdleConns": 0,
- "MaxOpenConns": 0,
- "Trace": true,
- "AtRestEncryptKey": "string"
}, - "LogSettings": {
- "EnableConsole": true,
- "ConsoleLevel": "string",
- "EnableFile": true,
- "FileLevel": "string",
- "FileLocation": "string",
- "EnableWebhookDebugging": true,
- "EnableDiagnostics": true
}, - "PasswordSettings": {
- "MinimumLength": 0,
- "Lowercase": true,
- "Number": true,
- "Uppercase": true,
- "Symbol": true
}, - "FileSettings": {
- "MaxFileSize": 0,
- "DriverName": "string",
- "Directory": "string",
- "EnablePublicLink": true,
- "PublicLinkSalt": "string",
- "ThumbnailWidth": 0,
- "ThumbnailHeight": 0,
- "PreviewWidth": 0,
- "PreviewHeight": 0,
- "ProfileWidth": 0,
- "ProfileHeight": 0,
- "InitialFont": "string",
- "AmazonS3AccessKeyId": "string",
- "AmazonS3SecretAccessKey": "string",
- "AmazonS3Bucket": "string",
- "AmazonS3Region": "string",
- "AmazonS3Endpoint": "string",
- "AmazonS3SSL": true
}, - "EmailSettings": {
- "EnableSignUpWithEmail": true,
- "EnableSignInWithEmail": true,
- "EnableSignInWithUsername": true,
- "SendEmailNotifications": true,
- "RequireEmailVerification": true,
- "FeedbackName": "string",
- "FeedbackEmail": "string",
- "FeedbackOrganization": "string",
- "SMTPUsername": "string",
- "SMTPPassword": "string",
- "SMTPServer": "string",
- "SMTPPort": "string",
- "ConnectionSecurity": "string",
- "InviteSalt": "string",
- "PasswordResetSalt": "string",
- "SendPushNotifications": true,
- "PushNotificationServer": "string",
- "PushNotificationContents": "string",
- "EnableEmailBatching": true,
- "EmailBatchingBufferSize": 0,
- "EmailBatchingInterval": 0
}, - "RateLimitSettings": {
- "Enable": true,
- "PerSec": 0,
- "MaxBurst": 0,
- "MemoryStoreSize": 0,
- "VaryByRemoteAddr": true,
- "VaryByHeader": "string"
}, - "PrivacySettings": {
- "ShowEmailAddress": true,
- "ShowFullName": true
}, - "SupportSettings": {
- "TermsOfServiceLink": "string",
- "PrivacyPolicyLink": "string",
- "AboutLink": "string",
- "HelpLink": "string",
- "ReportAProblemLink": "string",
- "SupportEmail": "string"
}, - "GitLabSettings": {
- "Enable": true,
- "Secret": "string",
- "Id": "string",
- "Scope": "string",
- "AuthEndpoint": "string",
- "TokenEndpoint": "string",
- "UserApiEndpoint": "string"
}, - "GoogleSettings": {
- "Enable": true,
- "Secret": "string",
- "Id": "string",
- "Scope": "string",
- "AuthEndpoint": "string",
- "TokenEndpoint": "string",
- "UserApiEndpoint": "string"
}, - "Office365Settings": {
- "Enable": true,
- "Secret": "string",
- "Id": "string",
- "Scope": "string",
- "AuthEndpoint": "string",
- "TokenEndpoint": "string",
- "UserApiEndpoint": "string"
}, - "LdapSettings": {
- "Enable": true,
- "LdapServer": "string",
- "LdapPort": 0,
- "ConnectionSecurity": "string",
- "BaseDN": "string",
- "BindUsername": "string",
- "BindPassword": "string",
- "UserFilter": "string",
- "FirstNameAttribute": "string",
- "LastNameAttribute": "string",
- "EmailAttribute": "string",
- "UsernameAttribute": "string",
- "NicknameAttribute": "string",
- "IdAttribute": "string",
- "PositionAttribute": "string",
- "SyncIntervalMinutes": 0,
- "SkipCertificateVerification": true,
- "QueryTimeout": 0,
- "MaxPageSize": 0,
- "LoginFieldName": "string"
}, - "ComplianceSettings": {
- "Enable": true,
- "Directory": "string",
- "EnableDaily": true
}, - "LocalizationSettings": {
- "DefaultServerLocale": "string",
- "DefaultClientLocale": "string",
- "AvailableLocales": "string"
}, - "SamlSettings": {
- "Enable": true,
- "Verify": true,
- "Encrypt": true,
- "IdpUrl": "string",
- "IdpDescriptorUrl": "string",
- "AssertionConsumerServiceURL": "string",
- "IdpCertificateFile": "string",
- "PublicCertificateFile": "string",
- "PrivateKeyFile": "string",
- "FirstNameAttribute": "string",
- "LastNameAttribute": "string",
- "EmailAttribute": "string",
- "UsernameAttribute": "string",
- "NicknameAttribute": "string",
- "LocaleAttribute": "string",
- "PositionAttribute": "string",
- "LoginButtonText": "string"
}, - "NativeAppSettings": {
- "AppDownloadLink": "string",
- "AndroidAppDownloadLink": "string",
- "IosAppDownloadLink": "string"
}, - "ClusterSettings": {
- "Enable": true,
- "InterNodeListenAddress": "string",
- "InterNodeUrls": [
- "string"
]
}, - "MetricsSettings": {
- "Enable": true,
- "BlockProfileRate": 0,
- "ListenAddress": "string"
}, - "AnalyticsSettings": {
- "MaxUsersForStatistics": 0
}
}
Upload a license to enable enterprise features.
-Minimum server version: 4.0
-Must have manage_system
permission.
license required | string <binary> The license to be uploaded - |
License file upload successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Content too large
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -file, err := os.Open("<Your license file>") -if err != nil { - return err -} -defer file.Close() - -data := &bytes.Buffer{} -if _, err := io.Copy(data, file); err != nil { - return err -} - -ok, resp := Client.UploadLicenseFile(data.Bytes()) -
{- "status": "string"
}
Remove the license file from the server. This will disable all enterprise features.
-Minimum server version: 4.0
-Must have manage_system
permission.
License removal successful
-No access token provided
-Do not have appropriate permissions
-{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Get a subset of the server license needed by the client.
-No permission required but having the manage_system
permission returns more information.
format required | string Must be |
License retrieval successful
-Invalid or missing parameters in URL or request body
-Feature is disabled
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -// GetOldClientLicense -license, resp := Client.GetOldClientLicense() -
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Get a page of audits for all users on the system, selected with page
and per_page
query parameters.
Must have manage_system
permission.
page | integer Default: 0 The page to select. - |
per_page | integer Default: 60 The number of audits per page. - |
Audits retrieval successful
-Do not have appropriate permissions
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -// GetAudits -audits, resp := Client.GetAudits(0, 100, "") -
[- {
- "id": "string",
- "create_at": 0,
- "user_id": "string",
- "action": "string",
- "extra_info": "string",
- "ip_address": "string",
- "session_id": "string"
}
]
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.
-Must have manage_system
permission.
Caches invalidate successful
-Do not have appropriate permissions
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -// InvalidateCaches -ok, resp := Client.InvalidateCaches() -
{- "status": "string"
}
Get a page of server logs, selected with page
and logs_per_page
query parameters.
Must have manage_system
permission.
page | integer Default: 0 The page to select. - |
logs_per_page | string Default: "10000" The number of logs per page. There is a maximum limit of 10000 logs per page. - |
Logs retrieval successful
-Do not have appropriate permissions
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -// GetLogs -logs, resp := Client.GetLogs(0, 10) -
[- "string"
]
Add log messages to the server logs.
-Users with manage_system
permission can log ERROR or DEBUG messages.
-Logged in users can log ERROR or DEBUG messages when ServiceSettings.EnableDeveloper
is true
or just DEBUG messages when false
.
-Non-logged in users can log ERROR or DEBUG messages when ServiceSettings.EnableDeveloper
is true
and cannot log when false
.
level required | string The error level, ERROR or DEBUG - |
message required | string Message to send to the server logs - |
Logs sent successful
-Do not have appropriate permissions
-{- "level": "string",
- "message": "string"
}
{ }
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.
The returned JSON changes based on the name
query parameter but is always key/value pairs.
Minimum server version: 4.0
-Must have manage_system
permission.
name | string Default: "standard" Possible values are "standard", "post_counts_day", "user_counts_with_posts_day" or "extra_counts" - |
team_id | string The team ID to filter the data by - |
Analytics retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Marks the server as currently having high load which disables non-critical services such as search, statuses and typing notifications.
-Minimum server version: 5.20
-Must have manage_system
permission.
seconds | string Default: "3600" Number of seconds until server is automatically marked as not busy. - |
Server busy flag set successfully
-Invalid or missing parameters in URL or request body
-Do not have appropriate permissions
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -ok, resp := Client.SetServerBusy(300) -
{- "status": "string"
}
Gets the timestamp corresponding to when the server busy flag will be automatically cleared.
-Minimum server version: 5.20
-Must have manage_system
permission.
Server busy expires timestamp retrieved successfully
-Do not have appropriate permissions
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -// expires is a time.Time -expires, resp := Client.GetServerBusyExpires() -
{- "busy": true,
- "expires": 0
}
Marks the server as not having high load which re-enables non-critical services such as search, statuses and typing notifications.
-Minimum server version: 5.20
-Must have manage_system
permission.
Server busy flag cleared successfully
-Do not have appropriate permissions
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -ok, resp := Client.ClearServerBusy() -
{- "status": "string"
}
Endpoints related to custom branding and white-labeling. See our branding documentation for more information.
-Get the previously uploaded brand image. Returns 404 if no brand image has been uploaded.
-No permission required.
-Brand image retrieval successful
-Resource not found
-Feature is disabled
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -// GetBrandImage -img, err := Client.GetBrandImage() -
"string"
Uploads a brand image.
-Must have manage_system
permission.
image required | string <binary> The image to be uploaded - |
Brand image upload successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Content too large
-Feature is disabled
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -file, err := os.Open("<Your image>") -if err != nil { - return err -} -defer file.Close() - -data := &bytes.Buffer{} -if _, err := io.Copy(data, file); err != nil { - return err -} - -ok, resp := Client.UploadBrandImage(data.Bytes()) -
{- "status": "string"
}
Deletes the previously uploaded brand image. Returns 404 if no brand image has been uploaded.
-Must have manage_system
permission.
-Minimum server version: 5.6
Brand image succesfully deleted
-No access token provided
-Do not have appropriate permissions
-Resource not found
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -// Delete brand image -resp := Client.DeleteBrandImage() -
{- "status": "string"
}
Register an OAuth 2.0 client application with Mattermost as the service provider.
-Must have manage_oauth
permission.
OAuth application to register
-name required | string The name of the client application - |
description required | string A short description of the application - |
icon_url | string A URL to an icon to display with the application - |
callback_urls required | Array of strings A list of callback URLs for the appliation - |
homepage required | string A link to the website of the application - |
is_trusted | boolean Set this to |
App registration successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-{- "name": "string",
- "description": "string",
- "icon_url": "string",
- "callback_urls": [
- "string"
], - "homepage": "string",
- "is_trusted": true
}
{- "id": "string",
- "client_secret": "string",
- "name": "string",
- "description": "string",
- "icon_url": "string",
- "callback_urls": [
- "string"
], - "homepage": "string",
- "is_trusted": true,
- "create_at": 0,
- "update_at": 0
}
Get a page of OAuth 2.0 client applications registered with Mattermost.
-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.
page | integer Default: 0 The page to select. - |
per_page | integer Default: 60 The number of apps per page. - |
OAuthApp list retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-[- {
- "id": "string",
- "client_secret": "string",
- "name": "string",
- "description": "string",
- "icon_url": "string",
- "callback_urls": [
- "string"
], - "homepage": "string",
- "is_trusted": true,
- "create_at": 0,
- "update_at": 0
}
]
Get an OAuth 2.0 client application registered with Mattermost.
-If app creator, must have mange_oauth
permission otherwise manage_system_wide_oauth
permission is required.
app_id required | string Application client id - |
App retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-Feature is disabled
-{- "id": "string",
- "client_secret": "string",
- "name": "string",
- "description": "string",
- "icon_url": "string",
- "callback_urls": [
- "string"
], - "homepage": "string",
- "is_trusted": true,
- "create_at": 0,
- "update_at": 0
}
Update an OAuth 2.0 client application based on OAuth struct.
-If app creator, must have mange_oauth
permission otherwise manage_system_wide_oauth
permission is required.
app_id required | string Application client id - |
OAuth application to update
-id required | string The id of the client application - |
name required | string The name of the client application - |
description required | string A short description of the application - |
icon_url | string A URL to an icon to display with the application - |
callback_urls required | Array of strings A list of callback URLs for the appliation - |
homepage required | string A link to the website of the application - |
is_trusted | boolean Set this to |
App update successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-Feature is disabled
-{- "id": "string",
- "name": "string",
- "description": "string",
- "icon_url": "string",
- "callback_urls": [
- "string"
], - "homepage": "string",
- "is_trusted": true
}
{- "id": "string",
- "client_secret": "string",
- "name": "string",
- "description": "string",
- "icon_url": "string",
- "callback_urls": [
- "string"
], - "homepage": "string",
- "is_trusted": true,
- "create_at": 0,
- "update_at": 0
}
Delete and unregister an OAuth 2.0 client application
-If app creator, must have mange_oauth
permission otherwise manage_system_wide_oauth
permission is required.
app_id required | string Application client id - |
App deletion successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-Feature is disabled
-{- "status": "string"
}
Regenerate the client secret for an OAuth 2.0 client application registered with Mattermost.
-If app creator, must have mange_oauth
permission otherwise manage_system_wide_oauth
permission is required.
app_id required | string Application client id - |
Secret regeneration successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-Feature is disabled
-{- "id": "string",
- "client_secret": "string",
- "name": "string",
- "description": "string",
- "icon_url": "string",
- "callback_urls": [
- "string"
], - "homepage": "string",
- "is_trusted": true,
- "create_at": 0,
- "update_at": 0
}
Get public information about an OAuth 2.0 client application registered with Mattermost. The application's client secret will be blanked out.
-Must be authenticated.
-app_id required | string Application client id - |
App retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Resource not found
-Feature is disabled
-{- "id": "string",
- "client_secret": "string",
- "name": "string",
- "description": "string",
- "icon_url": "string",
- "callback_urls": [
- "string"
], - "homepage": "string",
- "is_trusted": true,
- "create_at": 0,
- "update_at": 0
}
Get SAML metadata from the server. SAML must be configured properly.
-No permission required.
-SAML metadata retrieval successful
-Feature is disabled
-"string"
Upload the IDP certificate to be used with your SAML configuration. The server will pick a hard-coded filename for the IdpCertificateFile setting in your config.json
.
Must have manage_system
permission.
certificate required | string <binary> The IDP certificate file - |
SAML certificate upload successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-{- "status": "string"
}
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.
-Must have manage_system
permission.
SAML certificate delete successful
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-{- "status": "string"
}
Upload the public certificate to be used for encryption with your SAML configuration. The server will pick a hard-coded filename for the PublicCertificateFile setting in your config.json
.
Must have manage_system
permission.
certificate required | string <binary> The public certificate file - |
SAML certificate upload successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-{- "status": "string"
}
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.
-Must have manage_system
permission.
SAML certificate delete successful
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-{- "status": "string"
}
Upload the private key to be used for encryption with your SAML configuration. The server will pick a hard-coded filename for the PrivateKeyFile setting in your config.json
.
Must have manage_system
permission.
certificate required | string <binary> The private key file - |
SAML certificate upload successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-{- "status": "string"
}
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.
-Must have manage_system
permission.
SAML certificate delete successful
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-{- "status": "string"
}
Get the status of the uploaded certificates and keys in use by your SAML configuration.
-Must have manage_system
permission.
SAML certificate status retrieval successful
-Do not have appropriate permissions
-Feature is disabled
-{- "idp_certificate_file": true,
- "public_certificate_file": true,
- "private_key_file": true
}
Synchronize any user attribute changes in the configured AD/LDAP server with Mattermost.
-Must have manage_system
permission.
LDAP sync successful
-Feature is disabled
-{- "status": "string"
}
Test the current AD/LDAP configuration to see if the AD/LDAP server can be contacted successfully.
-Must have manage_system
permission.
LDAP test successful
-Something went wrong with the server
-Feature is disabled
-{- "status": "string"
}
Retrieve a list of all groups not associated to a particular channel or team.
-not_associated_to_team
OR not_associated_to_channel
is required.
If you use not_associated_to_team
, you must be a team admin for that particular team (permission to manage that team).
If you use not_associated_to_channel
, you must be a channel admin for that particular channel (permission to manage that channel).
Minimum server version: 5.11
-page | integer Default: 0 The page to select. - |
per_page | integer Default: 60 The number of groups per page. - |
q | string String to pattern match the |
include_member_count | boolean Boolean which adds the |
not_associated_to_team required | string Team GUID which is used to return all the groups not associated to this team - |
not_associated_to_channel required | string Group GUID which is used to return all the groups not associated to this channel - |
Group list retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-[- {
- "id": "string",
- "name": "string",
- "display_name": "string",
- "description": "string",
- "source": "string",
- "remote_id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "has_syncables": true
}
]
Get group from the provided group id string
-Must have manage_system
permission.
Minimum server version: 5.11
-group_id required | string Group GUID - |
Group retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-{- "id": "string",
- "name": "string",
- "display_name": "string",
- "description": "string",
- "source": "string",
- "remote_id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "has_syncables": true
}
Partially update a group 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.
-Must have manage_system
permission.
Minimum server version: 5.11
-group_id required | string Group GUID - |
Group object that is to be updated
-name | string |
display_name | string |
description | string |
Group patch successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-{- "name": "string",
- "display_name": "string",
- "description": "string"
}
{- "id": "string",
- "name": "string",
- "display_name": "string",
- "description": "string",
- "source": "string",
- "remote_id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "has_syncables": true
}
Link a team to a group
-Must have manage_team
permission.
Minimum server version: 5.11
-group_id required | string Group GUID - |
team_id required | string Team GUID - |
Team successfully linked to group
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-{- "team_id": "string",
- "group_id": "string",
- "auto_add": true,
- "create_at": 0,
- "delete_at": 0,
- "update_at": 0
}
Delete a link from a team to a group
-Must have manage_team
permission.
Minimum server version: 5.11
-group_id required | string Group GUID - |
team_id required | string Team GUID - |
Successfully deleted link between team and group
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-{- "status": "string"
}
Link a channel to a group
-If the channel is private, you must have manage_private_channel_members
permission.
-Otherwise, you must have the manage_public_channel_members
permission.
Minimum server version: 5.11
-group_id required | string Group GUID - |
channel_id required | string Channel GUID - |
Channel successfully linked to group
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-{- "channel_id": "string",
- "group_id": "string",
- "auto_add": true,
- "create_at": 0,
- "delete_at": 0,
- "update_at": 0
}
Delete a link from a channel to a group
-If the channel is private, you must have manage_private_channel_members
permission.
-Otherwise, you must have the manage_public_channel_members
permission.
Minimum server version: 5.11
-group_id required | string Group GUID - |
channel_id required | string Channel GUID - |
Successfully deleted link between channel and group
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-{- "status": "string"
}
Get the GroupSyncable object with group_id and team_id from params
-Must have manage_system
permission.
Minimum server version: 5.11
-group_id required | string Group GUID - |
team_id required | string Team GUID - |
GroupSyncable object retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Something went wrong with the server
-Feature is disabled
-{- "team_id": "string",
- "group_id": "string",
- "auto_add": true,
- "create_at": 0,
- "delete_at": 0,
- "update_at": 0
}
Get the GroupSyncable object with group_id and channel_id from params
-Must have manage_system
permission.
Minimum server version: 5.11
-group_id required | string Group GUID - |
channel_id required | string Channel GUID - |
GroupSyncable object retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Something went wrong with the server
-Feature is disabled
-{- "channel_id": "string",
- "group_id": "string",
- "auto_add": true,
- "create_at": 0,
- "delete_at": 0,
- "update_at": 0
}
Retrieve the list of teams associated to the group
-Must have manage_system
permission.
Minimum server version: 5.11
-group_id required | string Group GUID - |
Teams list retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Something went wrong with the server
-Feature is disabled
-[- {
- "team_id": "string",
- "team_display_name": "string",
- "team_type": "string",
- "group_id": "string",
- "auto_add": true,
- "create_at": 0,
- "delete_at": 0,
- "update_at": 0
}
]
Retrieve the list of channels associated to the group
-Must have manage_system
permission.
Minimum server version: 5.11
-group_id required | string Group GUID - |
Channel list retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Something went wrong with the server
-Feature is disabled
-[- {
- "channel_id": "string",
- "channel_display_name": "string",
- "channel_type": "string",
- "team_id": "string",
- "team_display_name": "string",
- "team_type": "string",
- "group_id": "string",
- "auto_add": true,
- "create_at": 0,
- "delete_at": 0,
- "update_at": 0
}
]
Partially update a GroupSyncable 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.
-Must have manage_system
permission.
Minimum server version: 5.11
-group_id required | string Group GUID - |
team_id required | string Team GUID - |
GroupSyncable object that is to be updated
-auto_add | boolean |
GroupSyncable patch successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-{- "auto_add": true
}
{- "team_id": "string",
- "group_id": "string",
- "auto_add": true,
- "create_at": 0,
- "delete_at": 0,
- "update_at": 0
}
Partially update a GroupSyncable 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.
-Must have manage_system
permission.
Minimum server version: 5.11
-group_id required | string Group GUID - |
channel_id required | string Channel GUID - |
GroupSyncable object that is to be updated
-auto_add | boolean |
GroupSyncable patch successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-{- "auto_add": true
}
{- "channel_id": "string",
- "group_id": "string",
- "auto_add": true,
- "create_at": 0,
- "delete_at": 0,
- "update_at": 0
}
Retrieve the list of users associated with a given group.
-Must have manage_system
permission.
Minimum server version: 5.11
-group_id required | string Group GUID - |
page | integer Default: 0 The page to select. - |
per_page | integer Default: 60 The number of groups per page. - |
User list retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Something went wrong with the server
-Feature is disabled
-{- "members": [
- {
- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "username": "string",
- "first_name": "string",
- "last_name": "string",
- "nickname": "string",
- "email": "string",
- "email_verified": true,
- "auth_service": "string",
- "roles": "string",
- "locale": "string",
- "notify_props": {
- "email": true,
- "push": "string",
- "desktop": "string",
- "desktop_sound": true,
- "mention_keys": "string",
- "channel": true,
- "first_name": true
}, - "props": { },
- "last_password_update": 0,
- "last_picture_update": 0,
- "failed_attempts": 0,
- "mfa_active": true,
- "timezone": {
- "useAutomaticTimezone": true,
- "manualTimezone": "string",
- "automaticTimezone": "string"
}, - "terms_of_service_id": "string",
- "terms_of_service_create_at": 0
}
], - "total_member_count": 0
}
Retrieve the list of groups associated with a given channel.
-Must have manage_system
permission.
Minimum server version: 5.11
-channel_id required | string Channel GUID - |
page | integer Default: 0 The page to select. - |
per_page | integer Default: 60 The number of groups per page. - |
Group list retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Something went wrong with the server
-Feature is disabled
-[- {
- "id": "string",
- "name": "string",
- "display_name": "string",
- "description": "string",
- "source": "string",
- "remote_id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "has_syncables": true
}
]
Retrieve the list of groups associated with a given team.
-Must have manage_system
permission.
Minimum server version: 5.11
-team_id required | string Team GUID - |
page | integer Default: 0 The page to select. - |
per_page | integer Default: 60 The number of groups per page. - |
Group list retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Something went wrong with the server
-Feature is disabled
-[- {
- "id": "string",
- "name": "string",
- "display_name": "string",
- "description": "string",
- "source": "string",
- "remote_id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "has_syncables": true
}
]
Create and save a compliance report.
-Must have manage_system
permission.
Compliance report creation successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-{- "id": "string",
- "create_at": 0,
- "user_id": "string",
- "status": "string",
- "count": 0,
- "desc": "string",
- "type": "string",
- "start_at": 0,
- "end_at": 0,
- "keywords": "string",
- "emails": "string"
}
Get a list of compliance reports previously created by page, selected with page
and per_page
query parameters.
Must have manage_system
permission.
page | integer Default: 0 The page to select. - |
per_page | integer Default: 60 The number of reports per page. - |
Compliance reports retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-[- {
- "id": "string",
- "create_at": 0,
- "user_id": "string",
- "status": "string",
- "count": 0,
- "desc": "string",
- "type": "string",
- "start_at": 0,
- "end_at": 0,
- "keywords": "string",
- "emails": "string"
}
]
Get a compliance reports previously created.
-Must have manage_system
permission.
report_id required | string Compliance report GUID - |
Compliance report retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-{- "id": "string",
- "create_at": 0,
- "user_id": "string",
- "status": "string",
- "count": 0,
- "desc": "string",
- "type": "string",
- "start_at": 0,
- "end_at": 0,
- "keywords": "string",
- "emails": "string"
}
Download the full contents of a report as a file.
-Must have manage_system
permission.
report_id required | string Compliance report GUID - |
The compliance report file
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Get a set of information for each node in the cluster, useful for checking the status and health of each node.
-Must have manage_system
permission.
Cluster status retrieval successful
-Do not have appropriate permissions
-[- {
- "id": "string",
- "version": "string",
- "config_hash": "string",
- "internode_url": "string",
- "hostname": "string",
- "last_ping": 0,
- "is_alive": true
}
]
Test the current Elasticsearch configuration to see if the Elasticsearch server can be contacted successfully. -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.
-Minimum server version: 4.1
-Must have manage_system
permission.
Elasticsearch test successful
-Invalid or missing parameters in URL or request body
-Something went wrong with the server
-Feature is disabled
-{- "status": "string"
}
Deletes all Elasticsearch indexes and their contents. After calling this endpoint, it is -necessary to schedule a new Elasticsearch indexing job to repopulate the indexes. -Minimum server version: 4.1
-Must have manage_system
permission.
Indexes purged successfully.
-Something went wrong with the server
-Feature is disabled
-{- "status": "string"
}
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. -Minimum server version: 4.3
-Requires an active session but no other permissions.
-Data retention policy details retrieved successfully.
-Something went wrong with the server
-Feature is disabled
-{- "message_deletion_enabled": true,
- "file_deletion_enabled": true,
- "message_retention_cutoff": 0,
- "file_retention_cutoff": 0
}
Endpoints related to various background jobs that can be run by the server or separately by job servers.
-Get a page of jobs. Use the query parameters to modify the behaviour of this endpoint. -Minimum server version: 4.1
-Must have manage_jobs
permission.
page | integer Default: 0 The page to select. - |
per_page | integer Default: 60 The number of jobs per page. - |
Job list retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-[- {
- "id": "string",
- "type": "string",
- "create_at": 0,
- "start_at": 0,
- "last_activity_at": 0,
- "status": "string",
- "progress": 0,
- "data": { }
}
]
Create a new job. -Minimum server version: 4.1
-Must have manage_jobs
permission.
Job object to be created
-type required | string The type of job to create - |
data | object An object containing any additional data required for this job type - |
Job creation successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "type": "string",
- "data": { }
}
{- "id": "string",
- "type": "string",
- "create_at": 0,
- "start_at": 0,
- "last_activity_at": 0,
- "status": "string",
- "progress": 0,
- "data": { }
}
Gets a single job. -Minimum server version: 4.1
-Must have manage_jobs
permission.
job_id required | string Job GUID - |
Job retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-{- "id": "string",
- "type": "string",
- "create_at": 0,
- "start_at": 0,
- "last_activity_at": 0,
- "status": "string",
- "progress": 0,
- "data": { }
}
Cancel a job. -Minimum server version: 4.1
-Must have manage_jobs
permission.
job_id required | string Job GUID - |
Job canceled successfully
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-{- "status": "string"
}
Get a page of jobs of the given type. Use the query parameters to modify the behaviour of this endpoint. -Minimum server version: 4.1
-Must have manage_jobs
permission.
type required | string Job type - |
page | integer Default: 0 The page to select. - |
per_page | integer Default: 60 The number of jobs per page. - |
Job list retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-[- {
- "id": "string",
- "type": "string",
- "create_at": 0,
- "start_at": 0,
- "last_activity_at": 0,
- "status": "string",
- "progress": 0,
- "data": { }
}
]
Upload a plugin that is contained within a compressed .tar.gz file. Plugins and plugin uploads must be enabled in the server's config settings.
-Must have manage_system
permission.
Minimum server version: 4.4
-plugin required | string <binary> The plugin image to be uploaded - |
force | string Set to 'true' to overwrite a previously installed plugin with the same ID, if any - |
Plugin upload successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Content too large
-Feature is disabled
-import ( - "bytes" - "io/ioutil" - "log" - - "github.com/mattermost/mattermost-server/model" -) - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -tarData, err := ioutil.ReadFile("plugin.tar.gz") -if err != nil { - log.Fatal("error while reading file") -} - -// Not forced -manifest, resp := Client.UploadPlugin(bytes.NewReader(tarData)) - -// Forced -manifest, resp := Client.UploadPluginForced(bytes.NewReader(tarData)) -
{- "status": "string"
}
Get a list of inactive and a list of active plugin manifests. Plugins must be enabled in the server's config settings.
-Must have manage_system
permission.
Minimum server version: 4.4
-Plugins retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -pluginsResp, resp := Client.GetPlugins() -
{- "active": [
- {
- "id": "string",
- "name": "string",
- "description": "string",
- "version": "string",
- "min_server_version": "string",
- "backend": {
- "executable": "string"
}, - "server": {
- "executables": {
- "linux-amd64": "string",
- "darwin-amd64": "string",
- "windows-amd64": "string"
}, - "executable": "string"
}, - "webapp": {
- "bundle_path": "string"
}, - "settings_schema": { }
}
], - "inactive": [
- {
- "id": "string",
- "name": "string",
- "description": "string",
- "version": "string",
- "min_server_version": "string",
- "backend": {
- "executable": "string"
}, - "server": {
- "executables": {
- "linux-amd64": "string",
- "darwin-amd64": "string",
- "windows-amd64": "string"
}, - "executable": "string"
}, - "webapp": {
- "bundle_path": "string"
}, - "settings_schema": { }
}
]
}
Supply a URL to a plugin compressed in a .tar.gz file. Plugins must be enabled in the server's config settings.
-Must have manage_system
permission.
Minimum server version: 5.14
-plugin_download_url required | string URL used to download the plugin - |
force | string Set to 'true' to overwrite a previously installed plugin with the same ID, if any - |
Plugin install successful
-Invalid or missing parameters in URL or request body
-Do not have appropriate permissions
-Feature is disabled
-import ( - "github.com/mattermost/mattermost-server/model" -) - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -url := "https://mysite.com/my-plugin.tar.gz" - -// Not forced -manifest, resp := Client.InstallPluginFromUrl(url, false) - -// Forced -manifest, resp := Client.InstallPluginFromUrl(url, true) -
{- "status": "string"
}
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.
-Must have manage_system
permission.
Minimum server version: 4.4
-plugin_id required | string |
Plugin removed successfully
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-Feature is disabled
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -pluginID := "com.mattermost.demo-plugin" - -ok, resp = Client.RemovePlugin(pluginID) -
{- "status": "string"
}
Enable a previously uploaded plugin. Plugins must be enabled in the server's config settings.
-Must have manage_system
permission.
Minimum server version: 4.4
-plugin_id required | string |
Plugin enabled successfully
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-Feature is disabled
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -pluginID := "com.mattermost.demo-plugin" - -ok, resp = Client.EnablePlugin(pluginID) -
{- "status": "string"
}
Disable a previously enabled plugin. Plugins must be enabled in the server's config settings.
-Must have manage_system
permission.
Minimum server version: 4.4
-plugin_id required | string |
Plugin disabled successfully
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-Feature is disabled
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -pluginID := "com.mattermost.demo-plugin" - -ok, resp = Client.DisablePlugin(pluginID) -
{- "status": "string"
}
Get a list of web app plugins installed and activated on the server.
-No permissions required.
-Minimum server version: 4.4
-Plugin deactivated successfully
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") - -manifests, resp := Client.GetWebappPlugins() -
[- {
- "id": "string",
- "version": "string",
- "webapp": {
- "bundle_path": "string"
}
}
]
Installs a plugin listed in the marketplace server.
-Must have manage_system
permission.
Minimum server version: 5.16
-The metadata identifying the plugin to install.
-id required | string The ID of the plugin to install. - |
version required | string The version of the plugin to install. - |
Plugin installed successfully
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-Feature is disabled
-{- "id": "string",
- "version": "string"
}
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Gets all plugins from the marketplace server, merging data from locally installed plugins as well as prepackaged plugins shipped with the server.
-Must have manage_system
permission.
Minimum server version: 5.16
-page | integer Page number to be fetched. (not yet implemented) - |
per_page | integer Number of item per page. (not yet implemented) - |
filter | string Set to filter plugins by ID, name, or description. - |
server_version | string Set to filter minimum plugin server version. (not yet implemented) - |
local_only | boolean Set true to only retrieve local plugins. - |
Plugins retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -filter := &model.MarketplacePluginFilter{ - Page: 1, - PerPage: 10, - Filter: "antivirus", - ServerVersion: "0.1.2", - LocalOnly: true, -} - -ok, resp = Client.GetMarketplacePlugins(filter) -
{- "status_code": 0,
- "id": "string",
- "message": "string",
- "request_id": "string"
}
Get a role from the provided role id.
-Requires an active session but no other permissions.
-Minimum server version: 4.9
-role_id required | string Role GUID - |
Role retrieval successful
-No access token provided
-Resource not found
-import "github.com/mattermost/mattermost-server/model" -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -role, resp := Client.GetRole(<ROLEID>, "") -
{- "id": "string",
- "name": "string",
- "display_name": "string",
- "description": "string",
- "permissions": [
- "string"
], - "scheme_managed": true
}
Get a role from the provided role name.
-Requires an active session but no other permissions.
-Minimum server version: 4.9
-role_name required | string Role Name - |
Role retrieval successful
-No access token provided
-Resource not found
-import "github.com/mattermost/mattermost-server/model" -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -role, resp := Client.GetRoleByName(<ROLENAME>, "") -
{- "id": "string",
- "name": "string",
- "display_name": "string",
- "description": "string",
- "permissions": [
- "string"
], - "scheme_managed": true
}
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.
-manage_system
permission is required.
Minimum server version: 4.9
-role_id required | string Role GUID - |
Role object to be updated
-permissions | Array of strings The permissions the role should grant. - |
Role patch successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-{- "permissions": [
- "string"
]
}
{- "id": "string",
- "name": "string",
- "display_name": "string",
- "description": "string",
- "permissions": [
- "string"
], - "scheme_managed": true
}
Get a list of roles from their names.
-Requires an active session but no other permissions.
-Minimum server version: 4.9
-List of role names
-Role list retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Resource not found
-[- "string"
]
[- {
- "id": "string",
- "name": "string",
- "display_name": "string",
- "description": "string",
- "permissions": [
- "string"
], - "scheme_managed": true
}
]
Get a page of schemes. Use the query parameters to modify the behaviour of this endpoint.
-Must have manage_system
permission.
Minimum server version: 5.0
-scope | string Default: "" Limit the results returned to the provided scope, either |
page | integer Default: 0 The page to select. - |
per_page | integer Default: 60 The number of schemes per page. - |
Scheme list retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-[- {
- "id": "string",
- "name": "string",
- "description": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "scope": "string",
- "default_team_admin_role": "string",
- "default_team_user_role": "string",
- "default_channel_admin_role": "string",
- "default_channel_user_role": "string"
}
]
Create a new scheme.
-Must have manage_system
permission.
Minimum server version: 5.0
-Scheme object to create
-name required | string The name of the scheme - |
description | string The description of the scheme - |
scope required | string The scope of the scheme ("team" or "channel") - |
Scheme creation successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-{- "name": "string",
- "description": "string",
- "scope": "string"
}
{- "id": "string",
- "name": "string",
- "description": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "scope": "string",
- "default_team_admin_role": "string",
- "default_team_user_role": "string",
- "default_channel_admin_role": "string",
- "default_channel_user_role": "string"
}
Get a scheme from the provided scheme id.
-Must have manage_system
permission.
Minimum server version: 5.0
-scheme_id required | string Scheme GUID - |
Scheme retrieval successful
-No access token provided
-Resource not found
-Feature is disabled
-import "github.com/mattermost/mattermost-server/model" -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -scheme, resp := Client.GetScheme(<SCHEMEID>, "") -
{- "id": "string",
- "name": "string",
- "description": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "scope": "string",
- "default_team_admin_role": "string",
- "default_team_user_role": "string",
- "default_channel_admin_role": "string",
- "default_channel_user_role": "string"
}
Soft deletes a scheme, by marking the scheme as deleted in the database.
-Must have manage_system
permission.
Minimum server version: 5.0
-scheme_id required | string ID of the scheme to delete - |
Scheme deletion successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Feature is disabled
-{- "status": "string"
}
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.
-manage_system
permission is required.
Minimum server version: 5.0
-scheme_id required | string Scheme GUID - |
Scheme object to be updated
-name | string The human readable name of the scheme - |
description | string The description of the scheme - |
Scheme patch successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-Feature is disabled
-{- "name": "string",
- "description": "string"
}
{- "id": "string",
- "name": "string",
- "description": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "scope": "string",
- "default_team_admin_role": "string",
- "default_team_user_role": "string",
- "default_channel_admin_role": "string",
- "default_channel_user_role": "string"
}
Get a page of teams which use this scheme. The provided Scheme ID should be for a Team-scoped Scheme. -Use the query parameters to modify the behaviour of this endpoint.
-manage_system
permission is required.
Minimum server version: 5.0
-scheme_id required | string Scheme GUID - |
page | integer Default: 0 The page to select. - |
per_page | integer Default: 60 The number of teams per page. - |
Team list retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-[- {
- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "display_name": "string",
- "name": "string",
- "description": "string",
- "email": "string",
- "type": "string",
- "allowed_domains": "string",
- "invite_id": "string",
- "allow_open_invite": true
}
]
Get a page of channels which use this scheme. The provided Scheme ID should be for a Channel-scoped Scheme. -Use the query parameters to modify the behaviour of this endpoint.
-manage_system
permission is required.
Minimum server version: 5.0
-scheme_id required | string Scheme GUID - |
page | integer Default: 0 The page to select. - |
per_page | integer Default: 60 The number of channels per page. - |
Channel list retrieval successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-Resource not found
-[- {
- "id": "string",
- "create_at": 0,
- "update_at": 0,
- "delete_at": 0,
- "team_id": "string",
- "type": "string",
- "display_name": "string",
- "name": "string",
- "header": "string",
- "purpose": "string",
- "last_post_at": 0,
- "total_msg_count": 0,
- "extra_update_at": 0,
- "creator_id": "string"
}
]
Open an interactive dialog using a trigger ID provided by a slash command, or some other action payload. See https://docs.mattermost.com/developer/interactive-dialogs.html for more information on interactive dialogs. -Minimum server version: 5.6
-Metadata for the dialog to be opened
-trigger_id required | string Trigger ID provided by other action - |
url required | string The URL to send the submitted dialog payload to - |
dialog required | object Post object to create - |
Dialog open successful
-Invalid or missing parameters in URL or request body
-{- "trigger_id": "string",
- "url": "string",
- "dialog": {
- "callback_id": "string",
- "title": "string",
- "introduction_text": "string",
- "elements": [
- { }
], - "submit_label": "string",
- "notify_on_cancel": true,
- "state": "string"
}
}
{- "status": "string"
}
Endpoint used by the Mattermost clients to submit a dialog. See https://docs.mattermost.com/developer/interactive-dialogs.html for more information on interactive dialogs. -Minimum server version: 5.6
-Dialog submission data
-url required | string The URL to send the submitted dialog payload to - |
channel_id required | string Channel ID the user submitted the dialog from - |
team_id required | string Team ID the user submitted the dialog from - |
submission required | object String map where keys are element names and values are the element input values - |
callback_id | string Callback ID sent when the dialog was opened - |
state | string State sent when the dialog was opened - |
cancelled | boolean Set to true if the dialog was cancelled - |
Dialog submission successful
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "url": "string",
- "channel_id": "string",
- "team_id": "string",
- "submission": { },
- "callback_id": "string",
- "state": "string",
- "cancelled": true
}
{- "status": "string"
}
Records user action when they accept or decline custom terms of service. Records the action in audit table. -Updates user's last accepted terms of service ID if they accepted it.
-Minimum server version: 5.4
-Must be logged in as the user being acted on.
-user_id required | string User GUID - |
terms of service details
-serviceTermsId required | string terms of service ID on which the user is acting on - |
accepted required | string true or false, indicates whether the user accepted or rejected the terms of service. - |
Terms of service action recorded successfully
-Invalid or missing parameters in URL or request body
-No access token provided
-Do not have appropriate permissions
-{- "serviceTermsId": "string",
- "accepted": "string"
}
{- "status": "string"
}
Will be deprecated in v6.0 -Fetches user's latest terms of service action if the latest action was for acceptance.
-Minimum server version: 5.6
-Must be logged in as the user being acted on.
-user_id required | string User GUID - |
User's accepted terms of service action
-Invalid or missing parameters in URL or request body
-No access token provided
-User hasn't performed an action or the latest action was a rejection.
-import "github.com/mattermost/mattermost-server/model" - -Client := model.NewAPIv4Client("https://your-mattermost-url.com") -Client.Login("email@domain.com", "Password1") - -userID := "adWv1qPZmHdtxk7Lmqh6RtxWxS" - -userTermsOfService, resp := Client.GetUserTermsOfService(userID, "") -
{- "user_id": "string",
- "terms_of_service_id": "string",
- "create_at": 0
}