Mattermost Users API

The Users API from Mattermost — 8 operation(s) for users.

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).

Operations 11

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /users/login Log in to Mattermost · Login to Mattermost #
Ask an LLM
“How do I log in to Mattermost with a username and password?”
“Can I log in with a personal access token instead of a password?”
Tell an agent
Log in to Mattermost as {login_id} with password {password}.
Log in to Mattermost using personal access token {token}.
POST /users/logout End my Mattermost session · End the user session #
Ask an LLM
“How do I log myself out of Mattermost?”
“Can I end a session on another device?”
Tell an agent destructive · confirm first
End my current Mattermost session.
Log me out of Mattermost.
GET /users List Mattermost users · List users #
Ask an LLM
“Which users are on my Mattermost server?”
“Can I list only the users on a particular team?”
Tell an agent
List all users on the server.
List users on team {in_team}.
POST /users Create a user · Create a user #
Ask an LLM
“How do I create a new user on Mattermost?”
“Can I set a user's roles when creating them?”
Tell an agent
Create a user named {first_name} {last_name} with username {username} and email {email}.
Add a new user {username} with roles {roles}.
GET /users/{user_id} Get a user · Get a user #
Ask an LLM
“What are the details of a specific user?”
“Can I look up a user by their user ID?”
Tell an agent
Get user {user_id}.
Show the profile of user {user_id}.
PUT /users/{user_id} Update a user's profile · Update a user #
Ask an LLM
“How do I change a user's email or name?”
“Can I update a user's roles?”
Tell an agent
Update user {user_id} with email {email}.
Rename user {user_id} to {first_name} {last_name}.
DELETE /users/{user_id} Deactivate a user · Deactivate a user #
Ask an LLM
“How do I deactivate a user account?”
“Can I remove a user from the server without deleting their data?”
Tell an agent destructive · confirm first
Deactivate user {user_id}.
Disable user {user_id} so they can no longer log in.
PUT /users/{user_id}/patch Partially update a user · Partially update a user #
Ask an LLM
“Can I change just a user's email without resending their full profile?”
“Is there a partial update for a user's details?”
Tell an agent
Patch user {user_id} with email {email}.
Partially update user {user_id} to change their roles to {roles}.
POST /users/search Search users · Search users #
Ask an LLM
“How do I find a user by name on a team?”
“Can I search users in a channel and include inactive ones?”
Tell an agent
Search users for {term} on team {team_id}.
Find users named {term} in channel {in_channel_id}, including inactive users.
GET /users/autocomplete Autocomplete a user's name · Autocomplete users #
Ask an LLM
“How do I suggest users as I type a name?”
“Can autocomplete be limited to a team or channel?”
Tell an agent
Autocomplete users whose name starts with {name}.
Suggest users named {name} on team {team_id}.
GET /users/{user_id}/sessions List a user's active sessions · List active sessions for a user #
Ask an LLM
“Which devices is a user logged in from?”
“Can I see the active sessions for one user?”
Tell an agent
List the active sessions for user {user_id}.
Show where user {user_id} is currently logged in.

Specifications

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/mattermost:mattermost-users-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

mattermost-users-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Mattermost REST Users API
  version: '4'
  description: 'Mattermost REST API v4 for managing users, teams, channels, posts, threads,

    files, integrations, plugins, webhooks, slash commands, and OAuth

    applications on a self-hosted or cloud Mattermost server. Authentication

    uses Personal Access Tokens or session tokens carried as a Bearer token.'
  contact:
    name: Mattermost API Documentation
    url: https://developers.mattermost.com/api-documentation
servers:
- url: https://{your-mattermost-server}/api/v4
  description: Self-hosted Mattermost server
  variables:
    your-mattermost-server:
      default: your-mattermost-server.com
      description: Hostname of your Mattermost server
security:
- bearerAuth: []
tags:
- name: Users
paths:
  /users/login:
    post:
      tags:
      - Users
      summary: Login to Mattermost
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                login_id:
                  type: string
                password:
                  type: string
                token:
                  type: string
                device_id:
                  type: string
      responses:
        '200':
          description: Successful login. Session token returned in Token header.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
      operationId: postUsersLogin
      x-operation-id-source: derived
  /users/logout:
    post:
      tags:
      - Users
      summary: End the user session
      responses:
        '200':
          description: Logged out
      operationId: postUsersLogout
      x-operation-id-source: derived
  /users:
    get:
      tags:
      - Users
      summary: List users
      parameters:
      - in: query
        name: page
        schema:
          type: integer
          default: 0
      - in: query
        name: per_page
        schema:
          type: integer
          default: 60
      - in: query
        name: in_team
        schema:
          type: string
      - in: query
        name: in_channel
        schema:
          type: string
      responses:
        '200':
          description: A page of users
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/User'
      operationId: getUsers
      x-operation-id-source: derived
    post:
      tags:
      - Users
      summary: Create a user
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/User'
      responses:
        '201':
          description: User created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
      operationId: postUsers
      x-operation-id-source: derived
  /users/{user_id}:
    parameters:
    - in: path
      name: user_id
      required: true
      schema:
        type: string
    get:
      tags:
      - Users
      summary: Get a user
      responses:
        '200':
          description: User
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
      operationId: getUsersByUserId
      x-operation-id-source: derived
    put:
      tags:
      - Users
      summary: Update a user
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/User'
      responses:
        '200':
          description: Updated user
      operationId: putUsersByUserId
      x-operation-id-source: derived
    delete:
      tags:
      - Users
      summary: Deactivate a user
      responses:
        '200':
          description: Deactivated
      operationId: deleteUsersByUserId
      x-operation-id-source: derived
  /users/{user_id}/patch:
    put:
      tags:
      - Users
      summary: Partially update a user
      parameters:
      - in: path
        name: user_id
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/User'
      responses:
        '200':
          description: Patched user
      operationId: putUsersByUserIdPatch
      x-operation-id-source: derived
  /users/search:
    post:
      tags:
      - Users
      summary: Search users
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                term:
                  type: string
                team_id:
                  type: string
                in_channel_id:
                  type: string
                not_in_channel_id:
                  type: string
                allow_inactive:
                  type: boolean
      responses:
        '200':
          description: Search results
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/User'
      operationId: postUsersSearch
      x-operation-id-source: derived
  /users/autocomplete:
    get:
      tags:
      - Users
      summary: Autocomplete users
      parameters:
      - in: query
        name: name
        required: true
        schema:
          type: string
      - in: query
        name: team_id
        schema:
          type: string
      - in: query
        name: channel_id
        schema:
          type: string
      responses:
        '200':
          description: Autocomplete results
      operationId: getUsersAutocomplete
      x-operation-id-source: derived
  /users/{user_id}/sessions:
    get:
      tags:
      - Users
      summary: List active sessions for a user
      parameters:
      - in: path
        name: user_id
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Sessions
      operationId: getUsersByUserIdSessions
      x-operation-id-source: derived
components:
  schemas:
    User:
      type: object
      properties:
        id:
          type: string
        username:
          type: string
        email:
          type: string
        first_name:
          type: string
        last_name:
          type: string
        roles:
          type: string
        create_at:
          type: integer
        update_at:
          type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Personal Access Token or session token issued by /users/login.