Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

A Python Mattermost Driver

Project description

Python Mattermost Driver (APIv4)


Breaking changes may happen but I try to avoid them.

Mostly a bit more documentation to do now.

If something changes, it is most likely to change because the official mattermost api changed.


pip install mattermostdriver


Documentation can be found at .


from mattermostdriver import Driver

foo = Driver({
    # Required options
    'url': '',
    'login_id': '',
    'password': 'verySecret',
    # Optional / defaults to
    'scheme': 'https',
    'port': 8065,
    'basepath': '/api/v4',
    # Use False if self signed/insecure certificate
    'verify': True,
    # The interval the websocket will ping the server to keep the connection alive
    'timeout': 30,

# Most of the requests need you to be logged in, so calling login()
# should be the first thing you do after you created your Driver instance.
# login() returns the raw response

# You can make api calls by using api['yourendpointofchoice'].
# The names of the endpoints and requests are almost identical to
# the names on the page.
# API calls always return the json the server send as a response.

# If the api request needs additional parameters
# you can pass them to the function in the following way:
# - Path parameters are always simple parameters you pass to the function

# - Query parameters are always passed by passing a `params` dict to the function

# - Request Bodies are always passed by passing an `options` dict or array to the function

# See the mattermost api documentation to see which parameters you need to pass.
    'team_id': 'some_team_id',
    'name': 'awesome-channel',
    'display_name': 'awesome channel',
    'type': 'O'

# If you want to make a websocket connection to the mattermost server
# you can call the init_websocket method, passing an event_handler.
# Every Websocket event send by mattermost will be send to that event_handler.
# See the API documentation for which events are available.

Available endpoints:

  • users
  • teams
  • channels
  • posts
  • files
  • preferences
  • system
  • webhooks
  • commands
  • compliance
  • cluster
  • brand
  • oauth
  • saml
  • ldap
  • jobs

See to see which api requests are available.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
mattermostdriver-0.5.2.tar.gz (11.6 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page