diff --git a/.github/workflows/api.yml b/.github/workflows/api.yml new file mode 100644 index 0000000000..2e56ee92a1 --- /dev/null +++ b/.github/workflows/api.yml @@ -0,0 +1,35 @@ +name: API + +on: + push: + branches: + - master + pull_request: + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./api + + steps: + - name: Checkout code + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + + - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 + with: + node-version-file: .nvmrc + cache: 'npm' + cache-dependency-path: api/package-lock.json + + - name: Run build + run: make build + + - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + with: + name: mattermost-api-reference + path: api/v4/html diff --git a/api/.gitignore b/api/.gitignore new file mode 100644 index 0000000000..5045daf545 --- /dev/null +++ b/api/.gitignore @@ -0,0 +1,17 @@ +# Mac OSX +.DS_Store + +# VIM +*.swp + +# Build +v4/html/index.html +*mattermost-openapi-v3.yaml +*mattermost-openapi-v4.yaml +.npminstall +node_modules +playbooks/*.yaml +!playbooks/tags.yaml + +# IDEs +.idea/ diff --git a/api/.gitpod.yml b/api/.gitpod.yml new file mode 100644 index 0000000000..e85c2124ea --- /dev/null +++ b/api/.gitpod.yml @@ -0,0 +1,15 @@ +ports: + - port: 8080 + onOpen: open-browser + +tasks: + - name: Docs + init: make build + command: make run + - name: Notice + command: | + clear + echo "Once the docs server is running, go to the following URL to view the docs: + + $(gp url 8080)" + openMode: split-right diff --git a/api/.spectral.yaml b/api/.spectral.yaml new file mode 100644 index 0000000000..28d05be55e --- /dev/null +++ b/api/.spectral.yaml @@ -0,0 +1,14 @@ +extends: '@ibm-cloud/openapi-ruleset' +rules: + operation-tags: off + property-case-convention: off + request-body-object: off + operation-operationId: error + operation-summary: warn + array-responses: off + parameter-description: error + parameter-description: off + parameter-case-convention: info + no-$ref-siblings: off + enum-case-convention: off + path-segment-case-convention: info diff --git a/api/CONTRIBUTING.md b/api/CONTRIBUTING.md new file mode 100644 index 0000000000..f8d050e63e --- /dev/null +++ b/api/CONTRIBUTING.md @@ -0,0 +1,13 @@ +## Contributing + +We're accepting pull requests! Specifically we're looking for documenation on routes defined [here](../server/channels/api4). + +All the documentation is written in YAML and found in the [source](v4/source) directory. + +* When adding a new route, please add it to the correct file. For example, a channel route will go in [channels.yaml](v4/source/channels.yaml). +* To add a new tag, please do so in [introduction.yaml](v4/source/introduction.yaml) +* Definitions should be added to [definitions.yaml](v4/source/definitions.yaml) + +There is no strict style guide but please try to follow the example of the existing documentation. + +To build the full YAML, run `make build` and it will be output to `html/static/mattermost-openapi.yaml`. To check for syntax, you can copy the contents of that into http://editor.swagger.io/ or you can look into using a commandline or ESLint-based syntax checker. diff --git a/api/Makefile b/api/Makefile new file mode 100644 index 0000000000..c151e94736 --- /dev/null +++ b/api/Makefile @@ -0,0 +1,79 @@ +.PHONY: build build-v4 clean playbooks + +V4_YAML = v4/html/static/mattermost-openapi-v4.yaml + +V4_SRC = v4/source +PLAYBOOKS_SRC = playbooks + +build: build-v4 + +build-v4: node_modules playbooks + @echo Building mattermost openapi yaml for v4 + + @if [ -r $(PLAYBOOKS_SRC)/merged-tags.yaml ]; then cat $(PLAYBOOKS_SRC)/merged-tags.yaml > $(V4_YAML); else cat $(V4_SRC)/introduction.yaml > $(V4_YAML); fi + @cat $(V4_SRC)/insights.yaml >> $(V4_YAML) + @cat $(V4_SRC)/users.yaml >> $(V4_YAML) + @cat $(V4_SRC)/status.yaml >> $(V4_YAML) + @cat $(V4_SRC)/teams.yaml >> $(V4_YAML) + @cat $(V4_SRC)/channels.yaml >> $(V4_YAML) + @cat $(V4_SRC)/posts.yaml >> $(V4_YAML) + @cat $(V4_SRC)/preferences.yaml >> $(V4_YAML) + @cat $(V4_SRC)/files.yaml >> $(V4_YAML) + @cat $(V4_SRC)/uploads.yaml >> $(V4_YAML) + @cat $(V4_SRC)/jobs.yaml >> $(V4_YAML) + @cat $(V4_SRC)/system.yaml >> $(V4_YAML) + @cat $(V4_SRC)/emoji.yaml >> $(V4_YAML) + @cat $(V4_SRC)/webhooks.yaml >> $(V4_YAML) + @cat $(V4_SRC)/saml.yaml >> $(V4_YAML) + @cat $(V4_SRC)/compliance.yaml >> $(V4_YAML) + @cat $(V4_SRC)/ldap.yaml >> $(V4_YAML) + @cat $(V4_SRC)/groups.yaml >> $(V4_YAML) + @cat $(V4_SRC)/cluster.yaml >> $(V4_YAML) + @cat $(V4_SRC)/brand.yaml >> $(V4_YAML) + @cat $(V4_SRC)/commands.yaml >> $(V4_YAML) + @cat $(V4_SRC)/oauth.yaml >> $(V4_YAML) + @cat $(V4_SRC)/elasticsearch.yaml >> $(V4_YAML) + @cat $(V4_SRC)/bleve.yaml >> $(V4_YAML) + @cat $(V4_SRC)/dataretention.yaml >> $(V4_YAML) + @cat $(V4_SRC)/plugins.yaml >> $(V4_YAML) + @cat $(V4_SRC)/roles.yaml >> $(V4_YAML) + @cat $(V4_SRC)/schemes.yaml >> $(V4_YAML) + @cat $(V4_SRC)/service_terms.yaml >> $(V4_YAML) + @cat $(V4_SRC)/sharedchannels.yaml >> $(V4_YAML) + @cat $(V4_SRC)/opengraph.yaml >> $(V4_YAML) + @cat $(V4_SRC)/reactions.yaml >> $(V4_YAML) + @cat $(V4_SRC)/actions.yaml >> $(V4_YAML) + @cat $(V4_SRC)/bots.yaml >> $(V4_YAML) + @cat $(V4_SRC)/cloud.yaml >> $(V4_YAML) + @cat $(V4_SRC)/usage.yaml >> $(V4_YAML) + @cat $(V4_SRC)/permissions.yaml >> $(V4_YAML) + @cat $(V4_SRC)/imports.yaml >> $(V4_YAML) + @cat $(V4_SRC)/exports.yaml >> $(V4_YAML) + @if [ -r $(PLAYBOOKS_SRC)/paths.yaml ]; then cat $(PLAYBOOKS_SRC)/paths.yaml >> $(V4_YAML); fi + @if [ -r $(PLAYBOOKS_SRC)/merged-definitions.yaml ]; then cat $(PLAYBOOKS_SRC)/merged-definitions.yaml >> $(V4_YAML); else cat $(V4_SRC)/definitions.yaml >> $(V4_YAML); fi + + @node_modules/.bin/swagger-cli validate $(V4_YAML) + @node_modules/.bin/redoc-cli -t ./v4/html/ssr_template.hbs build ./v4/html/static/mattermost-openapi-v4.yaml -o ./v4/html/index.html --options.noAutoAuth --options.suppressWarnings + @echo Complete + +node_modules: package.json $(wildcard package-lock.json) + @echo Getting dependencies using npm + + npm install + touch $@ + +run: + @echo Starting redoc server + + @node_modules/.bin/redoc-cli -t ./v4/html/ssr_template.hbs serve ./v4/html/static/mattermost-openapi-v4.yaml --options.noAutoAuth --options.suppressWarnings --ssr + +clean: + @echo Cleaning + + rm -rf node_modules + +playbooks: + @echo Fetching Playbooks OpenAPI spec + cd playbooks && node extract.js + cd playbooks && node merge-definitions.js ../$(V4_SRC)/definitions.yaml + cd playbooks && node merge-tags.js ../$(V4_SRC)/introduction.yaml diff --git a/api/README.md b/api/README.md new file mode 100644 index 0000000000..4db79eb0b7 --- /dev/null +++ b/api/README.md @@ -0,0 +1,28 @@ +# Mattermost API Documentation + +This repository holds the API reference available at [https://api.mattermost.com](https://api.mattermost.com). + +The Mattermost API reference uses the [OpenAPI standard](https://openapis.org/) and the [ReDoc document generator](https://github.com/Rebilly/ReDoc). + +All documentation is available under the terms of a [Creative Commons License](https://creativecommons.org/licenses/by-nc-sa/3.0/). + +## Contributing + +We're accepting pull requests! See something that could be documented better or is missing documentation? Make a PR and we'll gladly accept it. + +All the documentation is written in YAML and found in the [v4/source](v4/source) directories. APIv4 documentation is in the [v4 directory](v4). +APIs for [Playbooks](https://github.com/mattermost/mattermost-plugin-playbooks) are retrieved from GitHub at build time and integrated into the final YAML file. + +* When adding a new route, please add it to the correct file. For example, a channel route will go in [channels.yaml](v4/source/channels.yaml). +* To add a new tag, please do so in [introduction.yaml](v4/source/introduction.yaml) +* Definitions should be added to [definitions.yaml](v4/source/definitions.yaml) + +There is no strict style guide but please try to follow the example of the existing documentation. + +To build the full YAML, run `make build` and it will be output to `v4/html/static/mattermost-openapi-v4.yaml`. This will also check syntax using [swagger-cli](https://github.com/APIDevTools/swagger-cli). + +To test locally, run `make build`, `make run` and navigate to `http://127.0.0.1:8080`. For any updates to the source files, re-run the same commands. + +## Deployment + +Deployment is handled automatically by our Jenkins CLI machine. When a pull request is merged it will automatically be deployed to [https://api.mattermost.com](https://api.mattermost.com). diff --git a/api/package-lock.json b/api/package-lock.json new file mode 100644 index 0000000000..014cab16ee --- /dev/null +++ b/api/package-lock.json @@ -0,0 +1,6391 @@ +{ + "name": "mattermost-api-reference", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "mattermost-api-reference", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "redoc-cli": "0.13.17", + "swagger-cli": "4.0.4", + "sync-fetch": "0.4.1", + "yaml": "2.1.1" + } + }, + "node_modules/@apidevtools/json-schema-ref-parser": { + "version": "9.0.6", + "resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.6.tgz", + "integrity": "sha512-M3YgsLjI0lZxvrpeGVk9Ap032W6TPQkH6pRAZz81Ac3WUNF79VQooAFnp8umjvVzUmD93NkogxEwbSce7qMsUg==", + "dependencies": { + "@jsdevtools/ono": "^7.1.3", + "call-me-maybe": "^1.0.1", + "js-yaml": "^3.13.1" + } + }, + "node_modules/@apidevtools/openapi-schemas": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@apidevtools/openapi-schemas/-/openapi-schemas-2.1.0.tgz", + "integrity": "sha512-Zc1AlqrJlX3SlpupFGpiLi2EbteyP7fXmUOGup6/DnkRgjP9bgMM/ag+n91rsv0U1Gpz0H3VILA/o3bW7Ua6BQ==", + "engines": { + "node": ">=10" + } + }, + "node_modules/@apidevtools/swagger-cli": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@apidevtools/swagger-cli/-/swagger-cli-4.0.4.tgz", + "integrity": "sha512-hdDT3B6GLVovCsRZYDi3+wMcB1HfetTU20l2DC8zD3iFRNMC6QNAZG5fo/6PYeHWBEv7ri4MvnlKodhNB0nt7g==", + "dependencies": { + "@apidevtools/swagger-parser": "^10.0.1", + "chalk": "^4.1.0", + "js-yaml": "^3.14.0", + "yargs": "^15.4.1" + }, + "bin": { + "swagger-cli": "bin/swagger-cli.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@apidevtools/swagger-cli/node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/@apidevtools/swagger-cli/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@apidevtools/swagger-cli/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@apidevtools/swagger-cli/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@apidevtools/swagger-cli/node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "engines": { + "node": ">=8" + } + }, + "node_modules/@apidevtools/swagger-cli/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@apidevtools/swagger-cli/node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" + }, + "node_modules/@apidevtools/swagger-cli/node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@apidevtools/swagger-cli/node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@apidevtools/swagger-methods": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@apidevtools/swagger-methods/-/swagger-methods-3.0.2.tgz", + "integrity": "sha512-QAkD5kK2b1WfjDS/UQn/qQkbwF31uqRjPTrsCs5ZG9BQGAkjwvqGFjjPqAuzac/IYzpPtRzjCP1WrTuAIjMrXg==" + }, + "node_modules/@apidevtools/swagger-parser": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/@apidevtools/swagger-parser/-/swagger-parser-10.1.0.tgz", + "integrity": "sha512-9Kt7EuS/7WbMAUv2gSziqjvxwDbFSg3Xeyfuj5laUODX8o/k/CpsAKiQ8W7/R88eXFTMbJYg6+7uAmOWNKmwnw==", + "dependencies": { + "@apidevtools/json-schema-ref-parser": "9.0.6", + "@apidevtools/openapi-schemas": "^2.1.0", + "@apidevtools/swagger-methods": "^3.0.2", + "@jsdevtools/ono": "^7.1.3", + "ajv": "^8.6.3", + "ajv-draft-04": "^1.0.0", + "call-me-maybe": "^1.0.1" + }, + "peerDependencies": { + "openapi-types": ">=7" + } + }, + "node_modules/@jsdevtools/ono": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz", + "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==" + }, + "node_modules/ajv": { + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", + "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-draft-04": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ajv-draft-04/-/ajv-draft-04-1.0.0.tgz", + "integrity": "sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw==", + "peerDependencies": { + "ajv": "^8.5.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/call-me-maybe": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", + "integrity": "sha512-wCyFsDQkKPwwF8BDwOiWNx/9K45L/hvggQiDbve+viMNMQnWhrlYIuBk09offfwCRtCO9P6XwUttufzU11WCVw==" + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/openapi-types": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/openapi-types/-/openapi-types-12.0.0.tgz", + "integrity": "sha512-6Wd9k8nmGQHgCbehZCP6wwWcfXcvinhybUTBatuhjRsCxUIujuYFZc9QnGeae75CyHASewBtxs0HX/qwREReUw==", + "peer": true + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "engines": { + "node": ">=6" + } + }, + "node_modules/redoc-cli": { + "version": "0.13.17", + "resolved": "https://registry.npmjs.org/redoc-cli/-/redoc-cli-0.13.17.tgz", + "integrity": "sha512-9nlebYPiysVnuSJSoXAfEmwy8eHMsp14Rt4oRKqXaCz00O6chMnveZpzTB6APMVwA9gtNbiGO3Rbsm5PQQExzQ==", + "hasShrinkwrap": true, + "dependencies": { + "chokidar": "^3.5.1", + "handlebars": "^4.7.7", + "isarray": "^2.0.5", + "mkdirp": "^1.0.4", + "mobx": "^6.3.2", + "node-libs-browser": "^2.2.1", + "react": "^17.0.1", + "react-dom": "^17.0.1", + "redoc": "2.0.0-rc.74", + "styled-components": "^5.3.0", + "yargs": "^17.3.1" + }, + "bin": { + "redoc-cli": "index.js" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/redoc-cli/node_modules/@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "dependencies": { + "@babel/highlight": "^7.12.13" + } + }, + "node_modules/redoc-cli/node_modules/@babel/generator": { + "version": "7.14.3", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.3.tgz", + "integrity": "sha512-bn0S6flG/j0xtQdz3hsjJ624h3W0r3llttBMfyHX3YrZ/KtLYr15bjA0FXkgW7FpvrDuTuElXeVjiKlYRpnOFA==", + "dependencies": { + "@babel/types": "^7.14.2", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "node_modules/redoc-cli/node_modules/@babel/generator/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/redoc-cli/node_modules/@babel/helper-annotate-as-pure": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.12.13.tgz", + "integrity": "sha512-7YXfX5wQ5aYM/BOlbSccHDbuXXFPxeoUmfWtz8le2yTkTZc+BxsiEnENFoi2SlmA8ewDkG2LgIMIVzzn2h8kfw==", + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/redoc-cli/node_modules/@babel/helper-function-name": { + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.14.2.tgz", + "integrity": "sha512-NYZlkZRydxw+YT56IlhIcS8PAhb+FEUiOzuhFTfqDyPmzAhRge6ua0dQYT/Uh0t/EDHq05/i+e5M2d4XvjgarQ==", + "dependencies": { + "@babel/helper-get-function-arity": "^7.12.13", + "@babel/template": "^7.12.13", + "@babel/types": "^7.14.2" + } + }, + "node_modules/redoc-cli/node_modules/@babel/helper-get-function-arity": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", + "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/redoc-cli/node_modules/@babel/helper-module-imports": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz", + "integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==", + "dependencies": { + "@babel/types": "^7.13.12" + } + }, + "node_modules/redoc-cli/node_modules/@babel/helper-split-export-declaration": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", + "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", + "dependencies": { + "@babel/types": "^7.12.13" + } + }, + "node_modules/redoc-cli/node_modules/@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==" + }, + "node_modules/redoc-cli/node_modules/@babel/highlight": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "node_modules/redoc-cli/node_modules/@babel/parser": { + "version": "7.14.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.4.tgz", + "integrity": "sha512-ArliyUsWDUqEGfWcmzpGUzNfLxTdTp6WU4IuP6QFSp9gGfWS6boxFCkJSJ/L4+RG8z/FnIU3WxCk6hPL9SSWeA==", + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/redoc-cli/node_modules/@babel/runtime": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.7.tgz", + "integrity": "sha512-9E9FJowqAsytyOY6LG+1KuueckRL+aQW+mKvXRXnuFGyRAyepJPmEo9vgMfXUA6O9u3IeEdv9MAkppFcaQwogQ==", + "dependencies": { + "regenerator-runtime": "^0.13.4" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/redoc-cli/node_modules/@babel/template": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", + "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@babel/parser": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "node_modules/redoc-cli/node_modules/@babel/traverse": { + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.2.tgz", + "integrity": "sha512-TsdRgvBFHMyHOOzcP9S6QU0QQtjxlRpEYOy3mcCO5RgmC305ki42aSAmfZEMSSYBla2oZ9BMqYlncBaKmD/7iA==", + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@babel/generator": "^7.14.2", + "@babel/helper-function-name": "^7.14.2", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/parser": "^7.14.2", + "@babel/types": "^7.14.2", + "debug": "^4.1.0", + "globals": "^11.1.0" + } + }, + "node_modules/redoc-cli/node_modules/@babel/types": { + "version": "7.14.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.4.tgz", + "integrity": "sha512-lCj4aIs0xUefJFQnwwQv2Bxg7Omd6bgquZ6LGC+gGMh6/s5qDVfjuCMlDmYQ15SLsWHd9n+X3E75lKIhl5Lkiw==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/redoc-cli/node_modules/@emotion/is-prop-valid": { + "version": "0.8.8", + "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-0.8.8.tgz", + "integrity": "sha512-u5WtneEAr5IDG2Wv65yhunPSMLIpuKsbuOktRojfrEiEvRyC85LgPMZI63cr7NUqT8ZIGdSVg8ZKGxIug4lXcA==", + "dependencies": { + "@emotion/memoize": "0.7.4" + } + }, + "node_modules/redoc-cli/node_modules/@emotion/memoize": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.4.tgz", + "integrity": "sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==" + }, + "node_modules/redoc-cli/node_modules/@emotion/stylis": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/@emotion/stylis/-/stylis-0.8.5.tgz", + "integrity": "sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ==" + }, + "node_modules/redoc-cli/node_modules/@emotion/unitless": { + "version": "0.7.5", + "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.5.tgz", + "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==" + }, + "node_modules/redoc-cli/node_modules/@exodus/schemasafe": { + "version": "1.0.0-rc.6", + "resolved": "https://registry.npmjs.org/@exodus/schemasafe/-/schemasafe-1.0.0-rc.6.tgz", + "integrity": "sha512-dDnQizD94EdBwEj/fh3zPRa/HWCS9O5au2PuHhZBbuM3xWHxuaKzPBOEWze7Nn0xW68MIpZ7Xdyn1CoCpjKCuQ==" + }, + "node_modules/redoc-cli/node_modules/@redocly/ajv": { + "version": "8.6.4", + "resolved": "https://registry.npmjs.org/@redocly/ajv/-/ajv-8.6.4.tgz", + "integrity": "sha512-y9qNj0//tZtWB2jfXNK3BX18BSBp9zNR7KE7lMysVHwbZtY392OJCjm6Rb/h4UHH2r1AqjNEHFD6bRn+DqU9Mw==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/redoc-cli/node_modules/@redocly/openapi-core": { + "version": "1.0.0-beta.105", + "resolved": "https://registry.npmjs.org/@redocly/openapi-core/-/openapi-core-1.0.0-beta.105.tgz", + "integrity": "sha512-8uYDMcqBOPhFgjRlg5uetW/E2uTVVRpk+YsJhaH78ZNuzBkQP5Waw5s8P8ym6myvHs5me8l5AdniY/ePLMT5xg==", + "dependencies": { + "@redocly/ajv": "^8.6.4", + "@types/node": "^14.11.8", + "colorette": "^1.2.0", + "js-levenshtein": "^1.1.6", + "js-yaml": "^4.1.0", + "lodash.isequal": "^4.5.0", + "minimatch": "^5.0.1", + "node-fetch": "^2.6.1", + "pluralize": "^8.0.0", + "yaml-ast-parser": "0.0.43" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/redoc-cli/node_modules/@redocly/openapi-core/node_modules/@types/node": { + "version": "14.18.22", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.22.tgz", + "integrity": "sha512-qzaYbXVzin6EPjghf/hTdIbnVW1ErMx8rPzwRNJhlbyJhu2SyqlvjGOY/tbUt6VFyzg56lROcOeSQRInpt63Yw==" + }, + "node_modules/redoc-cli/node_modules/@types/chokidar": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@types/chokidar/-/chokidar-2.1.3.tgz", + "integrity": "sha512-6qK3xoLLAhQVTucQGHTySwOVA1crHRXnJeLwqK6KIFkkKa2aoMFXh+WEi8PotxDtvN6MQJLyYN9ag9P6NLV81w==", + "deprecated": "This is a stub types definition. chokidar provides its own type definitions, so you do not need this installed.", + "extraneous": true, + "dependencies": { + "chokidar": "*" + } + }, + "node_modules/redoc-cli/node_modules/@types/eslint": { + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.1.tgz", + "integrity": "sha512-GE44+DNEyxxh2Kc6ro/VkIj+9ma0pO0bwv9+uHSyBrikYOHr8zYcdPvnBOp1aw8s+CjRvuSx7CyWqRrNFQ59mA==", + "peer": true, + "dependencies": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "node_modules/redoc-cli/node_modules/@types/eslint-scope": { + "version": "3.7.3", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.3.tgz", + "integrity": "sha512-PB3ldyrcnAicT35TWPs5IcwKD8S333HMaa2VVv4+wdvebJkjWuW/xESoB8IwRcog8HYVYamb1g/R31Qv5Bx03g==", + "peer": true, + "dependencies": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, + "node_modules/redoc-cli/node_modules/@types/estree": { + "version": "0.0.50", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.50.tgz", + "integrity": "sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw==", + "peer": true + }, + "node_modules/redoc-cli/node_modules/@types/handlebars": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@types/handlebars/-/handlebars-4.1.0.tgz", + "integrity": "sha512-gq9YweFKNNB1uFK71eRqsd4niVkXrxHugqWFQkeLRJvGjnxsLr16bYtcsG4tOFwmYi0Bax+wCkbf1reUfdl4kA==", + "deprecated": "This is a stub types definition. handlebars provides its own type definitions, so you do not need this installed.", + "extraneous": true, + "dependencies": { + "handlebars": "*" + } + }, + "node_modules/redoc-cli/node_modules/@types/json-schema": { + "version": "7.0.9", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", + "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==" + }, + "node_modules/redoc-cli/node_modules/@types/mkdirp": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@types/mkdirp/-/mkdirp-1.0.1.tgz", + "integrity": "sha512-HkGSK7CGAXncr8Qn/0VqNtExEE+PHMWb+qlR1faHMao7ng6P3tAaoWWBMdva0gL5h4zprjIO89GJOLXsMcDm1Q==", + "extraneous": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/redoc-cli/node_modules/@types/node": { + "version": "15.12.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-15.12.2.tgz", + "integrity": "sha512-zjQ69G564OCIWIOHSXyQEEDpdpGl+G348RAKY0XXy9Z5kU9Vzv1GMNnkar/ZJ8dzXB3COzD9Mo9NtRZ4xfgUww==", + "peer": true + }, + "node_modules/redoc-cli/node_modules/@webassemblyjs/ast": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", + "integrity": "sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==", + "peer": true, + "dependencies": { + "@webassemblyjs/helper-numbers": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1" + } + }, + "node_modules/redoc-cli/node_modules/@webassemblyjs/floating-point-hex-parser": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz", + "integrity": "sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ==", + "peer": true + }, + "node_modules/redoc-cli/node_modules/@webassemblyjs/helper-api-error": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz", + "integrity": "sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg==", + "peer": true + }, + "node_modules/redoc-cli/node_modules/@webassemblyjs/helper-buffer": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz", + "integrity": "sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA==", + "peer": true + }, + "node_modules/redoc-cli/node_modules/@webassemblyjs/helper-numbers": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz", + "integrity": "sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ==", + "peer": true, + "dependencies": { + "@webassemblyjs/floating-point-hex-parser": "1.11.1", + "@webassemblyjs/helper-api-error": "1.11.1", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/redoc-cli/node_modules/@webassemblyjs/helper-wasm-bytecode": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz", + "integrity": "sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q==", + "peer": true + }, + "node_modules/redoc-cli/node_modules/@webassemblyjs/helper-wasm-section": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz", + "integrity": "sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg==", + "peer": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-buffer": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/wasm-gen": "1.11.1" + } + }, + "node_modules/redoc-cli/node_modules/@webassemblyjs/ieee754": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz", + "integrity": "sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ==", + "peer": true, + "dependencies": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "node_modules/redoc-cli/node_modules/@webassemblyjs/leb128": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.1.tgz", + "integrity": "sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw==", + "peer": true, + "dependencies": { + "@xtuc/long": "4.2.2" + } + }, + "node_modules/redoc-cli/node_modules/@webassemblyjs/utf8": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.1.tgz", + "integrity": "sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ==", + "peer": true + }, + "node_modules/redoc-cli/node_modules/@webassemblyjs/wasm-edit": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz", + "integrity": "sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA==", + "peer": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-buffer": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/helper-wasm-section": "1.11.1", + "@webassemblyjs/wasm-gen": "1.11.1", + "@webassemblyjs/wasm-opt": "1.11.1", + "@webassemblyjs/wasm-parser": "1.11.1", + "@webassemblyjs/wast-printer": "1.11.1" + } + }, + "node_modules/redoc-cli/node_modules/@webassemblyjs/wasm-gen": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz", + "integrity": "sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA==", + "peer": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/ieee754": "1.11.1", + "@webassemblyjs/leb128": "1.11.1", + "@webassemblyjs/utf8": "1.11.1" + } + }, + "node_modules/redoc-cli/node_modules/@webassemblyjs/wasm-opt": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz", + "integrity": "sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw==", + "peer": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-buffer": "1.11.1", + "@webassemblyjs/wasm-gen": "1.11.1", + "@webassemblyjs/wasm-parser": "1.11.1" + } + }, + "node_modules/redoc-cli/node_modules/@webassemblyjs/wasm-parser": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz", + "integrity": "sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA==", + "peer": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-api-error": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/ieee754": "1.11.1", + "@webassemblyjs/leb128": "1.11.1", + "@webassemblyjs/utf8": "1.11.1" + } + }, + "node_modules/redoc-cli/node_modules/@webassemblyjs/wast-printer": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz", + "integrity": "sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg==", + "peer": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.1", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/redoc-cli/node_modules/@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "peer": true + }, + "node_modules/redoc-cli/node_modules/@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "peer": true + }, + "node_modules/redoc-cli/node_modules/acorn": { + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", + "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "peer": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/redoc-cli/node_modules/acorn-import-assertions": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz", + "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==", + "peer": true, + "peerDependencies": { + "acorn": "^8" + } + }, + "node_modules/redoc-cli/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/redoc-cli/node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "peer": true, + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "node_modules/redoc-cli/node_modules/ajv/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "peer": true + }, + "node_modules/redoc-cli/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/redoc-cli/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/redoc-cli/node_modules/anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/redoc-cli/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "node_modules/redoc-cli/node_modules/asn1.js": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", + "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", + "dependencies": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "safer-buffer": "^2.1.0" + } + }, + "node_modules/redoc-cli/node_modules/asn1.js/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/redoc-cli/node_modules/assert": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", + "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", + "dependencies": { + "object-assign": "^4.1.1", + "util": "0.10.3" + } + }, + "node_modules/redoc-cli/node_modules/assert/node_modules/inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=" + }, + "node_modules/redoc-cli/node_modules/assert/node_modules/util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "dependencies": { + "inherits": "2.0.1" + } + }, + "node_modules/redoc-cli/node_modules/babel-plugin-styled-components": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/babel-plugin-styled-components/-/babel-plugin-styled-components-1.12.0.tgz", + "integrity": "sha512-FEiD7l5ZABdJPpLssKXjBUJMYqzbcNzBowfXDCdJhOpbhWiewapUaY+LZGT8R4Jg2TwOjGjG4RKeyrO5p9sBkA==", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.0.0", + "@babel/helper-module-imports": "^7.0.0", + "babel-plugin-syntax-jsx": "^6.18.0", + "lodash": "^4.17.11" + }, + "peerDependencies": { + "styled-components": ">= 2" + } + }, + "node_modules/redoc-cli/node_modules/babel-plugin-syntax-jsx": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz", + "integrity": "sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY=" + }, + "node_modules/redoc-cli/node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/redoc-cli/node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/redoc-cli/node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "engines": { + "node": ">=8" + } + }, + "node_modules/redoc-cli/node_modules/bn.js": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", + "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + }, + "node_modules/redoc-cli/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/redoc-cli/node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/redoc-cli/node_modules/brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + }, + "node_modules/redoc-cli/node_modules/browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dependencies": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/redoc-cli/node_modules/browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dependencies": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "node_modules/redoc-cli/node_modules/browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "dependencies": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/redoc-cli/node_modules/browserify-rsa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", + "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", + "dependencies": { + "bn.js": "^5.0.0", + "randombytes": "^2.0.1" + } + }, + "node_modules/redoc-cli/node_modules/browserify-sign": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", + "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", + "dependencies": { + "bn.js": "^5.1.1", + "browserify-rsa": "^4.0.1", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.3", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.5", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + } + }, + "node_modules/redoc-cli/node_modules/browserify-sign/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/redoc-cli/node_modules/browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "dependencies": { + "pako": "~1.0.5" + } + }, + "node_modules/redoc-cli/node_modules/browserslist": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz", + "integrity": "sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==", + "peer": true, + "dependencies": { + "caniuse-lite": "^1.0.30001286", + "electron-to-chromium": "^1.4.17", + "escalade": "^3.1.1", + "node-releases": "^2.0.1", + "picocolors": "^1.0.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + } + }, + "node_modules/redoc-cli/node_modules/buffer": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", + "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", + "dependencies": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + } + }, + "node_modules/redoc-cli/node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "peer": true + }, + "node_modules/redoc-cli/node_modules/buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" + }, + "node_modules/redoc-cli/node_modules/buffer/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "node_modules/redoc-cli/node_modules/builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=" + }, + "node_modules/redoc-cli/node_modules/call-me-maybe": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", + "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=" + }, + "node_modules/redoc-cli/node_modules/camelize": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.0.tgz", + "integrity": "sha1-FkpUg+Yw+kMh5a8HAg5TGDGyYJs=" + }, + "node_modules/redoc-cli/node_modules/caniuse-lite": { + "version": "1.0.30001303", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001303.tgz", + "integrity": "sha512-/Mqc1oESndUNszJP0kx0UaQU9kEv9nNtJ7Kn8AdA0mNnH8eR1cj0kG+NbNuC1Wq/b21eA8prhKRA3bbkjONegQ==", + "peer": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + } + }, + "node_modules/redoc-cli/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/redoc-cli/node_modules/chokidar": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz", + "integrity": "sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==", + "dependencies": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.5.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.1" + } + }, + "node_modules/redoc-cli/node_modules/chrome-trace-event": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", + "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", + "peer": true, + "engines": { + "node": ">=6.0" + } + }, + "node_modules/redoc-cli/node_modules/cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/redoc-cli/node_modules/classnames": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.1.tgz", + "integrity": "sha512-OlQdbZ7gLfGarSqxesMesDa5uz7KFbID8Kpq/SxIoNGDqY8lSYs0D+hhtBXhcdB3rcbXArFr7vlHheLk1voeNA==" + }, + "node_modules/redoc-cli/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/redoc-cli/node_modules/clsx": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.1.1.tgz", + "integrity": "sha512-6/bPho624p3S2pMyvP5kKBPXnI3ufHLObBFCfgx+LkeR5lg2XYy2hqZqUf45ypD8COn2bhgGJSUE+l5dhNBieA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/redoc-cli/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/redoc-cli/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "node_modules/redoc-cli/node_modules/colorette": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz", + "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==" + }, + "node_modules/redoc-cli/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "peer": true + }, + "node_modules/redoc-cli/node_modules/console-browserify": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", + "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==" + }, + "node_modules/redoc-cli/node_modules/constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=" + }, + "node_modules/redoc-cli/node_modules/core-js": { + "version": "3.20.3", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.20.3.tgz", + "integrity": "sha512-vVl8j8ph6tRS3B8qir40H7yw7voy17xL0piAjlbBUsH7WIfzoedL/ZOr1OV9FyZQLWXsayOJyV4tnRyXR85/ag==", + "hasInstallScript": true, + "peer": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "node_modules/redoc-cli/node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "node_modules/redoc-cli/node_modules/create-ecdh": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", + "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", + "dependencies": { + "bn.js": "^4.1.0", + "elliptic": "^6.5.3" + } + }, + "node_modules/redoc-cli/node_modules/create-ecdh/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/redoc-cli/node_modules/create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dependencies": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "node_modules/redoc-cli/node_modules/create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dependencies": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "node_modules/redoc-cli/node_modules/crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dependencies": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + }, + "engines": { + "node": "*" + } + }, + "node_modules/redoc-cli/node_modules/css-color-keywords": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/css-color-keywords/-/css-color-keywords-1.0.0.tgz", + "integrity": "sha1-/qJhbcZ2spYmhrOvjb2+GAskTgU=", + "engines": { + "node": ">=4" + } + }, + "node_modules/redoc-cli/node_modules/css-to-react-native": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/css-to-react-native/-/css-to-react-native-3.0.0.tgz", + "integrity": "sha512-Ro1yETZA813eoyUp2GDBhG2j+YggidUmzO1/v9eYBKR2EHVEniE2MI/NqpTQ954BMpTPZFsGNPm46qFB9dpaPQ==", + "dependencies": { + "camelize": "^1.0.0", + "css-color-keywords": "^1.0.0", + "postcss-value-parser": "^4.0.2" + } + }, + "node_modules/redoc-cli/node_modules/debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/redoc-cli/node_modules/decko": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decko/-/decko-1.2.0.tgz", + "integrity": "sha1-/UPHNelnuAEzBohKVvvmZZlraBc=" + }, + "node_modules/redoc-cli/node_modules/des.js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", + "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", + "dependencies": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "node_modules/redoc-cli/node_modules/diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dependencies": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, + "node_modules/redoc-cli/node_modules/diffie-hellman/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/redoc-cli/node_modules/domain-browser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", + "engines": { + "node": ">=0.4", + "npm": ">=1.2" + } + }, + "node_modules/redoc-cli/node_modules/dompurify": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.3.5.tgz", + "integrity": "sha512-kD+f8qEaa42+mjdOpKeztu9Mfx5bv9gVLO6K9jRx4uGvh6Wv06Srn4jr1wPNY2OOUGGSKHNFN+A8MA3v0E0QAQ==" + }, + "node_modules/redoc-cli/node_modules/electron-to-chromium": { + "version": "1.4.54", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.54.tgz", + "integrity": "sha512-jRAoneRdSxnpRHO0ANpnEUtQHXxlgfVjrLOnQSisw1ryjXJXvS0pJaR/v2B7S++/tRjgEDp4Sjn5nmgb6uTySw==", + "peer": true + }, + "node_modules/redoc-cli/node_modules/elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/redoc-cli/node_modules/elliptic/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/redoc-cli/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/redoc-cli/node_modules/enhanced-resolve": { + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.3.tgz", + "integrity": "sha512-EGAbGvH7j7Xt2nc0E7D99La1OiEs8LnyimkRgwExpUMScN6O+3x9tIWs7PLQZVNx4YD+00skHXPXi1yQHpAmZA==", + "peer": true, + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/redoc-cli/node_modules/es-module-lexer": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz", + "integrity": "sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==", + "peer": true + }, + "node_modules/redoc-cli/node_modules/es6-promise": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz", + "integrity": "sha1-oIzd6EzNvzTQJ6FFG8kdS80ophM=" + }, + "node_modules/redoc-cli/node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "engines": { + "node": ">=6" + } + }, + "node_modules/redoc-cli/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/redoc-cli/node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "peer": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/redoc-cli/node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "peer": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/redoc-cli/node_modules/esrecurse/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "peer": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/redoc-cli/node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "peer": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/redoc-cli/node_modules/eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" + }, + "node_modules/redoc-cli/node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/redoc-cli/node_modules/evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dependencies": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/redoc-cli/node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "node_modules/redoc-cli/node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "peer": true + }, + "node_modules/redoc-cli/node_modules/fast-safe-stringify": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==" + }, + "node_modules/redoc-cli/node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/redoc-cli/node_modules/foreach": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.6.tgz", + "integrity": "sha512-k6GAGDyqLe9JaebCsFCoudPPWfihKu8pylYXRlqP1J7ms39iPoTtk2fviNglIeQEwdh0bQeKJ01ZPyuyQvKzwg==" + }, + "node_modules/redoc-cli/node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/redoc-cli/node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/redoc-cli/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/redoc-cli/node_modules/glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "peer": true + }, + "node_modules/redoc-cli/node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "engines": { + "node": ">=4" + } + }, + "node_modules/redoc-cli/node_modules/graceful-fs": { + "version": "4.2.9", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", + "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==", + "peer": true + }, + "node_modules/redoc-cli/node_modules/handlebars": { + "version": "4.7.7", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", + "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", + "dependencies": { + "minimist": "^1.2.5", + "neo-async": "^2.6.0", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, + "engines": { + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" + } + }, + "node_modules/redoc-cli/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "engines": { + "node": ">=4" + } + }, + "node_modules/redoc-cli/node_modules/hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dependencies": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/redoc-cli/node_modules/hash-base/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/redoc-cli/node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "node_modules/redoc-cli/node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/redoc-cli/node_modules/hoist-non-react-statics": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", + "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", + "dependencies": { + "react-is": "^16.7.0" + } + }, + "node_modules/redoc-cli/node_modules/hoist-non-react-statics/node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + }, + "node_modules/redoc-cli/node_modules/http2-client": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/http2-client/-/http2-client-1.3.5.tgz", + "integrity": "sha512-EC2utToWl4RKfs5zd36Mxq7nzHHBuomZboI0yYL6Y0RmBgT7Sgkq4rQ0ezFTYoIsSs7Tm9SJe+o2FcAg6GBhGA==" + }, + "node_modules/redoc-cli/node_modules/https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=" + }, + "node_modules/redoc-cli/node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/redoc-cli/node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/redoc-cli/node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/redoc-cli/node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/redoc-cli/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/redoc-cli/node_modules/is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/redoc-cli/node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/redoc-cli/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" + }, + "node_modules/redoc-cli/node_modules/jest-worker": { + "version": "27.4.6", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.4.6.tgz", + "integrity": "sha512-gHWJF/6Xi5CTG5QCvROr6GcmpIqNYpDJyc8A1h/DyXqH1tD6SnRCM0d3U5msV31D2LB/U+E0M+W4oyvKV44oNw==", + "peer": true, + "dependencies": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/redoc-cli/node_modules/jest-worker/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/redoc-cli/node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/redoc-cli/node_modules/js-levenshtein": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.6.tgz", + "integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/redoc-cli/node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "node_modules/redoc-cli/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/redoc-cli/node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/redoc-cli/node_modules/json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "peer": true + }, + "node_modules/redoc-cli/node_modules/json-pointer": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/json-pointer/-/json-pointer-0.6.2.tgz", + "integrity": "sha512-vLWcKbOaXlO+jvRy4qNd+TI1QUPZzfJj1tpJ3vAXDych5XJf93ftpUKe5pKCrzyIIwgBJcOcCVRUfqQP25afBw==", + "dependencies": { + "foreach": "^2.0.4" + } + }, + "node_modules/redoc-cli/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "node_modules/redoc-cli/node_modules/loader-runner": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz", + "integrity": "sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw==", + "peer": true, + "engines": { + "node": ">=6.11.5" + } + }, + "node_modules/redoc-cli/node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/redoc-cli/node_modules/lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==" + }, + "node_modules/redoc-cli/node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/redoc-cli/node_modules/lunr": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", + "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==" + }, + "node_modules/redoc-cli/node_modules/mark.js": { + "version": "8.11.1", + "resolved": "https://registry.npmjs.org/mark.js/-/mark.js-8.11.1.tgz", + "integrity": "sha1-GA8fnr74sOY45BZq1S24eb6y/8U=" + }, + "node_modules/redoc-cli/node_modules/marked": { + "version": "4.0.15", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.15.tgz", + "integrity": "sha512-esX5lPdTfG4p8LDkv+obbRCyOKzB+820ZZyMOXJZygZBHrH9b3xXR64X4kT3sPe9Nx8qQXbmcz6kFSMt4Nfk6Q==", + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/redoc-cli/node_modules/md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/redoc-cli/node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "peer": true + }, + "node_modules/redoc-cli/node_modules/miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dependencies": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + }, + "bin": { + "miller-rabin": "bin/miller-rabin" + } + }, + "node_modules/redoc-cli/node_modules/miller-rabin/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/redoc-cli/node_modules/mime-db": { + "version": "1.51.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", + "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==", + "peer": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/redoc-cli/node_modules/mime-types": { + "version": "2.1.34", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", + "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", + "peer": true, + "dependencies": { + "mime-db": "1.51.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/redoc-cli/node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + }, + "node_modules/redoc-cli/node_modules/minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" + }, + "node_modules/redoc-cli/node_modules/minimatch": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", + "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/redoc-cli/node_modules/minimist": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" + }, + "node_modules/redoc-cli/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/redoc-cli/node_modules/mobx": { + "version": "6.3.2", + "resolved": "https://registry.npmjs.org/mobx/-/mobx-6.3.2.tgz", + "integrity": "sha512-xGPM9dIE1qkK9Nrhevp0gzpsmELKU4MFUJRORW/jqxVFIHHWIoQrjDjL8vkwoJYY3C2CeVJqgvl38hgKTalTWg==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mobx" + } + }, + "node_modules/redoc-cli/node_modules/mobx-react": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/mobx-react/-/mobx-react-7.2.1.tgz", + "integrity": "sha512-LZS99KFLn75VWDXPdRJhILzVQ7qLcRjQbzkK+wVs0Qg4kWw5hOI2USp7tmu+9zP9KYsVBmKyx2k/8cTTBfsymw==", + "dependencies": { + "mobx-react-lite": "^3.2.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mobx" + }, + "peerDependencies": { + "mobx": "^6.1.0", + "react": "^16.8.0 || ^17" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + }, + "react-native": { + "optional": true + } + } + }, + "node_modules/redoc-cli/node_modules/mobx-react-lite": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/mobx-react-lite/-/mobx-react-lite-3.2.3.tgz", + "integrity": "sha512-7exWp1FV0M9dP08H9PIeHlJqDw4IdkQVRMfLYaZFMmlbzSS6ZU6p/kx392KN+rVf81hH3IQYewvRGQ70oiwmbw==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mobx" + }, + "peerDependencies": { + "mobx": "^6.1.0", + "react": "^16.8.0 || ^17" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + }, + "react-native": { + "optional": true + } + } + }, + "node_modules/redoc-cli/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/redoc-cli/node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==" + }, + "node_modules/redoc-cli/node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/redoc-cli/node_modules/node-fetch-h2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/node-fetch-h2/-/node-fetch-h2-2.3.0.tgz", + "integrity": "sha512-ofRW94Ab0T4AOh5Fk8t0h8OBWrmjb0SSB20xh1H8YnPV9EJ+f5AMoYSUQ2zgJ4Iq2HAK0I2l5/Nequ8YzFS3Hg==", + "dependencies": { + "http2-client": "^1.2.5" + }, + "engines": { + "node": "4.x || >=6.0.0" + } + }, + "node_modules/redoc-cli/node_modules/node-libs-browser": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz", + "integrity": "sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q==", + "dependencies": { + "assert": "^1.1.1", + "browserify-zlib": "^0.2.0", + "buffer": "^4.3.0", + "console-browserify": "^1.1.0", + "constants-browserify": "^1.0.0", + "crypto-browserify": "^3.11.0", + "domain-browser": "^1.1.1", + "events": "^3.0.0", + "https-browserify": "^1.0.0", + "os-browserify": "^0.3.0", + "path-browserify": "0.0.1", + "process": "^0.11.10", + "punycode": "^1.2.4", + "querystring-es3": "^0.2.0", + "readable-stream": "^2.3.3", + "stream-browserify": "^2.0.1", + "stream-http": "^2.7.2", + "string_decoder": "^1.0.0", + "timers-browserify": "^2.0.4", + "tty-browserify": "0.0.0", + "url": "^0.11.0", + "util": "^0.11.0", + "vm-browserify": "^1.0.1" + } + }, + "node_modules/redoc-cli/node_modules/node-readfiles": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/node-readfiles/-/node-readfiles-0.2.0.tgz", + "integrity": "sha1-271K8SE04uY1wkXvk//Pb2BnOl0=", + "dependencies": { + "es6-promise": "^3.2.1" + } + }, + "node_modules/redoc-cli/node_modules/node-releases": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz", + "integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==", + "peer": true + }, + "node_modules/redoc-cli/node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/redoc-cli/node_modules/oas-kit-common": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/oas-kit-common/-/oas-kit-common-1.0.8.tgz", + "integrity": "sha512-pJTS2+T0oGIwgjGpw7sIRU8RQMcUoKCDWFLdBqKB2BNmGpbBMH2sdqAaOXUg8OzonZHU0L7vfJu1mJFEiYDWOQ==", + "dependencies": { + "fast-safe-stringify": "^2.0.7" + } + }, + "node_modules/redoc-cli/node_modules/oas-linter": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/oas-linter/-/oas-linter-3.2.2.tgz", + "integrity": "sha512-KEGjPDVoU5K6swgo9hJVA/qYGlwfbFx+Kg2QB/kd7rzV5N8N5Mg6PlsoCMohVnQmo+pzJap/F610qTodKzecGQ==", + "dependencies": { + "@exodus/schemasafe": "^1.0.0-rc.2", + "should": "^13.2.1", + "yaml": "^1.10.0" + }, + "funding": { + "url": "https://github.com/Mermade/oas-kit?sponsor=1" + } + }, + "node_modules/redoc-cli/node_modules/oas-resolver": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/oas-resolver/-/oas-resolver-2.5.6.tgz", + "integrity": "sha512-Yx5PWQNZomfEhPPOphFbZKi9W93CocQj18NlD2Pa4GWZzdZpSJvYwoiuurRI7m3SpcChrnO08hkuQDL3FGsVFQ==", + "dependencies": { + "node-fetch-h2": "^2.3.0", + "oas-kit-common": "^1.0.8", + "reftools": "^1.1.9", + "yaml": "^1.10.0", + "yargs": "^17.0.1" + }, + "bin": { + "resolve": "resolve.js" + }, + "funding": { + "url": "https://github.com/Mermade/oas-kit?sponsor=1" + } + }, + "node_modules/redoc-cli/node_modules/oas-schema-walker": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/oas-schema-walker/-/oas-schema-walker-1.1.5.tgz", + "integrity": "sha512-2yucenq1a9YPmeNExoUa9Qwrt9RFkjqaMAA1X+U7sbb0AqBeTIdMHky9SQQ6iN94bO5NW0W4TRYXerG+BdAvAQ==", + "funding": { + "url": "https://github.com/Mermade/oas-kit?sponsor=1" + } + }, + "node_modules/redoc-cli/node_modules/oas-validator": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/oas-validator/-/oas-validator-5.0.8.tgz", + "integrity": "sha512-cu20/HE5N5HKqVygs3dt94eYJfBi0TsZvPVXDhbXQHiEityDN+RROTleefoKRKKJ9dFAF2JBkDHgvWj0sjKGmw==", + "dependencies": { + "call-me-maybe": "^1.0.1", + "oas-kit-common": "^1.0.8", + "oas-linter": "^3.2.2", + "oas-resolver": "^2.5.6", + "oas-schema-walker": "^1.1.5", + "reftools": "^1.1.9", + "should": "^13.2.1", + "yaml": "^1.10.0" + }, + "funding": { + "url": "https://github.com/Mermade/oas-kit?sponsor=1" + } + }, + "node_modules/redoc-cli/node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/redoc-cli/node_modules/openapi-sampler": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/openapi-sampler/-/openapi-sampler-1.3.0.tgz", + "integrity": "sha512-2QfjK1oM9Sv0q82Ae1RrUe3yfFmAyjF548+6eAeb+h/cL1Uj51TW4UezraBEvwEdzoBgfo4AaTLVFGTKj+yYDw==", + "dependencies": { + "@types/json-schema": "^7.0.7", + "json-pointer": "0.6.2" + } + }, + "node_modules/redoc-cli/node_modules/os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=" + }, + "node_modules/redoc-cli/node_modules/pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" + }, + "node_modules/redoc-cli/node_modules/parse-asn1": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", + "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", + "dependencies": { + "asn1.js": "^5.2.0", + "browserify-aes": "^1.0.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/redoc-cli/node_modules/path-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", + "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==" + }, + "node_modules/redoc-cli/node_modules/pbkdf2": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", + "dependencies": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/redoc-cli/node_modules/perfect-scrollbar": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/perfect-scrollbar/-/perfect-scrollbar-1.5.5.tgz", + "integrity": "sha512-dzalfutyP3e/FOpdlhVryN4AJ5XDVauVWxybSkLZmakFE2sS3y3pc4JnSprw8tGmHvkaG5Edr5T7LBTZ+WWU2g==" + }, + "node_modules/redoc-cli/node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "peer": true + }, + "node_modules/redoc-cli/node_modules/picomatch": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/redoc-cli/node_modules/pluralize": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", + "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", + "engines": { + "node": ">=4" + } + }, + "node_modules/redoc-cli/node_modules/polished": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/polished/-/polished-4.1.4.tgz", + "integrity": "sha512-Nq5Mbza+Auo7N3sQb1QMFaQiDO+4UexWuSGR7Cjb4Sw11SZIJcrrFtiZ+L0jT9MBsUsxDboHVASbCLbE1rnECg==", + "dependencies": { + "@babel/runtime": "^7.16.7" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/redoc-cli/node_modules/postcss-value-parser": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz", + "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==" + }, + "node_modules/redoc-cli/node_modules/prismjs": { + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.27.0.tgz", + "integrity": "sha512-t13BGPUlFDR7wRB5kQDG4jjl7XeuH6jbJGt11JHPL96qwsEHNX2+68tFXqc1/k+/jALsbSWJKUOT/hcYAZ5LkA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/redoc-cli/node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/redoc-cli/node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "node_modules/redoc-cli/node_modules/prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, + "node_modules/redoc-cli/node_modules/prop-types/node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + }, + "node_modules/redoc-cli/node_modules/public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "dependencies": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/redoc-cli/node_modules/public-encrypt/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/redoc-cli/node_modules/punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + }, + "node_modules/redoc-cli/node_modules/querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "engines": { + "node": ">=0.4.x" + } + }, + "node_modules/redoc-cli/node_modules/querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", + "engines": { + "node": ">=0.4.x" + } + }, + "node_modules/redoc-cli/node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/redoc-cli/node_modules/randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dependencies": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "node_modules/redoc-cli/node_modules/react": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz", + "integrity": "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==", + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/redoc-cli/node_modules/react-dom": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-17.0.2.tgz", + "integrity": "sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==", + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1", + "scheduler": "^0.20.2" + }, + "peerDependencies": { + "react": "17.0.2" + } + }, + "node_modules/redoc-cli/node_modules/react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "peer": true + }, + "node_modules/redoc-cli/node_modules/react-tabs": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/react-tabs/-/react-tabs-3.2.3.tgz", + "integrity": "sha512-jx325RhRVnS9DdFbeF511z0T0WEqEoMl1uCE3LoZ6VaZZm7ytatxbum0B8bCTmaiV0KsU+4TtLGTGevCic7SWg==", + "dependencies": { + "clsx": "^1.1.0", + "prop-types": "^15.5.0" + }, + "peerDependencies": { + "react": "^16.3.0 || ^17.0.0-0" + } + }, + "node_modules/redoc-cli/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/redoc-cli/node_modules/readable-stream/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "node_modules/redoc-cli/node_modules/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/redoc-cli/node_modules/readable-stream/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/redoc-cli/node_modules/readdirp": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", + "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/redoc-cli/node_modules/redoc": { + "version": "2.0.0-rc.74", + "resolved": "https://registry.npmjs.org/redoc/-/redoc-2.0.0-rc.74.tgz", + "integrity": "sha512-OeOWGcbmVdfVgN//7ispiRX0fhD7Gk3tWcERugyFfP8QX/1Pttw3jRYSXmiB0i+H48zFn20K1cMppBp/qzm5xQ==", + "dependencies": { + "@redocly/openapi-core": "^1.0.0-beta.104", + "classnames": "^2.3.1", + "decko": "^1.2.0", + "dompurify": "^2.2.8", + "eventemitter3": "^4.0.7", + "json-pointer": "^0.6.2", + "lunr": "^2.3.9", + "mark.js": "^8.11.1", + "marked": "^4.0.15", + "mobx-react": "^7.2.0", + "openapi-sampler": "^1.3.0", + "path-browserify": "^1.0.1", + "perfect-scrollbar": "^1.5.1", + "polished": "^4.1.3", + "prismjs": "^1.27.0", + "prop-types": "^15.7.2", + "react-tabs": "^3.2.2", + "slugify": "~1.4.7", + "stickyfill": "^1.1.1", + "style-loader": "^3.3.1", + "swagger2openapi": "^7.0.6", + "url-template": "^2.0.8" + }, + "engines": { + "node": ">=6.9", + "npm": ">=3.0.0" + }, + "peerDependencies": { + "core-js": "^3.1.4", + "mobx": "^6.0.4", + "react": "^16.8.4 || ^17.0.0", + "react-dom": "^16.8.4 || ^17.0.0", + "styled-components": "^4.1.1 || ^5.1.1" + } + }, + "node_modules/redoc-cli/node_modules/redoc/node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==" + }, + "node_modules/redoc-cli/node_modules/reftools": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/reftools/-/reftools-1.1.9.tgz", + "integrity": "sha512-OVede/NQE13xBQ+ob5CKd5KyeJYU2YInb1bmV4nRoOfquZPkAkxuOXicSe1PvqIuZZ4kD13sPKBbR7UFDmli6w==", + "funding": { + "url": "https://github.com/Mermade/oas-kit?sponsor=1" + } + }, + "node_modules/redoc-cli/node_modules/regenerator-runtime": { + "version": "0.13.9", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", + "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==" + }, + "node_modules/redoc-cli/node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/redoc-cli/node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/redoc-cli/node_modules/ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "node_modules/redoc-cli/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/redoc-cli/node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/redoc-cli/node_modules/scheduler": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.20.2.tgz", + "integrity": "sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==", + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + } + }, + "node_modules/redoc-cli/node_modules/schema-utils": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", + "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", + "peer": true, + "dependencies": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/redoc-cli/node_modules/serialize-javascript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "peer": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/redoc-cli/node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + }, + "node_modules/redoc-cli/node_modules/sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "bin": { + "sha.js": "bin.js" + } + }, + "node_modules/redoc-cli/node_modules/shallowequal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz", + "integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==" + }, + "node_modules/redoc-cli/node_modules/should": { + "version": "13.2.3", + "resolved": "https://registry.npmjs.org/should/-/should-13.2.3.tgz", + "integrity": "sha512-ggLesLtu2xp+ZxI+ysJTmNjh2U0TsC+rQ/pfED9bUZZ4DKefP27D+7YJVVTvKsmjLpIi9jAa7itwDGkDDmt1GQ==", + "dependencies": { + "should-equal": "^2.0.0", + "should-format": "^3.0.3", + "should-type": "^1.4.0", + "should-type-adaptors": "^1.0.1", + "should-util": "^1.0.0" + } + }, + "node_modules/redoc-cli/node_modules/should-equal": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/should-equal/-/should-equal-2.0.0.tgz", + "integrity": "sha512-ZP36TMrK9euEuWQYBig9W55WPC7uo37qzAEmbjHz4gfyuXrEUgF8cUvQVO+w+d3OMfPvSRQJ22lSm8MQJ43LTA==", + "dependencies": { + "should-type": "^1.4.0" + } + }, + "node_modules/redoc-cli/node_modules/should-format": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/should-format/-/should-format-3.0.3.tgz", + "integrity": "sha1-m/yPdPo5IFxT04w01xcwPidxJPE=", + "dependencies": { + "should-type": "^1.3.0", + "should-type-adaptors": "^1.0.1" + } + }, + "node_modules/redoc-cli/node_modules/should-type": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/should-type/-/should-type-1.4.0.tgz", + "integrity": "sha1-B1bYzoRt/QmEOmlHcZ36DUz/XPM=" + }, + "node_modules/redoc-cli/node_modules/should-type-adaptors": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/should-type-adaptors/-/should-type-adaptors-1.1.0.tgz", + "integrity": "sha512-JA4hdoLnN+kebEp2Vs8eBe9g7uy0zbRo+RMcU0EsNy+R+k049Ki+N5tT5Jagst2g7EAja+euFuoXFCa8vIklfA==", + "dependencies": { + "should-type": "^1.3.0", + "should-util": "^1.0.0" + } + }, + "node_modules/redoc-cli/node_modules/should-util": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/should-util/-/should-util-1.0.1.tgz", + "integrity": "sha512-oXF8tfxx5cDk8r2kYqlkUJzZpDBqVY/II2WhvU0n9Y3XYvAYRmeaf1PvvIvTgPnv4KJ+ES5M0PyDq5Jp+Ygy2g==" + }, + "node_modules/redoc-cli/node_modules/slugify": { + "version": "1.4.7", + "resolved": "https://registry.npmjs.org/slugify/-/slugify-1.4.7.tgz", + "integrity": "sha512-tf+h5W1IrjNm/9rKKj0JU2MDMruiopx0jjVA5zCdBtcGjfp0+c5rHw/zADLC3IeKlGHtVbHtpfzvYA0OYT+HKg==", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/redoc-cli/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/redoc-cli/node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "peer": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/redoc-cli/node_modules/stickyfill": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stickyfill/-/stickyfill-1.1.1.tgz", + "integrity": "sha1-OUE/7p0CXHSn5ZzuyyN4TMDxfwI=" + }, + "node_modules/redoc-cli/node_modules/stream-browserify": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", + "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", + "dependencies": { + "inherits": "~2.0.1", + "readable-stream": "^2.0.2" + } + }, + "node_modules/redoc-cli/node_modules/stream-http": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", + "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", + "dependencies": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "to-arraybuffer": "^1.0.0", + "xtend": "^4.0.0" + } + }, + "node_modules/redoc-cli/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/redoc-cli/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/redoc-cli/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/redoc-cli/node_modules/style-loader": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-3.3.1.tgz", + "integrity": "sha512-GPcQ+LDJbrcxHORTRes6Jy2sfvK2kS6hpSfI/fXhPt+spVzxF6LJ1dHLN9zIGmVaaP044YKaIatFaufENRiDoQ==", + "engines": { + "node": ">= 12.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.0.0" + } + }, + "node_modules/redoc-cli/node_modules/styled-components": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-5.3.0.tgz", + "integrity": "sha512-bPJKwZCHjJPf/hwTJl6TbkSZg/3evha+XPEizrZUGb535jLImwDUdjTNxXqjjaASt2M4qO4AVfoHJNe3XB/tpQ==", + "dependencies": { + "@babel/helper-module-imports": "^7.0.0", + "@babel/traverse": "^7.4.5", + "@emotion/is-prop-valid": "^0.8.8", + "@emotion/stylis": "^0.8.4", + "@emotion/unitless": "^0.7.4", + "babel-plugin-styled-components": ">= 1.12.0", + "css-to-react-native": "^3.0.0", + "hoist-non-react-statics": "^3.0.0", + "shallowequal": "^1.1.0", + "supports-color": "^5.5.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/styled-components" + }, + "peerDependencies": { + "react": ">= 16.8.0", + "react-dom": ">= 16.8.0", + "react-is": ">= 16.8.0" + } + }, + "node_modules/redoc-cli/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/redoc-cli/node_modules/swagger2openapi": { + "version": "7.0.8", + "resolved": "https://registry.npmjs.org/swagger2openapi/-/swagger2openapi-7.0.8.tgz", + "integrity": "sha512-upi/0ZGkYgEcLeGieoz8gT74oWHA0E7JivX7aN9mAf+Tc7BQoRBvnIGHoPDw+f9TXTW4s6kGYCZJtauP6OYp7g==", + "dependencies": { + "call-me-maybe": "^1.0.1", + "node-fetch": "^2.6.1", + "node-fetch-h2": "^2.3.0", + "node-readfiles": "^0.2.0", + "oas-kit-common": "^1.0.8", + "oas-resolver": "^2.5.6", + "oas-schema-walker": "^1.1.5", + "oas-validator": "^5.0.8", + "reftools": "^1.1.9", + "yaml": "^1.10.0", + "yargs": "^17.0.1" + }, + "bin": { + "boast": "boast.js", + "oas-validate": "oas-validate.js", + "swagger2openapi": "swagger2openapi.js" + }, + "funding": { + "url": "https://github.com/Mermade/oas-kit?sponsor=1" + } + }, + "node_modules/redoc-cli/node_modules/tapable": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/redoc-cli/node_modules/terser": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.10.0.tgz", + "integrity": "sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA==", + "peer": true, + "dependencies": { + "commander": "^2.20.0", + "source-map": "~0.7.2", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "acorn": "^8.5.0" + }, + "peerDependenciesMeta": { + "acorn": { + "optional": true + } + } + }, + "node_modules/redoc-cli/node_modules/terser-webpack-plugin": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.0.tgz", + "integrity": "sha512-LPIisi3Ol4chwAaPP8toUJ3L4qCM1G0wao7L3qNv57Drezxj6+VEyySpPw4B1HSO2Eg/hDY/MNF5XihCAoqnsQ==", + "peer": true, + "dependencies": { + "jest-worker": "^27.4.1", + "schema-utils": "^3.1.1", + "serialize-javascript": "^6.0.0", + "source-map": "^0.6.1", + "terser": "^5.7.2" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.1.0" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "uglify-js": { + "optional": true + } + } + }, + "node_modules/redoc-cli/node_modules/terser/node_modules/source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "peer": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/redoc-cli/node_modules/timers-browserify": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", + "integrity": "sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ==", + "dependencies": { + "setimmediate": "^1.0.4" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/redoc-cli/node_modules/to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=" + }, + "node_modules/redoc-cli/node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "engines": { + "node": ">=4" + } + }, + "node_modules/redoc-cli/node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/redoc-cli/node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + }, + "node_modules/redoc-cli/node_modules/tty-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=" + }, + "node_modules/redoc-cli/node_modules/uglify-js": { + "version": "3.13.9", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.9.tgz", + "integrity": "sha512-wZbyTQ1w6Y7fHdt8sJnHfSIuWeDgk6B5rCb4E/AM6QNNPbOMIZph21PW5dRB3h7Df0GszN+t7RuUH6sWK5bF0g==", + "optional": true, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/redoc-cli/node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/redoc-cli/node_modules/uri-js/node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "engines": { + "node": ">=6" + } + }, + "node_modules/redoc-cli/node_modules/url": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "dependencies": { + "punycode": "1.3.2", + "querystring": "0.2.0" + } + }, + "node_modules/redoc-cli/node_modules/url-template": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/url-template/-/url-template-2.0.8.tgz", + "integrity": "sha1-/FZaPMy/93MMd19WQflVV5FDnyE=" + }, + "node_modules/redoc-cli/node_modules/url/node_modules/punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=" + }, + "node_modules/redoc-cli/node_modules/util": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", + "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", + "dependencies": { + "inherits": "2.0.3" + } + }, + "node_modules/redoc-cli/node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "node_modules/redoc-cli/node_modules/util/node_modules/inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "node_modules/redoc-cli/node_modules/vm-browserify": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", + "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==" + }, + "node_modules/redoc-cli/node_modules/watchpack": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.3.1.tgz", + "integrity": "sha512-x0t0JuydIo8qCNctdDrn1OzH/qDzk2+rdCOC3YzumZ42fiMqmQ7T3xQurykYMhYfHaPHTp4ZxAx2NfUo1K6QaA==", + "peer": true, + "dependencies": { + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/redoc-cli/node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + }, + "node_modules/redoc-cli/node_modules/webpack": { + "version": "5.67.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.67.0.tgz", + "integrity": "sha512-LjFbfMh89xBDpUMgA1W9Ur6Rn/gnr2Cq1jjHFPo4v6a79/ypznSYbAyPgGhwsxBtMIaEmDD1oJoA7BEYw/Fbrw==", + "peer": true, + "dependencies": { + "@types/eslint-scope": "^3.7.0", + "@types/estree": "^0.0.50", + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/wasm-edit": "1.11.1", + "@webassemblyjs/wasm-parser": "1.11.1", + "acorn": "^8.4.1", + "acorn-import-assertions": "^1.7.6", + "browserslist": "^4.14.5", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^5.8.3", + "es-module-lexer": "^0.9.0", + "eslint-scope": "5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.9", + "json-parse-better-errors": "^1.0.2", + "loader-runner": "^4.2.0", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "schema-utils": "^3.1.0", + "tapable": "^2.1.1", + "terser-webpack-plugin": "^5.1.3", + "watchpack": "^2.3.1", + "webpack-sources": "^3.2.3" + }, + "bin": { + "webpack": "bin/webpack.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependenciesMeta": { + "webpack-cli": { + "optional": true + } + } + }, + "node_modules/redoc-cli/node_modules/webpack-sources": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", + "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", + "peer": true, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/redoc-cli/node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/redoc-cli/node_modules/wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=" + }, + "node_modules/redoc-cli/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/redoc-cli/node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/redoc-cli/node_modules/wrap-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/redoc-cli/node_modules/wrap-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/redoc-cli/node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "engines": { + "node": ">=0.4" + } + }, + "node_modules/redoc-cli/node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "engines": { + "node": ">=10" + } + }, + "node_modules/redoc-cli/node_modules/yaml": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", + "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", + "engines": { + "node": ">= 6" + } + }, + "node_modules/redoc-cli/node_modules/yaml-ast-parser": { + "version": "0.0.43", + "resolved": "https://registry.npmjs.org/yaml-ast-parser/-/yaml-ast-parser-0.0.43.tgz", + "integrity": "sha512-2PTINUwsRqSd+s8XxKaJWQlUuEMHJQyEuh2edBbW8KNJz0SJPwUSD2zRWqezFEdN7IzAgeuYHFUCF7o8zRdZ0A==" + }, + "node_modules/redoc-cli/node_modules/yargs": { + "version": "17.3.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.3.1.tgz", + "integrity": "sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA==", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/redoc-cli/node_modules/yargs-parser": { + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz", + "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==", + "engines": { + "node": ">=12" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/swagger-cli": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/swagger-cli/-/swagger-cli-4.0.4.tgz", + "integrity": "sha512-Cp8YYuLny3RJFQ4CvOBTaqmOOgYsem52dPx1xM5S4EUWFblIh2Q8atppMZvXKUr1e9xH5RwipYpmdUzdPcxWcA==", + "dependencies": { + "@apidevtools/swagger-cli": "4.0.4" + }, + "bin": { + "swagger-cli": "swagger-cli.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/sync-fetch": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/sync-fetch/-/sync-fetch-0.4.1.tgz", + "integrity": "sha512-JDtyFEvnKUzt1CxRtzzsGgkBanEv8XRmLyJo0F0nGkpCR8EjYmpOJJXz8GA/SWtlPU0nAYh0+CNMNnFworGyOA==", + "dependencies": { + "buffer": "^5.7.1", + "node-fetch": "^2.6.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==" + }, + "node_modules/yaml": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.1.1.tgz", + "integrity": "sha512-o96x3OPo8GjWeSLF+wOAbrPfhFOGY0W00GNaxCDv+9hkcDJEnev1yh8S7pgHF0ik6zc8sQLuL8hjHjJULZp8bw==", + "engines": { + "node": ">= 14" + } + } + }, + "dependencies": { + "@apidevtools/json-schema-ref-parser": { + "version": "9.0.6", + "resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.6.tgz", + "integrity": "sha512-M3YgsLjI0lZxvrpeGVk9Ap032W6TPQkH6pRAZz81Ac3WUNF79VQooAFnp8umjvVzUmD93NkogxEwbSce7qMsUg==", + "requires": { + "@jsdevtools/ono": "^7.1.3", + "call-me-maybe": "^1.0.1", + "js-yaml": "^3.13.1" + } + }, + "@apidevtools/openapi-schemas": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@apidevtools/openapi-schemas/-/openapi-schemas-2.1.0.tgz", + "integrity": "sha512-Zc1AlqrJlX3SlpupFGpiLi2EbteyP7fXmUOGup6/DnkRgjP9bgMM/ag+n91rsv0U1Gpz0H3VILA/o3bW7Ua6BQ==" + }, + "@apidevtools/swagger-cli": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@apidevtools/swagger-cli/-/swagger-cli-4.0.4.tgz", + "integrity": "sha512-hdDT3B6GLVovCsRZYDi3+wMcB1HfetTU20l2DC8zD3iFRNMC6QNAZG5fo/6PYeHWBEv7ri4MvnlKodhNB0nt7g==", + "requires": { + "@apidevtools/swagger-parser": "^10.0.1", + "chalk": "^4.1.0", + "js-yaml": "^3.14.0", + "yargs": "^15.4.1" + }, + "dependencies": { + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" + }, + "yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "@apidevtools/swagger-methods": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@apidevtools/swagger-methods/-/swagger-methods-3.0.2.tgz", + "integrity": "sha512-QAkD5kK2b1WfjDS/UQn/qQkbwF31uqRjPTrsCs5ZG9BQGAkjwvqGFjjPqAuzac/IYzpPtRzjCP1WrTuAIjMrXg==" + }, + "@apidevtools/swagger-parser": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/@apidevtools/swagger-parser/-/swagger-parser-10.1.0.tgz", + "integrity": "sha512-9Kt7EuS/7WbMAUv2gSziqjvxwDbFSg3Xeyfuj5laUODX8o/k/CpsAKiQ8W7/R88eXFTMbJYg6+7uAmOWNKmwnw==", + "requires": { + "@apidevtools/json-schema-ref-parser": "9.0.6", + "@apidevtools/openapi-schemas": "^2.1.0", + "@apidevtools/swagger-methods": "^3.0.2", + "@jsdevtools/ono": "^7.1.3", + "ajv": "^8.6.3", + "ajv-draft-04": "^1.0.0", + "call-me-maybe": "^1.0.1" + } + }, + "@jsdevtools/ono": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz", + "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==" + }, + "ajv": { + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", + "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "ajv-draft-04": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ajv-draft-04/-/ajv-draft-04-1.0.0.tgz", + "integrity": "sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw==", + "requires": {} + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + }, + "buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "call-me-maybe": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", + "integrity": "sha512-wCyFsDQkKPwwF8BDwOiWNx/9K45L/hvggQiDbve+viMNMQnWhrlYIuBk09offfwCRtCO9P6XwUttufzU11WCVw==" + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==" + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "requires": { + "whatwg-url": "^5.0.0" + } + }, + "openapi-types": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/openapi-types/-/openapi-types-12.0.0.tgz", + "integrity": "sha512-6Wd9k8nmGQHgCbehZCP6wwWcfXcvinhybUTBatuhjRsCxUIujuYFZc9QnGeae75CyHASewBtxs0HX/qwREReUw==", + "peer": true + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "requires": { + "p-try": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, + "redoc-cli": { + "version": "0.13.17", + "resolved": "https://registry.npmjs.org/redoc-cli/-/redoc-cli-0.13.17.tgz", + "integrity": "sha512-9nlebYPiysVnuSJSoXAfEmwy8eHMsp14Rt4oRKqXaCz00O6chMnveZpzTB6APMVwA9gtNbiGO3Rbsm5PQQExzQ==", + "requires": { + "chokidar": "^3.5.1", + "handlebars": "^4.7.7", + "isarray": "^2.0.5", + "mkdirp": "^1.0.4", + "mobx": "^6.3.2", + "node-libs-browser": "^2.2.1", + "react": "^17.0.1", + "react-dom": "^17.0.1", + "redoc": "2.0.0-rc.74", + "styled-components": "^5.3.0", + "yargs": "^17.3.1" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "requires": { + "@babel/highlight": "^7.12.13" + } + }, + "@babel/generator": { + "version": "7.14.3", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.3.tgz", + "integrity": "sha512-bn0S6flG/j0xtQdz3hsjJ624h3W0r3llttBMfyHX3YrZ/KtLYr15bjA0FXkgW7FpvrDuTuElXeVjiKlYRpnOFA==", + "requires": { + "@babel/types": "^7.14.2", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + } + } + }, + "@babel/helper-annotate-as-pure": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.12.13.tgz", + "integrity": "sha512-7YXfX5wQ5aYM/BOlbSccHDbuXXFPxeoUmfWtz8le2yTkTZc+BxsiEnENFoi2SlmA8ewDkG2LgIMIVzzn2h8kfw==", + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-function-name": { + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.14.2.tgz", + "integrity": "sha512-NYZlkZRydxw+YT56IlhIcS8PAhb+FEUiOzuhFTfqDyPmzAhRge6ua0dQYT/Uh0t/EDHq05/i+e5M2d4XvjgarQ==", + "requires": { + "@babel/helper-get-function-arity": "^7.12.13", + "@babel/template": "^7.12.13", + "@babel/types": "^7.14.2" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", + "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-module-imports": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz", + "integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==", + "requires": { + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", + "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==" + }, + "@babel/highlight": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.14.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.4.tgz", + "integrity": "sha512-ArliyUsWDUqEGfWcmzpGUzNfLxTdTp6WU4IuP6QFSp9gGfWS6boxFCkJSJ/L4+RG8z/FnIU3WxCk6hPL9SSWeA==" + }, + "@babel/runtime": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.7.tgz", + "integrity": "sha512-9E9FJowqAsytyOY6LG+1KuueckRL+aQW+mKvXRXnuFGyRAyepJPmEo9vgMfXUA6O9u3IeEdv9MAkppFcaQwogQ==", + "requires": { + "regenerator-runtime": "^0.13.4" + } + }, + "@babel/template": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", + "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", + "requires": { + "@babel/code-frame": "^7.12.13", + "@babel/parser": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "@babel/traverse": { + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.2.tgz", + "integrity": "sha512-TsdRgvBFHMyHOOzcP9S6QU0QQtjxlRpEYOy3mcCO5RgmC305ki42aSAmfZEMSSYBla2oZ9BMqYlncBaKmD/7iA==", + "requires": { + "@babel/code-frame": "^7.12.13", + "@babel/generator": "^7.14.2", + "@babel/helper-function-name": "^7.14.2", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/parser": "^7.14.2", + "@babel/types": "^7.14.2", + "debug": "^4.1.0", + "globals": "^11.1.0" + } + }, + "@babel/types": { + "version": "7.14.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.4.tgz", + "integrity": "sha512-lCj4aIs0xUefJFQnwwQv2Bxg7Omd6bgquZ6LGC+gGMh6/s5qDVfjuCMlDmYQ15SLsWHd9n+X3E75lKIhl5Lkiw==", + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "to-fast-properties": "^2.0.0" + } + }, + "@emotion/is-prop-valid": { + "version": "0.8.8", + "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-0.8.8.tgz", + "integrity": "sha512-u5WtneEAr5IDG2Wv65yhunPSMLIpuKsbuOktRojfrEiEvRyC85LgPMZI63cr7NUqT8ZIGdSVg8ZKGxIug4lXcA==", + "requires": { + "@emotion/memoize": "0.7.4" + } + }, + "@emotion/memoize": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.4.tgz", + "integrity": "sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==" + }, + "@emotion/stylis": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/@emotion/stylis/-/stylis-0.8.5.tgz", + "integrity": "sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ==" + }, + "@emotion/unitless": { + "version": "0.7.5", + "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.5.tgz", + "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==" + }, + "@exodus/schemasafe": { + "version": "1.0.0-rc.6", + "resolved": "https://registry.npmjs.org/@exodus/schemasafe/-/schemasafe-1.0.0-rc.6.tgz", + "integrity": "sha512-dDnQizD94EdBwEj/fh3zPRa/HWCS9O5au2PuHhZBbuM3xWHxuaKzPBOEWze7Nn0xW68MIpZ7Xdyn1CoCpjKCuQ==" + }, + "@redocly/ajv": { + "version": "8.6.4", + "resolved": "https://registry.npmjs.org/@redocly/ajv/-/ajv-8.6.4.tgz", + "integrity": "sha512-y9qNj0//tZtWB2jfXNK3BX18BSBp9zNR7KE7lMysVHwbZtY392OJCjm6Rb/h4UHH2r1AqjNEHFD6bRn+DqU9Mw==", + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "@redocly/openapi-core": { + "version": "1.0.0-beta.105", + "resolved": "https://registry.npmjs.org/@redocly/openapi-core/-/openapi-core-1.0.0-beta.105.tgz", + "integrity": "sha512-8uYDMcqBOPhFgjRlg5uetW/E2uTVVRpk+YsJhaH78ZNuzBkQP5Waw5s8P8ym6myvHs5me8l5AdniY/ePLMT5xg==", + "requires": { + "@redocly/ajv": "^8.6.4", + "@types/node": "^14.11.8", + "colorette": "^1.2.0", + "js-levenshtein": "^1.1.6", + "js-yaml": "^4.1.0", + "lodash.isequal": "^4.5.0", + "minimatch": "^5.0.1", + "node-fetch": "^2.6.1", + "pluralize": "^8.0.0", + "yaml-ast-parser": "0.0.43" + }, + "dependencies": { + "@types/node": { + "version": "14.18.22", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.22.tgz", + "integrity": "sha512-qzaYbXVzin6EPjghf/hTdIbnVW1ErMx8rPzwRNJhlbyJhu2SyqlvjGOY/tbUt6VFyzg56lROcOeSQRInpt63Yw==" + } + } + }, + "@types/chokidar": { + "version": "https://registry.npmjs.org/@types/chokidar/-/chokidar-2.1.3.tgz", + "integrity": "sha512-6qK3xoLLAhQVTucQGHTySwOVA1crHRXnJeLwqK6KIFkkKa2aoMFXh+WEi8PotxDtvN6MQJLyYN9ag9P6NLV81w==", + "extraneous": true, + "requires": { + "chokidar": "*" + } + }, + "@types/eslint": { + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.1.tgz", + "integrity": "sha512-GE44+DNEyxxh2Kc6ro/VkIj+9ma0pO0bwv9+uHSyBrikYOHr8zYcdPvnBOp1aw8s+CjRvuSx7CyWqRrNFQ59mA==", + "peer": true, + "requires": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "@types/eslint-scope": { + "version": "3.7.3", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.3.tgz", + "integrity": "sha512-PB3ldyrcnAicT35TWPs5IcwKD8S333HMaa2VVv4+wdvebJkjWuW/xESoB8IwRcog8HYVYamb1g/R31Qv5Bx03g==", + "peer": true, + "requires": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, + "@types/estree": { + "version": "0.0.50", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.50.tgz", + "integrity": "sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw==", + "peer": true + }, + "@types/handlebars": { + "version": "https://registry.npmjs.org/@types/handlebars/-/handlebars-4.1.0.tgz", + "integrity": "sha512-gq9YweFKNNB1uFK71eRqsd4niVkXrxHugqWFQkeLRJvGjnxsLr16bYtcsG4tOFwmYi0Bax+wCkbf1reUfdl4kA==", + "extraneous": true, + "requires": { + "handlebars": "*" + } + }, + "@types/json-schema": { + "version": "7.0.9", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", + "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==" + }, + "@types/mkdirp": { + "version": "https://registry.npmjs.org/@types/mkdirp/-/mkdirp-1.0.1.tgz", + "integrity": "sha512-HkGSK7CGAXncr8Qn/0VqNtExEE+PHMWb+qlR1faHMao7ng6P3tAaoWWBMdva0gL5h4zprjIO89GJOLXsMcDm1Q==", + "extraneous": true, + "requires": { + "@types/node": "*" + } + }, + "@types/node": { + "version": "15.12.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-15.12.2.tgz", + "integrity": "sha512-zjQ69G564OCIWIOHSXyQEEDpdpGl+G348RAKY0XXy9Z5kU9Vzv1GMNnkar/ZJ8dzXB3COzD9Mo9NtRZ4xfgUww==", + "peer": true + }, + "@webassemblyjs/ast": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", + "integrity": "sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==", + "peer": true, + "requires": { + "@webassemblyjs/helper-numbers": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1" + } + }, + "@webassemblyjs/floating-point-hex-parser": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz", + "integrity": "sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ==", + "peer": true + }, + "@webassemblyjs/helper-api-error": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz", + "integrity": "sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg==", + "peer": true + }, + "@webassemblyjs/helper-buffer": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz", + "integrity": "sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA==", + "peer": true + }, + "@webassemblyjs/helper-numbers": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz", + "integrity": "sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ==", + "peer": true, + "requires": { + "@webassemblyjs/floating-point-hex-parser": "1.11.1", + "@webassemblyjs/helper-api-error": "1.11.1", + "@xtuc/long": "4.2.2" + } + }, + "@webassemblyjs/helper-wasm-bytecode": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz", + "integrity": "sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q==", + "peer": true + }, + "@webassemblyjs/helper-wasm-section": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz", + "integrity": "sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg==", + "peer": true, + "requires": { + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-buffer": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/wasm-gen": "1.11.1" + } + }, + "@webassemblyjs/ieee754": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz", + "integrity": "sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ==", + "peer": true, + "requires": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "@webassemblyjs/leb128": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.1.tgz", + "integrity": "sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw==", + "peer": true, + "requires": { + "@xtuc/long": "4.2.2" + } + }, + "@webassemblyjs/utf8": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.1.tgz", + "integrity": "sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ==", + "peer": true + }, + "@webassemblyjs/wasm-edit": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz", + "integrity": "sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA==", + "peer": true, + "requires": { + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-buffer": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/helper-wasm-section": "1.11.1", + "@webassemblyjs/wasm-gen": "1.11.1", + "@webassemblyjs/wasm-opt": "1.11.1", + "@webassemblyjs/wasm-parser": "1.11.1", + "@webassemblyjs/wast-printer": "1.11.1" + } + }, + "@webassemblyjs/wasm-gen": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz", + "integrity": "sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA==", + "peer": true, + "requires": { + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/ieee754": "1.11.1", + "@webassemblyjs/leb128": "1.11.1", + "@webassemblyjs/utf8": "1.11.1" + } + }, + "@webassemblyjs/wasm-opt": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz", + "integrity": "sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw==", + "peer": true, + "requires": { + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-buffer": "1.11.1", + "@webassemblyjs/wasm-gen": "1.11.1", + "@webassemblyjs/wasm-parser": "1.11.1" + } + }, + "@webassemblyjs/wasm-parser": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz", + "integrity": "sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA==", + "peer": true, + "requires": { + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-api-error": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/ieee754": "1.11.1", + "@webassemblyjs/leb128": "1.11.1", + "@webassemblyjs/utf8": "1.11.1" + } + }, + "@webassemblyjs/wast-printer": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz", + "integrity": "sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg==", + "peer": true, + "requires": { + "@webassemblyjs/ast": "1.11.1", + "@xtuc/long": "4.2.2" + } + }, + "@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "peer": true + }, + "@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "peer": true + }, + "acorn": { + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", + "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "peer": true + }, + "acorn-import-assertions": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz", + "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==", + "peer": true, + "requires": {} + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "peer": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "dependencies": { + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "peer": true + } + } + }, + "ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "peer": true, + "requires": {} + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "asn1.js": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", + "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", + "requires": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "safer-buffer": "^2.1.0" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } + } + }, + "assert": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", + "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", + "requires": { + "object-assign": "^4.1.1", + "util": "0.10.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=" + }, + "util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "requires": { + "inherits": "2.0.1" + } + } + } + }, + "babel-plugin-styled-components": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/babel-plugin-styled-components/-/babel-plugin-styled-components-1.12.0.tgz", + "integrity": "sha512-FEiD7l5ZABdJPpLssKXjBUJMYqzbcNzBowfXDCdJhOpbhWiewapUaY+LZGT8R4Jg2TwOjGjG4RKeyrO5p9sBkA==", + "requires": { + "@babel/helper-annotate-as-pure": "^7.0.0", + "@babel/helper-module-imports": "^7.0.0", + "babel-plugin-syntax-jsx": "^6.18.0", + "lodash": "^4.17.11" + } + }, + "babel-plugin-syntax-jsx": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz", + "integrity": "sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY=" + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + }, + "binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==" + }, + "bn.js": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", + "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + }, + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "requires": { + "balanced-match": "^1.0.0" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "requires": { + "fill-range": "^7.0.1" + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "requires": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "requires": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "browserify-rsa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", + "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", + "requires": { + "bn.js": "^5.0.0", + "randombytes": "^2.0.1" + } + }, + "browserify-sign": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", + "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", + "requires": { + "bn.js": "^5.1.1", + "browserify-rsa": "^4.0.1", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.3", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.5", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, + "browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "requires": { + "pako": "~1.0.5" + } + }, + "browserslist": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz", + "integrity": "sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==", + "peer": true, + "requires": { + "caniuse-lite": "^1.0.30001286", + "electron-to-chromium": "^1.4.17", + "escalade": "^3.1.1", + "node-releases": "^2.0.1", + "picocolors": "^1.0.0" + } + }, + "buffer": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", + "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + } + } + }, + "buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "peer": true + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" + }, + "builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=" + }, + "call-me-maybe": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", + "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=" + }, + "camelize": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.0.tgz", + "integrity": "sha1-FkpUg+Yw+kMh5a8HAg5TGDGyYJs=" + }, + "caniuse-lite": { + "version": "1.0.30001303", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001303.tgz", + "integrity": "sha512-/Mqc1oESndUNszJP0kx0UaQU9kEv9nNtJ7Kn8AdA0mNnH8eR1cj0kG+NbNuC1Wq/b21eA8prhKRA3bbkjONegQ==", + "peer": true + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "chokidar": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz", + "integrity": "sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==", + "requires": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.3.1", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.5.0" + } + }, + "chrome-trace-event": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", + "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", + "peer": true + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "classnames": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.1.tgz", + "integrity": "sha512-OlQdbZ7gLfGarSqxesMesDa5uz7KFbID8Kpq/SxIoNGDqY8lSYs0D+hhtBXhcdB3rcbXArFr7vlHheLk1voeNA==" + }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "clsx": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.1.1.tgz", + "integrity": "sha512-6/bPho624p3S2pMyvP5kKBPXnI3ufHLObBFCfgx+LkeR5lg2XYy2hqZqUf45ypD8COn2bhgGJSUE+l5dhNBieA==" + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "colorette": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz", + "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==" + }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "peer": true + }, + "console-browserify": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", + "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==" + }, + "constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=" + }, + "core-js": { + "version": "3.20.3", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.20.3.tgz", + "integrity": "sha512-vVl8j8ph6tRS3B8qir40H7yw7voy17xL0piAjlbBUsH7WIfzoedL/ZOr1OV9FyZQLWXsayOJyV4tnRyXR85/ag==", + "peer": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "create-ecdh": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", + "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", + "requires": { + "bn.js": "^4.1.0", + "elliptic": "^6.5.3" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "requires": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + } + }, + "css-color-keywords": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/css-color-keywords/-/css-color-keywords-1.0.0.tgz", + "integrity": "sha1-/qJhbcZ2spYmhrOvjb2+GAskTgU=" + }, + "css-to-react-native": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/css-to-react-native/-/css-to-react-native-3.0.0.tgz", + "integrity": "sha512-Ro1yETZA813eoyUp2GDBhG2j+YggidUmzO1/v9eYBKR2EHVEniE2MI/NqpTQ954BMpTPZFsGNPm46qFB9dpaPQ==", + "requires": { + "camelize": "^1.0.0", + "css-color-keywords": "^1.0.0", + "postcss-value-parser": "^4.0.2" + } + }, + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "requires": { + "ms": "2.1.2" + } + }, + "decko": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decko/-/decko-1.2.0.tgz", + "integrity": "sha1-/UPHNelnuAEzBohKVvvmZZlraBc=" + }, + "des.js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", + "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", + "requires": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "requires": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } + } + }, + "domain-browser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==" + }, + "dompurify": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.3.5.tgz", + "integrity": "sha512-kD+f8qEaa42+mjdOpKeztu9Mfx5bv9gVLO6K9jRx4uGvh6Wv06Srn4jr1wPNY2OOUGGSKHNFN+A8MA3v0E0QAQ==" + }, + "electron-to-chromium": { + "version": "1.4.54", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.54.tgz", + "integrity": "sha512-jRAoneRdSxnpRHO0ANpnEUtQHXxlgfVjrLOnQSisw1ryjXJXvS0pJaR/v2B7S++/tRjgEDp4Sjn5nmgb6uTySw==", + "peer": true + }, + "elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "requires": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } + } + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "enhanced-resolve": { + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.3.tgz", + "integrity": "sha512-EGAbGvH7j7Xt2nc0E7D99La1OiEs8LnyimkRgwExpUMScN6O+3x9tIWs7PLQZVNx4YD+00skHXPXi1yQHpAmZA==", + "peer": true, + "requires": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + } + }, + "es-module-lexer": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz", + "integrity": "sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==", + "peer": true + }, + "es6-promise": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz", + "integrity": "sha1-oIzd6EzNvzTQJ6FFG8kdS80ophM=" + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "peer": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "peer": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "peer": true + } + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "peer": true + }, + "eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" + }, + "events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==" + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "peer": true + }, + "fast-safe-stringify": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==" + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "foreach": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.6.tgz", + "integrity": "sha512-k6GAGDyqLe9JaebCsFCoudPPWfihKu8pylYXRlqP1J7ms39iPoTtk2fviNglIeQEwdh0bQeKJ01ZPyuyQvKzwg==" + }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "optional": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "requires": { + "is-glob": "^4.0.1" + } + }, + "glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "peer": true + }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==" + }, + "graceful-fs": { + "version": "4.2.9", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", + "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==", + "peer": true + }, + "handlebars": { + "version": "4.7.7", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", + "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", + "requires": { + "minimist": "^1.2.5", + "neo-async": "^2.6.0", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4", + "wordwrap": "^1.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "hoist-non-react-statics": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", + "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", + "requires": { + "react-is": "^16.7.0" + }, + "dependencies": { + "react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + } + } + }, + "http2-client": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/http2-client/-/http2-client-1.3.5.tgz", + "integrity": "sha512-EC2utToWl4RKfs5zd36Mxq7nzHHBuomZboI0yYL6Y0RmBgT7Sgkq4rQ0ezFTYoIsSs7Tm9SJe+o2FcAg6GBhGA==" + }, + "https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=" + }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + }, + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" + }, + "jest-worker": { + "version": "27.4.6", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.4.6.tgz", + "integrity": "sha512-gHWJF/6Xi5CTG5QCvROr6GcmpIqNYpDJyc8A1h/DyXqH1tD6SnRCM0d3U5msV31D2LB/U+E0M+W4oyvKV44oNw==", + "peer": true, + "requires": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "peer": true + }, + "supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "peer": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "js-levenshtein": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.6.tgz", + "integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==" + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "requires": { + "argparse": "^2.0.1" + } + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==" + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "peer": true + }, + "json-pointer": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/json-pointer/-/json-pointer-0.6.2.tgz", + "integrity": "sha512-vLWcKbOaXlO+jvRy4qNd+TI1QUPZzfJj1tpJ3vAXDych5XJf93ftpUKe5pKCrzyIIwgBJcOcCVRUfqQP25afBw==", + "requires": { + "foreach": "^2.0.4" + } + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "loader-runner": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz", + "integrity": "sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw==", + "peer": true + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==" + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "lunr": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", + "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==" + }, + "mark.js": { + "version": "8.11.1", + "resolved": "https://registry.npmjs.org/mark.js/-/mark.js-8.11.1.tgz", + "integrity": "sha1-GA8fnr74sOY45BZq1S24eb6y/8U=" + }, + "marked": { + "version": "4.0.15", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.15.tgz", + "integrity": "sha512-esX5lPdTfG4p8LDkv+obbRCyOKzB+820ZZyMOXJZygZBHrH9b3xXR64X4kT3sPe9Nx8qQXbmcz6kFSMt4Nfk6Q==" + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "peer": true + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } + } + }, + "mime-db": { + "version": "1.51.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", + "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==", + "peer": true + }, + "mime-types": { + "version": "2.1.34", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", + "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", + "peer": true, + "requires": { + "mime-db": "1.51.0" + } + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" + }, + "minimatch": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", + "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "requires": { + "brace-expansion": "^2.0.1" + } + }, + "minimist": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" + }, + "mobx": { + "version": "6.3.2", + "resolved": "https://registry.npmjs.org/mobx/-/mobx-6.3.2.tgz", + "integrity": "sha512-xGPM9dIE1qkK9Nrhevp0gzpsmELKU4MFUJRORW/jqxVFIHHWIoQrjDjL8vkwoJYY3C2CeVJqgvl38hgKTalTWg==" + }, + "mobx-react": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/mobx-react/-/mobx-react-7.2.1.tgz", + "integrity": "sha512-LZS99KFLn75VWDXPdRJhILzVQ7qLcRjQbzkK+wVs0Qg4kWw5hOI2USp7tmu+9zP9KYsVBmKyx2k/8cTTBfsymw==", + "requires": { + "mobx-react-lite": "^3.2.0" + } + }, + "mobx-react-lite": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/mobx-react-lite/-/mobx-react-lite-3.2.3.tgz", + "integrity": "sha512-7exWp1FV0M9dP08H9PIeHlJqDw4IdkQVRMfLYaZFMmlbzSS6ZU6p/kx392KN+rVf81hH3IQYewvRGQ70oiwmbw==", + "requires": {} + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==" + }, + "node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "requires": { + "whatwg-url": "^5.0.0" + } + }, + "node-fetch-h2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/node-fetch-h2/-/node-fetch-h2-2.3.0.tgz", + "integrity": "sha512-ofRW94Ab0T4AOh5Fk8t0h8OBWrmjb0SSB20xh1H8YnPV9EJ+f5AMoYSUQ2zgJ4Iq2HAK0I2l5/Nequ8YzFS3Hg==", + "requires": { + "http2-client": "^1.2.5" + } + }, + "node-libs-browser": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz", + "integrity": "sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q==", + "requires": { + "assert": "^1.1.1", + "browserify-zlib": "^0.2.0", + "buffer": "^4.3.0", + "console-browserify": "^1.1.0", + "constants-browserify": "^1.0.0", + "crypto-browserify": "^3.11.0", + "domain-browser": "^1.1.1", + "events": "^3.0.0", + "https-browserify": "^1.0.0", + "os-browserify": "^0.3.0", + "path-browserify": "0.0.1", + "process": "^0.11.10", + "punycode": "^1.2.4", + "querystring-es3": "^0.2.0", + "readable-stream": "^2.3.3", + "stream-browserify": "^2.0.1", + "stream-http": "^2.7.2", + "string_decoder": "^1.0.0", + "timers-browserify": "^2.0.4", + "tty-browserify": "0.0.0", + "url": "^0.11.0", + "util": "^0.11.0", + "vm-browserify": "^1.0.1" + } + }, + "node-readfiles": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/node-readfiles/-/node-readfiles-0.2.0.tgz", + "integrity": "sha1-271K8SE04uY1wkXvk//Pb2BnOl0=", + "requires": { + "es6-promise": "^3.2.1" + } + }, + "node-releases": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz", + "integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==", + "peer": true + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" + }, + "oas-kit-common": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/oas-kit-common/-/oas-kit-common-1.0.8.tgz", + "integrity": "sha512-pJTS2+T0oGIwgjGpw7sIRU8RQMcUoKCDWFLdBqKB2BNmGpbBMH2sdqAaOXUg8OzonZHU0L7vfJu1mJFEiYDWOQ==", + "requires": { + "fast-safe-stringify": "^2.0.7" + } + }, + "oas-linter": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/oas-linter/-/oas-linter-3.2.2.tgz", + "integrity": "sha512-KEGjPDVoU5K6swgo9hJVA/qYGlwfbFx+Kg2QB/kd7rzV5N8N5Mg6PlsoCMohVnQmo+pzJap/F610qTodKzecGQ==", + "requires": { + "@exodus/schemasafe": "^1.0.0-rc.2", + "should": "^13.2.1", + "yaml": "^1.10.0" + } + }, + "oas-resolver": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/oas-resolver/-/oas-resolver-2.5.6.tgz", + "integrity": "sha512-Yx5PWQNZomfEhPPOphFbZKi9W93CocQj18NlD2Pa4GWZzdZpSJvYwoiuurRI7m3SpcChrnO08hkuQDL3FGsVFQ==", + "requires": { + "node-fetch-h2": "^2.3.0", + "oas-kit-common": "^1.0.8", + "reftools": "^1.1.9", + "yaml": "^1.10.0", + "yargs": "^17.0.1" + } + }, + "oas-schema-walker": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/oas-schema-walker/-/oas-schema-walker-1.1.5.tgz", + "integrity": "sha512-2yucenq1a9YPmeNExoUa9Qwrt9RFkjqaMAA1X+U7sbb0AqBeTIdMHky9SQQ6iN94bO5NW0W4TRYXerG+BdAvAQ==" + }, + "oas-validator": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/oas-validator/-/oas-validator-5.0.8.tgz", + "integrity": "sha512-cu20/HE5N5HKqVygs3dt94eYJfBi0TsZvPVXDhbXQHiEityDN+RROTleefoKRKKJ9dFAF2JBkDHgvWj0sjKGmw==", + "requires": { + "call-me-maybe": "^1.0.1", + "oas-kit-common": "^1.0.8", + "oas-linter": "^3.2.2", + "oas-resolver": "^2.5.6", + "oas-schema-walker": "^1.1.5", + "reftools": "^1.1.9", + "should": "^13.2.1", + "yaml": "^1.10.0" + } + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "openapi-sampler": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/openapi-sampler/-/openapi-sampler-1.3.0.tgz", + "integrity": "sha512-2QfjK1oM9Sv0q82Ae1RrUe3yfFmAyjF548+6eAeb+h/cL1Uj51TW4UezraBEvwEdzoBgfo4AaTLVFGTKj+yYDw==", + "requires": { + "@types/json-schema": "^7.0.7", + "json-pointer": "0.6.2" + } + }, + "os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=" + }, + "pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" + }, + "parse-asn1": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", + "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", + "requires": { + "asn1.js": "^5.2.0", + "browserify-aes": "^1.0.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3", + "safe-buffer": "^5.1.1" + } + }, + "path-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", + "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==" + }, + "pbkdf2": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "perfect-scrollbar": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/perfect-scrollbar/-/perfect-scrollbar-1.5.5.tgz", + "integrity": "sha512-dzalfutyP3e/FOpdlhVryN4AJ5XDVauVWxybSkLZmakFE2sS3y3pc4JnSprw8tGmHvkaG5Edr5T7LBTZ+WWU2g==" + }, + "picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "peer": true + }, + "picomatch": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==" + }, + "pluralize": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", + "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==" + }, + "polished": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/polished/-/polished-4.1.4.tgz", + "integrity": "sha512-Nq5Mbza+Auo7N3sQb1QMFaQiDO+4UexWuSGR7Cjb4Sw11SZIJcrrFtiZ+L0jT9MBsUsxDboHVASbCLbE1rnECg==", + "requires": { + "@babel/runtime": "^7.16.7" + } + }, + "postcss-value-parser": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz", + "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==" + }, + "prismjs": { + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.27.0.tgz", + "integrity": "sha512-t13BGPUlFDR7wRB5kQDG4jjl7XeuH6jbJGt11JHPL96qwsEHNX2+68tFXqc1/k+/jALsbSWJKUOT/hcYAZ5LkA==" + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=" + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "requires": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + }, + "dependencies": { + "react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + } + } + }, + "public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "requires": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } + } + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + }, + "querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=" + }, + "querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=" + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "requires": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "react": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz", + "integrity": "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==", + "requires": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + } + }, + "react-dom": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-17.0.2.tgz", + "integrity": "sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==", + "requires": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1", + "scheduler": "^0.20.2" + } + }, + "react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "peer": true + }, + "react-tabs": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/react-tabs/-/react-tabs-3.2.3.tgz", + "integrity": "sha512-jx325RhRVnS9DdFbeF511z0T0WEqEoMl1uCE3LoZ6VaZZm7ytatxbum0B8bCTmaiV0KsU+4TtLGTGevCic7SWg==", + "requires": { + "clsx": "^1.1.0", + "prop-types": "^15.5.0" + } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "readdirp": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", + "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", + "requires": { + "picomatch": "^2.2.1" + } + }, + "redoc": { + "version": "2.0.0-rc.74", + "resolved": "https://registry.npmjs.org/redoc/-/redoc-2.0.0-rc.74.tgz", + "integrity": "sha512-OeOWGcbmVdfVgN//7ispiRX0fhD7Gk3tWcERugyFfP8QX/1Pttw3jRYSXmiB0i+H48zFn20K1cMppBp/qzm5xQ==", + "requires": { + "@redocly/openapi-core": "^1.0.0-beta.104", + "classnames": "^2.3.1", + "decko": "^1.2.0", + "dompurify": "^2.2.8", + "eventemitter3": "^4.0.7", + "json-pointer": "^0.6.2", + "lunr": "^2.3.9", + "mark.js": "^8.11.1", + "marked": "^4.0.15", + "mobx-react": "^7.2.0", + "openapi-sampler": "^1.3.0", + "path-browserify": "^1.0.1", + "perfect-scrollbar": "^1.5.1", + "polished": "^4.1.3", + "prismjs": "^1.27.0", + "prop-types": "^15.7.2", + "react-tabs": "^3.2.2", + "slugify": "~1.4.7", + "stickyfill": "^1.1.1", + "style-loader": "^3.3.1", + "swagger2openapi": "^7.0.6", + "url-template": "^2.0.8" + }, + "dependencies": { + "path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==" + } + } + }, + "reftools": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/reftools/-/reftools-1.1.9.tgz", + "integrity": "sha512-OVede/NQE13xBQ+ob5CKd5KyeJYU2YInb1bmV4nRoOfquZPkAkxuOXicSe1PvqIuZZ4kD13sPKBbR7UFDmli6w==" + }, + "regenerator-runtime": { + "version": "0.13.9", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", + "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==" + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" + }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "scheduler": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.20.2.tgz", + "integrity": "sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==", + "requires": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + } + }, + "schema-utils": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", + "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", + "peer": true, + "requires": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + } + }, + "serialize-javascript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "peer": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "shallowequal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz", + "integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==" + }, + "should": { + "version": "13.2.3", + "resolved": "https://registry.npmjs.org/should/-/should-13.2.3.tgz", + "integrity": "sha512-ggLesLtu2xp+ZxI+ysJTmNjh2U0TsC+rQ/pfED9bUZZ4DKefP27D+7YJVVTvKsmjLpIi9jAa7itwDGkDDmt1GQ==", + "requires": { + "should-equal": "^2.0.0", + "should-format": "^3.0.3", + "should-type": "^1.4.0", + "should-type-adaptors": "^1.0.1", + "should-util": "^1.0.0" + } + }, + "should-equal": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/should-equal/-/should-equal-2.0.0.tgz", + "integrity": "sha512-ZP36TMrK9euEuWQYBig9W55WPC7uo37qzAEmbjHz4gfyuXrEUgF8cUvQVO+w+d3OMfPvSRQJ22lSm8MQJ43LTA==", + "requires": { + "should-type": "^1.4.0" + } + }, + "should-format": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/should-format/-/should-format-3.0.3.tgz", + "integrity": "sha1-m/yPdPo5IFxT04w01xcwPidxJPE=", + "requires": { + "should-type": "^1.3.0", + "should-type-adaptors": "^1.0.1" + } + }, + "should-type": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/should-type/-/should-type-1.4.0.tgz", + "integrity": "sha1-B1bYzoRt/QmEOmlHcZ36DUz/XPM=" + }, + "should-type-adaptors": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/should-type-adaptors/-/should-type-adaptors-1.1.0.tgz", + "integrity": "sha512-JA4hdoLnN+kebEp2Vs8eBe9g7uy0zbRo+RMcU0EsNy+R+k049Ki+N5tT5Jagst2g7EAja+euFuoXFCa8vIklfA==", + "requires": { + "should-type": "^1.3.0", + "should-util": "^1.0.0" + } + }, + "should-util": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/should-util/-/should-util-1.0.1.tgz", + "integrity": "sha512-oXF8tfxx5cDk8r2kYqlkUJzZpDBqVY/II2WhvU0n9Y3XYvAYRmeaf1PvvIvTgPnv4KJ+ES5M0PyDq5Jp+Ygy2g==" + }, + "slugify": { + "version": "1.4.7", + "resolved": "https://registry.npmjs.org/slugify/-/slugify-1.4.7.tgz", + "integrity": "sha512-tf+h5W1IrjNm/9rKKj0JU2MDMruiopx0jjVA5zCdBtcGjfp0+c5rHw/zADLC3IeKlGHtVbHtpfzvYA0OYT+HKg==" + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + }, + "source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "peer": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "stickyfill": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stickyfill/-/stickyfill-1.1.1.tgz", + "integrity": "sha1-OUE/7p0CXHSn5ZzuyyN4TMDxfwI=" + }, + "stream-browserify": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", + "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", + "requires": { + "inherits": "~2.0.1", + "readable-stream": "^2.0.2" + } + }, + "stream-http": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", + "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", + "requires": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "to-arraybuffer": "^1.0.0", + "xtend": "^4.0.0" + } + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + } + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "style-loader": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-3.3.1.tgz", + "integrity": "sha512-GPcQ+LDJbrcxHORTRes6Jy2sfvK2kS6hpSfI/fXhPt+spVzxF6LJ1dHLN9zIGmVaaP044YKaIatFaufENRiDoQ==", + "requires": {} + }, + "styled-components": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-5.3.0.tgz", + "integrity": "sha512-bPJKwZCHjJPf/hwTJl6TbkSZg/3evha+XPEizrZUGb535jLImwDUdjTNxXqjjaASt2M4qO4AVfoHJNe3XB/tpQ==", + "requires": { + "@babel/helper-module-imports": "^7.0.0", + "@babel/traverse": "^7.4.5", + "@emotion/is-prop-valid": "^0.8.8", + "@emotion/stylis": "^0.8.4", + "@emotion/unitless": "^0.7.4", + "babel-plugin-styled-components": ">= 1.12.0", + "css-to-react-native": "^3.0.0", + "hoist-non-react-statics": "^3.0.0", + "shallowequal": "^1.1.0", + "supports-color": "^5.5.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + }, + "swagger2openapi": { + "version": "7.0.8", + "resolved": "https://registry.npmjs.org/swagger2openapi/-/swagger2openapi-7.0.8.tgz", + "integrity": "sha512-upi/0ZGkYgEcLeGieoz8gT74oWHA0E7JivX7aN9mAf+Tc7BQoRBvnIGHoPDw+f9TXTW4s6kGYCZJtauP6OYp7g==", + "requires": { + "call-me-maybe": "^1.0.1", + "node-fetch": "^2.6.1", + "node-fetch-h2": "^2.3.0", + "node-readfiles": "^0.2.0", + "oas-kit-common": "^1.0.8", + "oas-resolver": "^2.5.6", + "oas-schema-walker": "^1.1.5", + "oas-validator": "^5.0.8", + "reftools": "^1.1.9", + "yaml": "^1.10.0", + "yargs": "^17.0.1" + } + }, + "tapable": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", + "peer": true + }, + "terser": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.10.0.tgz", + "integrity": "sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA==", + "peer": true, + "requires": { + "commander": "^2.20.0", + "source-map": "~0.7.2", + "source-map-support": "~0.5.20" + }, + "dependencies": { + "source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "peer": true + } + } + }, + "terser-webpack-plugin": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.0.tgz", + "integrity": "sha512-LPIisi3Ol4chwAaPP8toUJ3L4qCM1G0wao7L3qNv57Drezxj6+VEyySpPw4B1HSO2Eg/hDY/MNF5XihCAoqnsQ==", + "peer": true, + "requires": { + "jest-worker": "^27.4.1", + "schema-utils": "^3.1.1", + "serialize-javascript": "^6.0.0", + "source-map": "^0.6.1", + "terser": "^5.7.2" + } + }, + "timers-browserify": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", + "integrity": "sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ==", + "requires": { + "setimmediate": "^1.0.4" + } + }, + "to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=" + }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=" + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "requires": { + "is-number": "^7.0.0" + } + }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + }, + "tty-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=" + }, + "uglify-js": { + "version": "3.13.9", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.9.tgz", + "integrity": "sha512-wZbyTQ1w6Y7fHdt8sJnHfSIuWeDgk6B5rCb4E/AM6QNNPbOMIZph21PW5dRB3h7Df0GszN+t7RuUH6sWK5bF0g==", + "optional": true + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "requires": { + "punycode": "^2.1.0" + }, + "dependencies": { + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + } + } + }, + "url": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=" + } + } + }, + "url-template": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/url-template/-/url-template-2.0.8.tgz", + "integrity": "sha1-/FZaPMy/93MMd19WQflVV5FDnyE=" + }, + "util": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", + "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", + "requires": { + "inherits": "2.0.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + } + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "vm-browserify": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", + "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==" + }, + "watchpack": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.3.1.tgz", + "integrity": "sha512-x0t0JuydIo8qCNctdDrn1OzH/qDzk2+rdCOC3YzumZ42fiMqmQ7T3xQurykYMhYfHaPHTp4ZxAx2NfUo1K6QaA==", + "peer": true, + "requires": { + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" + } + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + }, + "webpack": { + "version": "5.67.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.67.0.tgz", + "integrity": "sha512-LjFbfMh89xBDpUMgA1W9Ur6Rn/gnr2Cq1jjHFPo4v6a79/ypznSYbAyPgGhwsxBtMIaEmDD1oJoA7BEYw/Fbrw==", + "peer": true, + "requires": { + "@types/eslint-scope": "^3.7.0", + "@types/estree": "^0.0.50", + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/wasm-edit": "1.11.1", + "@webassemblyjs/wasm-parser": "1.11.1", + "acorn": "^8.4.1", + "acorn-import-assertions": "^1.7.6", + "browserslist": "^4.14.5", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^5.8.3", + "es-module-lexer": "^0.9.0", + "eslint-scope": "5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.9", + "json-parse-better-errors": "^1.0.2", + "loader-runner": "^4.2.0", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "schema-utils": "^3.1.0", + "tapable": "^2.1.1", + "terser-webpack-plugin": "^5.1.3", + "watchpack": "^2.3.1", + "webpack-sources": "^3.2.3" + } + }, + "webpack-sources": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", + "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", + "peer": true + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=" + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + } + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" + }, + "yaml": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", + "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==" + }, + "yaml-ast-parser": { + "version": "0.0.43", + "resolved": "https://registry.npmjs.org/yaml-ast-parser/-/yaml-ast-parser-0.0.43.tgz", + "integrity": "sha512-2PTINUwsRqSd+s8XxKaJWQlUuEMHJQyEuh2edBbW8KNJz0SJPwUSD2zRWqezFEdN7IzAgeuYHFUCF7o8zRdZ0A==" + }, + "yargs": { + "version": "17.3.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.3.1.tgz", + "integrity": "sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA==", + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.0.0" + } + }, + "yargs-parser": { + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz", + "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==" + } + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==" + }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } + }, + "swagger-cli": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/swagger-cli/-/swagger-cli-4.0.4.tgz", + "integrity": "sha512-Cp8YYuLny3RJFQ4CvOBTaqmOOgYsem52dPx1xM5S4EUWFblIh2Q8atppMZvXKUr1e9xH5RwipYpmdUzdPcxWcA==", + "requires": { + "@apidevtools/swagger-cli": "4.0.4" + } + }, + "sync-fetch": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/sync-fetch/-/sync-fetch-0.4.1.tgz", + "integrity": "sha512-JDtyFEvnKUzt1CxRtzzsGgkBanEv8XRmLyJo0F0nGkpCR8EjYmpOJJXz8GA/SWtlPU0nAYh0+CNMNnFworGyOA==", + "requires": { + "buffer": "^5.7.1", + "node-fetch": "^2.6.1" + } + }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "requires": { + "punycode": "^2.1.0" + } + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==" + }, + "yaml": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.1.1.tgz", + "integrity": "sha512-o96x3OPo8GjWeSLF+wOAbrPfhFOGY0W00GNaxCDv+9hkcDJEnev1yh8S7pgHF0ik6zc8sQLuL8hjHjJULZp8bw==" + } + } +} diff --git a/api/package.json b/api/package.json new file mode 100644 index 0000000000..3352aa5fec --- /dev/null +++ b/api/package.json @@ -0,0 +1,25 @@ +{ + "name": "mattermost-api-reference", + "version": "1.0.0", + "description": "This respository holds the API reference available at [https://api.mattermost.com](https://api.mattermost.com).", + "main": "index.js", + "dependencies": { + "redoc-cli": "0.13.17", + "swagger-cli": "4.0.4", + "sync-fetch": "0.4.1", + "yaml": "2.1.1" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/mattermost/mattermost-api-reference.git" + }, + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/mattermost/mattermost-api-reference/issues" + }, + "homepage": "https://github.com/mattermost/mattermost-api-reference#readme" +} diff --git a/api/playbooks/extract.js b/api/playbooks/extract.js new file mode 100644 index 0000000000..72b6b80882 --- /dev/null +++ b/api/playbooks/extract.js @@ -0,0 +1,55 @@ +'use strict'; +const YAML = require('yaml'); +const fs = require('fs'); +const fetch = require('sync-fetch'); + +class Extractor { + constructor() {} + + /** + * Write YAML data to the specified file, optionally indenting all lines by a specified amount + * @param filename {String} The file to write the data to + * @param data {Record} An object that contains the data to be written to the file + * @param indent {Number} Number of spaces to left-pad each line with + */ + writeFile(filename, data, indent = 0) { + let stringified = YAML.stringify(data, { lineWidth: 0 }); + if (indent > 0) { + stringified = stringified.replace(/^(.*)$/mg, '$1'.padStart(2 + indent)) + "\n"; + } + fs.writeFileSync(filename, stringified); + console.log("wrote file " + filename); + } + + /** + * Extract various parts of an OpenAPI spec into separate files + * @param args {Array} Program arguments + */ + run(args) { + // Fetch the OpenAPI spec + const rawSpec = fetch('https://raw.githubusercontent.com/mattermost/mattermost-plugin-playbooks/master/server/api/api.yaml').text(); + console.log("fetched Playbooks OpenAPI spec"); + // Parse the OpenAPI spec + const parsed = YAML.parse(rawSpec); + // Extract paths + if ("paths" in parsed) { + this.writeFile("paths.yaml", parsed["paths"], 2); + } + // Extract components.schemas, components.responses, and components.securitySchemes + if ("components" in parsed) { + /** @type {Record} */ + const components = parsed["components"]; + if ("schemas" in components) { + this.writeFile("schemas.yaml", components["schemas"]); + } + if ("responses" in components) { + this.writeFile("responses.yaml", components["responses"]); + } + if ("securitySchemes" in components) { + this.writeFile("securitySchemes.yaml", components["securitySchemes"]); + } + } + } +} + +new Extractor().run(process.argv); diff --git a/api/playbooks/merge-definitions.js b/api/playbooks/merge-definitions.js new file mode 100644 index 0000000000..e48c81fb52 --- /dev/null +++ b/api/playbooks/merge-definitions.js @@ -0,0 +1,61 @@ +'use strict'; +const YAML = require('yaml'); +const fs = require('fs'); + +class MergeDefinitions { + constructor() {} + + /** + * Write YAML data to the specified file + * @param filename {String} + * @param data {Record} + */ + writeFile(filename, data) { + fs.writeFileSync(filename, YAML.stringify(data, { lineWidth: 0 }).trimEnd()); + console.log("wrote file " + filename); + } + + /** + * Read a YAML file, parse it, and return the resulting object + * @param filename {String} The YAML file to read + * @returns {Record} The parsed object + */ + readFile(filename) { + const rawYaml = fs.readFileSync(filename); + console.log("read file " + filename); + return YAML.parse(rawYaml.toString()); + } + + /** + * Merge OpenAPI schema definitions + * @param args {Array} Program arguments + */ + run(args) { + if (args.length < 3) { + console.error("please specify an input file"); + return; + } + if (args[2] === "") { + console.error("input file not specified"); + return; + } + // read definitions.yaml + const parsed = this.readFile(args[2]); + // read schemas.yaml + const schemas = this.readFile("schemas.yaml"); + // read responses.yaml + const responses = this.readFile("responses.yaml"); + // read securitySchemes.yaml + const securitySchemes = this.readFile("securitySchemes.yaml"); + // merge schemas with definitions.yaml + parsed["components"]["schemas"] = Object.assign(parsed["components"]["schemas"], schemas); + // merge responses with definitions.yaml + parsed["components"]["responses"] = Object.assign(parsed["components"]["responses"], responses); + // merge securitySchemes with definitions.yaml + parsed["components"]["securitySchemes"] = Object.assign(parsed["components"]["securitySchemes"], securitySchemes); + // write merged definitions to a new file + this.writeFile("merged-definitions.yaml", parsed); + } +} + +new MergeDefinitions().run(process.argv); diff --git a/api/playbooks/merge-tags.js b/api/playbooks/merge-tags.js new file mode 100644 index 0000000000..5e54342533 --- /dev/null +++ b/api/playbooks/merge-tags.js @@ -0,0 +1,53 @@ +'use strict'; +const YAML = require('yaml'); +const fs = require('fs'); + +class MergeTags { + constructor() {} + + /** + * Read a YAML file, parse it, and return the resulting object + * @param filename {String} The YAML file to read + * @returns {Record} The parsed object + */ + readFile(filename) { + const rawYaml = fs.readFileSync(filename); + console.log("read file " + filename); + return YAML.parse(rawYaml.toString()); + } + + /** + * Merge OpenAPI tags + * @param args {Array} Program arguments + */ + run(args) { + if (args.length < 3) { + console.error("please specify an input file"); + return; + } + if (args[2] === "") { + console.error("input file not specified"); + return; + } + // read introduction.yaml + const parsed = this.readFile(args[2]); + // read tags.yaml + const tags = this.readFile("tags.yaml"); + if ("tags" in parsed) { + parsed["tags"].push(...tags["tags"]); + } + if ("x-tagGroups" in parsed) { + parsed["x-tagGroups"].push(...tags["x-tagGroups"]); + } + // Convert the modified object back to YAML and remove the trailing "null" as we want the + // "paths" field to have no value at this stage of building. + const yamlString = + YAML.stringify(parsed, { lineWidth: 0 }). + replace(/^paths:.*null.*$/mg, "paths: "); + // write out to merged-tags.yaml + fs.writeFileSync("merged-tags.yaml", yamlString); + console.log("wrote file merged-tags.yaml"); + } +} + +new MergeTags().run(process.argv); diff --git a/api/playbooks/tags.yaml b/api/playbooks/tags.yaml new file mode 100644 index 0000000000..cdd76d4c20 --- /dev/null +++ b/api/playbooks/tags.yaml @@ -0,0 +1,20 @@ +--- +tags: + - name: Playbooks + description: Playbooks + - name: PlaybookRuns + description: Playbook runs + - name: Internal + description: Internal endpoints + - name: Timeline + description: Timeline + - name: PlaybookAutofollows + description: Playbook Autofollows +x-tagGroups: + - name: Playbooks + tags: + - Playbooks + - PlaybookRuns + - PlaybookAutofollows + - Timeline + - Internal diff --git a/api/redoc-static.html b/api/redoc-static.html new file mode 100644 index 0000000000..0c6b2011e8 --- /dev/null +++ b/api/redoc-static.html @@ -0,0 +1,4362 @@ + + + + + + Mattermost API Reference + + + + + + + + + + +

Mattermost API Reference (4.0.0)

Download OpenAPI specification:Download

There is also a work-in-progress Postman API reference.

+
Mattermost is an open source platform for secure collaboration across the entire software development lifecycle. This is the reference documentation for the Mattermost REST API.

Authentication

bearerAuth

Security Scheme Type HTTP
HTTP Authorization Scheme bearer
Bearer format "Token"

introduction

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.

+

Support

+

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.

+

Contributing

+

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.

+

schema

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.

+

APIv3 Deprecation

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

+
    +
  1. Set your server's log level to DEBUG in System Console > General > Logging > File Log Level to print detailed logs for API requests.
  2. +
  3. In System Console > Logs, search for requests hitting /api/v3/ endpoints. Any requests hitting these endpoints are from integrations that should be migrated to API v4.
      +
    • For in-house or self-built integrations, update them to use v4 with the help of this API reference. Most v3 endpoints have direct counterparts in v4 and should be migrated easily.
    • +
    • For third-party integrations, visit their homepage (on GitHub, GitLab, etc.). Check if they already have a version that uses the Mattermost v4 API. If they do not, consider opening an issue asking them if support is planned.
    • +
    +
  4. +
  5. Once all integrations have been migrated to API v4, review the server logs with log level set to DEBUG. Confirm no requests hit /api/v3/ endpoints.
  6. +
  7. Set Allow use of API v3 endpoints to false in System Console > General > Configuration, or set EnableAPIv3 to false in config.json. This setting disables API v3 on your server. Any time a v3 endpoint is used, an error is logged in System Console > Logs.
  8. +
  9. Set your server's log level back to ERROR. Use the error logs to help track down any remaining uses of API v3.
  10. +
+

Below are the major changes made between v3 and v4:

+
    +
  1. Endpoint URLs only require team IDs when necessary. For example, getting a channel by ID no longer requires a team ID in v4.
  2. +
  3. Collection endpoints now generally return lists and include paging as part of the query string.
  4. +
  5. User ID is now included in most user endpoints. This allows admins to modify other users through v4 endpoints.
  6. +
+

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.

+

drivers

The easiest way to interact with the Mattermost Web Service API is through a language specific driver.

+

Official Drivers

+ +

Community-built Drivers

+ +

For other community-built drivers and API wrappers, see our app directory.

+

authentication

There are multiple ways to authenticate against the Mattermost API.

+

All examples assume there is a Mattermost instance running at http://localhost:8065.

+

Session Token

+

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.

+

Personal Access Tokens

+

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

OAuth 2.0

+

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.

+

errors

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
+}

rate limiting

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.

+ + + + + + + + + + + + + + + + + + + +
HeaderDescription
X-Ratelimit-LimitThe maximum number of requests you can make per second.
X-Ratelimit-RemainingThe number of requests remaining in the current window.
X-Ratelimit-ResetThe 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

WebSocket

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.

+

Authentication

+

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.

+

Events

+

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:

+
    +
  • added_to_team
  • +
  • authentication_challenge
  • +
  • channel_converted
  • +
  • channel_created
  • +
  • channel_deleted
  • +
  • channel_member_updated
  • +
  • channel_updated
  • +
  • channel_viewed
  • +
  • config_changed
  • +
  • delete_team
  • +
  • direct_added
  • +
  • emoji_added
  • +
  • ephemeral_message
  • +
  • group_added
  • +
  • hello
  • +
  • leave_team
  • +
  • license_changed
  • +
  • memberrole_updated
  • +
  • new_user
  • +
  • plugin_disabled
  • +
  • plugin_enabled
  • +
  • plugin_statuses_changed
  • +
  • post_deleted
  • +
  • post_edited
  • +
  • post_unread
  • +
  • posted
  • +
  • preference_changed
  • +
  • preferences_changed
  • +
  • preferences_deleted
  • +
  • reaction_added
  • +
  • reaction_removed
  • +
  • response
  • +
  • role_updated
  • +
  • status_change
  • +
  • typing
  • +
  • update_team
  • +
  • user_added
  • +
  • user_removed
  • +
  • user_role_updated
  • +
  • user_updated
  • +
  • dialog_opened
  • +
+

WebSocket API

+

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:

+
    +
  • user_typing
  • +
  • get_statuses
  • +
  • get_statuses_by_ids
  • +
+

To see how these actions work, please refer to either the Golang WebSocket driver or our JavaScript WebSocket driver.

+

users

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 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.

+
Permissions
+

No permission required but user creation can be controlled by server configuration.

+
Authorizations:
query Parameters
t
string

Token id from an email invitation

+
iid
string

Token id from an invitation link

+
Request Body schema: application/json

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)

Responses

201

User creation successful

+
400

Invalid or missing parameters in URL or request body

+
403

Do not have appropriate permissions

+
post /users
http://your-mattermost-url.com/api/v4/users
https://your-mattermost-url.com/api/v4/users

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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":
    {
    },
  • "props": { },
  • "last_password_update": 0,
  • "last_picture_update": 0,
  • "failed_attempts": 0,
  • "mfa_active": true,
  • "timezone":
    {
    },
  • "terms_of_service_id": "string",
  • "terms_of_service_create_at": 0
}

Get users

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.

+
Permissions
+

Requires an active session and (if specified) membership to the channel or team being selected from.

+
Authorizations:
query Parameters
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 not_in_channel or not_in_team, returns only the users that are allowed to join the channel or team based on its group constrains.

+
without_team
boolean

Whether or not to list users that are not on any team. This option takes precendence over in_team, in_channel, and not_in_channel.

+
sort
string

Sort is only available in conjunction with certain options below. The paging parameter is also always available.

+
in_team
+

Can be "", "last_activity_at" or "create_at". +When left blank, sorting is done by username. +Minimum server version: 4.0

+
in_channel
+

Can be "", "status". +When left blank, sorting is done by username. status will sort by User's current status (Online, Away, DND, Offline), then by Username. +Minimum server version: 4.7

+

Responses

200

User page retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /users
http://your-mattermost-url.com/api/v4/users
https://your-mattermost-url.com/api/v4/users

Request samples

Copy
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, "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get users by ids

Get a list of users based on a provided list of user ids.

+
Permissions
+

Requires an active session but no other permissions.

+
Authorizations:
query Parameters
since
integer

Only return users that have been modified since the given Unix timestamp (in milliseconds).

+

Minimum server version: 5.14

+
Request Body schema: application/json

List of user ids

+
Array
string

Responses

200

User list retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
post /users/ids
http://your-mattermost-url.com/api/v4/users/ids
https://your-mattermost-url.com/api/v4/users/ids

Request samples

Content type
application/json
Copy
Expand all Collapse all
[
  • "string"
]

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get users by group channels ids

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.

+
Permissions
+

Requires an active session but no other permissions.

+

Minimum server version: 5.14

+
Authorizations:
Request Body schema: application/json

List of group channel ids

+
Array
string

Responses

200

User list retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
post /users/group_channels
http://your-mattermost-url.com/api/v4/users/group_channels
https://your-mattermost-url.com/api/v4/users/group_channels

Request samples

Content type
application/json
Copy
Expand all Collapse all
[
  • "string"
]

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "<CHANNEL_ID>":
    [
    ]
}

Get users by usernames

Get a list of users based on a provided list of usernames.

+
Permissions
+

Requires an active session but no other permissions.

+
Authorizations:
Request Body schema: application/json

List of usernames

+
Array
string

Responses

200

User list retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
post /users/usernames
http://your-mattermost-url.com/api/v4/users/usernames
https://your-mattermost-url.com/api/v4/users/usernames

Request samples

Content type
application/json
Copy
Expand all Collapse all
[
  • "string"
]

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Search users

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.

+
Permissions
+

Requires an active session and read_channel and/or view_team permissions for any channels or teams specified in the request body.

+
Authorizations:
Request Body schema: application/json

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 team_id when using this option

+
group_constrained
boolean

When used with not_in_channel_id or not_in_team_id, returns only the users that are allowed to join the channel or team based on its group constrains.

+
allow_inactive
boolean

When true, include deactivated users in the results

+
without_team
boolean

Set this to true if you would like to search for users that are not on a team. This option takes precendence over team_id, in_channel_id, and not_in_channel_id.

+
limit
integer
Default: 100

The maximum number of users to return in the results

+

Available as of server version 5.6. Defaults to 100 if not provided or on an earlier server version.

+

Responses

200

User list retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /users/search
http://your-mattermost-url.com/api/v4/users/search
https://your-mattermost-url.com/api/v4/users/search

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Autocomplete users

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.

+
Permissions
+

Requires an active session and view_team and read_channel on any teams or channels used to filter the results further.

+
Authorizations:
query Parameters
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 100 if not provided or on an earlier server version.

+

Responses

200

User autocomplete successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /users/autocomplete
http://your-mattermost-url.com/api/v4/users/autocomplete
https://your-mattermost-url.com/api/v4/users/autocomplete

Request samples

Copy
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, "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "users":
    [
    ],
  • "out_of_channel":
    [
    ]
}

Get total count of users in the system

Get a total count of users in the system.

+
Permissions
+

Must be authenticated.

+
Authorizations:

Responses

200

User stats retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
get /users/stats
http://your-mattermost-url.com/api/v4/users/stats
https://your-mattermost-url.com/api/v4/users/stats

Request samples

Copy
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("")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "total_users_count": 0
}

Get a user

Get a user a object. Sensitive information will be sanitized out.

+
Permissions
+

Requires an active session but no other permissions.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+

Responses

200

User retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
404

Resource not found

+
get /users/{user_id}
http://your-mattermost-url.com/api/v4/users/{user_id}
https://your-mattermost-url.com/api/v4/users/{user_id}

Request samples

Copy
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, "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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":
    {
    },
  • "props": { },
  • "last_password_update": 0,
  • "last_picture_update": 0,
  • "failed_attempts": 0,
  • "mfa_active": true,
  • "timezone":
    {
    },
  • "terms_of_service_id": "string",
  • "terms_of_service_create_at": 0
}

Update a user

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.

+
Permissions
+

Must be logged in as the user being updated or have the edit_other_users permission.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+
Request Body schema: application/json

User object that is to be updated

+
id
required
string
email
string
username
string
first_name
string
last_name
string
nickname
string
locale
string
position
string
props
object
notify_props
object (UserNotifyProps)

Responses

200

User update successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
put /users/{user_id}
http://your-mattermost-url.com/api/v4/users/{user_id}
https://your-mattermost-url.com/api/v4/users/{user_id}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "email": "string",
  • "username": "string",
  • "first_name": "string",
  • "last_name": "string",
  • "nickname": "string",
  • "locale": "string",
  • "position": "string",
  • "props": { },
  • "notify_props":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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":
    {
    },
  • "props": { },
  • "last_password_update": 0,
  • "last_picture_update": 0,
  • "failed_attempts": 0,
  • "mfa_active": true,
  • "timezone":
    {
    },
  • "terms_of_service_id": "string",
  • "terms_of_service_create_at": 0
}

Deactivate a user account.

Deactivates the user and revokes all its sessions by archiving its user object.

+
Permissions
+

Must be logged in as the user being deactivated or have the edit_other_users permission.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+

Responses

200

User deactivation successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
delete /users/{user_id}
http://your-mattermost-url.com/api/v4/users/{user_id}
https://your-mattermost-url.com/api/v4/users/{user_id}

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Patch a user

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.

+
Permissions
+

Must be logged in as the user being updated or have the edit_other_users permission.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+
Request Body schema: application/json

User object that is to be updated

+
email
string
username
string
first_name
string
last_name
string
nickname
string
locale
string
position
string
props
object
notify_props
object (UserNotifyProps)

Responses

200

User patch successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
put /users/{user_id}/patch
http://your-mattermost-url.com/api/v4/users/{user_id}/patch
https://your-mattermost-url.com/api/v4/users/{user_id}/patch

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "email": "string",
  • "username": "string",
  • "first_name": "string",
  • "last_name": "string",
  • "nickname": "string",
  • "locale": "string",
  • "position": "string",
  • "props": { },
  • "notify_props":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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":
    {
    },
  • "props": { },
  • "last_password_update": 0,
  • "last_picture_update": 0,
  • "failed_attempts": 0,
  • "mfa_active": true,
  • "timezone":
    {
    },
  • "terms_of_service_id": "string",
  • "terms_of_service_create_at": 0
}

Update a user's roles

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.

+
Permissions
+

Must have the manage_roles permission.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+
Request Body schema: application/json

Space-delimited system roles to assign to the user

+
roles
required
string

Responses

200

User roles update successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
put /users/{user_id}/roles
http://your-mattermost-url.com/api/v4/users/{user_id}/roles
https://your-mattermost-url.com/api/v4/users/{user_id}/roles

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "roles": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Update user active status

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.

+
Permissions
+

User can deactivate themselves. +User with manage_system permission can activate or deactivate a user.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+
Request Body schema: application/json

Use true to set the user active, false for inactive

+
active
required
boolean

Responses

200

User active status update successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
put /users/{user_id}/active
http://your-mattermost-url.com/api/v4/users/{user_id}/active
https://your-mattermost-url.com/api/v4/users/{user_id}/active

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "active": true
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Get user's profile image

Get a user's profile image based on user_id string parameter.

+
Permissions
+

Must be logged in.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+

Responses

200

User's profile image

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
501

Feature is disabled

+
get /users/{user_id}/image
http://your-mattermost-url.com/api/v4/users/{user_id}/image
https://your-mattermost-url.com/api/v4/users/{user_id}/image

Request samples

Copy
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, "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Set user's profile image

Set a user's profile image based on user_id string parameter.

+
Permissions
+

Must be logged in as the user being updated or have the edit_other_users permission.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+
Request Body schema: multipart/form-data
image
required
string <binary>

The image to be uploaded

+

Responses

200

Profile image set successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
501

Feature is disabled

+
post /users/{user_id}/image
http://your-mattermost-url.com/api/v4/users/{user_id}/image
https://your-mattermost-url.com/api/v4/users/{user_id}/image

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Delete user's profile image

Delete user's profile image and reset to default image based on user_id string parameter.

+
Permissions
+

Must be logged in as the user being updated or have the edit_other_users permission. +Minimum server version: 5.5

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+

Responses

200

Profile image reset successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
501

Feature is disabled

+
delete /users/{user_id}/image
http://your-mattermost-url.com/api/v4/users/{user_id}/image
https://your-mattermost-url.com/api/v4/users/{user_id}/image

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Return user's default (generated) profile image

Returns the default (generated) user profile image based on user_id string parameter.

+
Permissions
+

Must be logged in. +Minimum server version: 5.5

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+

Responses

200

Default profile image

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
501

Feature is disabled

+
get /users/{user_id}/image/default
http://your-mattermost-url.com/api/v4/users/{user_id}/image/default
https://your-mattermost-url.com/api/v4/users/{user_id}/image/default

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Get a user by username

Get a user object by providing a username. Sensitive information will be sanitized out.

+
Permissions
+

Requires an active session but no other permissions.

+
Authorizations:
path Parameters
username
required
string

Username

+

Responses

200

User retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
404

Resource not found

+
get /users/username/{username}
http://your-mattermost-url.com/api/v4/users/username/{username}
https://your-mattermost-url.com/api/v4/users/username/{username}

Request samples

Copy
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, "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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":
    {
    },
  • "props": { },
  • "last_password_update": 0,
  • "last_picture_update": 0,
  • "failed_attempts": 0,
  • "mfa_active": true,
  • "timezone":
    {
    },
  • "terms_of_service_id": "string",
  • "terms_of_service_create_at": 0
}

Reset password

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.

+
Permissions
+

No permissions required.

+
Authorizations:
Request Body schema: application/json
code
required
string

The recovery code

+
new_password
required
string

The new password for the user

+

Responses

200

User password update successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /users/password/reset
http://your-mattermost-url.com/api/v4/users/password/reset
https://your-mattermost-url.com/api/v4/users/password/reset

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "code": "string",
  • "new_password": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Update a user's MFA

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.

+
Permissions
+

Must be logged in as the user being updated or have the edit_other_users permission.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+
Request Body schema: application/json
activate
required
boolean

Use true to activate, false to deactivate

+
code
string

The code produced by your MFA client. Required if activate is true

+

Responses

200

User MFA update successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
put /users/{user_id}/mfa
http://your-mattermost-url.com/api/v4/users/{user_id}/mfa
https://your-mattermost-url.com/api/v4/users/{user_id}/mfa

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "activate": true,
  • "code": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Generate MFA secret

Generates an multi-factor authentication secret for a user and returns it as a string and as base64 encoded QR code image.

+
Permissions
+

Must be logged in as the user or have the edit_other_users permission.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+

Responses

200

MFA secret generation successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
501

Feature is disabled

+
post /users/{user_id}/mfa/generate
http://your-mattermost-url.com/api/v4/users/{user_id}/mfa/generate
https://your-mattermost-url.com/api/v4/users/{user_id}/mfa/generate

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "secret": "string",
  • "qr_code": "string"
}

Demote a user to a guest

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

+
Permissions
+

Must be logged in as the user or have the demote_to_guest permission.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+

Responses

200

User successfully demoted

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
501

Feature is disabled

+
post /users/{user_id}/demote
http://your-mattermost-url.com/api/v4/users/{user_id}/demote
https://your-mattermost-url.com/api/v4/users/{user_id}/demote

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Promote a guest to user

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

+
Permissions
+

Must be logged in as the user or have the promote_guest permission.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+

Responses

200

Guest successfully promoted

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
501

Feature is disabled

+
post /users/{user_id}/promote
http://your-mattermost-url.com/api/v4/users/{user_id}/promote
https://your-mattermost-url.com/api/v4/users/{user_id}/promote

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Check MFA

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.

+
Permissions
+

No permission required.

+
Authorizations:
Request Body schema: application/json
login_id
required
string

The email or username used to login

+

Responses

200

MFA check successful

+
400

Invalid or missing parameters in URL or request body

+
post /users/mfa
http://your-mattermost-url.com/api/v4/users/mfa
https://your-mattermost-url.com/api/v4/users/mfa

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "login_id": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "mfa_required": true
}

Update a user's password

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.

+
Permissions
+

Must be logged in as the user the password is being changed for or have manage_system permission.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+
Request Body schema: application/json
current_password
string

The current password for the user

+
new_password
required
string

The new password for the user

+

Responses

200

User password update successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
put /users/{user_id}/password
http://your-mattermost-url.com/api/v4/users/{user_id}/password
https://your-mattermost-url.com/api/v4/users/{user_id}/password

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "current_password": "string",
  • "new_password": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Send password reset email

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.

+
Permissions
+

No permissions required.

+
Authorizations:
Request Body schema: application/json
email
required
string

The email of the user

+

Responses

200

Email sent if account exists

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /users/password/reset/send
http://your-mattermost-url.com/api/v4/users/password/reset/send
https://your-mattermost-url.com/api/v4/users/password/reset/send

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "email": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Get a user by email

Get a user object by providing a user email. Sensitive information will be sanitized out.

+
Permissions
+

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.

+
Authorizations:
path Parameters
email
required
string

User Email

+

Responses

200

User retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
get /users/email/{email}
http://your-mattermost-url.com/api/v4/users/email/{email}
https://your-mattermost-url.com/api/v4/users/email/{email}

Request samples

Copy
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, "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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":
    {
    },
  • "props": { },
  • "last_password_update": 0,
  • "last_picture_update": 0,
  • "failed_attempts": 0,
  • "mfa_active": true,
  • "timezone":
    {
    },
  • "terms_of_service_id": "string",
  • "terms_of_service_create_at": 0
}

Get user's sessions

Get a list of sessions by providing the user GUID. Sensitive information will be sanitized out.

+
Permissions
+

Must be logged in as the user being updated or have the edit_other_users permission.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+

Responses

200

User session retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /users/{user_id}/sessions
http://your-mattermost-url.com/api/v4/users/{user_id}/sessions
https://your-mattermost-url.com/api/v4/users/{user_id}/sessions

Request samples

Copy
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, "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Revoke a user session

Revokes a user session from the provided user id and session id strings.

+
Permissions
+

Must be logged in as the user being updated or have the edit_other_users permission.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+
Request Body schema: application/json
session_id
required
string

The session GUID to revoke.

+

Responses

200

User session revoked successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /users/{user_id}/sessions/revoke
http://your-mattermost-url.com/api/v4/users/{user_id}/sessions/revoke
https://your-mattermost-url.com/api/v4/users/{user_id}/sessions/revoke

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "session_id": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Revoke all active sessions for a user

Revokes all user sessions from the provided user id and session id strings.

+
Permissions
+

Must be logged in as the user being updated or have the edit_other_users permission. +Minimum server version: 4.4

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+

Responses

200

User sessions revoked successfully

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /users/{user_id}/sessions/revoke/all
http://your-mattermost-url.com/api/v4/users/{user_id}/sessions/revoke/all
https://your-mattermost-url.com/api/v4/users/{user_id}/sessions/revoke/all

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Attach mobile device

Attach a mobile device id to the currently logged in session. This will enable push notifications for a user, if configured by the server.

+
Permissions
+

Must be authenticated.

+
Authorizations:
Request Body schema: application/json
device_id
required
string

Mobile device id. For Android prefix the id with android: and Apple with apple:

+

Responses

200

Device id attach successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
put /users/sessions/device
http://your-mattermost-url.com/api/v4/users/sessions/device
https://your-mattermost-url.com/api/v4/users/sessions/device

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "device_id": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Get user's audits

Get a list of audit by providing the user GUID.

+
Permissions
+

Must be logged in as the user or have the edit_other_users permission.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+

Responses

200

User audits retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /users/{user_id}/audits
http://your-mattermost-url.com/api/v4/users/{user_id}/audits
https://your-mattermost-url.com/api/v4/users/{user_id}/audits

Request samples

Copy
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, "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Verify user email

Verify the email used by a user to sign-up their account with.

+
Permissions
+

No permissions required.

+
Authorizations:
Request Body schema: application/json
token
required
string

The token given to validate the email

+

Responses

200

User email verification successful

+
400

Invalid or missing parameters in URL or request body

+
post /users/email/verify
http://your-mattermost-url.com/api/v4/users/email/verify
https://your-mattermost-url.com/api/v4/users/email/verify

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "token": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Send verification email

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.

+
Permissions
+

No permissions required.

+
Authorizations:
Request Body schema: application/json
email
required
string

Email of a user

+

Responses

200

Email send successful if email exists

+
400

Invalid or missing parameters in URL or request body

+
post /users/email/verify/send
http://your-mattermost-url.com/api/v4/users/email/verify/send
https://your-mattermost-url.com/api/v4/users/email/verify/send

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "email": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Switch login method

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.

+
Permissions
+

No current authentication required except when switching from OAuth2/SAML to email.

+
Authorizations:
Request Body schema: application/json
current_service
required
string

The service the user currently uses to login

+
new_service
required
string

The service the user will use to login

+
email
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

+

Responses

200

Login method switch or request successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
501

Feature is disabled

+
post /users/login/switch
http://your-mattermost-url.com/api/v4/users/login/switch
https://your-mattermost-url.com/api/v4/users/login/switch

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "current_service": "string",
  • "new_service": "string",
  • "email": "string",
  • "password": "string",
  • "mfa_code": "string",
  • "ldap_id": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "follow_link": "string"
}

Create a user access token

Generate a user access token that can be used to authenticate with the Mattermost REST API.

+

Minimum server version: 4.1

+
Permissions
+

Must have create_user_access_token permission. For non-self requests, must also have the edit_other_users permission.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+
Request Body schema: application/json
description
required
string

A description of the token usage

+

Responses

201

User access token creation successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /users/{user_id}/tokens
http://your-mattermost-url.com/api/v4/users/{user_id}/tokens
https://your-mattermost-url.com/api/v4/users/{user_id}/tokens

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "description": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "token": "string",
  • "user_id": "string",
  • "description": "string"
}

Get user access tokens

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

+
Permissions
+

Must have read_user_access_token permission. For non-self requests, must also have the edit_other_users permission.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+
query Parameters
page
integer
Default: 0

The page to select.

+
per_page
integer
Default: 60

The number of tokens per page.

+

Responses

200

User access tokens retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /users/{user_id}/tokens
http://your-mattermost-url.com/api/v4/users/{user_id}/tokens
https://your-mattermost-url.com/api/v4/users/{user_id}/tokens

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get user access tokens

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

+
Permissions
+

Must have manage_system permission.

+
Authorizations:
query Parameters
page
integer
Default: 0

The page to select.

+
per_page
integer
Default: 60

The number of tokens per page.

+

Responses

200

User access tokens retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /users/tokens
http://your-mattermost-url.com/api/v4/users/tokens
https://your-mattermost-url.com/api/v4/users/tokens

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Revoke a user access token

Revoke a user access token and delete any sessions using the token.

+

Minimum server version: 4.1

+
Permissions
+

Must have revoke_user_access_token permission. For non-self requests, must also have the edit_other_users permission.

+
Authorizations:
Request Body schema: application/json
token_id
required
string

The user access token GUID to revoke

+

Responses

200

User access token revoke successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /users/tokens/revoke
http://your-mattermost-url.com/api/v4/users/tokens/revoke
https://your-mattermost-url.com/api/v4/users/tokens/revoke

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "token_id": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Get a user access token

Get a user access token. Does not include the actual authentication token.

+

Minimum server version: 4.1

+
Permissions
+

Must have read_user_access_token permission. For non-self requests, must also have the edit_other_users permission.

+
Authorizations:
path Parameters
token_id
required
string

User access token GUID

+

Responses

200

User access token retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
get /users/tokens/{token_id}
http://your-mattermost-url.com/api/v4/users/tokens/{token_id}
https://your-mattermost-url.com/api/v4/users/tokens/{token_id}

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "user_id": "string",
  • "description": "string",
  • "is_active": true
}

Disable personal access token

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

+
Permissions
+

Must have revoke_user_access_token permission. For non-self requests, must also have the edit_other_users permission.

+
Authorizations:
Request Body schema: application/json
token_id
required
string

The personal access token GUID to disable

+

Responses

200

Personal access token disable successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /users/tokens/disable
http://your-mattermost-url.com/api/v4/users/tokens/disable
https://your-mattermost-url.com/api/v4/users/tokens/disable

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "token_id": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Enable personal access token

Re-enable a personal access token that has been disabled.

+

Minimum server version: 4.4

+
Permissions
+

Must have create_user_access_token permission. For non-self requests, must also have the edit_other_users permission.

+
Authorizations:
Request Body schema: application/json
token_id
required
string

The personal access token GUID to enable

+

Responses

200

Personal access token enable successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /users/tokens/enable
http://your-mattermost-url.com/api/v4/users/tokens/enable
https://your-mattermost-url.com/api/v4/users/tokens/enable

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "token_id": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Search tokens

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

+
Permissions
+

Must have manage_system permission.

+
Authorizations:
Request Body schema: application/json

Search criteria

+
term
required
string

The search term to match against the token id, user id or username.

+

Responses

200

Personal access token search successful

+
post /users/tokens/search
http://your-mattermost-url.com/api/v4/users/tokens/search
https://your-mattermost-url.com/api/v4/users/tokens/search

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "term": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Update a user's authentication method

Updates a user's authentication method. This can be used to change them to/from LDAP authentication for example.

+

Minimum server version: 4.6

+
Permissions
+

Must have the edit_other_users permission.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+
Request Body schema: application/json
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

+

Responses

200

User auth update successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
put /users/{user_id}/auth
http://your-mattermost-url.com/api/v4/users/{user_id}/auth
https://your-mattermost-url.com/api/v4/users/{user_id}/auth

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "auth_data": "string",
  • "auth_service": "string",
  • "password": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "auth_data": "string",
  • "auth_service": "string",
  • "password": "string"
}

Records user action when they accept or decline custom terms of service

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

+
Permissions
+

Must be logged in as the user being acted on.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+
Request Body schema: application/json

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.

+

Responses

200

Terms of service action recorded successfully

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /users/{user_id}/terms_of_service
http://your-mattermost-url.com/api/v4/users/{user_id}/terms_of_service
https://your-mattermost-url.com/api/v4/users/{user_id}/terms_of_service

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "serviceTermsId": "string",
  • "accepted": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Fetches user's latest terms of service action if the latest action was for acceptance.

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

+
Permissions
+

Must be logged in as the user being acted on.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+

Responses

200

User's accepted terms of service action

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
404

User hasn't performed an action or the latest action was a rejection.

+
get /users/{user_id}/terms_of_service
http://your-mattermost-url.com/api/v4/users/{user_id}/terms_of_service
https://your-mattermost-url.com/api/v4/users/{user_id}/terms_of_service

Request samples

Copy
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, "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "user_id": "string",
  • "terms_of_service_id": "string",
  • "create_at": 0
}

Revoke all sessions from all users.

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

+
Permissions
+

Must have manage_system permission.

+
Authorizations:

Responses

200

Sessions successfully revoked.

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /users/sessions/revoke/all
http://your-mattermost-url.com/api/v4/users/sessions/revoke/all
https://your-mattermost-url.com/api/v4/users/sessions/revoke/all

Request samples

Copy
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()
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

bots

Endpoints for creating, getting and updating bot users.

+

Create a bot

Create a new bot account on the system. Username is required.

+
Permissions
+

Must have create_bot permission. +Minimum server version: 5.10

+
Authorizations:
Request Body schema: application/json

Bot to be created

+
username
required
string
display_name
string
description
string

Responses

201

Bot creation successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /bots
http://your-mattermost-url.com/api/v4/bots
https://your-mattermost-url.com/api/v4/bots

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "username": "string",
  • "display_name": "string",
  • "description": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "user_id": "string",
  • "create_at": 0,
  • "update_at": 0,
  • "delete_at": 0,
  • "username": "string",
  • "display_name": "string",
  • "description": "string",
  • "owner_id": "string"
}

Get bots

Get a page of a list of bots.

+
Permissions
+

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

+
Authorizations:
query Parameters
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.

+

Responses

200

Bot page retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /bots
http://your-mattermost-url.com/api/v4/bots
https://your-mattermost-url.com/api/v4/bots

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Patch a bot

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.

+
Permissions
+

Must have manage_bots permission. +Minimum server version: 5.10

+
Authorizations:
path Parameters
bot_user_id
required
string

Bot user ID

+
Request Body schema: application/json

Bot to be created

+
username
required
string
display_name
string
description
string

Responses

200

Bot patch successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
put /bots/{bot_user_id}
http://your-mattermost-url.com/api/v4/bots/{bot_user_id}
https://your-mattermost-url.com/api/v4/bots/{bot_user_id}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "username": "string",
  • "display_name": "string",
  • "description": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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

Get a bot specified by its bot id.

+
Permissions
+

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

+
Authorizations:
path Parameters
bot_user_id
required
string

Bot user ID

+
query Parameters
include_deleted
boolean

If deleted bots should be returned.

+

Responses

200

Bot successfully retrieved.

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /bots/{bot_user_id}
http://your-mattermost-url.com/api/v4/bots/{bot_user_id}
https://your-mattermost-url.com/api/v4/bots/{bot_user_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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

Disable a bot.

+
Permissions
+

Must have manage_bots permission. +Minimum server version: 5.10

+
Authorizations:
path Parameters
bot_user_id
required
string

Bot user ID

+

Responses

200

Bot successfully disabled.

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /bots/{bot_user_id}/disable
http://your-mattermost-url.com/api/v4/bots/{bot_user_id}/disable
https://your-mattermost-url.com/api/v4/bots/{bot_user_id}/disable

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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

Enable a bot.

+
Permissions
+

Must have manage_bots permission. +Minimum server version: 5.10

+
Authorizations:
path Parameters
bot_user_id
required
string

Bot user ID

+

Responses

200

Bot successfully enabled.

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /bots/{bot_user_id}/enable
http://your-mattermost-url.com/api/v4/bots/{bot_user_id}/enable
https://your-mattermost-url.com/api/v4/bots/{bot_user_id}/enable

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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 user

Assign a bot to a specified user.

+
Permissions
+

Must have manage_bots permission. +Minimum server version: 5.10

+
Authorizations:
path Parameters
bot_user_id
required
string

Bot user ID

+
user_id
required
string

The user ID to assign the bot to.

+

Responses

200

Bot successfully assigned.

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /bots/{bot_user_id}/assign/{user_id}
http://your-mattermost-url.com/api/v4/bots/{bot_user_id}/assign/{user_id}
https://your-mattermost-url.com/api/v4/bots/{bot_user_id}/assign/{user_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "user_id": "string",
  • "create_at": 0,
  • "update_at": 0,
  • "delete_at": 0,
  • "username": "string",
  • "display_name": "string",
  • "description": "string",
  • "owner_id": "string"
}

Get bot's LHS icon

Get a bot's LHS icon image based on bot_user_id string parameter.

+
Permissions
+

Must be logged in. +Minimum server version: 5.14

+
Authorizations:
path Parameters
bot_user_id
required
string

Bot user ID

+

Responses

200

Bot's LHS icon image

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
500

Something went wrong with the server

+
501

Feature is disabled

+
get /bots/{bot_user_id}/icon
http://your-mattermost-url.com/api/v4/bots/{bot_user_id}/icon
https://your-mattermost-url.com/api/v4/bots/{bot_user_id}/icon

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Set bot's LHS icon image

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.

+
Permissions
+

Must have manage_bots permission. +Minimum server version: 5.14

+
Authorizations:
path Parameters
bot_user_id
required
string

Bot user ID

+
Request Body schema: multipart/form-data
image
required
string <binary>

SVG icon image to be uploaded

+

Responses

200

SVG icon image set successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
413

Content too large

+
500

Something went wrong with the server

+
501

Feature is disabled

+
post /bots/{bot_user_id}/icon
http://your-mattermost-url.com/api/v4/bots/{bot_user_id}/icon
https://your-mattermost-url.com/api/v4/bots/{bot_user_id}/icon

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Delete bot's LHS icon image

Delete bot's LHS icon image based on bot_user_id string parameter.

+
Permissions
+

Must have manage_bots permission. +Minimum server version: 5.14

+
Authorizations:
path Parameters
bot_user_id
required
string

Bot user ID

+

Responses

200

Icon image deletion successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
500

Something went wrong with the server

+
501

Feature is disabled

+
delete /bots/{bot_user_id}/icon
http://your-mattermost-url.com/api/v4/bots/{bot_user_id}/icon
https://your-mattermost-url.com/api/v4/bots/{bot_user_id}/icon

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

teams

Endpoints for creating, getting and interacting with teams.

+

Create a team

Create a new team on the system.

+
Permissions
+

Must be authenticated and have the create_team permission.

+
Authorizations:
Request Body schema: application/json

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

'O' for open, 'I' for invite only

+

Responses

201

Team creation successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /teams
http://your-mattermost-url.com/api/v4/teams
https://your-mattermost-url.com/api/v4/teams

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "string",
  • "display_name": "string",
  • "type": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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 teams

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.

+
Permissions
+

Must be authenticated. "manage_system" permission is required to show all teams.

+
Authorizations:
query Parameters
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

Responses

200

Team list retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
get /teams
http://your-mattermost-url.com/api/v4/teams
https://your-mattermost-url.com/api/v4/teams

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get a team

Get a team on the system.

+
Permissions
+

Must be authenticated and have the view_team permission.

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+

Responses

200

Team retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
get /teams/{team_id}
http://your-mattermost-url.com/api/v4/teams/{team_id}
https://your-mattermost-url.com/api/v4/teams/{team_id}

Request samples

Copy
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, "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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

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.

+
Permissions
+

Must have the manage_team permission.

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+
Request Body schema: application/json

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

Responses

200

Team update successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
put /teams/{team_id}
http://your-mattermost-url.com/api/v4/teams/{team_id}
https://your-mattermost-url.com/api/v4/teams/{team_id}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "display_name": "string",
  • "description": "string",
  • "company_name": "string",
  • "allowed_domains": "string",
  • "invite_id": "string",
  • "allow_open_invite": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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
}

Delete a team

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.

+
Permissions
+

Must have the manage_team permission.

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+
query Parameters
permanent
boolean
Default: false

Permanently delete the team, to be used for compliance reasons only. As of server version 5.0, ServiceSettings.EnableAPITeamDeletion must be set to true in the server's configuration.

+

Responses

200

Team deletion successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
delete /teams/{team_id}
http://your-mattermost-url.com/api/v4/teams/{team_id}
https://your-mattermost-url.com/api/v4/teams/{team_id}

Request samples

Copy
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})
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Patch a team

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.

+
Permissions
+

Must have the manage_team permission.

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+
Request Body schema: application/json

Team object that is to be updated

+
display_name
string
description
string
company_name
string
invite_id
string
allow_open_invite
boolean

Responses

200

team patch successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
put /teams/{team_id}/patch
http://your-mattermost-url.com/api/v4/teams/{team_id}/patch
https://your-mattermost-url.com/api/v4/teams/{team_id}/patch

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "display_name": "string",
  • "description": "string",
  • "company_name": "string",
  • "invite_id": "string",
  • "allow_open_invite": true
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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 by name

Get a team based on provided name string

+
Permissions
+

Must be authenticated, team type is open and have the view_team permission.

+
Authorizations:
path Parameters
name
required
string

Team Name

+

Responses

200

Team retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
get /teams/name/{name}
http://your-mattermost-url.com/api/v4/teams/name/{name}
https://your-mattermost-url.com/api/v4/teams/name/{name}

Request samples

Copy
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", "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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

Search teams based on search term provided in the request body.

+
Permissions
+

Logged in user only shows open teams +Logged in user with "manage_system" permission shows all teams

+
Authorizations:
Request Body schema: application/json

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 parameter then the results will be returned un-paged.

+
per_page
string

The number of entries to return per page, if paginated. If this parameter is not present with the page parameter then the results will be returned un-paged.

+

Responses

200

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.)

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
post /teams/search
http://your-mattermost-url.com/api/v4/teams/search
https://your-mattermost-url.com/api/v4/teams/search

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "term": "string",
  • "page": "string",
  • "per_page": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "teams":
    [
    ],
  • "total_count": 0
}

Check if team exists

Check if the team exists based on a team name.

+
Permissions
+

Must be authenticated.

+
Authorizations:
path Parameters
name
required
string

Team Name

+

Responses

200

Team retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
404

Resource not found

+
get /teams/name/{name}/exists
http://your-mattermost-url.com/api/v4/teams/name/{name}/exists
https://your-mattermost-url.com/api/v4/teams/name/{name}/exists

Request samples

Copy
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", "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "exists": true
}

Get a user's teams

Get a list of teams that a user is on.

+
Permissions
+

Must be authenticated as the user or have the manage_system permission.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+

Responses

200

Team list retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /users/{user_id}/teams
http://your-mattermost-url.com/api/v4/users/{user_id}/teams
https://your-mattermost-url.com/api/v4/users/{user_id}/teams

Request samples

Copy
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, "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get team members

Get a page team members list based on query string parameters - team id, page and per page.

+
Permissions
+

Must be authenticated and have the view_team permission.

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+
query Parameters
page
integer
Default: 0

The page to select.

+
per_page
integer
Default: 60

The number of users per page.

+

Responses

200

Team members retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
get /teams/{team_id}/members
http://your-mattermost-url.com/api/v4/teams/{team_id}/members
https://your-mattermost-url.com/api/v4/teams/{team_id}/members

Request samples

Copy
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, "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Add user to team

Add user to the team by user_id.

+
Permissions
+

Must be authenticated and team be open to add self. For adding another user, authenticated user must have the add_user_to_team permission.

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+
Request Body schema: application/json
team_id
string
user_id
string

Responses

201

Team member creation successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
post /teams/{team_id}/members
http://your-mattermost-url.com/api/v4/teams/{team_id}/members
https://your-mattermost-url.com/api/v4/teams/{team_id}/members

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "team_id": "string",
  • "user_id": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "team_id": "string",
  • "user_id": "string",
  • "roles": "string",
  • "delete_at": 0,
  • "scheme_user": true,
  • "scheme_admin": true,
  • "explicit_roles": "string"
}

Add user to team from invite

Using either an invite id or hash/data pair from an email invite link, add a user to a team.

+
Permissions
+

Must be authenticated.

+
Authorizations:
query Parameters
token
required
string

Token id from the invitation

+

Responses

201

Team member creation successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
post /teams/members/invite
http://your-mattermost-url.com/api/v4/teams/members/invite
https://your-mattermost-url.com/api/v4/teams/members/invite

Request samples

Copy
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, "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "team_id": "string",
  • "user_id": "string",
  • "roles": "string",
  • "delete_at": 0,
  • "scheme_user": true,
  • "scheme_admin": true,
  • "explicit_roles": "string"
}

Add multiple users to team

Add a number of users to the team by user_id.

+
Permissions
+

Must be authenticated. Authenticated user must have the add_user_to_team permission.

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+
query Parameters
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 [{"member": {...}, "user_id", "...", "error": {...}}]

+
Request Body schema: application/json
Array
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.

+

Responses

201

Team members created successfully.

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
post /teams/{team_id}/members/batch
http://your-mattermost-url.com/api/v4/teams/{team_id}/members/batch
https://your-mattermost-url.com/api/v4/teams/{team_id}/members/batch

Request samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get team members for a user

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.

+
Permissions
+

Must be logged in as the user or have the edit_other_users permission.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+

Responses

200

Team members retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
get /users/{user_id}/teams/members
http://your-mattermost-url.com/api/v4/users/{user_id}/teams/members
https://your-mattermost-url.com/api/v4/users/{user_id}/teams/members

Request samples

Copy
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, "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get a team member

Get a team member on the system.

+
Permissions
+

Must be authenticated and have the view_team permission.

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+
user_id
required
string

User GUID

+

Responses

200

Team member retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
get /teams/{team_id}/members/{user_id}
http://your-mattermost-url.com/api/v4/teams/{team_id}/members/{user_id}
https://your-mattermost-url.com/api/v4/teams/{team_id}/members/{user_id}

Request samples

Copy
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, "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "team_id": "string",
  • "user_id": "string",
  • "roles": "string",
  • "delete_at": 0,
  • "scheme_user": true,
  • "scheme_admin": true,
  • "explicit_roles": "string"
}

Remove user from team

Delete the team member object for a user, effectively removing them from a team.

+
Permissions
+

Must be logged in as the user or have the remove_user_from_team permission.

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+
user_id
required
string

User GUID

+

Responses

200

Team member deletion successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
delete /teams/{team_id}/members/{user_id}
http://your-mattermost-url.com/api/v4/teams/{team_id}/members/{user_id}
https://your-mattermost-url.com/api/v4/teams/{team_id}/members/{user_id}

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Get team members by ids

Get a list of team members based on a provided array of user ids.

+
Permissions
+

Must have view_team permission for the team.

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+
Request Body schema: application/json

List of user ids

+
Array
string

Responses

200

Team members retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /teams/{team_id}/members/ids
http://your-mattermost-url.com/api/v4/teams/{team_id}/members/ids
https://your-mattermost-url.com/api/v4/teams/{team_id}/members/ids

Request samples

Content type
application/json
Copy
Expand all Collapse all
[
  • "string"
]

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get a team stats

Get a team stats on the system.

+
Permissions
+

Must be authenticated and have the view_team permission.

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+

Responses

200

Team stats retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
get /teams/{team_id}/stats
http://your-mattermost-url.com/api/v4/teams/{team_id}/stats
https://your-mattermost-url.com/api/v4/teams/{team_id}/stats

Request samples

Copy
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, "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "team_id": "string",
  • "total_member_count": 0,
  • "active_member_count": 0
}

Regenerate the Invite ID from a Team

Regenerates the invite ID used in invite links of a team

+
Permissions
+

Must be authenticated and have the manage_team permission.

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+

Responses

200

Team Invite ID regenerated

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
post /teams/{team_id}/regenerate_invite_id
http://your-mattermost-url.com/api/v4/teams/{team_id}/regenerate_invite_id
https://your-mattermost-url.com/api/v4/teams/{team_id}/regenerate_invite_id

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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

Get the team icon of the team.

+

Minimum server version: 4.9

+
Permissions
+

User must be authenticated. In addition, team must be open or the user must have the view_team permission.

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+

Responses

200

Team icon retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
501

Feature is disabled

+
get /teams/{team_id}/image
http://your-mattermost-url.com/api/v4/teams/{team_id}/image
https://your-mattermost-url.com/api/v4/teams/{team_id}/image

Request samples

Copy
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, "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Sets the team icon

Sets the team icon for the team.

+

Minimum server version: 4.9

+
Permissions
+

Must be authenticated and have the manage_team permission.

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+
Request Body schema: multipart/form-data
image
required
string <binary>

The image to be uploaded

+

Responses

200

Team icon successfully set

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
500

Something went wrong with the server

+
501

Feature is disabled

+
post /teams/{team_id}/image
http://your-mattermost-url.com/api/v4/teams/{team_id}/image
https://your-mattermost-url.com/api/v4/teams/{team_id}/image

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Remove the team icon

Remove the team icon for the team.

+

Minimum server version: 4.10

+
Permissions
+

Must be authenticated and have the manage_team permission.

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+

Responses

200

Team icon successfully remove

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
500

Something went wrong with the server

+
501

Feature is disabled

+
delete /teams/{team_id}/image
http://your-mattermost-url.com/api/v4/teams/{team_id}/image
https://your-mattermost-url.com/api/v4/teams/{team_id}/image

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Update a team member roles

Update a team member roles. Valid team roles are "team_user", "team_admin" or both of them. Overwrites any previously assigned team roles.

+
Permissions
+

Must be authenticated and have the manage_team_roles permission.

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+
user_id
required
string

User GUID

+
Request Body schema: application/json

Space-delimited team roles to assign to the user

+
roles
required
string

Responses

200

Team member roles update successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
put /teams/{team_id}/members/{user_id}/roles
http://your-mattermost-url.com/api/v4/teams/{team_id}/members/{user_id}/roles
https://your-mattermost-url.com/api/v4/teams/{team_id}/members/{user_id}/roles

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "roles": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Update the scheme-derived roles of a team member.

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

+
Permissions
+

Must be authenticated and have the manage_team_roles permission.

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+
user_id
required
string

User GUID

+
Request Body schema: application/json

Scheme properties.

+
scheme_admin
required
boolean
scheme_user
required
boolean

Responses

200

Team member's scheme-derived roles updated successfully.

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
put /teams/{team_id}/members/{user_id}/schemeRoles
http://your-mattermost-url.com/api/v4/teams/{team_id}/members/{user_id}/schemeRoles
https://your-mattermost-url.com/api/v4/teams/{team_id}/members/{user_id}/schemeRoles

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "scheme_admin": true,
  • "scheme_user": true
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Get team unreads for a user

Get the count for unread messages and mentions in the teams the user is a member of.

+
Permissions
+

Must be logged in.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+
query Parameters
exclude_team
required
string

Optional team id to be excluded from the results

+

Responses

200

Team unreads retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /users/{user_id}/teams/unread
http://your-mattermost-url.com/api/v4/users/{user_id}/teams/unread
https://your-mattermost-url.com/api/v4/users/{user_id}/teams/unread

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get unreads for a team

Get the unread mention and message counts for a team for the specified user.

+
Permissions
+

Must be the user or have edit_other_users permission and have view_team permission for the team.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+
team_id
required
string

Team GUID

+

Responses

200

Team unread count retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
get /users/{user_id}/teams/{team_id}/unread
http://your-mattermost-url.com/api/v4/users/{user_id}/teams/{team_id}/unread
https://your-mattermost-url.com/api/v4/users/{user_id}/teams/{team_id}/unread

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "team_id": "string",
  • "msg_count": 0,
  • "mention_count": 0
}

Invite users to the team by email

Invite users to the existing team usign the user's email.

+
Permissions
+

Must have invite_to_team permission for the team.

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+
Request Body schema: application/json

List of user's email

+
Array
string

Responses

200

Users invite successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /teams/{team_id}/invite/email
http://your-mattermost-url.com/api/v4/teams/{team_id}/invite/email
https://your-mattermost-url.com/api/v4/teams/{team_id}/invite/email

Request samples

Content type
application/json
Copy
Expand all Collapse all
[
  • "string"
]

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Invite guests to the team by email

Invite guests to existing team channels usign the user's email.

+

Minimum server version: 5.16

+
Permissions
+

Must have invite_guest permission for the team.

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+
Request Body schema: application/json

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

+

Responses

200

Guests invite successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /teams/{team_id}/invite-guests/email
http://your-mattermost-url.com/api/v4/teams/{team_id}/invite-guests/email
https://your-mattermost-url.com/api/v4/teams/{team_id}/invite-guests/email

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "emails":
    [
    ],
  • "channels":
    [
    ],
  • "message": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Invalidate active email invitations

Invalidate active email invitations that have not been accepted by the user.

+
Permissions
+

Must have manage_system permission.

+
Authorizations:

Responses

200

Email invites successfully revoked

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
delete /teams/invites/email
http://your-mattermost-url.com/api/v4/teams/invites/email
https://your-mattermost-url.com/api/v4/teams/invites/email

Request samples

Copy
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()
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Import a Team from other application

Import a team into a existing team. Import users, channels, posts, hooks.

+
Permissions
+

Must have permission_import_team permission.

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+
Request Body schema: multipart/form-data
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.

+

Responses

200

JSON object containing a base64 encoded text file of the import logs in its results property.

+
400

Invalid or missing parameters in URL or request body

+
403

Do not have appropriate permissions

+
post /teams/{team_id}/import
http://your-mattermost-url.com/api/v4/teams/{team_id}/import
https://your-mattermost-url.com/api/v4/teams/{team_id}/import

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "results": "string"
}

Get invite info for a team

Get the name, display_name, description and id for a team from the invite id.

+

Minimum server version: 4.0

+
Permissions
+

No authentication required.

+
Authorizations:
path Parameters
invite_id
required
string

Invite id for a team

+

Responses

200

Team invite info retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
get /teams/invite/{invite_id}
http://your-mattermost-url.com/api/v4/teams/invite/{invite_id}
https://your-mattermost-url.com/api/v4/teams/invite/{invite_id}

Request samples

Copy
import "github.com/mattermost/mattermost-server/model"
+
+Client := model.NewAPIv4Client("https://your-mattermost-url.com")
+
+inviteID := "zWEyrTZ7GZ22aBSfoX60iWryTY"
+
+team, resp = Client.GetTeamInviteInfo(inviteID)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "name": "string",
  • "display_name": "string",
  • "description": "string"
}

Set a team's scheme

Set a team's scheme, more specifically sets the scheme_id value of a team record.

+
Permissions
+

Must have manage_system permission.

+

Minimum server version: 5.0

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+
Request Body schema: application/json

Scheme GUID

+
scheme_id
required
string

The ID of the scheme.

+

Responses

200

Update team scheme successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
put /teams/{team_id}/scheme
http://your-mattermost-url.com/api/v4/teams/{team_id}/scheme
https://your-mattermost-url.com/api/v4/teams/{team_id}/scheme

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "scheme_id": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Team members minus group members.

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.

+
Permissions
+

Must have manage_system permission.

+

Minimum server version: 5.14

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+
query Parameters
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.

+

Responses

200

Successfully returns users specified by the pagination, and the total_count.

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /teams/{team_id}/members_minus_group_members
http://your-mattermost-url.com/api/v4/teams/{team_id}/members_minus_group_members
https://your-mattermost-url.com/api/v4/teams/{team_id}/members_minus_group_members

Request samples

Copy
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'
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

channels

Endpoints for creating, getting and interacting with channels.

+

Create a channel

Create a new channel.

+
Permissions
+

If creating a public channel, create_public_channel permission is required. If creating a private channel, create_private_channel permission is required.

+
Authorizations:
Request Body schema: application/json

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

+

Responses

201

Channel creation successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /channels
http://your-mattermost-url.com/api/v4/channels
https://your-mattermost-url.com/api/v4/channels

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "team_id": "string",
  • "name": "string",
  • "display_name": "string",
  • "purpose": "string",
  • "header": "string",
  • "type": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Create a direct message channel

Create a new direct message channel between two users.

+
Permissions
+

Must be one of the two users and have create_direct_channel permission. Having the manage_system permission voids the previous requirements.

+
Authorizations:
Request Body schema: application/json

The two user ids to be in the direct message

+
Array
string

Responses

201

Direct channel creation successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /channels/direct
http://your-mattermost-url.com/api/v4/channels/direct
https://your-mattermost-url.com/api/v4/channels/direct

Request samples

Content type
application/json
Copy
Expand all Collapse all
[
  • "string",
  • "string"
]

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Create a group message channel

Create a new group message channel to group of users. If the logged in user's id is not included in the list, it will be appended to the end.

+
Permissions
+

Must have create_group_channel permission.

+
Authorizations:
Request Body schema: application/json

User ids to be in the group message channel

+
Array
string

Responses

201

Group channel creation successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /channels/group
http://your-mattermost-url.com/api/v4/channels/group
https://your-mattermost-url.com/api/v4/channels/group

Request samples

Content type
application/json
Copy
Expand all Collapse all
[
  • "string"
]

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Search all private and open type channels across all teams

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.

+
Authorizations:
Request Body schema: application/json

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 parameter then the results will be returned un-paged.

+
per_page
string

The number of entries to return per page, if paginated. If this parameter is not present with the page parameter then the results will be returned un-paged.

+

Responses

200

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.)

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
post /channels/search
http://your-mattermost-url.com/api/v4/channels/search
https://your-mattermost-url.com/api/v4/channels/search

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "term": "string",
  • "not_associated_to_group": "string",
  • "exclude_default_channels": true,
  • "page": "string",
  • "per_page": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Search Group Channels

Get a list of group channels for a user which members' usernames match the search term.

+

Minimum server version: 5.14

+
Authorizations:
Request Body schema: application/json

Search criteria

+
term
required
string

The search term to match against the members' usernames of the group channels

+

Responses

200

Channels search successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
post /group/search
http://your-mattermost-url.com/api/v4/group/search
https://your-mattermost-url.com/api/v4/group/search

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "term": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Get a list of channels by ids

Get a list of public channels on a team by id.

+
Permissions
+

view_team for the team the channels are on.

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+
Request Body schema: application/json

List of channel ids

+
Array
string

Responses

200

Channel list retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
404

Resource not found

+
post /teams/{team_id}/channels/ids
http://your-mattermost-url.com/api/v4/teams/{team_id}/channels/ids
https://your-mattermost-url.com/api/v4/teams/{team_id}/channels/ids

Request samples

Content type
application/json
Copy
Expand all Collapse all
[
  • "string"
]

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Get timezones in a channel

Get a list of timezones for the users who are in this channel.

+

Minimum server version: 5.6

+
Permissions
+

Must have the read_channel permission.

+
Authorizations:
path Parameters
channel_id
required
string

Channel GUID

+

Responses

200

Timezone retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /channels/{channel_id}/timezones
http://your-mattermost-url.com/api/v4/channels/{channel_id}/timezones
https://your-mattermost-url.com/api/v4/channels/{channel_id}/timezones

Request samples

Copy
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>)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Get a channel

Get channel from the provided channel id string.

+
Permissions
+

read_channel permission for the channel.

+
Authorizations:
path Parameters
channel_id
required
string

Channel GUID

+

Responses

200

Channel retrieval successful

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
get /channels/{channel_id}
http://your-mattermost-url.com/api/v4/channels/{channel_id}
https://your-mattermost-url.com/api/v4/channels/{channel_id}

Request samples

Copy
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>, "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Update a channel

Update a channel. The fields that can be updated are listed as parameters. Omitted fields will be treated as blanks.

+
Permissions
+

If updating a public channel, manage_public_channel_members permission is required. If updating a private channel, manage_private_channel_members permission is required.

+
Authorizations:
path Parameters
channel_id
required
string

Channel GUID

+
Request Body schema: application/json

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

+

Responses

200

Channel update successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
put /channels/{channel_id}
http://your-mattermost-url.com/api/v4/channels/{channel_id}
https://your-mattermost-url.com/api/v4/channels/{channel_id}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "name": "string",
  • "display_name": "string",
  • "purpose": "string",
  • "header": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Delete a channel

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.

+
Permissions
+

delete_public_channel permission if the channel is public, +delete_private_channel permission if the channel is private, +or have manage_system permission.

+
Authorizations:
path Parameters
channel_id
required
string

Channel GUID

+

Responses

200

Channel deletion successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
delete /channels/{channel_id}
http://your-mattermost-url.com/api/v4/channels/{channel_id}
https://your-mattermost-url.com/api/v4/channels/{channel_id}

Request samples

Copy
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>)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Patch a channel

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.

+
Permissions
+

If updating a public channel, manage_public_channel_members permission is required. If updating a private channel, manage_private_channel_members permission is required.

+
Authorizations:
path Parameters
channel_id
required
string

Channel GUID

+
Request Body schema: application/json

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

+

Responses

200

Channel patch successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
put /channels/{channel_id}/patch
http://your-mattermost-url.com/api/v4/channels/{channel_id}/patch
https://your-mattermost-url.com/api/v4/channels/{channel_id}/patch

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "string",
  • "display_name": "string",
  • "purpose": "string",
  • "header": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Update channel's privacy

Updates channel's privacy allowing changing a channel from Public to Private and back.

+

Minimum server version: 5.16

+
Permissions
+

manage_team permission for the team of the channel.

+
Authorizations:
path Parameters
channel_id
required
string

Channel GUID

+
Request Body schema: application/json
privacy
required
string

Channel privacy setting: 'O' for a public channel, 'P' for a private channel

+

Responses

200

Channel conversion successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
put /channels/{channel_id}/privacy
http://your-mattermost-url.com/api/v4/channels/{channel_id}/privacy
https://your-mattermost-url.com/api/v4/channels/{channel_id}/privacy

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "privacy": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Convert a channel from public to private

Will be deprecated in 6.0

+

Convert into private channel from the provided channel id string.

+

Minimum server version: 4.10

+
Permissions
+

manage_team permission for the team of the channel.

+
Authorizations:
path Parameters
channel_id
required
string

Channel GUID

+

Responses

200

Channel conversion successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
post /channels/{channel_id}/convert
http://your-mattermost-url.com/api/v4/channels/{channel_id}/convert
https://your-mattermost-url.com/api/v4/channels/{channel_id}/convert

Request samples

Copy
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>)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Restore a channel

Restore channel from the provided channel id string.

+

Minimum server version: 3.10

+
Permissions
+

manage_team permission for the team of the channel.

+
Authorizations:
path Parameters
channel_id
required
string

Channel GUID

+

Responses

200

Channel restore successful

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
post /channels/{channel_id}/restore
http://your-mattermost-url.com/api/v4/channels/{channel_id}/restore
https://your-mattermost-url.com/api/v4/channels/{channel_id}/restore

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Get channel statistics

Get statistics for a channel.

+
Permissions
+

Must have the read_channel permission.

+
Authorizations:
path Parameters
channel_id
required
string

Channel GUID

+

Responses

200

Channel statistics retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /channels/{channel_id}/stats
http://your-mattermost-url.com/api/v4/channels/{channel_id}/stats
https://your-mattermost-url.com/api/v4/channels/{channel_id}/stats

Request samples

Copy
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>)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Get a channel's pinned posts

Get a list of pinned posts for channel.

+
Authorizations:
path Parameters
channel_id
required
string

Channel GUID

+

Responses

200

The list of channel pinned posts

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /channels/{channel_id}/pinned
http://your-mattermost-url.com/api/v4/channels/{channel_id}/pinned
https://your-mattermost-url.com/api/v4/channels/{channel_id}/pinned

Request samples

Copy
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>, "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Get public channels

Get a page of public channels on a team based on query string parameters - page and per_page.

+
Permissions
+

Must be authenticated and have the list_team_channels permission.

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+
query Parameters
page
integer
Default: 0

The page to select.

+
per_page
integer
Default: 60

The number of public channels per page.

+

Responses

200

Channels retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
get /teams/{team_id}/channels
http://your-mattermost-url.com/api/v4/teams/{team_id}/channels
https://your-mattermost-url.com/api/v4/teams/{team_id}/channels

Request samples

Copy
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, "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Get deleted channels

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

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+
query Parameters
page
integer
Default: 0

The page to select.

+
per_page
integer
Default: 60

The number of public channels per page.

+

Responses

200

Channels retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
get /teams/{team_id}/channels/deleted
http://your-mattermost-url.com/api/v4/teams/{team_id}/channels/deleted
https://your-mattermost-url.com/api/v4/teams/{team_id}/channels/deleted

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Autocomplete channels

Autocomplete public channels on a team based on the search term provided in the request URL.

+

Minimum server version: 4.7

+
Permissions
+

Must have the list_team_channels permission.

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+
query Parameters
name
required
string

Name or display name

+

Responses

200

Channels autocomplete successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
get /teams/{team_id}/channels/autocomplete
http://your-mattermost-url.com/api/v4/teams/{team_id}/channels/autocomplete
https://your-mattermost-url.com/api/v4/teams/{team_id}/channels/autocomplete

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Autocomplete channels for search

Autocomplete your channels on a team based on the search term provided in the request URL.

+

Minimum server version: 5.4

+
Permissions
+

Must have the list_team_channels permission.

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+
query Parameters
name
required
string

Name or display name

+

Responses

200

Channels autocomplete successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
get /teams/{team_id}/channels/search_autocomplete
http://your-mattermost-url.com/api/v4/teams/{team_id}/channels/search_autocomplete
https://your-mattermost-url.com/api/v4/teams/{team_id}/channels/search_autocomplete

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Search channels

Search public channels on a team based on the search term provided in the request body.

+
Permissions
+

Must have the list_team_channels permission.

+

In server version 5.16 and later, a user without the list_team_channels permission will be able to use this endpoint, with the search results limited to the channels that the user is a member of.

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+
Request Body schema: application/json

Search criteria

+
term
required
string

The search term to match against the name or display name of channels

+

Responses

201

Channels search successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
post /teams/{team_id}/channels/search
http://your-mattermost-url.com/api/v4/teams/{team_id}/channels/search
https://your-mattermost-url.com/api/v4/teams/{team_id}/channels/search

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "term": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Search archived channels

Search archived channels on a team based on the search term provided in the request body.

+

Minimum server version: 5.18

+
Permissions
+

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.

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+
Request Body schema: application/json

Search criteria

+
term
required
string

The search term to match against the name or display name of archived channels

+

Responses

201

Channels search successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
post /teams/{team_id}/channels/search_archived
http://your-mattermost-url.com/api/v4/teams/{team_id}/channels/search_archived
https://your-mattermost-url.com/api/v4/teams/{team_id}/channels/search_archived

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "term": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Get a channel by name

Gets channel from the provided team id and channel name strings.

+
Permissions
+

read_channel permission for the channel.

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+
channel_name
required
string

Channel Name

+
query Parameters
include_deleted
boolean
Default: false

Defines if deleted channels should be returned or not

+

Responses

200

Channel retrieval successful

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
get /teams/{team_id}/channels/name/{channel_name}
http://your-mattermost-url.com/api/v4/teams/{team_id}/channels/name/{channel_name}
https://your-mattermost-url.com/api/v4/teams/{team_id}/channels/name/{channel_name}

Request samples

Copy
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>, "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Get a channel by name and team name

Gets a channel from the provided team name and channel name strings.

+
Permissions
+

read_channel permission for the channel.

+
Authorizations:
path Parameters
team_name
required
string

Team Name

+
channel_name
required
string

Channel Name

+
query Parameters
include_deleted
boolean
Default: false

Defines if deleted channels should be returned or not

+

Responses

200

Channel retrieval successful

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
get /teams/name/{team_name}/channels/name/{channel_name}
http://your-mattermost-url.com/api/v4/teams/name/{team_name}/channels/name/{channel_name}
https://your-mattermost-url.com/api/v4/teams/name/{team_name}/channels/name/{channel_name}

Request samples

Copy
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>, "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Get channel members

Get a page of members for a channel.

+
Permissions
+

read_channel permission for the channel.

+
Authorizations:
path Parameters
channel_id
required
string

Channel GUID

+
query Parameters
page
integer
Default: 0

The page to select.

+
per_page
integer
Default: 60

The number of members per page.

+

Responses

200

Channel members retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /channels/{channel_id}/members
http://your-mattermost-url.com/api/v4/channels/{channel_id}/members
https://your-mattermost-url.com/api/v4/channels/{channel_id}/members

Request samples

Copy
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, "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Add user to channel

Add a user to a channel by creating a channel member object.

+
Authorizations:
path Parameters
channel_id
required
string

The channel ID

+
Request Body schema: application/json
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

+

Responses

201

Channel member creation successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /channels/{channel_id}/members
http://your-mattermost-url.com/api/v4/channels/{channel_id}/members
https://your-mattermost-url.com/api/v4/channels/{channel_id}/members

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "user_id": "string",
  • "post_root_id": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Get channel members by ids

Get a list of channel members based on the provided user ids.

+
Permissions
+

Must have the read_channel permission.

+
Authorizations:
path Parameters
channel_id
required
string

Channel GUID

+
Request Body schema: application/json

List of user ids

+
Array
string

Responses

200

Channel member list retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
post /channels/{channel_id}/members/ids
http://your-mattermost-url.com/api/v4/channels/{channel_id}/members/ids
https://your-mattermost-url.com/api/v4/channels/{channel_id}/members/ids

Request samples

Content type
application/json
Copy
Expand all Collapse all
[
  • "string"
]

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Get channel member

Get a channel member.

+
Permissions
+

read_channel permission for the channel.

+
Authorizations:
path Parameters
channel_id
required
string

Channel GUID

+
user_id
required
string

User GUID

+

Responses

200

Channel member retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /channels/{channel_id}/members/{user_id}
http://your-mattermost-url.com/api/v4/channels/{channel_id}/members/{user_id}
https://your-mattermost-url.com/api/v4/channels/{channel_id}/members/{user_id}

Request samples

Copy
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>, "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Remove user from channel

Delete a channel member, effectively removing them from a channel.

+

In server version 5.3 and later, channel members can only be deleted from public or private channels.

+
Permissions
+

manage_public_channel_members permission if the channel is public. +manage_private_channel_members permission if the channel is private.

+
Authorizations:
path Parameters
channel_id
required
string

Channel GUID

+
user_id
required
string

User GUID

+

Responses

200

Channel member deletion successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
delete /channels/{channel_id}/members/{user_id}
http://your-mattermost-url.com/api/v4/channels/{channel_id}/members/{user_id}
https://your-mattermost-url.com/api/v4/channels/{channel_id}/members/{user_id}

Request samples

Copy
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>)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Update channel roles

Update a user's roles for a channel.

+
Permissions
+

Must have manage_channel_roles permission for the channel.

+
Authorizations:
path Parameters
channel_id
required
string

Channel GUID

+
user_id
required
string

User GUID

+
Request Body schema: application/json

Space-delimited channel roles to assign to the user

+
roles
required
string

Responses

200

Channel roles update successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
put /channels/{channel_id}/members/{user_id}/roles
http://your-mattermost-url.com/api/v4/channels/{channel_id}/members/{user_id}/roles
https://your-mattermost-url.com/api/v4/channels/{channel_id}/members/{user_id}/roles

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "roles": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Update the scheme-derived roles of a channel member.

Update a channel member's scheme_admin/scheme_user properties. Typically this should either be scheme_admin=false, scheme_user=true for ordinary channel member, or scheme_admin=true, scheme_user=true for a channel admin. +Minimum server version: 5.0

+
Permissions
+

Must be authenticated and have the manage_channel_roles permission.

+
Authorizations:
path Parameters
channel_id
required
string

Channel GUID

+
user_id
required
string

User GUID

+
Request Body schema: application/json

Scheme properties.

+
scheme_admin
required
boolean
scheme_user
required
boolean

Responses

200

Channel member's scheme-derived roles updated successfully.

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
put /channels/{channel_id}/members/{user_id}/schemeRoles
http://your-mattermost-url.com/api/v4/channels/{channel_id}/members/{user_id}/schemeRoles
https://your-mattermost-url.com/api/v4/channels/{channel_id}/members/{user_id}/schemeRoles

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "scheme_admin": true,
  • "scheme_user": true
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Update channel notifications

Update a user's notification properties for a channel. Only the provided fields are updated.

+
Permissions
+

Must be logged in as the user or have edit_other_users permission.

+
Authorizations:
path Parameters
channel_id
required
string

Channel GUID

+
user_id
required
string

User GUID

+
Request Body schema: application/json
email
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".

+

Responses

200

Channel notification properties update successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
put /channels/{channel_id}/members/{user_id}/notify_props
http://your-mattermost-url.com/api/v4/channels/{channel_id}/members/{user_id}/notify_props
https://your-mattermost-url.com/api/v4/channels/{channel_id}/members/{user_id}/notify_props

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "email": true,
  • "push": "string",
  • "desktop": "string",
  • "mark_unread": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

View channel

Perform all the actions involved in viewing a channel. This includes marking channels as read, clearing push notifications, and updating the active channel.

+
Permissions
+

Must be logged in as user or have edit_other_users permission.

+

Response only includes last_viewed_at_times in Mattermost server 4.3 and newer.

+
Authorizations:
path Parameters
user_id
required
string

User ID to perform the view action for

+
Request Body schema: application/json

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.

+

Responses

200

Channel view successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /channels/members/{user_id}/view
http://your-mattermost-url.com/api/v4/channels/members/{user_id}/view
https://your-mattermost-url.com/api/v4/channels/members/{user_id}/view

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "channel_id": "string",
  • "prev_channel_id": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Get channel memberships and roles for a user

Get all channel memberships and associated membership roles (i.e. channel_user, channel_admin) for a user on a specific team.

+
Permissions
+

Logged in as the user and view_team permission for the team. Having manage_system permission voids the previous requirements.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+
team_id
required
string

Team GUID

+

Responses

200

Channel members retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /users/{user_id}/teams/{team_id}/channels/members
http://your-mattermost-url.com/api/v4/users/{user_id}/teams/{team_id}/channels/members
https://your-mattermost-url.com/api/v4/users/{user_id}/teams/{team_id}/channels/members

Request samples

Copy
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>, "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Get channels for user

Get all the channels on a team for a user.

+
Permissions
+

Logged in as the user, or have edit_other_users permission, and view_team permission for the team.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+
team_id
required
string

Team GUID

+

Responses

200

Channels retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
get /users/{user_id}/teams/{team_id}/channels
http://your-mattermost-url.com/api/v4/users/{user_id}/teams/{team_id}/channels
https://your-mattermost-url.com/api/v4/users/{user_id}/teams/{team_id}/channels

Request samples

Copy
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>, "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Get unread messages

Get the total unread messages and mentions for a channel for a user.

+
Permissions
+

Must be logged in as user and have the read_channel permission, or have edit_other_usrs permission.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+
channel_id
required
string

Channel GUID

+

Responses

200

Channel unreads retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
get /users/{user_id}/channels/{channel_id}/unread
http://your-mattermost-url.com/api/v4/users/{user_id}/channels/{channel_id}/unread
https://your-mattermost-url.com/api/v4/users/{user_id}/channels/{channel_id}/unread

Request samples

Copy
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>)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Set a channel's scheme

Set a channel's scheme, more specifically sets the scheme_id value of a channel record.

+
Permissions
+

Must have manage_system permission.

+

Minimum server version: 4.10

+
Authorizations:
path Parameters
channel_id
required
string

Channel GUID

+
Request Body schema: application/json

Scheme GUID

+
scheme_id
required
string

The ID of the scheme.

+

Responses

200

Update channel scheme successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
put /channels/{channel_id}/scheme
http://your-mattermost-url.com/api/v4/channels/{channel_id}/scheme
https://your-mattermost-url.com/api/v4/channels/{channel_id}/scheme

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "scheme_id": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Channel members minus group members.

Get the set of users who are members of the channel minus the set of users who are members of the given groups. +Each user object contains an array of group objects representing the group memberships for that user. +Each user object contains the boolean fields scheme_guest, scheme_user, and scheme_admin representing the roles that user has for the given channel.

+
Permissions
+

Must have manage_system permission.

+

Minimum server version: 5.14

+
Authorizations:
path Parameters
channel_id
required
string

Channel GUID

+
query Parameters
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.

+

Responses

200

Successfully returns users specified by the pagination, and the total_count.

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /channels/{channel_id}/members_minus_group_members
http://your-mattermost-url.com/api/v4/channels/{channel_id}/members_minus_group_members
https://your-mattermost-url.com/api/v4/channels/{channel_id}/members_minus_group_members

Request samples

Copy
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'
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

posts

Endpoints for creating, getting and interacting with posts.

+

Create a post

Create a new post in a channel. To create the post as a comment on another post, provide root_id.

+
Permissions
+

Must have create_post permission for the channel the post is being created in.

+
Authorizations:
query Parameters
set_online
boolean

Whether to set the user status as online or not.

+
Request Body schema: application/json

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

+

Responses

201

Post creation successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /posts
http://your-mattermost-url.com/api/v4/posts
https://your-mattermost-url.com/api/v4/posts

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "channel_id": "string",
  • "message": "string",
  • "root_id": "string",
  • "file_ids":
    [
    ],
  • "props": { }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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":
    [
    ],
  • "file_ids":
    [
    ],
  • "pending_post_id": "string",
  • "metadata":
    {
    }
}

Create a ephemeral post

Create a new ephemeral post in a channel.

+
Permissions
+

Must have create_post_ephemeral permission (currently only given to system admin)

+
Authorizations:
Request Body schema: application/json

Ephemeral Post object to send

+
user_id
required
string

The target user id for the ephemeral post

+
post
required
object

Post object to create

+

Responses

201

Post creation successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /posts/ephemeral
http://your-mattermost-url.com/api/v4/posts/ephemeral
https://your-mattermost-url.com/api/v4/posts/ephemeral

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "user_id": "string",
  • "post":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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":
    [
    ],
  • "file_ids":
    [
    ],
  • "pending_post_id": "string",
  • "metadata":
    {
    }
}

Get a post

Get a single post.

+
Permissions
+

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.

+
Authorizations:
path Parameters
post_id
required
string

ID of the post to get

+

Responses

200

Post retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /posts/{post_id}
http://your-mattermost-url.com/api/v4/posts/{post_id}
https://your-mattermost-url.com/api/v4/posts/{post_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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":
    [
    ],
  • "file_ids":
    [
    ],
  • "pending_post_id": "string",
  • "metadata":
    {
    }
}

Delete a post

Soft deletes a post, by marking the post as deleted in the database. Soft deleted posts will not be returned in post queries.

+
Permissions
+

Must be logged in as the user or have delete_others_posts permission.

+
Authorizations:
path Parameters
post_id
required
string

ID of the post to delete

+

Responses

200

Post deletion successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
delete /posts/{post_id}
http://your-mattermost-url.com/api/v4/posts/{post_id}
https://your-mattermost-url.com/api/v4/posts/{post_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Update a post

Update a post. Only the fields listed below are updatable, omitted fields will be treated as blank.

+
Permissions
+

Must have edit_post permission for the channel the post is in.

+
Authorizations:
path Parameters
post_id
required
string

ID of the post to update

+
Request Body schema: application/json

Post object that is to be updated

+
id
required
string

ID of the post to update

+
is_pinned
boolean

Set to true to pin the post to the channel it is in

+
message
string

The message text of the post

+
has_reactions
boolean

Set to true if the post has reactions to it

+
props
string

A general JSON property bag to attach to the post

+

Responses

200

Post update successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
put /posts/{post_id}
http://your-mattermost-url.com/api/v4/posts/{post_id}
https://your-mattermost-url.com/api/v4/posts/{post_id}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "is_pinned": true,
  • "message": "string",
  • "has_reactions": true,
  • "props": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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":
    [
    ],
  • "file_ids":
    [
    ],
  • "pending_post_id": "string",
  • "metadata":
    {
    }
}

Mark as unread from a post.

Mark a channel as being unread from a given post.

+
Permissions
+

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

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+
post_id
required
string

Post GUID

+

Responses

200

Post marked as unread successfully

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
post /user/{user_id}/posts/{post_id}/set_unread
http://your-mattermost-url.com/api/v4/user/{user_id}/posts/{post_id}/set_unread
https://your-mattermost-url.com/api/v4/user/{user_id}/posts/{post_id}/set_unread

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "team_id": "string",
  • "channel_id": "string",
  • "msg_count": 0,
  • "mention_count": 0,
  • "last_viewed_at": 0
}

Patch a post

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.

+
Permissions
+

Must have the edit_post permission.

+
Authorizations:
path Parameters
post_id
required
string

Post GUID

+
Request Body schema: application/json

Post object that is to be updated

+
is_pinned
boolean

Set to true to pin the post to the channel it is in

+
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 true if the post has reactions to it

+
props
string

A general JSON property bag to attach to the post

+

Responses

200

Post patch successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
put /posts/{post_id}/patch
http://your-mattermost-url.com/api/v4/posts/{post_id}/patch
https://your-mattermost-url.com/api/v4/posts/{post_id}/patch

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "is_pinned": true,
  • "message": "string",
  • "file_ids":
    [
    ],
  • "has_reactions": true,
  • "props": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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":
    [
    ],
  • "file_ids":
    [
    ],
  • "pending_post_id": "string",
  • "metadata":
    {
    }
}

Get a thread

Get a post and the rest of the posts in the same thread.

+
Permissions
+

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.

+
Authorizations:
path Parameters
post_id
required
string

ID of a post in the thread

+

Responses

200

Post list retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /posts/{post_id}/thread
http://your-mattermost-url.com/api/v4/posts/{post_id}/thread
https://your-mattermost-url.com/api/v4/posts/{post_id}/thread

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "order":
    [
    ],
  • "posts":
    {
    },
  • "next_post_id": "string",
  • "prev_post_id": "string"
}

Get a list of flagged posts

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.

+
Permissions
+

Must be user or have manage_system permission.

+
Authorizations:
path Parameters
user_id
required
string

ID of the user

+
query Parameters
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

+

Responses

200

Post list retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /users/{user_id}/posts/flagged
http://your-mattermost-url.com/api/v4/users/{user_id}/posts/flagged
https://your-mattermost-url.com/api/v4/users/{user_id}/posts/flagged

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get file info for post

Gets a list of file information objects for the files attached to a post.

+
Permissions
+

Must have read_channel permission for the channel the post is in.

+
Authorizations:
path Parameters
post_id
required
string

ID of the post

+

Responses

200

File info retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /posts/{post_id}/files/info
http://your-mattermost-url.com/api/v4/posts/{post_id}/files/info
https://your-mattermost-url.com/api/v4/posts/{post_id}/files/info

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get posts for a channel

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.

+
Permissions
+

Must have read_channel permission for the channel.

+
Authorizations:
path Parameters
channel_id
required
string

The channel ID to get the posts for

+
query Parameters
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

+

Responses

200

Post list retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /channels/{channel_id}/posts
http://your-mattermost-url.com/api/v4/channels/{channel_id}/posts
https://your-mattermost-url.com/api/v4/channels/{channel_id}/posts

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "order":
    [
    ],
  • "posts":
    {
    },
  • "next_post_id": "string",
  • "prev_post_id": "string"
}

Get posts around last unread

Get the oldest unread post in the channel for the given user as well as the posts around it.

+
Permissions
+

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

+
Authorizations:
path Parameters
user_id
required
string

ID of the user

+
channel_id
required
string

The channel ID to get the posts for

+
query Parameters
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.

+

Responses

200

Post list retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /users/{user_id}/channels/{channel_id}/posts/unread
http://your-mattermost-url.com/api/v4/users/{user_id}/channels/{channel_id}/posts/unread
https://your-mattermost-url.com/api/v4/users/{user_id}/channels/{channel_id}/posts/unread

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "order":
    [
    ],
  • "posts":
    {
    },
  • "next_post_id": "string",
  • "prev_post_id": "string"
}

Search for team posts

Search posts in the team and from the provided terms string.

+
Permissions
+

Must be authenticated and have the view_team permission.

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+
Request Body schema: application/json

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 from:someusername, using a user's username. To search in a specific channel include in:somechannel, using the channel name (not the display name).

+
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)

+

Responses

200

Post list retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /teams/{team_id}/posts/search
http://your-mattermost-url.com/api/v4/teams/{team_id}/posts/search
https://your-mattermost-url.com/api/v4/teams/{team_id}/posts/search

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "terms": "string",
  • "is_or_search": true,
  • "time_zone_offset": 0,
  • "include_deleted_channels": true,
  • "page": 0,
  • "per_page": 60
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "order":
    [
    ],
  • "posts":
    {
    },
  • "matches":
    {
    }
}

Pin a post to the channel

Pin a post to a channel it is in based from the provided post id string.

+
Permissions
+

Must be authenticated and have the read_channel permission to the channel the post is in.

+
Authorizations:
path Parameters
post_id
required
string

Post GUID

+

Responses

200

Pinned post successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /posts/{post_id}/pin
http://your-mattermost-url.com/api/v4/posts/{post_id}/pin
https://your-mattermost-url.com/api/v4/posts/{post_id}/pin

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Unpin a post to the channel

Unpin a post to a channel it is in based from the provided post id string.

+
Permissions
+

Must be authenticated and have the read_channel permission to the channel the post is in.

+
Authorizations:
path Parameters
post_id
required
string

Post GUID

+

Responses

200

Unpinned post successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /posts/{post_id}/unpin
http://your-mattermost-url.com/api/v4/posts/{post_id}/unpin
https://your-mattermost-url.com/api/v4/posts/{post_id}/unpin

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Perform a post action

Perform a post action, which allows users to interact with integrations through posts.

+
Permissions
+

Must be authenticated and have the read_channel permission to the channel the post is in.

+
Authorizations:
path Parameters
post_id
required
string

Post GUID

+
action_id
required
string

Action GUID

+

Responses

200

Post action successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /posts/{post_id}/actions/{action_id}
http://your-mattermost-url.com/api/v4/posts/{post_id}/actions/{action_id}
https://your-mattermost-url.com/api/v4/posts/{post_id}/actions/{action_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

files

Endpoints for uploading and interacting with files.

+

Upload a file

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.

+
Permissions
+

Must have upload_file permission.

+
Authorizations:
query Parameters
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

+
Request Body schema: multipart/form-data
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

+

Responses

201

Corresponding lists of the provided client_ids and the metadata that has been stored in the database for each one

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
413

Content too large

+
501

Feature is disabled

+
post /files
http://your-mattermost-url.com/api/v4/files
https://your-mattermost-url.com/api/v4/files

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "file_infos":
    [
    ],
  • "client_ids":
    [
    ]
}

Get a file

Gets a file that has been uploaded previously.

+
Permissions
+

Must have read_channel permission or be uploader of the file.

+
Authorizations:
path Parameters
file_id
required
string

The ID of the file to get

+

Responses

400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
501

Feature is disabled

+
get /files/{file_id}
http://your-mattermost-url.com/api/v4/files/{file_id}
https://your-mattermost-url.com/api/v4/files/{file_id}

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Get a file's thumbnail

Gets a file's thumbnail.

+
Permissions
+

Must have read_channel permission or be uploader of the file.

+
Authorizations:
path Parameters
file_id
required
string

The ID of the file to get

+

Responses

400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
501

Feature is disabled

+
get /files/{file_id}/thumbnail
http://your-mattermost-url.com/api/v4/files/{file_id}/thumbnail
https://your-mattermost-url.com/api/v4/files/{file_id}/thumbnail

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Get a file's preview

Gets a file's preview.

+
Permissions
+

Must have read_channel permission or be uploader of the file.

+
Authorizations:
path Parameters
file_id
required
string

The ID of the file to get

+

Responses

400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
501

Feature is disabled

+
get /files/{file_id}/preview
http://your-mattermost-url.com/api/v4/files/{file_id}/preview
https://your-mattermost-url.com/api/v4/files/{file_id}/preview

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Get a public file link

Gets a public link for a file that can be accessed without logging into Mattermost.

+
Permissions
+

Must have read_channel permission or be uploader of the file.

+
Authorizations:
path Parameters
file_id
required
string

The ID of the file to get a link for

+

Responses

200

A publicly accessible link to the given file

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
501

Feature is disabled

+
get /files/{file_id}/link
http://your-mattermost-url.com/api/v4/files/{file_id}/link
https://your-mattermost-url.com/api/v4/files/{file_id}/link

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "link": "string"
}

Get metadata for a file

Gets a file's info.

+
Permissions
+

Must have read_channel permission or be uploader of the file.

+
Authorizations:
path Parameters
file_id
required
string

The ID of the file info to get

+

Responses

200

The stored metadata for the given file

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
501

Feature is disabled

+
get /files/{file_id}/info
http://your-mattermost-url.com/api/v4/files/{file_id}/info
https://your-mattermost-url.com/api/v4/files/{file_id}/info

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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
}

preferences

Endpoints for saving and modifying user preferences.

+

Get the user's preferences

Get a list of the user's preferences.

+
Permissions
+

Must be logged in as the user being updated or have the edit_other_users permission.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+

Responses

200

User preferences retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /users/{user_id}/preferences
http://your-mattermost-url.com/api/v4/users/{user_id}/preferences
https://your-mattermost-url.com/api/v4/users/{user_id}/preferences

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Save the user's preferences

Save a list of the user's preferences.

+
Permissions
+

Must be logged in as the user being updated or have the edit_other_users permission.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+
Request Body schema: application/json

List of preference objects

+
Array
user_id
string

The ID of the user that owns this preference

+
category
string
name
string
value
string

Responses

200

User preferences saved successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
put /users/{user_id}/preferences
http://your-mattermost-url.com/api/v4/users/{user_id}/preferences
https://your-mattermost-url.com/api/v4/users/{user_id}/preferences

Request samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Delete user's preferences

Delete a list of the user's preferences.

+
Permissions
+

Must be logged in as the user being updated or have the edit_other_users permission.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+
Request Body schema: application/json

List of preference objects

+
Array
user_id
string

The ID of the user that owns this preference

+
category
string
name
string
value
string

Responses

200

User preferences saved successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /users/{user_id}/preferences/delete
http://your-mattermost-url.com/api/v4/users/{user_id}/preferences/delete
https://your-mattermost-url.com/api/v4/users/{user_id}/preferences/delete

Request samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

List a user's preferences by category

Lists the current user's stored preferences in the given category.

+
Permissions
+

Must be logged in as the user being updated or have the edit_other_users permission.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+
category
required
string

The category of a group of preferences

+

Responses

200

A list of all of the current user's preferences in the given category

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /users/{user_id}/preferences/{category}
http://your-mattermost-url.com/api/v4/users/{user_id}/preferences/{category}
https://your-mattermost-url.com/api/v4/users/{user_id}/preferences/{category}

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get a specific user preference

Gets a single preference for the current user with the given category and name.

+
Permissions
+

Must be logged in as the user being updated or have the edit_other_users permission.

+
Authorizations:
path Parameters
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

+

Responses

200

A single preference for the current user in the current categorylist of all of the current user's preferences in the given category.

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
get /users/{user_id}/preferences/{category}/name/{preference_name}
http://your-mattermost-url.com/api/v4/users/{user_id}/preferences/{category}/name/{preference_name}
https://your-mattermost-url.com/api/v4/users/{user_id}/preferences/{category}/name/{preference_name}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "user_id": "string",
  • "category": "string",
  • "name": "string",
  • "value": "string"
}

status

Endpoints for getting and updating user statuses.

+

Get user status

Get user status by id from the server.

+
Permissions
+

Must be authenticated.

+
Authorizations:
path Parameters
user_id
required
string

User ID

+

Responses

200

User status retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
get /users/{user_id}/status
http://your-mattermost-url.com/api/v4/users/{user_id}/status
https://your-mattermost-url.com/api/v4/users/{user_id}/status

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "user_id": "string",
  • "status": "string",
  • "manual": true,
  • "last_activity_at": 0
}

Update user status

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.

+
Permissions
+

Must have edit_other_users permission for the team.

+
Authorizations:
path Parameters
user_id
required
string

User ID

+
Request Body schema: application/json

Status object that is to be updated

+
user_id
required
string

User ID

+
status
required
string

User status, can be online, away, offline and dnd

+

Responses

200

User status update successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
put /users/{user_id}/status
http://your-mattermost-url.com/api/v4/users/{user_id}/status
https://your-mattermost-url.com/api/v4/users/{user_id}/status

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "user_id": "string",
  • "status": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "user_id": "string",
  • "status": "string",
  • "manual": true,
  • "last_activity_at": 0
}

Get user statuses by id

Get a list of user statuses by id from the server.

+
Permissions
+

Must be authenticated.

+
Authorizations:
Request Body schema: application/json

List of user ids to fetch

+
Array
string

Responses

200

User statuses retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
post /users/status/ids
http://your-mattermost-url.com/api/v4/users/status/ids
https://your-mattermost-url.com/api/v4/users/status/ids

Request samples

Content type
application/json
Copy
Expand all Collapse all
[
  • "string"
]

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

emoji

Endpoints for creating, getting and interacting with emojis.

+

Create a custom emoji

Create a custom emoji for the team.

+
Permissions
+

Must be authenticated.

+
Authorizations:
Request Body schema: multipart/form-data
image
required
string <binary>

A file to be uploaded

+
emoji
required
string

A JSON object containing a name field with the name of the emoji and a creator_id field with the id of the authenticated user.

+

Responses

201

Emoji creation successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
413

Content too large

+
501

Feature is disabled

+
post /emoji
http://your-mattermost-url.com/api/v4/emoji
https://your-mattermost-url.com/api/v4/emoji

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "creator_id": "string",
  • "name": "string",
  • "create_at": 0,
  • "update_at": 0,
  • "delete_at": 0
}

Get a list of custom emoji

Get a page of metadata for custom emoji on the system. Since server version 4.7, sort using the sort query parameter.

+
Permissions
+

Must be authenticated.

+
Authorizations:
query Parameters
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.

+

Responses

200

Emoji list retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
get /emoji
http://your-mattermost-url.com/api/v4/emoji
https://your-mattermost-url.com/api/v4/emoji

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "creator_id": "string",
  • "name": "string",
  • "create_at": 0,
  • "update_at": 0,
  • "delete_at": 0
}

Get a custom emoji

Get some metadata for a custom emoji.

+
Permissions
+

Must be authenticated.

+
Authorizations:
path Parameters
emoji_id
required
string

Emoji GUID

+

Responses

200

Emoji retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
404

Resource not found

+
501

Feature is disabled

+
get /emoji/{emoji_id}
http://your-mattermost-url.com/api/v4/emoji/{emoji_id}
https://your-mattermost-url.com/api/v4/emoji/{emoji_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "creator_id": "string",
  • "name": "string",
  • "create_at": 0,
  • "update_at": 0,
  • "delete_at": 0
}

Delete a custom emoji

Delete a custom emoji.

+
Permissions
+

Must have the manage_team or manage_system permissions or be the user who created the emoji.

+
Authorizations:
path Parameters
emoji_id
required
string

Emoji GUID

+

Responses

200

Emoji delete successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
delete /emoji/{emoji_id}
http://your-mattermost-url.com/api/v4/emoji/{emoji_id}
https://your-mattermost-url.com/api/v4/emoji/{emoji_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "creator_id": "string",
  • "name": "string",
  • "create_at": 0,
  • "update_at": 0,
  • "delete_at": 0
}

Get a custom emoji by name

Get some metadata for a custom emoji using its name.

+
Permissions
+

Must be authenticated.

+

Minimum server version: 4.7

+
Authorizations:
path Parameters
emoji_name
required
string

Emoji name

+

Responses

200

Emoji retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
404

Resource not found

+
501

Feature is disabled

+
get /emoji/name/{emoji_name}
http://your-mattermost-url.com/api/v4/emoji/name/{emoji_name}
https://your-mattermost-url.com/api/v4/emoji/name/{emoji_name}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "creator_id": "string",
  • "name": "string",
  • "create_at": 0,
  • "update_at": 0,
  • "delete_at": 0
}

Get custom emoji image

Get the image for a custom emoji.

+
Permissions
+

Must be authenticated.

+
Authorizations:
path Parameters
emoji_id
required
string

Emoji GUID

+

Responses

200

Emoji image retrieval successful

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
500

Something went wrong with the server

+
501

Feature is disabled

+
get /emoji/{emoji_id}/image
http://your-mattermost-url.com/api/v4/emoji/{emoji_id}/image
https://your-mattermost-url.com/api/v4/emoji/{emoji_id}/image

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Search custom emoji

Search for custom emoji by name based on search criteria provided in the request body. A maximum of 200 results are returned.

+
Permissions
+

Must be authenticated.

+

Minimum server version: 4.7

+
Authorizations:
Request Body schema: application/json

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.

+

Responses

200

Emoji list retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
post /emoji/search
http://your-mattermost-url.com/api/v4/emoji/search
https://your-mattermost-url.com/api/v4/emoji/search

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "term": "string",
  • "prefix_only": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Autocomplete custom emoji

Get a list of custom emoji with names starting with or matching the provided name. Returns a maximum of 100 results.

+
Permissions
+

Must be authenticated.

+

Minimum server version: 4.7

+
Authorizations:
query Parameters
name
required
string

The emoji name to search.

+

Responses

200

Emoji list retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
get /emoji/autocomplete
http://your-mattermost-url.com/api/v4/emoji/autocomplete
https://your-mattermost-url.com/api/v4/emoji/autocomplete

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "creator_id": "string",
  • "name": "string",
  • "create_at": 0,
  • "update_at": 0,
  • "delete_at": 0
}

reactions

Endpoints for creating, getting and removing emoji reactions.

+

Create a reaction

Create a reaction.

+
Permissions
+

Must have read_channel permission for the channel the post is in.

+
Authorizations:
Request Body schema: application/json

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

+

Responses

201

Reaction creation successful

+
400

Invalid or missing parameters in URL or request body

+
403

Do not have appropriate permissions

+
post /reactions
http://your-mattermost-url.com/api/v4/reactions
https://your-mattermost-url.com/api/v4/reactions

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "user_id": "string",
  • "post_id": "string",
  • "emoji_name": "string",
  • "create_at": 0
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "user_id": "string",
  • "post_id": "string",
  • "emoji_name": "string",
  • "create_at": 0
}

Get a list of reactions to a post

Get a list of reactions made by all users to a given post.

+
Permissions
+

Must have read_channel permission for the channel the post is in.

+
Authorizations:
path Parameters
post_id
required
string

ID of a post

+

Responses

200

List reactions retrieve successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /posts/{post_id}/reactions
http://your-mattermost-url.com/api/v4/posts/{post_id}/reactions
https://your-mattermost-url.com/api/v4/posts/{post_id}/reactions

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Remove a reaction from a post

Deletes a reaction made by a user from the given post.

+
Permissions
+

Must be user or have manage_system permission.

+
Authorizations:
path Parameters
user_id
required
string

ID of the user

+
post_id
required
string

ID of the post

+
emoji_name
required
string

emoji name

+

Responses

200

Reaction deletion successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
delete /users/{user_id}/posts/{post_id}/reactions/{emoji_name}
http://your-mattermost-url.com/api/v4/users/{user_id}/posts/{post_id}/reactions/{emoji_name}
https://your-mattermost-url.com/api/v4/users/{user_id}/posts/{post_id}/reactions/{emoji_name}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Bulk get the reaction for posts

Get a list of reactions made by all users to a given post.

+
Permissions
+

Must have read_channel permission for the channel the post is in.

+

Minimum server version: 5.8

+
Authorizations:
Request Body schema: application/json

Array of post IDs

+
Array
string

Responses

200

Reactions retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /posts/ids/reactions
http://your-mattermost-url.com/api/v4/posts/ids/reactions
https://your-mattermost-url.com/api/v4/posts/ids/reactions

Request samples

Content type
application/json
Copy
Expand all Collapse all
[
  • "string"
]

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "property1":
    [
    ],
  • "property2":
    [
    ]
}

webhooks

Endpoints for creating, getting and updating webhooks.

+

Create an incoming webhook

Create an incoming webhook for a channel.

+
Permissions
+

manage_webhooks for the channel the webhook is in.

+
Authorizations:
Request Body schema: application/json

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.

+

Responses

201

Incoming webhook creation successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /hooks/incoming
http://your-mattermost-url.com/api/v4/hooks/incoming
https://your-mattermost-url.com/api/v4/hooks/incoming

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "channel_id": "string",
  • "display_name": "string",
  • "description": "string",
  • "username": "string",
  • "icon_url": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "create_at": 0,
  • "update_at": 0,
  • "delete_at": 0,
  • "channel_id": "string",
  • "description": "string",
  • "display_name": "string"
}

List incoming webhooks

Get a page of a list of incoming webhooks. Optionally filter for a specific team using query parameters.

+
Permissions
+

manage_webhooks for the system or manage_webhooks for the specific team.

+
Authorizations:
query Parameters
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.

+

Responses

200

Incoming webhooks retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /hooks/incoming
http://your-mattermost-url.com/api/v4/hooks/incoming
https://your-mattermost-url.com/api/v4/hooks/incoming

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get an incoming webhook

Get an incoming webhook given the hook id.

+
Permissions
+

manage_webhooks for system or manage_webhooks for the specific team or manage_webhooks for the channel.

+
Authorizations:
path Parameters
hook_id
required
string

Incoming Webhook GUID

+

Responses

200

Webhook retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
get /hooks/incoming/{hook_id}
http://your-mattermost-url.com/api/v4/hooks/incoming/{hook_id}
https://your-mattermost-url.com/api/v4/hooks/incoming/{hook_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "create_at": 0,
  • "update_at": 0,
  • "delete_at": 0,
  • "channel_id": "string",
  • "description": "string",
  • "display_name": "string"
}

Update an incoming webhook

Update an incoming webhook given the hook id.

+
Permissions
+

manage_webhooks for system or manage_webhooks for the specific team or manage_webhooks for the channel.

+
Authorizations:
path Parameters
hook_id
required
string

Incoming Webhook GUID

+
Request Body schema: application/json

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.

+

Responses

200

Webhook update successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
put /hooks/incoming/{hook_id}
http://your-mattermost-url.com/api/v4/hooks/incoming/{hook_id}
https://your-mattermost-url.com/api/v4/hooks/incoming/{hook_id}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "hook_id": "string",
  • "channel_id": "string",
  • "display_name": "string",
  • "description": "string",
  • "username": "string",
  • "icon_url": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "create_at": 0,
  • "update_at": 0,
  • "delete_at": 0,
  • "channel_id": "string",
  • "description": "string",
  • "display_name": "string"
}

Create an outgoing webhook

Create an outgoing webhook for a team.

+
Permissions
+

manage_webhooks for the team the webhook is in.

+
Authorizations:
Request Body schema: application/json

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, 0 when a trigger word is present at all and 1 if the message starts with a trigger word

+
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 application/json or application/x-www-form-urlencoded

+

Responses

201

Outgoing webhook creation successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
post /hooks/outgoing
http://your-mattermost-url.com/api/v4/hooks/outgoing
https://your-mattermost-url.com/api/v4/hooks/outgoing

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "team_id": "string",
  • "channel_id": "string",
  • "description": "string",
  • "display_name": "string",
  • "trigger_words":
    [
    ],
  • "trigger_when": 0,
  • "callback_urls":
    [
    ],
  • "content_type": "application/x-www-form-urlencoded"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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":
    [
    ],
  • "trigger_when": 0,
  • "callback_urls":
    [
    ],
  • "content_type": "application/x-www-form-urlencoded"
}

List outgoing webhooks

Get a page of a list of outgoing webhooks. Optionally filter for a specific team or channel using query parameters.

+
Permissions
+

manage_webhooks for the system or manage_webhooks for the specific team/channel.

+
Authorizations:
query Parameters
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.

+

Responses

200

Outgoing webhooks retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
get /hooks/outgoing
http://your-mattermost-url.com/api/v4/hooks/outgoing
https://your-mattermost-url.com/api/v4/hooks/outgoing

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get an outgoing webhook

Get an outgoing webhook given the hook id.

+
Permissions
+

manage_webhooks for system or manage_webhooks for the specific team or manage_webhooks for the channel.

+
Authorizations:
path Parameters
hook_id
required
string

Outgoing webhook GUID

+

Responses

200

Outgoing webhook retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
get /hooks/outgoing/{hook_id}
http://your-mattermost-url.com/api/v4/hooks/outgoing/{hook_id}
https://your-mattermost-url.com/api/v4/hooks/outgoing/{hook_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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":
    [
    ],
  • "trigger_when": 0,
  • "callback_urls":
    [
    ],
  • "content_type": "application/x-www-form-urlencoded"
}

Delete an outgoing webhook

Delete an outgoing webhook given the hook id.

+
Permissions
+

manage_webhooks for system or manage_webhooks for the specific team or manage_webhooks for the channel.

+
Authorizations:
path Parameters
hook_id
required
string

Outgoing webhook GUID

+

Responses

200

Webhook deletion successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
delete /hooks/outgoing/{hook_id}
http://your-mattermost-url.com/api/v4/hooks/outgoing/{hook_id}
https://your-mattermost-url.com/api/v4/hooks/outgoing/{hook_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Update an outgoing webhook

Update an outgoing webhook given the hook id.

+
Permissions
+

manage_webhooks for system or manage_webhooks for the specific team or manage_webhooks for the channel.

+
Authorizations:
path Parameters
hook_id
required
string

outgoing Webhook GUID

+
Request Body schema: application/json

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

+

Responses

200

Webhook update successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
put /hooks/outgoing/{hook_id}
http://your-mattermost-url.com/api/v4/hooks/outgoing/{hook_id}
https://your-mattermost-url.com/api/v4/hooks/outgoing/{hook_id}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "hook_id": "string",
  • "channel_id": "string",
  • "display_name": "string",
  • "description": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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":
    [
    ],
  • "trigger_when": 0,
  • "callback_urls":
    [
    ],
  • "content_type": "application/x-www-form-urlencoded"
}

Regenerate the token for the outgoing webhook.

Regenerate the token for the outgoing webhook.

+
Permissions
+

manage_webhooks for system or manage_webhooks for the specific team or manage_webhooks for the channel.

+
Authorizations:
path Parameters
hook_id
required
string

Outgoing webhook GUID

+

Responses

200

Webhook token regenerate successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
post /hooks/outgoing/{hook_id}/regen_token
http://your-mattermost-url.com/api/v4/hooks/outgoing/{hook_id}/regen_token
https://your-mattermost-url.com/api/v4/hooks/outgoing/{hook_id}/regen_token

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

commands

Endpoints for creating, getting and updating slash commands.

+

Create a command

Create a command for a team.

+
Permissions
+

manage_slash_commands for the team the command is in.

+
Authorizations:
Request Body schema: application/json

command to be created

+
team_id
required
string

Team ID to where the command should be created

+
method
required
string

'P' for post request, 'G' for get request

+
trigger
required
string

Activation word to trigger the command

+
url
required
string

The URL that the command will make the request

+

Responses

201

Command creation successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
post /commands
http://your-mattermost-url.com/api/v4/commands
https://your-mattermost-url.com/api/v4/commands

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "team_id": "string",
  • "method": "string",
  • "trigger": "string",
  • "url": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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

List commands for a team.

+
Permissions
+

manage_slash_commands if need list custom commands.

+
Authorizations:
query Parameters
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.

+

Responses

200

List Commands retrieve successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
get /commands
http://your-mattermost-url.com/api/v4/commands
https://your-mattermost-url.com/api/v4/commands

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

List autocomplete commands

List autocomplete commands in the team.

+
Permissions
+

view_team for the team.

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+

Responses

200

Autocomplete commands retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /teams/{team_id}/commands/autocomplete
http://your-mattermost-url.com/api/v4/teams/{team_id}/commands/autocomplete
https://your-mattermost-url.com/api/v4/teams/{team_id}/commands/autocomplete

Request samples

Copy
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>)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get a command

Get a command definition based on command id string.

+
Permissions
+

Must have manage_slash_commands permission for the team the command is in.

+

Minimum server version: 5.22

+
Authorizations:
path Parameters
command_id
required
string

ID of the command to get

+

Responses

200

Command get successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
404

Resource not found

+
get /commands/{command_id}
http://your-mattermost-url.com/api/v4/commands/{command_id}
https://your-mattermost-url.com/api/v4/commands/{command_id}

Request samples

Copy
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>)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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 command

Update a single command based on command id string and Command struct.

+
Permissions
+

Must have manage_slash_commands permission for the team the command is in.

+
Authorizations:
path Parameters
command_id
required
string

ID of the command to update

+
Request Body schema: application/json
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

+

Responses

200

Command updated successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
put /commands/{command_id}
http://your-mattermost-url.com/api/v4/commands/{command_id}
https://your-mattermost-url.com/api/v4/commands/{command_id}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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

Delete a command based on command id string.

+
Permissions
+

Must have manage_slash_commands permission for the team the command is in.

+
Authorizations:
path Parameters
command_id
required
string

ID of the command to delete

+

Responses

200

Command deletion successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
delete /commands/{command_id}
http://your-mattermost-url.com/api/v4/commands/{command_id}
https://your-mattermost-url.com/api/v4/commands/{command_id}

Request samples

Copy
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>)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Move a command

Move a command to a different team based on command id string.

+
Permissions
+

Must have manage_slash_commands permission for the team the command is currently in and the destination team.

+

Minimum server version: 5.22

+
Authorizations:
path Parameters
command_id
required
string

ID of the command to move

+
Request Body schema: application/json
team_id
string

Destination teamId

+

Responses

200

Command move successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
put /commands/{command_id}/move
http://your-mattermost-url.com/api/v4/commands/{command_id}/move
https://your-mattermost-url.com/api/v4/commands/{command_id}/move

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "team_id": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Generate a new token

Generate a new token for the command based on command id string.

+
Permissions
+

Must have manage_slash_commands permission for the team the command is in.

+
Authorizations:
path Parameters
command_id
required
string

ID of the command to generate the new token

+

Responses

200

Token generation successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
put /commands/{command_id}/regen_token
http://your-mattermost-url.com/api/v4/commands/{command_id}/regen_token
https://your-mattermost-url.com/api/v4/commands/{command_id}/regen_token

Request samples

Copy
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>)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "token": "string"
}

Execute a command

Execute a command on a team.

+
Permissions
+

Must have use_slash_commands permission for the team the command is in.

+
Authorizations:
Request Body schema: application/json

command to be executed

+
channel_id
required
string

Channel Id where the command will execute

+
command
required
string

The slash command to execute

+

Responses

200

Command execution successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
post /commands/execute
http://your-mattermost-url.com/api/v4/commands/execute
https://your-mattermost-url.com/api/v4/commands/execute

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "channel_id": "string",
  • "command": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "ResponseType": "string",
  • "Text": "string",
  • "Username": "string",
  • "IconURL": "string",
  • "GotoLocation": "string",
  • "Attachments":
    [
    ]
}

OpenGraph

Endpoint for getting Open Graph metadata.

+

Get open graph metadata for url

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

+
Permissions
+

No permission required but must be logged in.

+
Authorizations:
Request Body schema: application/json
url
required
string

The URL to get Open Graph Metadata.

+

Responses

200

Open Graph retrieval successful

+
501

Feature is disabled

+
post /opengraph
http://your-mattermost-url.com/api/v4/opengraph
https://your-mattermost-url.com/api/v4/opengraph

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "url": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "type": "string",
  • "url": "string",
  • "title": "string",
  • "description": "string",
  • "determiner": "string",
  • "site_name": "string",
  • "locale": "string",
  • "locales_alternate":
    [
    ],
  • "images":
    [
    ],
  • "videos":
    [
    ],
  • "audios":
    [
    ],
  • "article":
    {
    },
  • "book":
    {
    },
  • "profile":
    {
    }
}

system

General endpoints for interacting with the server, such as configuration and logging.

+

Check system health

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

+
Permissions
+

Must be logged in.

+
Authorizations:

Responses

200

Status of the system

+
500

Something went wrong with the server

+
get /system/ping
http://your-mattermost-url.com/api/v4/system/ping
https://your-mattermost-url.com/api/v4/system/ping

Request samples

Copy
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()
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Recycle database connections

Recycle database connections by closing and reconnecting all connections to master and read replica databases.

+
Permissions
+

Must have manage_system permission.

+
Authorizations:

Responses

200

Database recycle successful

+
403

Do not have appropriate permissions

+
post /database/recycle
http://your-mattermost-url.com/api/v4/database/recycle
https://your-mattermost-url.com/api/v4/database/recycle

Request samples

Copy
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()
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Send a test email

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.

+
Permissions
+

Must have manage_system permission.

+
Authorizations:
Request Body schema: application/json

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

Responses

200

Email successful sent

+
403

Do not have appropriate permissions

+
500

Something went wrong with the server

+
post /email/test
http://your-mattermost-url.com/api/v4/email/test
https://your-mattermost-url.com/api/v4/email/test

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "ServiceSettings":
    {
    },
  • "TeamSettings":
    {
    },
  • "SqlSettings":
    {
    },
  • "LogSettings":
    {
    },
  • "PasswordSettings":
    {
    },
  • "FileSettings":
    {
    },
  • "EmailSettings":
    {
    },
  • "RateLimitSettings":
    {
    },
  • "PrivacySettings":
    {
    },
  • "SupportSettings":
    {
    },
  • "GitLabSettings":
    {
    },
  • "GoogleSettings":
    {
    },
  • "Office365Settings":
    {
    },
  • "LdapSettings":
    {
    },
  • "ComplianceSettings":
    {
    },
  • "LocalizationSettings":
    {
    },
  • "SamlSettings":
    {
    },
  • "NativeAppSettings":
    {
    },
  • "ClusterSettings":
    {
    },
  • "MetricsSettings":
    {
    },
  • "AnalyticsSettings":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Checks the validity of a Site URL

Sends a Ping request to the mattermost server using the specified Site URL.

+
Permissions
+

Must have manage_system permission.

+

Minimum server version: 5.16

+
Authorizations:
Request Body schema: application/json
site_url
required
string

The Site URL to test

+

Responses

200

Site URL is valid

+
400

Invalid or missing parameters in URL or request body

+
403

Do not have appropriate permissions

+
500

Something went wrong with the server

+
post /site_url/test
http://your-mattermost-url.com/api/v4/site_url/test
https://your-mattermost-url.com/api/v4/site_url/test

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "site_url": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Test AWS S3 connection

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.

+
Permissions
+

Must have manage_system permission. +Minimum server version: 4.8

+
Authorizations:
Request Body schema: application/json

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

Responses

200

S3 Test successful

+
403

Do not have appropriate permissions

+
500

Something went wrong with the server

+
post /file/s3_test
http://your-mattermost-url.com/api/v4/file/s3_test
https://your-mattermost-url.com/api/v4/file/s3_test

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "ServiceSettings":
    {
    },
  • "TeamSettings":
    {
    },
  • "SqlSettings":
    {
    },
  • "LogSettings":
    {
    },
  • "PasswordSettings":
    {
    },
  • "FileSettings":
    {
    },
  • "EmailSettings":
    {
    },
  • "RateLimitSettings":
    {
    },
  • "PrivacySettings":
    {
    },
  • "SupportSettings":
    {
    },
  • "GitLabSettings":
    {
    },
  • "GoogleSettings":
    {
    },
  • "Office365Settings":
    {
    },
  • "LdapSettings":
    {
    },
  • "ComplianceSettings":
    {
    },
  • "LocalizationSettings":
    {
    },
  • "SamlSettings":
    {
    },
  • "NativeAppSettings":
    {
    },
  • "ClusterSettings":
    {
    },
  • "MetricsSettings":
    {
    },
  • "AnalyticsSettings":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Get configuration

Retrieve the current server configuration

+
Permissions
+

Must have manage_system permission.

+
Authorizations:

Responses

200

Configuration retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
403

Do not have appropriate permissions

+
get /config
http://your-mattermost-url.com/api/v4/config
https://your-mattermost-url.com/api/v4/config

Request samples

Copy
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()
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "ServiceSettings":
    {
    },
  • "TeamSettings":
    {
    },
  • "SqlSettings":
    {
    },
  • "LogSettings":
    {
    },
  • "PasswordSettings":
    {
    },
  • "FileSettings":
    {
    },
  • "EmailSettings":
    {
    },
  • "RateLimitSettings":
    {
    },
  • "PrivacySettings":
    {
    },
  • "SupportSettings":
    {
    },
  • "GitLabSettings":
    {
    },
  • "GoogleSettings":
    {
    },
  • "Office365Settings":
    {
    },
  • "LdapSettings":
    {
    },
  • "ComplianceSettings":
    {
    },
  • "LocalizationSettings":
    {
    },
  • "SamlSettings":
    {
    },
  • "NativeAppSettings":
    {
    },
  • "ClusterSettings":
    {
    },
  • "MetricsSettings":
    {
    },
  • "AnalyticsSettings":
    {
    }
}

Update configuration

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.

+
Permissions
+

Must have manage_system permission.

+
Authorizations:
Request Body schema: application/json

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

Responses

200

Configuration update successful

+
400

Invalid or missing parameters in URL or request body

+
403

Do not have appropriate permissions

+
put /config
http://your-mattermost-url.com/api/v4/config
https://your-mattermost-url.com/api/v4/config

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "ServiceSettings":
    {
    },
  • "TeamSettings":
    {
    },
  • "SqlSettings":
    {
    },
  • "LogSettings":
    {
    },
  • "PasswordSettings":
    {
    },
  • "FileSettings":
    {
    },
  • "EmailSettings":
    {
    },
  • "RateLimitSettings":
    {
    },
  • "PrivacySettings":
    {
    },
  • "SupportSettings":
    {
    },
  • "GitLabSettings":
    {
    },
  • "GoogleSettings":
    {
    },
  • "Office365Settings":
    {
    },
  • "LdapSettings":
    {
    },
  • "ComplianceSettings":
    {
    },
  • "LocalizationSettings":
    {
    },
  • "SamlSettings":
    {
    },
  • "NativeAppSettings":
    {
    },
  • "ClusterSettings":
    {
    },
  • "MetricsSettings":
    {
    },
  • "AnalyticsSettings":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "ServiceSettings":
    {
    },
  • "TeamSettings":
    {
    },
  • "SqlSettings":
    {
    },
  • "LogSettings":
    {
    },
  • "PasswordSettings":
    {
    },
  • "FileSettings":
    {
    },
  • "EmailSettings":
    {
    },
  • "RateLimitSettings":
    {
    },
  • "PrivacySettings":
    {
    },
  • "SupportSettings":
    {
    },
  • "GitLabSettings":
    {
    },
  • "GoogleSettings":
    {
    },
  • "Office365Settings":
    {
    },
  • "LdapSettings":
    {
    },
  • "ComplianceSettings":
    {
    },
  • "LocalizationSettings":
    {
    },
  • "SamlSettings":
    {
    },
  • "NativeAppSettings":
    {
    },
  • "ClusterSettings":
    {
    },
  • "MetricsSettings":
    {
    },
  • "AnalyticsSettings":
    {
    }
}

Reload configuration

Reload the configuration file to pick up on any changes made to it.

+
Permissions
+

Must have manage_system permission.

+
Authorizations:

Responses

200

Configuration reload successful

+
400

Invalid or missing parameters in URL or request body

+
403

Do not have appropriate permissions

+
post /config/reload
http://your-mattermost-url.com/api/v4/config/reload
https://your-mattermost-url.com/api/v4/config/reload

Request samples

Copy
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()
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Get client configuration

Get a subset of the server configuration needed by the client.

+
Permissions
+

No permission required.

+
Authorizations:
query Parameters
format
required
string

Must be old, other formats not implemented yet

+

Responses

200

Configuration retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
501

Feature is disabled

+
get /config/client
http://your-mattermost-url.com/api/v4/config/client
https://your-mattermost-url.com/api/v4/config/client

Request samples

Copy
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()
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Get configuration made through environment variables

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

+
Permissions
+

Must have manage_system permission.

+
Authorizations:

Responses

200

Configuration retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /config/environment
http://your-mattermost-url.com/api/v4/config/environment
https://your-mattermost-url.com/api/v4/config/environment

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "ServiceSettings":
    {
    },
  • "TeamSettings":
    {
    },
  • "SqlSettings":
    {
    },
  • "LogSettings":
    {
    },
  • "PasswordSettings":
    {
    },
  • "FileSettings":
    {
    },
  • "EmailSettings":
    {
    },
  • "RateLimitSettings":
    {
    },
  • "PrivacySettings":
    {
    },
  • "SupportSettings":
    {
    },
  • "GitLabSettings":
    {
    },
  • "GoogleSettings":
    {
    },
  • "Office365Settings":
    {
    },
  • "LdapSettings":
    {
    },
  • "ComplianceSettings":
    {
    },
  • "LocalizationSettings":
    {
    },
  • "SamlSettings":
    {
    },
  • "NativeAppSettings":
    {
    },
  • "ClusterSettings":
    {
    },
  • "MetricsSettings":
    {
    },
  • "AnalyticsSettings":
    {
    }
}

Patch configuration

Submit configuration to patch. As of server version 4.8, the PluginSettings.EnableUploads setting cannot be modified by this endpoint.

+
Permissions
+

Must have manage_system permission. +Minimum server version: 5.20

+
Authorizations:
Request Body schema: application/json

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

Responses

200

Configuration update successful

+
400

Invalid or missing parameters in URL or request body

+
403

Do not have appropriate permissions

+
put /config/patch
http://your-mattermost-url.com/api/v4/config/patch
https://your-mattermost-url.com/api/v4/config/patch

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "ServiceSettings":
    {
    },
  • "TeamSettings":
    {
    },
  • "SqlSettings":
    {
    },
  • "LogSettings":
    {
    },
  • "PasswordSettings":
    {
    },
  • "FileSettings":
    {
    },
  • "EmailSettings":
    {
    },
  • "RateLimitSettings":
    {
    },
  • "PrivacySettings":
    {
    },
  • "SupportSettings":
    {
    },
  • "GitLabSettings":
    {
    },
  • "GoogleSettings":
    {
    },
  • "Office365Settings":
    {
    },
  • "LdapSettings":
    {
    },
  • "ComplianceSettings":
    {
    },
  • "LocalizationSettings":
    {
    },
  • "SamlSettings":
    {
    },
  • "NativeAppSettings":
    {
    },
  • "ClusterSettings":
    {
    },
  • "MetricsSettings":
    {
    },
  • "AnalyticsSettings":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "ServiceSettings":
    {
    },
  • "TeamSettings":
    {
    },
  • "SqlSettings":
    {
    },
  • "LogSettings":
    {
    },
  • "PasswordSettings":
    {
    },
  • "FileSettings":
    {
    },
  • "EmailSettings":
    {
    },
  • "RateLimitSettings":
    {
    },
  • "PrivacySettings":
    {
    },
  • "SupportSettings":
    {
    },
  • "GitLabSettings":
    {
    },
  • "GoogleSettings":
    {
    },
  • "Office365Settings":
    {
    },
  • "LdapSettings":
    {
    },
  • "ComplianceSettings":
    {
    },
  • "LocalizationSettings":
    {
    },
  • "SamlSettings":
    {
    },
  • "NativeAppSettings":
    {
    },
  • "ClusterSettings":
    {
    },
  • "MetricsSettings":
    {
    },
  • "AnalyticsSettings":
    {
    }
}

Upload license file

Upload a license to enable enterprise features.

+

Minimum server version: 4.0

+
Permissions
+

Must have manage_system permission.

+
Authorizations:
Request Body schema: multipart/form-data
license
required
string <binary>

The license to be uploaded

+

Responses

201

License file upload successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
413

Content too large

+
post /license
http://your-mattermost-url.com/api/v4/license
https://your-mattermost-url.com/api/v4/license

Request samples

Copy
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())
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Remove license file

Remove the license file from the server. This will disable all enterprise features.

+

Minimum server version: 4.0

+
Permissions
+

Must have manage_system permission.

+
Authorizations:

Responses

200

License removal successful

+
401

No access token provided

+
403

Do not have appropriate permissions

+
delete /license
http://your-mattermost-url.com/api/v4/license
https://your-mattermost-url.com/api/v4/license

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Get client license

Get a subset of the server license needed by the client.

+
Permissions
+

No permission required but having the manage_system permission returns more information.

+
Authorizations:
query Parameters
format
required
string

Must be old, other formats not implemented yet

+

Responses

200

License retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
501

Feature is disabled

+
get /license/client
http://your-mattermost-url.com/api/v4/license/client
https://your-mattermost-url.com/api/v4/license/client

Request samples

Copy
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()
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Get audits

Get a page of audits for all users on the system, selected with page and per_page query parameters.

+
Permissions
+

Must have manage_system permission.

+
Authorizations:
query Parameters
page
integer
Default: 0

The page to select.

+
per_page
integer
Default: 60

The number of audits per page.

+

Responses

200

Audits retrieval successful

+
403

Do not have appropriate permissions

+
get /audits
http://your-mattermost-url.com/api/v4/audits
https://your-mattermost-url.com/api/v4/audits

Request samples

Copy
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, "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Invalidate all the caches

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.

+
Permissions
+

Must have manage_system permission.

+
Authorizations:

Responses

200

Caches invalidate successful

+
403

Do not have appropriate permissions

+
post /caches/invalidate
http://your-mattermost-url.com/api/v4/caches/invalidate
https://your-mattermost-url.com/api/v4/caches/invalidate

Request samples

Copy
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()
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Get logs

Get a page of server logs, selected with page and logs_per_page query parameters.

+
Permissions
+

Must have manage_system permission.

+
Authorizations:
query Parameters
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.

+

Responses

200

Logs retrieval successful

+
403

Do not have appropriate permissions

+
get /logs
http://your-mattermost-url.com/api/v4/logs
https://your-mattermost-url.com/api/v4/logs

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • "string"
]

Add log message

Add log messages to the server logs.

+
Permissions
+

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.

+
Authorizations:
Request Body schema: application/json
level
required
string

The error level, ERROR or DEBUG

+
message
required
string

Message to send to the server logs

+

Responses

200

Logs sent successful

+
403

Do not have appropriate permissions

+
post /logs
http://your-mattermost-url.com/api/v4/logs
https://your-mattermost-url.com/api/v4/logs

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "level": "string",
  • "message": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{ }

Get analytics

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

+
Permissions
+

Must have manage_system permission.

+
Authorizations:
query Parameters
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

+

Responses

200

Analytics retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /analytics/old
http://your-mattermost-url.com/api/v4/analytics/old
https://your-mattermost-url.com/api/v4/analytics/old

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Set the server busy (high load) flag

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

+
Permissions
+

Must have manage_system permission.

+
Authorizations:
query Parameters
seconds
string
Default: "3600"

Number of seconds until server is automatically marked as not busy.

+

Responses

200

Server busy flag set successfully

+
400

Invalid or missing parameters in URL or request body

+
403

Do not have appropriate permissions

+
post /server_busy
http://your-mattermost-url.com/api/v4/server_busy
https://your-mattermost-url.com/api/v4/server_busy

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Get server busy expiry time.

Gets the timestamp corresponding to when the server busy flag will be automatically cleared.

+

Minimum server version: 5.20

+
Permissions
+

Must have manage_system permission.

+
Authorizations:

Responses

200

Server busy expires timestamp retrieved successfully

+
403

Do not have appropriate permissions

+
get /server_busy
http://your-mattermost-url.com/api/v4/server_busy
https://your-mattermost-url.com/api/v4/server_busy

Request samples

Copy
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()
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "busy": true,
  • "expires": 0
}

Clears the server busy (high load) flag

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

+
Permissions
+

Must have manage_system permission.

+
Authorizations:

Responses

200

Server busy flag cleared successfully

+
403

Do not have appropriate permissions

+
delete /server_busy
http://your-mattermost-url.com/api/v4/server_busy
https://your-mattermost-url.com/api/v4/server_busy

Request samples

Copy
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()
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

brand

Endpoints related to custom branding and white-labeling. See our branding documentation for more information.

+

Get brand image

Get the previously uploaded brand image. Returns 404 if no brand image has been uploaded.

+
Permissions
+

No permission required.

+
Authorizations:

Responses

200

Brand image retrieval successful

+
404

Resource not found

+
501

Feature is disabled

+
get /brand/image
http://your-mattermost-url.com/api/v4/brand/image
https://your-mattermost-url.com/api/v4/brand/image

Request samples

Copy
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()
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
"string"

Upload brand image

Uploads a brand image.

+
Permissions
+

Must have manage_system permission.

+
Authorizations:
Request Body schema: multipart/form-data
image
required
string <binary>

The image to be uploaded

+

Responses

201

Brand image upload successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
413

Content too large

+
501

Feature is disabled

+
post /brand/image
http://your-mattermost-url.com/api/v4/brand/image
https://your-mattermost-url.com/api/v4/brand/image

Request samples

Copy
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())
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Delete current brand image

Deletes the previously uploaded brand image. Returns 404 if no brand image has been uploaded.

+
Permissions
+

Must have manage_system permission. +Minimum server version: 5.6

+
Authorizations:

Responses

200

Brand image succesfully deleted

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
delete /brand/image
http://your-mattermost-url.com/api/v4/brand/image
https://your-mattermost-url.com/api/v4/brand/image

Request samples

Copy
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()
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

OAuth

Endpoints for configuring and interacting with Mattermost as an OAuth 2.0 service provider.

+

Register OAuth app

Register an OAuth 2.0 client application with Mattermost as the service provider.

+
Permissions
+

Must have manage_oauth permission.

+
Authorizations:
Request Body schema: application/json

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 true to skip asking users for permission

+

Responses

201

App registration successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
post /oauth/apps
http://your-mattermost-url.com/api/v4/oauth/apps
https://your-mattermost-url.com/api/v4/oauth/apps

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "string",
  • "description": "string",
  • "icon_url": "string",
  • "callback_urls":
    [
    ],
  • "homepage": "string",
  • "is_trusted": true
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "client_secret": "string",
  • "name": "string",
  • "description": "string",
  • "icon_url": "string",
  • "callback_urls":
    [
    ],
  • "homepage": "string",
  • "is_trusted": true,
  • "create_at": 0,
  • "update_at": 0
}

Get OAuth apps

Get a page of OAuth 2.0 client applications registered with Mattermost.

+
Permissions
+

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.

+
Authorizations:
query Parameters
page
integer
Default: 0

The page to select.

+
per_page
integer
Default: 60

The number of apps per page.

+

Responses

200

OAuthApp list retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
get /oauth/apps
http://your-mattermost-url.com/api/v4/oauth/apps
https://your-mattermost-url.com/api/v4/oauth/apps

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get an OAuth app

Get an OAuth 2.0 client application registered with Mattermost.

+
Permissions
+

If app creator, must have mange_oauth permission otherwise manage_system_wide_oauth permission is required.

+
Authorizations:
path Parameters
app_id
required
string

Application client id

+

Responses

200

App retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
501

Feature is disabled

+
get /oauth/apps/{app_id}
http://your-mattermost-url.com/api/v4/oauth/apps/{app_id}
https://your-mattermost-url.com/api/v4/oauth/apps/{app_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "client_secret": "string",
  • "name": "string",
  • "description": "string",
  • "icon_url": "string",
  • "callback_urls":
    [
    ],
  • "homepage": "string",
  • "is_trusted": true,
  • "create_at": 0,
  • "update_at": 0
}

Update an OAuth app

Update an OAuth 2.0 client application based on OAuth struct.

+
Permissions
+

If app creator, must have mange_oauth permission otherwise manage_system_wide_oauth permission is required.

+
Authorizations:
path Parameters
app_id
required
string

Application client id

+
Request Body schema: application/json

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 true to skip asking users for permission. It will be set to false if value is not provided.

+

Responses

200

App update successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
501

Feature is disabled

+
put /oauth/apps/{app_id}
http://your-mattermost-url.com/api/v4/oauth/apps/{app_id}
https://your-mattermost-url.com/api/v4/oauth/apps/{app_id}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "name": "string",
  • "description": "string",
  • "icon_url": "string",
  • "callback_urls":
    [
    ],
  • "homepage": "string",
  • "is_trusted": true
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "client_secret": "string",
  • "name": "string",
  • "description": "string",
  • "icon_url": "string",
  • "callback_urls":
    [
    ],
  • "homepage": "string",
  • "is_trusted": true,
  • "create_at": 0,
  • "update_at": 0
}

Delete an OAuth app

Delete and unregister an OAuth 2.0 client application

+
Permissions
+

If app creator, must have mange_oauth permission otherwise manage_system_wide_oauth permission is required.

+
Authorizations:
path Parameters
app_id
required
string

Application client id

+

Responses

200

App deletion successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
501

Feature is disabled

+
delete /oauth/apps/{app_id}
http://your-mattermost-url.com/api/v4/oauth/apps/{app_id}
https://your-mattermost-url.com/api/v4/oauth/apps/{app_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Regenerate OAuth app secret

Regenerate the client secret for an OAuth 2.0 client application registered with Mattermost.

+
Permissions
+

If app creator, must have mange_oauth permission otherwise manage_system_wide_oauth permission is required.

+
Authorizations:
path Parameters
app_id
required
string

Application client id

+

Responses

200

Secret regeneration successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
501

Feature is disabled

+
post /oauth/apps/{app_id}/regen_secret
http://your-mattermost-url.com/api/v4/oauth/apps/{app_id}/regen_secret
https://your-mattermost-url.com/api/v4/oauth/apps/{app_id}/regen_secret

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "client_secret": "string",
  • "name": "string",
  • "description": "string",
  • "icon_url": "string",
  • "callback_urls":
    [
    ],
  • "homepage": "string",
  • "is_trusted": true,
  • "create_at": 0,
  • "update_at": 0
}

Get info on an OAuth app

Get public information about an OAuth 2.0 client application registered with Mattermost. The application's client secret will be blanked out.

+
Permissions
+

Must be authenticated.

+
Authorizations:
path Parameters
app_id
required
string

Application client id

+

Responses

200

App retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
404

Resource not found

+
501

Feature is disabled

+
get /oauth/apps/{app_id}/info
http://your-mattermost-url.com/api/v4/oauth/apps/{app_id}/info
https://your-mattermost-url.com/api/v4/oauth/apps/{app_id}/info

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "client_secret": "string",
  • "name": "string",
  • "description": "string",
  • "icon_url": "string",
  • "callback_urls":
    [
    ],
  • "homepage": "string",
  • "is_trusted": true,
  • "create_at": 0,
  • "update_at": 0
}

Get authorized OAuth apps

Get a page of OAuth 2.0 client applications authorized to access a user's account.

+
Permissions
+

Must be authenticated as the user or have edit_other_users permission.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+
query Parameters
page
integer
Default: 0

The page to select.

+
per_page
integer
Default: 60

The number of apps per page.

+

Responses

200

OAuthApp list retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
get /users/{user_id}/oauth/apps/authorized
http://your-mattermost-url.com/api/v4/users/{user_id}/oauth/apps/authorized
https://your-mattermost-url.com/api/v4/users/{user_id}/oauth/apps/authorized

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

SAML

Endpoints for configuring and interacting with SAML.

+

Get metadata

Get SAML metadata from the server. SAML must be configured properly.

+
Permissions
+

No permission required.

+
Authorizations:

Responses

200

SAML metadata retrieval successful

+
501

Feature is disabled

+
get /saml/metadata
http://your-mattermost-url.com/api/v4/saml/metadata
https://your-mattermost-url.com/api/v4/saml/metadata

Response samples

Content type
application/json
Copy
Expand all Collapse all
"string"

Upload IDP certificate

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.

+
Permissions
+

Must have manage_system permission.

+
Authorizations:
Request Body schema: multipart/form-data
certificate
required
string <binary>

The IDP certificate file

+

Responses

200

SAML certificate upload successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
post /saml/certificate/idp
http://your-mattermost-url.com/api/v4/saml/certificate/idp
https://your-mattermost-url.com/api/v4/saml/certificate/idp

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Remove IDP certificate

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.

+
Permissions
+

Must have manage_system permission.

+
Authorizations:

Responses

200

SAML certificate delete successful

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
delete /saml/certificate/idp
http://your-mattermost-url.com/api/v4/saml/certificate/idp
https://your-mattermost-url.com/api/v4/saml/certificate/idp

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Upload public certificate

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.

+
Permissions
+

Must have manage_system permission.

+
Authorizations:
Request Body schema: multipart/form-data
certificate
required
string <binary>

The public certificate file

+

Responses

200

SAML certificate upload successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
post /saml/certificate/public
http://your-mattermost-url.com/api/v4/saml/certificate/public
https://your-mattermost-url.com/api/v4/saml/certificate/public

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Remove public certificate

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.

+
Permissions
+

Must have manage_system permission.

+
Authorizations:

Responses

200

SAML certificate delete successful

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
delete /saml/certificate/public
http://your-mattermost-url.com/api/v4/saml/certificate/public
https://your-mattermost-url.com/api/v4/saml/certificate/public

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Upload private key

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.

+
Permissions
+

Must have manage_system permission.

+
Authorizations:
Request Body schema: multipart/form-data
certificate
required
string <binary>

The private key file

+

Responses

200

SAML certificate upload successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
post /saml/certificate/private
http://your-mattermost-url.com/api/v4/saml/certificate/private
https://your-mattermost-url.com/api/v4/saml/certificate/private

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Remove private key

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.

+
Permissions
+

Must have manage_system permission.

+
Authorizations:

Responses

200

SAML certificate delete successful

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
delete /saml/certificate/private
http://your-mattermost-url.com/api/v4/saml/certificate/private
https://your-mattermost-url.com/api/v4/saml/certificate/private

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Get certificate status

Get the status of the uploaded certificates and keys in use by your SAML configuration.

+
Permissions
+

Must have manage_system permission.

+
Authorizations:

Responses

200

SAML certificate status retrieval successful

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
get /saml/certificate/status
http://your-mattermost-url.com/api/v4/saml/certificate/status
https://your-mattermost-url.com/api/v4/saml/certificate/status

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "idp_certificate_file": true,
  • "public_certificate_file": true,
  • "private_key_file": true
}

LDAP

Endpoints for configuring and interacting with LDAP.

+

Sync with LDAP

Synchronize any user attribute changes in the configured AD/LDAP server with Mattermost.

+
Permissions
+

Must have manage_system permission.

+
Authorizations:

Responses

200

LDAP sync successful

+
501

Feature is disabled

+
post /ldap/sync
http://your-mattermost-url.com/api/v4/ldap/sync
https://your-mattermost-url.com/api/v4/ldap/sync

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Test LDAP configuration

Test the current AD/LDAP configuration to see if the AD/LDAP server can be contacted successfully.

+
Permissions
+

Must have manage_system permission.

+
Authorizations:

Responses

200

LDAP test successful

+
500

Something went wrong with the server

+
501

Feature is disabled

+
post /ldap/test
http://your-mattermost-url.com/api/v4/ldap/test
https://your-mattermost-url.com/api/v4/ldap/test

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

groups

Endpoints related to LDAP groups.

+

Get groups

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

+
Authorizations:
query Parameters
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 name and display_name field. Will return all groups whose name and display_name field match any of the text.

+
include_member_count
boolean

Boolean which adds the member_count attribute to each group JSON object

+
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

+

Responses

200

Group list retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
get /groups
http://your-mattermost-url.com/api/v4/groups
https://your-mattermost-url.com/api/v4/groups

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get a group

Get group from the provided group id string

+
Permissions
+

Must have manage_system permission.

+

Minimum server version: 5.11

+
Authorizations:
path Parameters
group_id
required
string

Group GUID

+

Responses

200

Group retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
get /groups/{group_id}
http://your-mattermost-url.com/api/v4/groups/{group_id}
https://your-mattermost-url.com/api/v4/groups/{group_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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
}

Patch a group

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.

+
Permissions
+

Must have manage_system permission.

+

Minimum server version: 5.11

+
Authorizations:
path Parameters
group_id
required
string

Group GUID

+
Request Body schema: application/json

Group object that is to be updated

+
name
string
display_name
string
description
string

Responses

200

Group patch successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
put /groups/{group_id}/patch
http://your-mattermost-url.com/api/v4/groups/{group_id}/patch
https://your-mattermost-url.com/api/v4/groups/{group_id}/patch

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "string",
  • "display_name": "string",
  • "description": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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

Link a team to a group

+
Permissions
+

Must have manage_team permission.

+

Minimum server version: 5.11

+
Authorizations:
path Parameters
group_id
required
string

Group GUID

+
team_id
required
string

Team GUID

+

Responses

201

Team successfully linked to group

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
post /groups/{group_id}/teams/{team_id}/link
http://your-mattermost-url.com/api/v4/groups/{group_id}/teams/{team_id}/link
https://your-mattermost-url.com/api/v4/groups/{group_id}/teams/{team_id}/link

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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

Delete a link from a team to a group

+
Permissions
+

Must have manage_team permission.

+

Minimum server version: 5.11

+
Authorizations:
path Parameters
group_id
required
string

Group GUID

+
team_id
required
string

Team GUID

+

Responses

200

Successfully deleted link between team and group

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
delete /groups/{group_id}/teams/{team_id}/link
http://your-mattermost-url.com/api/v4/groups/{group_id}/teams/{team_id}/link
https://your-mattermost-url.com/api/v4/groups/{group_id}/teams/{team_id}/link

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Link a channel to a group

Link a channel to a group

+
Permissions
+

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

+
Authorizations:
path Parameters
group_id
required
string

Group GUID

+
channel_id
required
string

Channel GUID

+

Responses

201

Channel successfully linked to group

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
post /groups/{group_id}/channels/{channel_id}/link
http://your-mattermost-url.com/api/v4/groups/{group_id}/channels/{channel_id}/link
https://your-mattermost-url.com/api/v4/groups/{group_id}/channels/{channel_id}/link

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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

Delete a link from a channel to a group

+
Permissions
+

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

+
Authorizations:
path Parameters
group_id
required
string

Group GUID

+
channel_id
required
string

Channel GUID

+

Responses

200

Successfully deleted link between channel and group

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
delete /groups/{group_id}/channels/{channel_id}/link
http://your-mattermost-url.com/api/v4/groups/{group_id}/channels/{channel_id}/link
https://your-mattermost-url.com/api/v4/groups/{group_id}/channels/{channel_id}/link

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Get GroupSyncable from Team ID

Get the GroupSyncable object with group_id and team_id from params

+
Permissions
+

Must have manage_system permission.

+

Minimum server version: 5.11

+
Authorizations:
path Parameters
group_id
required
string

Group GUID

+
team_id
required
string

Team GUID

+

Responses

200

GroupSyncable object retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
500

Something went wrong with the server

+
501

Feature is disabled

+
get /groups/{group_id}/teams/{team_id}
http://your-mattermost-url.com/api/v4/groups/{group_id}/teams/{team_id}
https://your-mattermost-url.com/api/v4/groups/{group_id}/teams/{team_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "team_id": "string",
  • "group_id": "string",
  • "auto_add": true,
  • "create_at": 0,
  • "delete_at": 0,
  • "update_at": 0
}

Get GroupSyncable from channel ID

Get the GroupSyncable object with group_id and channel_id from params

+
Permissions
+

Must have manage_system permission.

+

Minimum server version: 5.11

+
Authorizations:
path Parameters
group_id
required
string

Group GUID

+
channel_id
required
string

Channel GUID

+

Responses

200

GroupSyncable object retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
500

Something went wrong with the server

+
501

Feature is disabled

+
get /groups/{group_id}/channels/{channel_id}
http://your-mattermost-url.com/api/v4/groups/{group_id}/channels/{channel_id}
https://your-mattermost-url.com/api/v4/groups/{group_id}/channels/{channel_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "channel_id": "string",
  • "group_id": "string",
  • "auto_add": true,
  • "create_at": 0,
  • "delete_at": 0,
  • "update_at": 0
}

Get group teams

Retrieve the list of teams associated to the group

+
Permissions
+

Must have manage_system permission.

+

Minimum server version: 5.11

+
Authorizations:
path Parameters
group_id
required
string

Group GUID

+

Responses

200

Teams list retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
500

Something went wrong with the server

+
501

Feature is disabled

+
get /groups/{group_id}/teams
http://your-mattermost-url.com/api/v4/groups/{group_id}/teams
https://your-mattermost-url.com/api/v4/groups/{group_id}/teams

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get group channels

Retrieve the list of channels associated to the group

+
Permissions
+

Must have manage_system permission.

+

Minimum server version: 5.11

+
Authorizations:
path Parameters
group_id
required
string

Group GUID

+

Responses

200

Channel list retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
500

Something went wrong with the server

+
501

Feature is disabled

+
get /groups/{group_id}/channels
http://your-mattermost-url.com/api/v4/groups/{group_id}/channels
https://your-mattermost-url.com/api/v4/groups/{group_id}/channels

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Patch a GroupSyncable associated to Team

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.

+
Permissions
+

Must have manage_system permission.

+

Minimum server version: 5.11

+
Authorizations:
path Parameters
group_id
required
string

Group GUID

+
team_id
required
string

Team GUID

+
Request Body schema: application/json

GroupSyncable object that is to be updated

+
auto_add
boolean

Responses

200

GroupSyncable patch successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
put /groups/{group_id}/teams/{team_id}/patch
http://your-mattermost-url.com/api/v4/groups/{group_id}/teams/{team_id}/patch
https://your-mattermost-url.com/api/v4/groups/{group_id}/teams/{team_id}/patch

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "auto_add": true
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "team_id": "string",
  • "group_id": "string",
  • "auto_add": true,
  • "create_at": 0,
  • "delete_at": 0,
  • "update_at": 0
}

Patch a GroupSyncable associated to Channel

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.

+
Permissions
+

Must have manage_system permission.

+

Minimum server version: 5.11

+
Authorizations:
path Parameters
group_id
required
string

Group GUID

+
channel_id
required
string

Channel GUID

+
Request Body schema: application/json

GroupSyncable object that is to be updated

+
auto_add
boolean

Responses

200

GroupSyncable patch successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
put /groups/{group_id}/channels/{channel_id}/patch
http://your-mattermost-url.com/api/v4/groups/{group_id}/channels/{channel_id}/patch
https://your-mattermost-url.com/api/v4/groups/{group_id}/channels/{channel_id}/patch

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "auto_add": true
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "channel_id": "string",
  • "group_id": "string",
  • "auto_add": true,
  • "create_at": 0,
  • "delete_at": 0,
  • "update_at": 0
}

Get group users

Retrieve the list of users associated with a given group.

+
Permissions
+

Must have manage_system permission.

+

Minimum server version: 5.11

+
Authorizations:
path Parameters
group_id
required
string

Group GUID

+
query Parameters
page
integer
Default: 0

The page to select.

+
per_page
integer
Default: 60

The number of groups per page.

+

Responses

200

User list retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
500

Something went wrong with the server

+
501

Feature is disabled

+
get /groups/{group_id}/members
http://your-mattermost-url.com/api/v4/groups/{group_id}/members
https://your-mattermost-url.com/api/v4/groups/{group_id}/members

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "members":
    [
    ],
  • "total_member_count": 0
}

Get channel groups

Retrieve the list of groups associated with a given channel.

+
Permissions
+

Must have manage_system permission.

+

Minimum server version: 5.11

+
Authorizations:
path Parameters
channel_id
required
string

Channel GUID

+
query Parameters
page
integer
Default: 0

The page to select.

+
per_page
integer
Default: 60

The number of groups per page.

+

Responses

200

Group list retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
500

Something went wrong with the server

+
501

Feature is disabled

+
get /channels/{channel_id}/groups
http://your-mattermost-url.com/api/v4/channels/{channel_id}/groups
https://your-mattermost-url.com/api/v4/channels/{channel_id}/groups

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get team groups

Retrieve the list of groups associated with a given team.

+
Permissions
+

Must have manage_system permission.

+

Minimum server version: 5.11

+
Authorizations:
path Parameters
team_id
required
string

Team GUID

+
query Parameters
page
integer
Default: 0

The page to select.

+
per_page
integer
Default: 60

The number of groups per page.

+

Responses

200

Group list retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
500

Something went wrong with the server

+
501

Feature is disabled

+
get /teams/{team_id}/groups
http://your-mattermost-url.com/api/v4/teams/{team_id}/groups
https://your-mattermost-url.com/api/v4/teams/{team_id}/groups

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

compliance

Endpoints for creating, getting and downloading compliance reports.

+

Create report

Create and save a compliance report.

+
Permissions
+

Must have manage_system permission.

+
Authorizations:

Responses

201

Compliance report creation successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
post /compliance/reports
http://your-mattermost-url.com/api/v4/compliance/reports
https://your-mattermost-url.com/api/v4/compliance/reports

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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 reports

Get a list of compliance reports previously created by page, selected with page and per_page query parameters.

+
Permissions
+

Must have manage_system permission.

+
Authorizations:
query Parameters
page
integer
Default: 0

The page to select.

+
per_page
integer
Default: 60

The number of reports per page.

+

Responses

200

Compliance reports retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
get /compliance/reports
http://your-mattermost-url.com/api/v4/compliance/reports
https://your-mattermost-url.com/api/v4/compliance/reports

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get a report

Get a compliance reports previously created.

+
Permissions
+

Must have manage_system permission.

+
Authorizations:
path Parameters
report_id
required
string

Compliance report GUID

+

Responses

200

Compliance report retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
get /compliance/reports/{report_id}
http://your-mattermost-url.com/api/v4/compliance/reports/{report_id}
https://your-mattermost-url.com/api/v4/compliance/reports/{report_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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 a report

Download the full contents of a report as a file.

+
Permissions
+

Must have manage_system permission.

+
Authorizations:
path Parameters
report_id
required
string

Compliance report GUID

+

Responses

200

The compliance report file

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
get /compliance/reports/{report_id}/download
http://your-mattermost-url.com/api/v4/compliance/reports/{report_id}/download
https://your-mattermost-url.com/api/v4/compliance/reports/{report_id}/download

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

cluster

Endpoints for configuring and interacting with high availability clusters.

+

Get cluster status

Get a set of information for each node in the cluster, useful for checking the status and health of each node.

+
Permissions
+

Must have manage_system permission.

+
Authorizations:

Responses

200

Cluster status retrieval successful

+
403

Do not have appropriate permissions

+
get /cluster/status
http://your-mattermost-url.com/api/v4/cluster/status
https://your-mattermost-url.com/api/v4/cluster/status

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

elasticsearch

Endpoints for configuring and interacting with Elasticsearch.

+

Test Elasticsearch configuration

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

+
Permissions
+

Must have manage_system permission.

+
Authorizations:

Responses

200

Elasticsearch test successful

+
400

Invalid or missing parameters in URL or request body

+
500

Something went wrong with the server

+
501

Feature is disabled

+
post /elasticsearch/test
http://your-mattermost-url.com/api/v4/elasticsearch/test
https://your-mattermost-url.com/api/v4/elasticsearch/test

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Purge all Elasticsearch indexes

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

+
Permissions
+

Must have manage_system permission.

+
Authorizations:

Responses

200

Indexes purged successfully.

+
500

Something went wrong with the server

+
501

Feature is disabled

+
post /elasticsearch/purge_indexes
http://your-mattermost-url.com/api/v4/elasticsearch/purge_indexes
https://your-mattermost-url.com/api/v4/elasticsearch/purge_indexes

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

dataretention

Endpoint for getting data retention policy settings.

+

Get the data retention policy details.

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

+
Permissions
+

Requires an active session but no other permissions.

+
Authorizations:

Responses

200

Data retention policy details retrieved successfully.

+
500

Something went wrong with the server

+
501

Feature is disabled

+
get /data_retention/policy
http://your-mattermost-url.com/api/v4/data_retention/policy
https://your-mattermost-url.com/api/v4/data_retention/policy

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message_deletion_enabled": true,
  • "file_deletion_enabled": true,
  • "message_retention_cutoff": 0,
  • "file_retention_cutoff": 0
}

jobs

Endpoints related to various background jobs that can be run by the server or separately by job servers.

+

Get the jobs.

Get a page of jobs. Use the query parameters to modify the behaviour of this endpoint. +Minimum server version: 4.1

+
Permissions
+

Must have manage_jobs permission.

+
Authorizations:
query Parameters
page
integer
Default: 0

The page to select.

+
per_page
integer
Default: 60

The number of jobs per page.

+

Responses

200

Job list retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /jobs
http://your-mattermost-url.com/api/v4/jobs
https://your-mattermost-url.com/api/v4/jobs

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Create a new job.

Create a new job. +Minimum server version: 4.1

+
Permissions
+

Must have manage_jobs permission.

+
Authorizations:
Request Body schema: application/json

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

+

Responses

201

Job creation successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /jobs
http://your-mattermost-url.com/api/v4/jobs
https://your-mattermost-url.com/api/v4/jobs

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "type": "string",
  • "data": { }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "type": "string",
  • "create_at": 0,
  • "start_at": 0,
  • "last_activity_at": 0,
  • "status": "string",
  • "progress": 0,
  • "data": { }
}

Get a job.

Gets a single job. +Minimum server version: 4.1

+
Permissions
+

Must have manage_jobs permission.

+
Authorizations:
path Parameters
job_id
required
string

Job GUID

+

Responses

200

Job retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
get /jobs/{job_id}
http://your-mattermost-url.com/api/v4/jobs/{job_id}
https://your-mattermost-url.com/api/v4/jobs/{job_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "type": "string",
  • "create_at": 0,
  • "start_at": 0,
  • "last_activity_at": 0,
  • "status": "string",
  • "progress": 0,
  • "data": { }
}

Cancel a job.

Cancel a job. +Minimum server version: 4.1

+
Permissions
+

Must have manage_jobs permission.

+
Authorizations:
path Parameters
job_id
required
string

Job GUID

+

Responses

200

Job canceled successfully

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
post /jobs/{job_id}/cancel
http://your-mattermost-url.com/api/v4/jobs/{job_id}/cancel
https://your-mattermost-url.com/api/v4/jobs/{job_id}/cancel

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Get the jobs of the given type.

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

+
Permissions
+

Must have manage_jobs permission.

+
Authorizations:
path Parameters
type
required
string

Job type

+
query Parameters
page
integer
Default: 0

The page to select.

+
per_page
integer
Default: 60

The number of jobs per page.

+

Responses

200

Job list retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /jobs/type/{type}
http://your-mattermost-url.com/api/v4/jobs/type/{type}
https://your-mattermost-url.com/api/v4/jobs/type/{type}

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

plugins

Endpoints related to uploading and managing plugins.

+

Upload plugin

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.

+
Permissions
+

Must have manage_system permission.

+

Minimum server version: 4.4

+
Authorizations:
Request Body schema: multipart/form-data
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

+

Responses

201

Plugin upload successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
413

Content too large

+
501

Feature is disabled

+
post /plugins
http://your-mattermost-url.com/api/v4/plugins
https://your-mattermost-url.com/api/v4/plugins

Request samples

Copy
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))
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Get plugins

Get a list of inactive and a list of active plugin manifests. Plugins must be enabled in the server's config settings.

+
Permissions
+

Must have manage_system permission.

+

Minimum server version: 4.4

+
Authorizations:

Responses

200

Plugins retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
get /plugins
http://your-mattermost-url.com/api/v4/plugins
https://your-mattermost-url.com/api/v4/plugins

Request samples

Copy
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()
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "active":
    [
    ],
  • "inactive":
    [
    ]
}

Install plugin from url

Supply a URL to a plugin compressed in a .tar.gz file. Plugins must be enabled in the server's config settings.

+
Permissions
+

Must have manage_system permission.

+

Minimum server version: 5.14

+
Authorizations:
query Parameters
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

+

Responses

201

Plugin install successful

+
400

Invalid or missing parameters in URL or request body

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
post /plugins/install_from_url
http://your-mattermost-url.com/api/v4/plugins/install_from_url
https://your-mattermost-url.com/api/v4/plugins/install_from_url

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Remove plugin

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.

+
Permissions
+

Must have manage_system permission.

+

Minimum server version: 4.4

+
Authorizations:
path Parameters
plugin_id
required
string

Responses

200

Plugin removed successfully

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
501

Feature is disabled

+
delete /plugins/{plugin_id}
http://your-mattermost-url.com/api/v4/plugins/{plugin_id}
https://your-mattermost-url.com/api/v4/plugins/{plugin_id}

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Enable plugin

Enable a previously uploaded plugin. Plugins must be enabled in the server's config settings.

+
Permissions
+

Must have manage_system permission.

+

Minimum server version: 4.4

+
Authorizations:
path Parameters
plugin_id
required
string

Responses

200

Plugin enabled successfully

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
501

Feature is disabled

+
post /plugins/{plugin_id}/enable
http://your-mattermost-url.com/api/v4/plugins/{plugin_id}/enable
https://your-mattermost-url.com/api/v4/plugins/{plugin_id}/enable

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Disable plugin

Disable a previously enabled plugin. Plugins must be enabled in the server's config settings.

+
Permissions
+

Must have manage_system permission.

+

Minimum server version: 4.4

+
Authorizations:
path Parameters
plugin_id
required
string

Responses

200

Plugin disabled successfully

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
501

Feature is disabled

+
post /plugins/{plugin_id}/disable
http://your-mattermost-url.com/api/v4/plugins/{plugin_id}/disable
https://your-mattermost-url.com/api/v4/plugins/{plugin_id}/disable

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Get webapp plugins

Get a list of web app plugins installed and activated on the server.

+
Permissions
+

No permissions required.

+

Minimum server version: 4.4

+
Authorizations:

Responses

200

Plugin deactivated successfully

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
get /plugins/webapp
http://your-mattermost-url.com/api/v4/plugins/webapp
https://your-mattermost-url.com/api/v4/plugins/webapp

Request samples

Copy
import "github.com/mattermost/mattermost-server/model"
+
+Client := model.NewAPIv4Client("https://your-mattermost-url.com")
+
+manifests, resp := Client.GetWebappPlugins()
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Installs a marketplace plugin

Installs a plugin listed in the marketplace server.

+
Permissions
+

Must have manage_system permission.

+

Minimum server version: 5.16

+
Authorizations:
Request Body schema: application/json

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.

+

Responses

200

Plugin installed successfully

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
501

Feature is disabled

+
post /plugins/marketplace
http://your-mattermost-url.com/api/v4/plugins/marketplace
https://your-mattermost-url.com/api/v4/plugins/marketplace

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "version": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

Gets all the marketplace plugins

Gets all plugins from the marketplace server, merging data from locally installed plugins as well as prepackaged plugins shipped with the server.

+
Permissions
+

Must have manage_system permission.

+

Minimum server version: 5.16

+
Authorizations:
query Parameters
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.

+

Responses

200

Plugins retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
get /plugins/marketplace
http://your-mattermost-url.com/api/v4/plugins/marketplace
https://your-mattermost-url.com/api/v4/plugins/marketplace

Request samples

Copy
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)
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status_code": 0,
  • "id": "string",
  • "message": "string",
  • "request_id": "string"
}

roles

Endpoints for creating, getting and updating roles.

+

Get a role

Get a role from the provided role id.

+
Permissions
+

Requires an active session but no other permissions.

+

Minimum server version: 4.9

+
Authorizations:
path Parameters
role_id
required
string

Role GUID

+

Responses

200

Role retrieval successful

+
401

No access token provided

+
404

Resource not found

+
get /roles/{role_id}
http://your-mattermost-url.com/api/v4/roles/{role_id}
https://your-mattermost-url.com/api/v4/roles/{role_id}

Request samples

Copy
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>, "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "name": "string",
  • "display_name": "string",
  • "description": "string",
  • "permissions":
    [
    ],
  • "scheme_managed": true
}

Get a role

Get a role from the provided role name.

+
Permissions
+

Requires an active session but no other permissions.

+

Minimum server version: 4.9

+
Authorizations:
path Parameters
role_name
required
string

Role Name

+

Responses

200

Role retrieval successful

+
401

No access token provided

+
404

Resource not found

+
get /roles/name/{role_name}
http://your-mattermost-url.com/api/v4/roles/name/{role_name}
https://your-mattermost-url.com/api/v4/roles/name/{role_name}

Request samples

Copy
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>, "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "name": "string",
  • "display_name": "string",
  • "description": "string",
  • "permissions":
    [
    ],
  • "scheme_managed": true
}

Patch a role

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.

+
Permissions
+

manage_system permission is required.

+

Minimum server version: 4.9

+
Authorizations:
path Parameters
role_id
required
string

Role GUID

+
Request Body schema: application/json

Role object to be updated

+
permissions
Array of strings

The permissions the role should grant.

+

Responses

200

Role patch successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
put /roles/{role_id}/patch
http://your-mattermost-url.com/api/v4/roles/{role_id}/patch
https://your-mattermost-url.com/api/v4/roles/{role_id}/patch

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "permissions":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "name": "string",
  • "display_name": "string",
  • "description": "string",
  • "permissions":
    [
    ],
  • "scheme_managed": true
}

Get a list of roles by name

Get a list of roles from their names.

+
Permissions
+

Requires an active session but no other permissions.

+

Minimum server version: 4.9

+
Authorizations:
Request Body schema: application/json

List of role names

+
Array
string

Responses

200

Role list retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
404

Resource not found

+
post /roles/names
http://your-mattermost-url.com/api/v4/roles/names
https://your-mattermost-url.com/api/v4/roles/names

Request samples

Content type
application/json
Copy
Expand all Collapse all
[
  • "string"
]

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

schemes

Endpoints for creating, getting and updating and deleting schemes.

+

Get the schemes.

Get a page of schemes. Use the query parameters to modify the behaviour of this endpoint.

+
Permissions
+

Must have manage_system permission.

+

Minimum server version: 5.0

+
Authorizations:
query Parameters
scope
string
Default: ""

Limit the results returned to the provided scope, either team or channel.

+
page
integer
Default: 0

The page to select.

+
per_page
integer
Default: 60

The number of schemes per page.

+

Responses

200

Scheme list retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
get /schemes
http://your-mattermost-url.com/api/v4/schemes
https://your-mattermost-url.com/api/v4/schemes

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Create a scheme

Create a new scheme.

+
Permissions
+

Must have manage_system permission.

+

Minimum server version: 5.0

+
Authorizations:
Request Body schema: application/json

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")

+

Responses

201

Scheme creation successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
post /schemes
http://your-mattermost-url.com/api/v4/schemes
https://your-mattermost-url.com/api/v4/schemes

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "string",
  • "description": "string",
  • "scope": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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

Get a scheme from the provided scheme id.

+
Permissions
+

Must have manage_system permission.

+

Minimum server version: 5.0

+
Authorizations:
path Parameters
scheme_id
required
string

Scheme GUID

+

Responses

200

Scheme retrieval successful

+
401

No access token provided

+
404

Resource not found

+
501

Feature is disabled

+
get /schemes/{scheme_id}
http://your-mattermost-url.com/api/v4/schemes/{scheme_id}
https://your-mattermost-url.com/api/v4/schemes/{scheme_id}

Request samples

Copy
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>, "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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"
}

Delete a scheme

Soft deletes a scheme, by marking the scheme as deleted in the database.

+
Permissions
+

Must have manage_system permission.

+

Minimum server version: 5.0

+
Authorizations:
path Parameters
scheme_id
required
string

ID of the scheme to delete

+

Responses

200

Scheme deletion successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
501

Feature is disabled

+
delete /schemes/{scheme_id}
http://your-mattermost-url.com/api/v4/schemes/{scheme_id}
https://your-mattermost-url.com/api/v4/schemes/{scheme_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Patch a scheme

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.

+
Permissions
+

manage_system permission is required.

+

Minimum server version: 5.0

+
Authorizations:
path Parameters
scheme_id
required
string

Scheme GUID

+
Request Body schema: application/json

Scheme object to be updated

+
name
string

The human readable name of the scheme

+
description
string

The description of the scheme

+

Responses

200

Scheme patch successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
501

Feature is disabled

+
put /schemes/{scheme_id}/patch
http://your-mattermost-url.com/api/v4/schemes/{scheme_id}/patch
https://your-mattermost-url.com/api/v4/schemes/{scheme_id}/patch

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "string",
  • "description": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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.

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.

+
Permissions
+

manage_system permission is required.

+

Minimum server version: 5.0

+
Authorizations:
path Parameters
scheme_id
required
string

Scheme GUID

+
query Parameters
page
integer
Default: 0

The page to select.

+
per_page
integer
Default: 60

The number of teams per page.

+

Responses

200

Team list retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
get /schemes/{scheme_id}/teams
http://your-mattermost-url.com/api/v4/schemes/{scheme_id}/teams
https://your-mattermost-url.com/api/v4/schemes/{scheme_id}/teams

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get a page of channels which use this scheme.

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.

+
Permissions
+

manage_system permission is required.

+

Minimum server version: 5.0

+
Authorizations:
path Parameters
scheme_id
required
string

Scheme GUID

+
query Parameters
page
integer
Default: 0

The page to select.

+
per_page
integer
Default: 60

The number of channels per page.

+

Responses

200

Channel list retrieval successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
404

Resource not found

+
get /schemes/{scheme_id}/channels
http://your-mattermost-url.com/api/v4/schemes/{scheme_id}/channels
https://your-mattermost-url.com/api/v4/schemes/{scheme_id}/channels

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

integration_actions

Endpoints for interactive actions for use by integrations.

+

Open a dialog

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

+
Authorizations:
Request Body schema: application/json

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

+

Responses

200

Dialog open successful

+
400

Invalid or missing parameters in URL or request body

+
post /actions/dialogs/open
http://your-mattermost-url.com/api/v4/actions/dialogs/open
https://your-mattermost-url.com/api/v4/actions/dialogs/open

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "trigger_id": "string",
  • "url": "string",
  • "dialog":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Submit a dialog

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

+
Authorizations:
Request Body schema: application/json

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

+

Responses

200

Dialog submission successful

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /actions/dialogs/submit
http://your-mattermost-url.com/api/v4/actions/dialogs/submit
https://your-mattermost-url.com/api/v4/actions/dialogs/submit

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "url": "string",
  • "channel_id": "string",
  • "team_id": "string",
  • "submission": { },
  • "callback_id": "string",
  • "state": "string",
  • "cancelled": true
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

terms of service

Endpoints for getting and updating custom terms of service.

+

Records user action when they accept or decline custom terms of service

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

+
Permissions
+

Must be logged in as the user being acted on.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+
Request Body schema: application/json

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.

+

Responses

200

Terms of service action recorded successfully

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
403

Do not have appropriate permissions

+
post /users/{user_id}/terms_of_service
http://your-mattermost-url.com/api/v4/users/{user_id}/terms_of_service
https://your-mattermost-url.com/api/v4/users/{user_id}/terms_of_service

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "serviceTermsId": "string",
  • "accepted": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "string"
}

Fetches user's latest terms of service action if the latest action was for acceptance.

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

+
Permissions
+

Must be logged in as the user being acted on.

+
Authorizations:
path Parameters
user_id
required
string

User GUID

+

Responses

200

User's accepted terms of service action

+
400

Invalid or missing parameters in URL or request body

+
401

No access token provided

+
404

User hasn't performed an action or the latest action was a rejection.

+
get /users/{user_id}/terms_of_service
http://your-mattermost-url.com/api/v4/users/{user_id}/terms_of_service
https://your-mattermost-url.com/api/v4/users/{user_id}/terms_of_service

Request samples

Copy
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, "")
+

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "user_id": "string",
  • "terms_of_service_id": "string",
  • "create_at": 0
}
+ + + + diff --git a/api/v4/html/ssr_template.hbs b/api/v4/html/ssr_template.hbs new file mode 100644 index 0000000000..298d372dac --- /dev/null +++ b/api/v4/html/ssr_template.hbs @@ -0,0 +1,30 @@ + + + + + + Mattermost API Reference + + + + + {{{redocHead}}} + {{#unless disableGoogleFont}}{{/unless}} + + + + {{{redocHTML}}} + + + diff --git a/api/v4/html/static/favicon.ico b/api/v4/html/static/favicon.ico new file mode 100644 index 0000000000..178f1c5672 Binary files /dev/null and b/api/v4/html/static/favicon.ico differ diff --git a/api/v4/source/actions.yaml b/api/v4/source/actions.yaml new file mode 100644 index 0000000000..f38065f461 --- /dev/null +++ b/api/v4/source/actions.yaml @@ -0,0 +1,133 @@ + /api/v4/actions/dialogs/open: + post: + tags: + - integration_actions + summary: Open a dialog + description: > + 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__ + operationId: OpenInteractiveDialog + requestBody: + content: + application/json: + schema: + type: object + required: + - trigger_id + - url + - dialog + properties: + trigger_id: + type: string + description: Trigger ID provided by other action + url: + type: string + description: The URL to send the submitted dialog payload to + dialog: + type: object + required: + - title + - elements + description: Post object to create + properties: + callback_id: + type: string + description: Set an ID that will be included when the dialog is + submitted + title: + type: string + description: Title of the dialog + introduction_text: + type: string + description: Markdown formatted introductory paragraph + elements: + type: array + description: Input elements, see + https://docs.mattermost.com/developer/interactive-dialogs.html#elements + items: + type: object + submit_label: + type: string + description: Label on the submit button + notify_on_cancel: + type: boolean + description: Set true to receive payloads when user cancels a dialog + state: + type: string + description: Set some state to be echoed back with the dialog + submission + description: Metadata for the dialog to be opened + required: true + responses: + "200": + description: Dialog open successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + /api/v4/actions/dialogs/submit: + post: + tags: + - integration_actions + summary: Submit a dialog + description: > + 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__ + operationId: SubmitInteractiveDialog + requestBody: + content: + application/json: + schema: + type: object + required: + - url + - submission + - channel_id + - team_id + properties: + url: + type: string + description: The URL to send the submitted dialog payload to + channel_id: + type: string + description: Channel ID the user submitted the dialog from + team_id: + type: string + description: Team ID the user submitted the dialog from + submission: + type: object + description: String map where keys are element names and values are the + element input values + callback_id: + type: string + description: Callback ID sent when the dialog was opened + state: + type: string + description: State sent when the dialog was opened + cancelled: + type: boolean + description: Set to true if the dialog was cancelled + description: Dialog submission data + required: true + responses: + "200": + description: Dialog submission successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" diff --git a/api/v4/source/bleve.yaml b/api/v4/source/bleve.yaml new file mode 100644 index 0000000000..35ce63b2c9 --- /dev/null +++ b/api/v4/source/bleve.yaml @@ -0,0 +1,28 @@ + /api/v4/bleve/purge_indexes: + post: + tags: + - bleve + summary: Purge all Bleve indexes + description: > + Deletes all Bleve indexes and their contents. After calling this + endpoint, it is + + necessary to schedule a new Bleve indexing job to repopulate the indexes. + + __Minimum server version__: 5.24 + + ##### Permissions + + Must have `sysconsole_write_experimental` permission. + operationId: PurgeBleveIndexes + responses: + "200": + description: Indexes purged successfully. + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" diff --git a/api/v4/source/bots.yaml b/api/v4/source/bots.yaml new file mode 100644 index 0000000000..d63b22001e --- /dev/null +++ b/api/v4/source/bots.yaml @@ -0,0 +1,800 @@ + /api/v4/bots: + post: + tags: + - bots + summary: Create a bot + description: | + Create a new bot account on the system. Username is required. + ##### Permissions + Must have `create_bot` permission. + __Minimum server version__: 5.10 + operationId: CreateBot + requestBody: + description: Bot to be created + required: true + content: + application/json: + schema: + type: object + required: + - username + properties: + username: + type: string + display_name: + type: string + description: + type: string + responses: + "201": + description: Bot creation successful + content: + application/json: + schema: + $ref: "#/components/schemas/Bot" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $resp = $driver->getBotModel()->createBot([ + "username" => "userbot", + "display_name" => "AwesomeBot", + "description" => "test bot" + ]); + + if ($resp->getStatusCode() == 200) { + $createdBot = json_decode($resp->getBody()); + } + get: + tags: + - bots + summary: Get bots + description: > + Get a page of a list of bots. + + ##### Permissions + + 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 + operationId: GetBots + parameters: + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of users per page. There is a maximum limit of 200 users + per page. + schema: + type: integer + default: 60 + - name: include_deleted + in: query + description: If deleted bots should be returned. + schema: + type: boolean + - name: only_orphaned + in: query + description: When true, only orphaned bots will be returned. A bot is consitered + orphaned if it's owner has been deactivated. + schema: + type: boolean + responses: + "200": + description: Bot page retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Bot" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $resp = $driver->getBotModel()->getBots([ + "page" => 0, + "per_page" => 60, + "include_deleted" => true, + "only_orphaned" => true, + ]); + + if ($resp->getStatusCode() == 200) { + $bots = json_decode($resp->getBody()); + } + "/api/v4/bots/{bot_user_id}": + put: + tags: + - bots + summary: Patch a bot + description: > + 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. + + ##### Permissions + + Must have `manage_bots` permission. + + __Minimum server version__: 5.10 + operationId: PatchBot + parameters: + - name: bot_user_id + in: path + description: Bot user ID + required: true + schema: + type: string + requestBody: + description: Bot to be created + required: true + content: + application/json: + schema: + type: object + required: + - username + properties: + username: + type: string + display_name: + type: string + description: + type: string + responses: + "200": + description: Bot patch successful + content: + application/json: + schema: + $ref: "#/components/schemas/Bot" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $botUserID = "4xp9fdt77pncbef59f4k1qe83o"; + + $resp = $driver->getBotModel()->patchBot($botUserID, [ + "username" => "userbot2", + "display_name" => "AwesomeBot2", + "description" => "test bot2" + ]); + + if ($resp->getStatusCode() == 200) { + $bot = json_decode($resp->getBody()); + } + get: + tags: + - bots + summary: Get a bot + description: > + Get a bot specified by its bot id. + + ##### Permissions + + 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 + operationId: GetBot + parameters: + - name: bot_user_id + in: path + description: Bot user ID + required: true + schema: + type: string + - name: include_deleted + in: query + description: If deleted bots should be returned. + schema: + type: boolean + responses: + "200": + description: Bot successfully retrieved. + content: + application/json: + schema: + $ref: "#/components/schemas/Bot" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $botUserID = "4xp9fdt77pncbef59f4k1qe83o"; + + $resp = $driver->getBotModel()->getBot($botUserID, [ + "include_deleted" => true, + ]); + + if ($resp->getStatusCode() == 200) { + $bot = json_decode($resp->getBody()); + } + "/api/v4/bots/{bot_user_id}/disable": + post: + tags: + - bots + summary: Disable a bot + description: | + Disable a bot. + ##### Permissions + Must have `manage_bots` permission. + __Minimum server version__: 5.10 + operationId: DisableBot + parameters: + - name: bot_user_id + in: path + description: Bot user ID + required: true + schema: + type: string + responses: + "200": + description: Bot successfully disabled. + content: + application/json: + schema: + $ref: "#/components/schemas/Bot" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $botUserID = "4xp9fdt77pncbef59f4k1qe83o"; + + $resp = $driver->getBotModel()->disableBot($botUserID); + + if ($resp->getStatusCode() == 200) { + $disabledBot = json_decode($resp->getBody()); + } + "/api/v4/bots/{bot_user_id}/enable": + post: + tags: + - bots + summary: Enable a bot + description: | + Enable a bot. + ##### Permissions + Must have `manage_bots` permission. + __Minimum server version__: 5.10 + operationId: EnableBot + parameters: + - name: bot_user_id + in: path + description: Bot user ID + required: true + schema: + type: string + responses: + "200": + description: Bot successfully enabled. + content: + application/json: + schema: + $ref: "#/components/schemas/Bot" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $botUserID = "4xp9fdt77pncbef59f4k1qe83o"; + + $resp = $driver->getBotModel()->enableBot($botUserID); + + if ($resp->getStatusCode() == 200) { + $enabledBot = json_decode($resp->getBody()); + } + "/api/v4/bots/{bot_user_id}/assign/{user_id}": + post: + tags: + - bots + summary: Assign a bot to a user + description: | + Assign a bot to a specified user. + ##### Permissions + Must have `manage_bots` permission. + __Minimum server version__: 5.10 + operationId: AssignBot + parameters: + - name: bot_user_id + in: path + description: Bot user ID + required: true + schema: + type: string + - name: user_id + in: path + description: The user ID to assign the bot to. + required: true + schema: + type: string + responses: + "200": + description: Bot successfully assigned. + content: + application/json: + schema: + $ref: "#/components/schemas/Bot" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $botUserID = "4xp9fdt77pncbef59f4k1qe83o"; + $userID = "adWv1qPZmHdtxk7Lmqh6RtxWxS"; + + $resp = $driver->getBotModel()->assignBotToUser($botUserID, $userID); + + if ($resp->getStatusCode() == 200) { + $assignedBot = json_decode($resp->getBody()); + } + "/api/v4/bots/{bot_user_id}/icon": + get: + tags: + - bots + summary: Get bot's LHS icon + description: | + Get a bot's LHS icon image based on bot_user_id string parameter. + ##### Permissions + Must be logged in. + __Minimum server version__: 5.14 + operationId: GetBotIconImage + parameters: + - name: bot_user_id + in: path + description: Bot user ID + required: true + schema: + type: string + responses: + "200": + description: Bot's LHS icon image + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + botUserID := "4xp9fdt77pncbef59f4k1qe83o" + + data, resp := Client.GetBotIconImage(botUserID) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $botUserID = "4xp9fdt77pncbef59f4k1qe83o"; + + $resp = $driver->getBotModel()->getBotIcon($botUserID); + + if ($resp->getStatusCode() == 200) { + $data = json_decode($resp->getBody()); + } + post: + tags: + - bots + summary: Set bot's LHS icon image + description: > + 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. + + ##### Permissions + + Must have `manage_bots` permission. + + __Minimum server version__: 5.14 + operationId: SetBotIconImage + parameters: + - name: bot_user_id + in: path + description: Bot user ID + required: true + schema: + type: string + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + image: + description: SVG icon image to be uploaded + type: string + format: binary + required: + - image + responses: + "200": + description: SVG icon image set successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "413": + $ref: "#/components/responses/TooLarge" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import ( + "io/ioutil" + "log" + + "github.com/mattermost/mattermost-server/v5/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) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $botUserID = "4xp9fdt77pncbef59f4k1qe83o"; + $resource = fopen("icon_image.svg", 'rb'); + + if ($resource === false) { + throw new \Exeption("Failure."); + } + + $data = new \GuzzleHttp\Psr7\Stream($resource); + + $resp = $driver->getBotModel()->setBotIcon($botUserID, [ + "image" => $data, + ]); + + fclose($resource); + + if ($resp->getStatusCode() == 200) { + $ok = json_decode($resp->getBody())->status; + } + delete: + tags: + - bots + summary: Delete bot's LHS icon image + description: | + Delete bot's LHS icon image based on bot_user_id string parameter. + ##### Permissions + Must have `manage_bots` permission. + __Minimum server version__: 5.14 + operationId: DeleteBotIconImage + parameters: + - name: bot_user_id + in: path + description: Bot user ID + required: true + schema: + type: string + responses: + "200": + description: Icon image deletion successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + botUserID := "4xp9fdt77pncbef59f4k1qe83o" + + ok, resp := Client.DeleteBotIconImage(botUserID) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $botUserID = "4xp9fdt77pncbef59f4k1qe83o"; + + $resp = $driver->getBotModel()->deleteBotIcon($botUserID); + + if ($resp->getStatusCode() == 200) { + $ok = json_decode($resp->getBody())->status; + } + "/api/v4/bots/{bot_user_id}/convert_to_user": + post: + tags: + - bots + - users + summary: Convert a bot into a user + description: | + Convert a bot into a user. + + __Minimum server version__: 5.26 + + ##### Permissions + Must have `manage_system` permission. + operationId: ConvertBotToUser + parameters: + - name: bot_user_id + in: path + description: Bot user ID + required: true + schema: + type: string + - name: set_system_admin + in: query + description: Whether to give the user the system admin role. + schema: + type: boolean + default: false + requestBody: + content: + application/json: + schema: + type: object + properties: + email: + type: string + username: + type: string + password: + type: string + first_name: + type: string + last_name: + type: string + nickname: + type: string + locale: + type: string + position: + type: string + props: + type: object + notify_props: + $ref: "#/components/schemas/UserNotifyProps" + description: Data to be used in the user creation + required: true + responses: + "200": + description: Bot successfully converted + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + userId := "BbaYBYDV5IDOZFiJGBSzkw1k5u" + patch := &model.UserPatch{} + patch.Email = model.NewString("test@domain.com") + patch.Username = model.NewString("testUsername") + patch.Password = model.NewString("password") + + user, resp := Client.ConvertBotToUser(userId, userPatch, false) diff --git a/api/v4/source/brand.yaml b/api/v4/source/brand.yaml new file mode 100644 index 0000000000..5274b1f4d1 --- /dev/null +++ b/api/v4/source/brand.yaml @@ -0,0 +1,129 @@ + /api/v4/brand/image: + get: + tags: + - brand + summary: Get brand image + description: > + Get the previously uploaded brand image. Returns 404 if no brand image + has been uploaded. + + ##### Permissions + + No permission required. + operationId: GetBrandImage + responses: + "200": + description: Brand image retrieval successful + content: + application/json: + schema: + type: string + "404": + $ref: "#/components/responses/NotFound" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + // GetBrandImage + img, err := Client.GetBrandImage() + post: + tags: + - brand + summary: Upload brand image + description: | + Uploads a brand image. + ##### Permissions + Must have `manage_system` permission. + operationId: UploadBrandImage + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + image: + description: The image to be uploaded + type: string + format: binary + required: + - image + responses: + "201": + description: Brand image upload successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "413": + $ref: "#/components/responses/TooLarge" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + file, err := os.Open("") + 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()) + delete: + tags: + - brand + summary: Delete current brand image + description: > + Deletes the previously uploaded brand image. Returns 404 if no brand + image has been uploaded. + + ##### Permissions + + Must have `manage_system` permission. + + __Minimum server version: 5.6__ + operationId: DeleteBrandImage + responses: + "200": + description: Brand image succesfully deleted + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + // Delete brand image + resp := Client.DeleteBrandImage() diff --git a/api/v4/source/channels.yaml b/api/v4/source/channels.yaml new file mode 100644 index 0000000000..2c0afe3ce9 --- /dev/null +++ b/api/v4/source/channels.yaml @@ -0,0 +1,2931 @@ + /api/v4/channels: + get: + tags: + - channels + summary: Get a list of all channels + description: | + ##### Permissions + `manage_system` + operationId: GetAllChannels + parameters: + - name: not_associated_to_group + in: query + description: A group id to exclude channels that are associated with that group via GroupChannel records. This can also be left blank with `not_associated_to_group=`. + schema: + type: string + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of channels per page. + schema: + type: integer + default: 0 + - name: exclude_default_channels + in: query + description: Whether to exclude default channels (ex Town Square, Off-Topic) from the results. + schema: + type: boolean + default: false + - name: include_deleted + in: query + description: Include channels that have been archived. This correlates to the `DeleteAt` flag being set in the database. + schema: + type: boolean + default: false + - name: include_total_count + in: query + description: >- + Appends a total count of returned channels inside the response object - ex: `{ "channels": [], "total_count" : 0 }`. + schema: + type: boolean + default: false + - name: exclude_policy_constrained + in: query + schema: + type: boolean + default: false + description: >- + If set to true, channels which are part of a data retention policy will be excluded. + The `sysconsole_read_compliance` permission is required to use this parameter. + + __Minimum server version__: 5.35 + responses: + "200": + description: Channel list retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/ChannelListWithTeamData" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "404": + $ref: "#/components/responses/NotFound" + post: + tags: + - channels + summary: Create a channel + description: > + Create a new channel. + + ##### Permissions + + If creating a public channel, `create_public_channel` permission is required. If creating a private channel, `create_private_channel` permission is required. + operationId: CreateChannel + requestBody: + content: + application/json: + schema: + type: object + required: + - name + - display_name + - type + - team_id + properties: + team_id: + type: string + description: The team ID of the team to create the channel on + name: + type: string + description: The unique handle for the channel, will be present in the + channel URL + display_name: + type: string + description: The non-unique UI name for the channel + purpose: + type: string + description: A short description of the purpose of the channel + header: + type: string + description: Markdown-formatted text to display in the header of the + channel + type: + type: string + description: "'O' for a public channel, 'P' for a private channel" + description: Channel object to be created + required: true + responses: + "201": + description: Channel creation successful + content: + application/json: + schema: + $ref: "#/components/schemas/Channel" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + + channel := &model.Channel{DisplayName: , Name: , Type: , TeamId: } + + + // CreateChannel + + rchannel, resp := Client.CreateChannel(channel) + /api/v4/channels/direct: + post: + tags: + - channels + summary: Create a direct message channel + description: > + Create a new direct message channel between two users. + + ##### Permissions + + Must be one of the two users and have `create_direct_channel` permission. Having the `manage_system` permission voids the previous requirements. + operationId: CreateDirectChannel + requestBody: + content: + application/json: + schema: + type: array + items: + type: string + minItems: 2 + maxItems: 2 + description: The two user ids to be in the direct message + required: true + responses: + "201": + description: Direct channel creation successful + content: + application/json: + schema: + $ref: "#/components/schemas/Channel" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + // CreateDirectChannel + dm, resp := Client.CreateDirectChannel(, ) + /api/v4/channels/group: + post: + tags: + - channels + summary: Create a group message channel + description: > + Create a new group message channel to group of users. If the logged in + user's id is not included in the list, it will be appended to the end. + + ##### Permissions + + Must have `create_group_channel` permission. + operationId: CreateGroupChannel + requestBody: + content: + application/json: + schema: + type: array + items: + type: string + description: User ids to be in the group message channel + required: true + responses: + "201": + description: Group channel creation successful + content: + application/json: + schema: + $ref: "#/components/schemas/Channel" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + userIds := []string{, , ...} + + // CreateGroupChannel + rgc, resp := Client.CreateGroupChannel(userIds) + /api/v4/channels/search: + post: + tags: + - channels + summary: Search all private and open type channels across all teams + description: > + Returns all private and open type channels where 'term' matches on the + name, display name, or purpose of + + the channel. + + + Configured 'default' channels (ex Town Square and Off-Topic) can be excluded from the results + + with the `exclude_default_channels` boolean parameter. + + + Channels that are associated (via GroupChannel records) to a given group can be excluded from the results + + with the `not_associated_to_group` parameter and a group id string. + operationId: SearchAllChannels + parameters: + - name: system_console + in: query + description: > + Is the request from system_console. If this is set to true, it filters channels + by the logged in user. + required: false + schema: + type: boolean + default: true + requestBody: + content: + application/json: + schema: + type: object + required: + - term + properties: + term: + type: string + description: The string to search in the channel name, display name, and + purpose. + not_associated_to_group: + type: string + description: A group id to exclude channels that are associated to that + group via GroupChannel records. + exclude_default_channels: + type: boolean + description: Exclude default channels from the results by setting this + parameter to true. + team_ids: + type: array + items: + type: string + description: > + Filters results to channels belonging to the given team ids + + + __Minimum server version__: 5.26 + group_constrained: + type: boolean + description: > + Filters results to only return channels constrained to a group + + + __Minimum server version__: 5.26 + exclude_group_constrained: + type: boolean + description: > + Filters results to exclude channels constrained to a group + + + __Minimum server version__: 5.26 + public: + type: boolean + description: > + Filters results to only return Public / Open channels, can be used in conjunction + with `private` to return both `public` and `private` channels + + + __Minimum server version__: 5.26 + private: + type: boolean + description: > + Filters results to only return Private channels, can be used in conjunction + with `public` to return both `private` and `public` channels + + + __Minimum server version__: 5.26 + + deleted: + type: boolean + description: > + Filters results to only return deleted / archived channels + + + __Minimum server version__: 5.26 + page: + type: string + description: The page number to return, if paginated. If this parameter + is not present with the `per_page` parameter then the + results will be returned un-paged. + per_page: + type: string + description: The number of entries to return per page, if paginated. If + this parameter is not present with the `page` parameter then + the results will be returned un-paged. + exclude_policy_constrained: + type: boolean + default: false + description: > + If set to true, only channels which do not have a granular retention policy assigned to + them will be returned. The `sysconsole_read_compliance_data_retention` permission is + required to use this parameter. + + __Minimum server version__: 5.35 + + include_search_by_id: + type: boolean + default: false + description: > + If set to true, returns channels where given search 'term' matches channel ID. + + __Minimum server version__: 5.35 + description: The search terms and logic to use in the search. + required: true + responses: + "200": + description: Paginated channel response. (Note that the non-paginated + response—returned if the request body does not contain both `page` + and `per_page` fields—is a simple array of channels.) + content: + application/json: + schema: + type: object + properties: + channels: + type: array + description: The channels that matched the query. + items: + $ref: "#/components/schemas/Channel" + total_count: + type: number + description: The total number of results, regardless of page and + per_page requested. + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + /api/v4/channels/group/search: + post: + tags: + - channels + summary: Search Group Channels + description: > + Get a list of group channels for a user which members' usernames match + the search term. + + + __Minimum server version__: 5.14 + operationId: SearchGroupChannels + requestBody: + content: + application/json: + schema: + type: object + required: + - term + properties: + term: + description: The search term to match against the members' usernames of + the group channels + type: string + description: Search criteria + required: true + responses: + "200": + description: Channels search successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Channel" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + search := &model.ChannelSearch{Term: } + + // SearchGroupChannels + channels, resp := Client.SearchGroupChannels(search) + "/api/v4/teams/{team_id}/channels/ids": + post: + tags: + - channels + summary: Get a list of channels by ids + description: | + Get a list of public channels on a team by id. + ##### Permissions + `view_team` for the team the channels are on. + operationId: GetPublicChannelsByIdsForTeam + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: array + items: + type: string + description: List of channel ids + required: true + responses: + "200": + description: Channel list retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Channel" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + + channelIds := []string{, , ...} + + + // GetPublicChannelsByIdsForTeam + + channels, resp := Client.GetPublicChannelsByIdsForTeam(, channelIds) + "/api/v4/channels/{channel_id}/timezones": + get: + tags: + - channels + summary: Get timezones in a channel + description: | + Get a list of timezones for the users who are in this channel. + + __Minimum server version__: 5.6 + + ##### Permissions + Must have the `read_channel` permission. + operationId: GetChannelMembersTimezones + parameters: + - name: channel_id + in: path + description: Channel GUID + required: true + schema: + type: string + responses: + "200": + description: Timezone retrieval successful + content: + application/json: + schema: + type: array + items: + type: string + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + // GetChannelStats + stats, resp := Client.GetChannelTimezones() + "/api/v4/channels/{channel_id}": + get: + tags: + - channels + summary: Get a channel + description: | + Get channel from the provided channel id string. + ##### Permissions + `read_channel` permission for the channel. + operationId: GetChannel + parameters: + - name: channel_id + in: path + description: Channel GUID + required: true + schema: + type: string + responses: + "200": + description: Channel retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/Channel" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + // GetChannel + channel, resp := Client.GetChannel(, "") + put: + tags: + - channels + summary: Update a channel + description: > + Update a channel. The fields that can be updated are listed as + parameters. Omitted fields will be treated as blanks. + + ##### Permissions + + If updating a public channel, `manage_public_channel_members` permission is required. If updating a private channel, `manage_private_channel_members` permission is required. + operationId: UpdateChannel + parameters: + - name: channel_id + in: path + description: Channel GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - id + properties: + id: + type: string + description: The channel's id, not updatable + name: + type: string + description: The unique handle for the channel, will be present in the + channel URL + display_name: + type: string + description: The non-unique UI name for the channel + purpose: + type: string + description: A short description of the purpose of the channel + header: + type: string + description: Markdown-formatted text to display in the header of the + channel + description: Channel object to be updated + required: true + responses: + "200": + description: Channel update successful + content: + application/json: + schema: + $ref: "#/components/schemas/Channel" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + + channel := &model.Channel{DisplayName: , ChannelId: , TeamId: } + + + // UpdateChannel + + updatedChannel, resp := Client.UpdateChannel(channel) + delete: + tags: + - channels + summary: Delete a channel + description: > + Archives a channel. This will set the `deleteAt` to the current timestamp in the database. Soft deleted channels may not be accessible in the user + interface. They can be viewed and unarchived in the **System Console > User Management > Channels** based on your license. Direct and group message channels cannot be deleted. + + + As of server version 5.28, optionally use the `permanent=true` query parameter to permanently delete the channel for compliance reasons. To use this feature `ServiceSettings.EnableAPIChannelDeletion` must be set to `true` in the server's configuration. + If you permanently delete a channel this action is not recoverable outside of a database backup. + + + ##### Permissions + + `delete_public_channel` permission if the channel is public, + + `delete_private_channel` permission if the channel is private, + + or have `manage_system` permission. + operationId: DeleteChannel + parameters: + - name: channel_id + in: path + description: Channel GUID + required: true + schema: + type: string + responses: + "200": + description: Channel deletion successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + // DeleteChannel + pass, resp := Client.DeleteChannel() + "/api/v4/channels/{channel_id}/patch": + put: + tags: + - channels + summary: Patch a channel + description: > + Partially update a channel by providing only the fields you want to + update. Omitted fields will not be updated. The fields that can be + updated are defined in the request body, all other provided fields will + be ignored. + + ##### Permissions + + If updating a public channel, `manage_public_channel_members` permission is required. If updating a private channel, `manage_private_channel_members` permission is required. + operationId: PatchChannel + parameters: + - name: channel_id + in: path + description: Channel GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: The unique handle for the channel, will be present in the + channel URL + display_name: + type: string + description: The non-unique UI name for the channel + purpose: + type: string + description: A short description of the purpose of the channel + header: + type: string + description: Markdown-formatted text to display in the header of the + channel + description: Channel object to be updated + required: true + responses: + "200": + description: Channel patch successful + content: + application/json: + schema: + $ref: "#/components/schemas/Channel" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + patch := &model.ChannelPatch{ + Name: new(string), + DisplayName: new(string), + Header: new(string), + Purpose: new(string), + } + *patch.Name = "" + *patch.DisplayName = "" + *patch.Header = "" + *patch.Purpose = "" + + // PatchChannel + channel, resp := Client.PatchChannel(, patch) + "/api/v4/channels/{channel_id}/privacy": + put: + tags: + - channels + summary: Update channel's privacy + description: > + Updates channel's privacy allowing changing a channel from Public to + Private and back. + + + __Minimum server version__: 5.16 + + + ##### Permissions + + `manage_team` permission for the channels team on version < 5.28. + `convert_public_channel_to_private` permission for the channel if updating privacy to 'P' on version >= 5.28. + `convert_private_channel_to_public` permission for the channel if updating privacy to 'O' on version >= 5.28. + operationId: UpdateChannelPrivacy + parameters: + - name: channel_id + in: path + description: Channel GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - privacy + properties: + privacy: + type: string + description: "Channel privacy setting: 'O' for a public channel, 'P' for + a private channel" + required: true + responses: + "200": + description: Channel conversion successful + content: + application/json: + schema: + $ref: "#/components/schemas/Channel" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + + // Update channel's privacy to Public + + updatedChannel, resp := Client.UpdateChannelPrivacy(, model.CHANNEL_OPEN) + + + // Update channel's privacy to Private + + updatedChannel, resp := Client.UpdateChannelPrivacy(, model.CHANNEL_PRIVATE) + "/api/v4/channels/{channel_id}/restore": + post: + tags: + - channels + summary: Restore a channel + description: | + Restore channel from the provided channel id string. + + __Minimum server version__: 3.10 + + ##### Permissions + `manage_team` permission for the team of the channel. + operationId: RestoreChannel + parameters: + - name: channel_id + in: path + description: Channel GUID + required: true + schema: + type: string + responses: + "200": + description: Channel restore successful + content: + application/json: + schema: + $ref: "#/components/schemas/Channel" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "/api/v4/channels/{channel_id}/move": + post: + tags: + - channels + summary: Move a channel + description: | + Move a channel to another team. + + __Minimum server version__: 5.26 + + ##### Permissions + + Must have `manage_system` permission. + operationId: MoveChannel + parameters: + - name: channel_id + in: path + description: Channel GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - team_id + properties: + team_id: + type: string + force: + description: "Remove members those are not member of target team before moving the channel." + type: boolean + required: true + responses: + "200": + description: Channel move successful + content: + application/json: + schema: + $ref: "#/components/schemas/Channel" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "/api/v4/channels/{channel_id}/stats": + get: + tags: + - channels + summary: Get channel statistics + description: | + Get statistics for a channel. + ##### Permissions + Must have the `read_channel` permission. + operationId: GetChannelStats + parameters: + - name: channel_id + in: path + description: Channel GUID + required: true + schema: + type: string + responses: + "200": + description: Channel statistics retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/ChannelStats" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + // GetChannelStats + stats, resp := Client.GetChannelStats() + "/api/v4/channels/{channel_id}/pinned": + get: + tags: + - channels + summary: Get a channel's pinned posts + description: Get a list of pinned posts for channel. + operationId: GetPinnedPosts + parameters: + - name: channel_id + in: path + description: Channel GUID + required: true + schema: + type: string + responses: + "200": + description: The list of channel pinned posts + content: + application/json: + schema: + $ref: "#/components/schemas/PostList" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + // GetPinnedPosts + posts, resp := Client.GetPinnedPosts(, "") + "/api/v4/teams/{team_id}/channels": + get: + tags: + - channels + summary: Get public channels + description: > + Get a page of public channels on a team based on query string parameters + - page and per_page. + + ##### Permissions + + Must be authenticated and have the `list_team_channels` permission. + operationId: GetPublicChannelsForTeam + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of public channels per page. + schema: + type: integer + default: 60 + responses: + "200": + description: Channels retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Channel" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + // GetPublicChannelsForTeam + + channels, resp := Client.GetPublicChannelsForTeam(, 0, 100, "") + "/api/v4/teams/{team_id}/channels/private": + get: + tags: + - channels + summary: Get private channels + description: | + Get a page of private channels on a team based on query string + parameters - team_id, page and per_page. + + __Minimum server version__: 5.26 + + ##### Permissions + Must have `manage_system` permission. + operationId: GetPrivateChannelsForTeam + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of private channels per page. + schema: + type: integer + default: 60 + responses: + "200": + description: Channels retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Channel" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + // GetPrivateChannelsForTeam + + channels, resp := Client.GetPrivateChannelsForTeam(, 0, 100, "") + "/api/v4/teams/{team_id}/channels/deleted": + get: + tags: + - channels + summary: Get deleted channels + description: > + Get a page of deleted channels on a team based on query string + parameters - team_id, page and per_page. + + + __Minimum server version__: 3.10 + operationId: GetDeletedChannelsForTeam + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of public channels per page. + schema: + type: integer + default: 60 + responses: + "200": + description: Channels retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Channel" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "/api/v4/teams/{team_id}/channels/autocomplete": + get: + tags: + - channels + summary: Autocomplete channels + description: > + Autocomplete public channels on a team based on the search term provided + in the request URL. + + + __Minimum server version__: 4.7 + + + ##### Permissions + + Must have the `list_team_channels` permission. + operationId: AutocompleteChannelsForTeam + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + - name: name + in: query + description: Name or display name + required: true + schema: + type: string + responses: + "200": + description: Channels autocomplete successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Channel" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "/api/v4/teams/{team_id}/channels/search_autocomplete": + get: + tags: + - channels + summary: Autocomplete channels for search + description: > + Autocomplete your channels on a team based on the search term provided + in the request URL. + + + __Minimum server version__: 5.4 + + + ##### Permissions + + Must have the `list_team_channels` permission. + operationId: AutocompleteChannelsForTeamForSearch + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + - name: name + in: query + description: Name or display name + required: true + schema: + type: string + responses: + "200": + description: Channels autocomplete successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Channel" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "/api/v4/teams/{team_id}/channels/search": + post: + tags: + - channels + summary: Search channels + description: > + Search public channels on a team based on the search term provided in + the request body. + + ##### Permissions + + Must have the `list_team_channels` permission. + + + In server version 5.16 and later, a user without the `list_team_channels` permission will be able to use this endpoint, with the search results limited to the channels that the user is a member of. + operationId: SearchChannels + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - term + properties: + term: + description: The search term to match against the name or display name of + channels + type: string + description: Search criteria + required: true + responses: + "201": + description: Channels search successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Channel" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + search := &model.ChannelSearch{Term: } + + // SearchChannels + channels, resp := Client.SearchChannels(, search) + "/api/v4/teams/{team_id}/channels/search_archived": + post: + tags: + - channels + summary: Search archived channels + description: > + Search archived channels on a team based on the search term provided in + the request body. + + + __Minimum server version__: 5.18 + + + ##### Permissions + + 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. + operationId: SearchArchivedChannels + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - term + properties: + term: + description: The search term to match against the name or display name of + archived channels + type: string + description: Search criteria + required: true + responses: + "201": + description: Channels search successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Channel" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + search := &model.ChannelSearch{Term: } + + // SearchChannels + channels, resp := Client.SearchArchivedChannels(, search) + "/api/v4/teams/{team_id}/channels/name/{channel_name}": + get: + tags: + - channels + summary: Get a channel by name + description: | + Gets channel from the provided team id and channel name strings. + ##### Permissions + `read_channel` permission for the channel. + operationId: GetChannelByName + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + - name: channel_name + in: path + description: Channel Name + required: true + schema: + type: string + - name: include_deleted + in: query + description: Defines if deleted channels should be returned or not (Mattermost Server 5.26.0+) + schema: + type: boolean + default: false + responses: + "200": + description: Channel retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/Channel" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + + // GetChannelByName + + channel, resp := Client.GetChannelByName(, , "") + "/api/v4/teams/name/{team_name}/channels/name/{channel_name}": + get: + tags: + - channels + summary: Get a channel by name and team name + description: | + Gets a channel from the provided team name and channel name strings. + ##### Permissions + `read_channel` permission for the channel. + operationId: GetChannelByNameForTeamName + parameters: + - name: team_name + in: path + description: Team Name + required: true + schema: + type: string + - name: channel_name + in: path + description: Channel Name + required: true + schema: + type: string + - name: include_deleted + in: query + description: Defines if deleted channels should be returned or not (Mattermost Server 5.26.0+) + schema: + type: boolean + default: false + responses: + "200": + description: Channel retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/Channel" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + + // GetChannelByNameForTeamName + + channel, resp = Client.GetChannelByNameForTeamName(, , "") + "/api/v4/channels/{channel_id}/members": + get: + tags: + - channels + summary: Get channel members + description: | + Get a page of members for a channel. + ##### Permissions + `read_channel` permission for the channel. + operationId: GetChannelMembers + parameters: + - name: channel_id + in: path + description: Channel GUID + required: true + schema: + type: string + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of members per page. There is a maximum limit of 200 members. + schema: + type: integer + default: 60 + responses: + "200": + description: Channel members retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/ChannelMember" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/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, "") + post: + tags: + - channels + summary: Add user to channel + description: Add a user to a channel by creating a channel member object. + operationId: AddChannelMember + parameters: + - name: channel_id + in: path + description: The channel ID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - user_id + properties: + user_id: + type: string + description: The ID of user to add into the channel + post_root_id: + type: string + description: The ID of root post where link to add channel member + originates + required: true + responses: + "201": + description: Channel member creation successful + content: + application/json: + schema: + $ref: "#/components/schemas/ChannelMember" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + + // AddChannelMember + + cm, resp := Client.AddChannelMember(, ) + + + // AddChannelMemberWithRootId + + cm, resp := Client.AddChannelMemberWithRootId(, , ) + "/api/v4/channels/{channel_id}/members/ids": + post: + tags: + - channels + summary: Get channel members by ids + description: | + Get a list of channel members based on the provided user ids. + ##### Permissions + Must have the `read_channel` permission. + operationId: GetChannelMembersByIds + parameters: + - name: channel_id + in: path + description: Channel GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: array + items: + type: string + description: List of user ids + required: true + responses: + "200": + description: Channel member list retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/ChannelMember" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + usersIds := []string{, , ...} + + // GetChannelMembersByIds + cm, resp := Client.GetChannelMembersByIds(, usersIds) + "/api/v4/channels/{channel_id}/members/{user_id}": + get: + tags: + - channels + summary: Get channel member + description: | + Get a channel member. + ##### Permissions + `read_channel` permission for the channel. + operationId: GetChannelMember + parameters: + - name: channel_id + in: path + description: Channel GUID + required: true + schema: + type: string + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + responses: + "200": + description: Channel member retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/ChannelMember" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + // GetChannelMember + member, resp := Client.GetChannelMember(, , "") + delete: + tags: + - channels + summary: Remove user from channel + description: > + Delete a channel member, effectively removing them from a channel. + + + In server version 5.3 and later, channel members can only be deleted from public or private channels. + + ##### Permissions + + `manage_public_channel_members` permission if the channel is public. + + `manage_private_channel_members` permission if the channel is private. + operationId: RemoveUserFromChannel + parameters: + - name: channel_id + in: path + description: Channel GUID + required: true + schema: + type: string + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + responses: + "200": + description: Channel member deletion successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + // RemoveUserFromChannel + pass, resp := Client.RemoveUserFromChannel(, ) + "/api/v4/channels/{channel_id}/members/{user_id}/roles": + put: + tags: + - channels + summary: Update channel roles + description: | + Update a user's roles for a channel. + ##### Permissions + Must have `manage_channel_roles` permission for the channel. + operationId: UpdateChannelRoles + parameters: + - name: channel_id + in: path + description: Channel GUID + required: true + schema: + type: string + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - roles + properties: + roles: + type: string + description: Space-delimited channel roles to assign to the user + required: true + responses: + "200": + description: Channel roles update successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + + // UpdateChannelRoles + + pass, resp := Client.UpdateChannelRoles(, , "channel_admin channel_user") + "/api/v4/channels/{channel_id}/members/{user_id}/schemeRoles": + put: + tags: + - channels + summary: Update the scheme-derived roles of a channel member. + description: > + Update a channel member's scheme_admin/scheme_user properties. Typically + this should either be `scheme_admin=false, scheme_user=true` for + ordinary channel member, or `scheme_admin=true, scheme_user=true` for a + channel admin. + + __Minimum server version__: 5.0 + + ##### Permissions + + Must be authenticated and have the `manage_channel_roles` permission. + operationId: UpdateChannelMemberSchemeRoles + parameters: + - name: channel_id + in: path + description: Channel GUID + required: true + schema: + type: string + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - scheme_admin + - scheme_user + properties: + scheme_admin: + type: boolean + scheme_user: + type: boolean + description: Scheme properties. + required: true + responses: + "200": + description: Channel member's scheme-derived roles updated successfully. + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "/api/v4/channels/{channel_id}/members/{user_id}/notify_props": + put: + tags: + - channels + summary: Update channel notifications + description: > + Update a user's notification properties for a channel. Only the provided + fields are updated. + + ##### Permissions + + Must be logged in as the user or have `edit_other_users` permission. + operationId: UpdateChannelNotifyProps + parameters: + - name: channel_id + in: path + description: Channel GUID + required: true + schema: + type: string + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/ChannelNotifyProps" + required: true + responses: + "200": + description: Channel notification properties update successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + + props := map[string]string{} + + props[model.DESKTOP_NOTIFY_PROP] = model.CHANNEL_NOTIFY_MENTION + + props[model.MARK_UNREAD_NOTIFY_PROP] = model.CHANNEL_MARK_UNREAD_MENTION + + + // UpdateChannelNotifyProps + + pass, resp := Client.UpdateChannelNotifyProps(, , props) + "/api/v4/channels/members/{user_id}/view": + post: + tags: + - channels + summary: View channel + description: > + Perform all the actions involved in viewing a channel. This includes + marking channels as read, clearing push notifications, and updating the + active channel. + + ##### Permissions + + Must be logged in as user or have `edit_other_users` permission. + + + __Response only includes `last_viewed_at_times` in Mattermost server 4.3 and newer.__ + operationId: ViewChannel + parameters: + - in: path + name: user_id + description: User ID to perform the view action for + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - channel_id + properties: + channel_id: + type: string + description: The channel ID that is being viewed. Use a blank string to + indicate that all channels have lost focus. + prev_channel_id: + type: string + description: The channel ID of the previous channel, used when switching + channels. Providing this ID will cause push notifications to + clear on the channel being switched to. + description: Paremeters affecting how and which channels to view + required: true + responses: + "200": + description: Channel view successful + content: + application/json: + schema: + type: object + properties: + status: + type: string + description: Value should be "OK" if successful + last_viewed_at_times: + type: object + description: A JSON object mapping channel IDs to the channel view times + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + view := &model.ChannelView{ + ChannelId: , + } + // ViewChannel + pass, resp := Client.ViewChannel(, view) + "/api/v4/users/{user_id}/teams/{team_id}/channels/members": + get: + tags: + - channels + summary: Get channel memberships and roles for a user + description: > + Get all channel memberships and associated membership roles (i.e. + `channel_user`, `channel_admin`) for a user on a specific team. + + ##### Permissions + + Logged in as the user and `view_team` permission for the team. Having `manage_system` permission voids the previous requirements. + operationId: GetChannelMembersForUser + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + responses: + "200": + description: Channel members retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/ChannelMember" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + + // GetChannelMembersForUser + + members, resp := Client.GetChannelMembersForUser(, , "") + "/api/v4/users/{user_id}/teams/{team_id}/channels": + get: + tags: + - channels + summary: Get channels for user + description: > + Get all the channels on a team for a user. + + ##### Permissions + + Logged in as the user, or have `edit_other_users` permission, and `view_team` permission for the team. + operationId: GetChannelsForTeamForUser + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + - name: include_deleted + in: query + description: Defines if deleted channels should be returned or not + schema: + type: boolean + default: false + - name: last_delete_at + in: query + description: Filters the deleted channels by this time in epoch format. Does not have any effect if include_deleted is set to false. + schema: + type: integer + default: 0 + responses: + "200": + description: Channels retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Channel" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + + // GetChannelsForTeamForUser + + channels, resp := Client.GetChannelsForTeamForUser(, , "") + "/api/v4/users/{user_id}/channels": + get: + tags: + - channels + summary: Get all channels from all teams + description: | + Get all channels from all teams that a user is a member of. + + __Minimum server version__: 6.1 + + ##### Permissions + + Logged in as the user, or have `edit_other_users` permission. + operationId: GetChannelsForUser + parameters: + - name: user_id + in: path + description: The ID of the user. This can also be "me" which will point to the current user. + required: true + schema: + type: string + - name: last_delete_at + in: query + description: Filters the deleted channels by this time in epoch format. Does not have any effect if include_deleted is set to false. + schema: + type: integer + default: 0 + - name: include_deleted + in: query + description: Defines if deleted channels should be returned or not + schema: + type: boolean + default: false + responses: + "200": + description: Channels retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Channel" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v6/model" + + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + channels, response, err := Client.GetChannelsForUserWithLastDeleteAt("fc6suoon9pbbpmhrb9c967paxe", 0) + - lang: Curl + source: | + curl -X GET 'http://localhost:8065/api/v4/users/fc6suoon9pbbpmhrb9c967paxe/channels' \ + -H 'Authorization: Bearer 9kg8nqrnxprd9jbykqeg4r51hw' + "/api/v4/users/{user_id}/channels/{channel_id}/unread": + get: + tags: + - channels + summary: Get unread messages + description: > + Get the total unread messages and mentions for a channel for a user. + + ##### Permissions + + Must be logged in as user and have the `read_channel` permission, or have `edit_other_usrs` permission. + operationId: GetChannelUnread + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + - name: channel_id + in: path + description: Channel GUID + required: true + schema: + type: string + responses: + "200": + description: Channel unreads retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/ChannelUnread" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + + // GetChannelUnread + + channelUnread, resp := Client.GetChannelUnread(, ) + "/api/v4/channels/{channel_id}/scheme": + put: + tags: + - channels + summary: Set a channel's scheme + description: > + Set a channel's scheme, more specifically sets the scheme_id value of a + channel record. + + + ##### Permissions + + Must have `manage_system` permission. + + + __Minimum server version__: 4.10 + operationId: UpdateChannelScheme + parameters: + - name: channel_id + in: path + description: Channel GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - scheme_id + properties: + scheme_id: + type: string + description: The ID of the scheme. + description: Scheme GUID + required: true + responses: + "200": + description: Update channel scheme successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + channelID := "4xp9fdt77pncbef59f4k1qe83o" + schemeID := "qjda3stwafbgpqjaxej3k76sga" + ok, resp := UpdateChannelScheme(channelID, schemeID) + - lang: curl + source: > + curl -X PUT \ + https://your-mattermost-url.com/api/v4/channels/4xp9fdt77pncbef59f4k1qe83o/scheme \ + -H 'Authorization: Bearer frn8fu5rtpyc5m4xy6q3oj4yur' \ + -H 'Content-Type: application/json' \ + -d '{"scheme_id": "qjda3stwafbgpqjaxej3k76sga"}' + "/api/v4/channels/{channel_id}/members_minus_group_members": + get: + tags: + - channels + summary: Channel members minus group members. + description: > + Get the set of users who are members of the channel minus the set of + users who are members of the given groups. + + Each user object contains an array of group objects representing the group memberships for that user. + + Each user object contains the boolean fields `scheme_guest`, `scheme_user`, and `scheme_admin` representing the roles that user has for the given channel. + + + ##### Permissions + + Must have `manage_system` permission. + + + __Minimum server version__: 5.14 + operationId: ChannelMembersMinusGroupMembers + parameters: + - name: channel_id + in: path + description: Channel GUID + required: true + schema: + type: string + - name: group_ids + in: query + description: A comma-separated list of group ids. + required: true + schema: + type: string + default: "" + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of users per page. + schema: + type: integer + default: 0 + responses: + "200": + description: Successfully returns users specified by the pagination, and the + total_count. + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: curl + source: > + 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' + "/api/v4/channels/{channel_id}/member_counts_by_group": + get: + tags: + - channels + summary: Channel members counts for each group that has atleast one member in the channel + description: > + Returns a set of ChannelMemberCountByGroup objects which contain a `group_id`, `channel_member_count` and a `channel_member_timezones_count`. + + ##### Permissions + + Must have `read_channel` permission for the given channel. + + __Minimum server version__: 5.24 + operationId: GetChannelMemberCountsByGroup + parameters: + - name: channel_id + in: path + description: Channel GUID + required: true + schema: + type: string + - name: include_timezones + in: query + description: Defines if member timezone counts should be returned or not + schema: + type: boolean + default: false + responses: + "200": + description: Successfully returns member counts by group for the given channel. + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: curl + source: > + curl -X GET \ + 'http://your-mattermost-url.com/api/v4/channels/3wyp678obid8pggjmhmhwpah1r/member_counts_by_group?include_timezones=true' \ + -H 'Authorization: Bearer kno8tcdotpbx3dj1gzcbx9jrqy' \ + -H 'Content-Type: application/json' \ + -H 'X-Requested-With: XMLHttpRequest' + "/api/v4/channels/{channel_id}/moderations": + get: + tags: + - channels + summary: Get information about channel's moderation. + description: > + ##### Permissions + + Must have `manage_system` permission. + + + __Minimum server version__: 5.22 + operationId: GetChannelModerations + parameters: + - name: channel_id + in: path + description: Channel GUID + required: true + schema: + type: string + responses: + "200": + description: "Retreived successfully" + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/ChannelModeration" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "/api/v4/channels/{channel_id}/moderations/patch": + put: + tags: + - channels + summary: Update a channel's moderation settings. + description: > + ##### Permissions + + Must have `manage_system` permission. + + + __Minimum server version__: 5.22 + operationId: PatchChannelModerations + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/ChannelModerationPatch" + + parameters: + - name: channel_id + in: path + description: Channel GUID + required: true + schema: + type: string + + responses: + "200": + description: "Patched successfully" + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/ChannelModeration" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "/api/v4/users/{user_id}/teams/{team_id}/channels/categories": + get: + tags: + - channels + summary: Get user's sidebar categories + description: > + Get a list of sidebar categories that will appear in the user's sidebar + on the given team, including a list of channel IDs in each category. + + __Minimum server version__: 5.26 + + ##### Permissions + + Must be authenticated and have the `list_team_channels` permission. + operationId: GetSidebarCategoriesForTeamForUser + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + responses: + "200": + description: Category retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/OrderedSidebarCategories" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + post: + tags: + - channels + summary: Create user's sidebar category + description: > + Create a custom sidebar category for the user on the given team. + + __Minimum server version__: 5.26 + + ##### Permissions + + Must be authenticated and have the `list_team_channels` permission. + operationId: CreateSidebarCategoryForTeamForUser + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/SidebarCategory" + required: true + responses: + "200": + description: Category creation successful + content: + application/json: + schema: + $ref: "#/components/schemas/SidebarCategory" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + put: + tags: + - channels + summary: Update user's sidebar categories + description: > + Update any number of sidebar categories for the user on the given team. This + can be used to reorder the channels in these categories. + + __Minimum server version__: 5.26 + + ##### Permissions + + Must be authenticated and have the `list_team_channels` permission. + operationId: UpdateSidebarCategoriesForTeamForUser + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/SidebarCategory" + required: true + responses: + "200": + description: Category update successful + content: + application/json: + schema: + $ref: "#/components/schemas/SidebarCategory" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "/api/v4/users/{user_id}/teams/{team_id}/channels/categories/order": + get: + tags: + - channels + summary: Get user's sidebar category order + description: > + Returns the order of the sidebar categories for a user on the given team as + an array of IDs. + + __Minimum server version__: 5.26 + + ##### Permissions + + Must be authenticated and have the `list_team_channels` permission. + operationId: GetSidebarCategoryOrderForTeamForUser + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + responses: + "200": + description: Order retrieval successful + content: + application/json: + schema: + type: array + items: + type: string + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + put: + tags: + - channels + summary: Update user's sidebar category order + description: > + Updates the order of the sidebar categories for a user on the given team. + The provided array must include the IDs of all categories on the team. + + __Minimum server version__: 5.26 + + ##### Permissions + + Must be authenticated and have the `list_team_channels` permission. + operationId: UpdateSidebarCategoryOrderForTeamForUser + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: array + items: + type: string + required: true + responses: + "200": + description: Order update successful + content: + application/json: + schema: + type: array + items: + type: string + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "/api/v4/users/{user_id}/teams/{team_id}/channels/categories/{category_id}": + get: + tags: + - channels + summary: Get sidebar category + description: > + Returns a single sidebar category for the user on the given team. + + __Minimum server version__: 5.26 + + ##### Permissions + + Must be authenticated and have the `list_team_channels` permission. + operationId: GetSidebarCategoryForTeamForUser + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + - name: category_id + in: path + description: Category GUID + required: true + schema: + type: string + responses: + "200": + description: Category retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/SidebarCategory" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + put: + tags: + - channels + summary: Update sidebar category + description: > + Updates a single sidebar category for the user on the given team. + + __Minimum server version__: 5.26 + + ##### Permissions + + Must be authenticated and have the `list_team_channels` permission. + operationId: UpdateSidebarCategoryForTeamForUser + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + - name: category_id + in: path + description: Category GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/SidebarCategory" + required: true + responses: + "200": + description: Category update successful + content: + application/json: + schema: + $ref: "#/components/schemas/SidebarCategory" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + delete: + tags: + - channels + summary: Delete sidebar category + description: > + Deletes a single sidebar category for the user on the given team. Only + custom categories can be deleted. + + __Minimum server version__: 5.26 + + ##### Permissions + + Must be authenticated and have the `list_team_channels` permission. + operationId: RemoveSidebarCategoryForTeamForUser + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + - name: category_id + in: path + description: Category GUID + required: true + schema: + type: string + responses: + "200": + description: Category delete successful + content: + application/json: + schema: + $ref: "#/components/schemas/SidebarCategory" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" diff --git a/api/v4/source/cloud.yaml b/api/v4/source/cloud.yaml new file mode 100644 index 0000000000..52f4e619e0 --- /dev/null +++ b/api/v4/source/cloud.yaml @@ -0,0 +1,357 @@ + /api/v4/cloud/limits: + get: + tags: + - cloud + summary: Get cloud workspace limits + description: > + Retrieve any cloud workspace limits applicable to this instance. + + ##### Permissions + + Must be authenticated and be licensed for Cloud. + + __Minimum server version__: 7.0 + __Note:__ This is intended for internal use and is subject to change. + operationId: GetCloudLimits + responses: + "200": + description: Cloud workspace limits returned successfully + content: + application/json: + schema: + $ref: "#/components/schemas/ProductLimits" + "401": + $ref: "#/components/responses/Unauthorized" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + /api/v4/cloud/products: + get: + tags: + - cloud + summary: Get cloud products + description: > + Retrieve a list of all products that are offered for Mattermost Cloud. + + ##### Permissions + + Must have `manage_system` permission and be licensed for Cloud. + + __Minimum server version__: 5.28 + __Note:__ This is intended for internal use and is subject to change. + operationId: GetCloudProducts + responses: + "200": + description: Cloud products returned successfully + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Product" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + /api/v4/cloud/payment: + post: + tags: + - cloud + summary: Create a customer setup payment intent + description: | + Creates a customer setup payment intent for the given Mattermost cloud installation. + + ##### Permissions + + Must have `manage_system` permission and be licensed for Cloud. + + __Minimum server version__: 5.28 + __Note:__: This is intended for internal use and is subject to change. + + operationId: CreateCustomerPayment + responses: + "201": + description: Payment setup intented created + content: + application/json: + schema: + $ref: "#/components/schemas/PaymentSetupIntent" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + /api/v4/cloud/payment/confirm: + post: + tags: + - cloud + summary: Completes the payment setup intent + description: > + Confirms the payment setup intent initiated when posting to `/cloud/payment`. + + ##### Permissions + + Must have `manage_system` permission and be licensed for Cloud. + + __Minimum server version__: 5.28 + __Note:__ This is intended for internal use and is subject to change. + operationId: ConfirmCustomerPayment + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + stripe_setup_intent_id: + type: string + responses: + "200": + description: Payment setup intent confirmed successfully + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + /api/v4/cloud/customer: + get: + tags: + - cloud + summary: Get cloud customer + description: > + Retrieves the customer information for the Mattermost Cloud customer bound to this installation. + + ##### Permissions + + Must have `manage_system` permission and be licensed for Cloud. + + __Minimum server version__: 5.28 + __Note:__ This is intended for internal use and is subject to change. + operationId: GetCloudCustomer + responses: + "200": + description: Cloud customer returned successfully + content: + application/json: + schema: + $ref: "#/components/schemas/CloudCustomer" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + put: + tags: + - cloud + summary: Update cloud customer + description: > + Updates the customer information for the Mattermost Cloud customer bound to this installation. + + ##### Permissions + + Must have `manage_system` permission and be licensed for Cloud. + + __Minimum server version__: 5.29 + __Note:__ This is intended for internal use and is subject to change. + operationId: UpdateCloudCustomer + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + email: + type: string + contact_first_name: + type: string + contact_last_name: + type: string + num_employees: + type: string + description: Customer patch including information to update + required: true + responses: + "200": + description: Cloud customer updated successfully + content: + application/json: + schema: + $ref: "#/components/schemas/CloudCustomer" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + /api/v4/cloud/customer/address: + put: + tags: + - cloud + summary: Update cloud customer address + description: > + Updates the company address for the Mattermost Cloud customer bound to this installation. + + ##### Permissions + + Must have `manage_system` permission and be licensed for Cloud. + + __Minimum server version__: 5.29 + __Note:__ This is intended for internal use and is subject to change. + operationId: UpdateCloudCustomerAddress + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/Address" + description: Company address information to update + required: true + responses: + "200": + description: Cloud customer address updated successfully + content: + application/json: + schema: + $ref: "#/components/schemas/CloudCustomer" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + /api/v4/cloud/subscription: + get: + tags: + - cloud + summary: Get cloud subscription + description: > + Retrieves the subscription information for the Mattermost Cloud customer bound to this installation. + + ##### Permissions + + Must have `manage_system` permission and be licensed for Cloud. + + __Minimum server version__: 5.28 + __Note:__ This is intended for internal use and is subject to change. + operationId: GetSubscription + responses: + "200": + description: Cloud subscription returned successfully + content: + application/json: + schema: + $ref: "#/components/schemas/Subscription" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + /api/v4/cloud/subscription/invoices: + get: + tags: + - cloud + summary: Get cloud subscription invoices + description: > + Retrieves the invoices for the subscription bound to this installation. + + ##### Permissions + + Must have `manage_system` permission and be licensed for Cloud. + + __Minimum server version__: 5.30 + __Note:__ This is intended for internal use and is subject to change. + operationId: GetInvoicesForSubscription + responses: + "200": + description: Subscription invoices returned successfully + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Invoice" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + /api/v4/cloud/subscription/invoices/{invoice_id}/pdf: + get: + tags: + - cloud + summary: Get cloud invoice PDF + description: > + Retrieves the PDF for the invoice passed as parameter + + ##### Permissions + + Must have `manage_system` permission and be licensed for Cloud. + + __Minimum server version__: 5.30 + __Note:__ This is intended for internal use and is subject to change. + operationId: GetInvoiceForSubscriptionAsPdf + parameters: + - name: invoice_id + in: path + description: Invoice ID + required: true + schema: + type: string + responses: + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + /api/v4/cloud/webhook: + post: + tags: + - cloud + summary: POST endpoint for CWS Webhooks + description: > + An endpoint for processing webhooks from the Customer Portal + + ##### Permissions + + This endpoint should only be accessed by CWS, in a Mattermost Cloud instance + + __Minimum server version__: 5.30 + __Note:__ This is intended for internal use and is subject to change. + operationId: PostEndpointForCwsWebhooks + responses: + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + diff --git a/api/v4/source/cluster.yaml b/api/v4/source/cluster.yaml new file mode 100644 index 0000000000..aff66b7b7d --- /dev/null +++ b/api/v4/source/cluster.yaml @@ -0,0 +1,24 @@ + /api/v4/cluster/status: + get: + tags: + - cluster + summary: Get cluster status + description: > + Get a set of information for each node in the cluster, useful for + checking the status and health of each node. + + ##### Permissions + + Must have `manage_system` permission. + operationId: GetClusterStatus + responses: + "200": + description: Cluster status retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/ClusterInfo" + "403": + $ref: "#/components/responses/Forbidden" diff --git a/api/v4/source/commands.yaml b/api/v4/source/commands.yaml new file mode 100644 index 0000000000..7a811cf457 --- /dev/null +++ b/api/v4/source/commands.yaml @@ -0,0 +1,512 @@ + /api/v4/commands: + post: + tags: + - commands + summary: Create a command + description: | + Create a command for a team. + ##### Permissions + `manage_slash_commands` for the team the command is in. + operationId: CreateCommand + requestBody: + content: + application/json: + schema: + type: object + required: + - team_id + - method + - trigger + - url + properties: + team_id: + type: string + description: Team ID to where the command should be created + method: + type: string + description: "`'P'` for post request, `'G'` for get request" + trigger: + type: string + description: Activation word to trigger the command + url: + type: string + description: The URL that the command will make the request + description: command to be created + required: true + responses: + "201": + description: Command creation successful + content: + application/json: + schema: + $ref: "#/components/schemas/Command" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + newCmd := &model.Command { + TeamId: , + URL: "http://nowhere.com", + Method: model.COMMAND_METHOD_POST, + Trigger: "trigger", + AutoComplete: false, + Description: "Description", + DisplayName: "Display name", + IconURL: "IconURL", + Username: "Username" + } + + // CreateCommand + createdCmd, resp := Client.CreateCommand(newCmd) + get: + tags: + - commands + summary: List commands for a team + description: | + List commands for a team. + ##### Permissions + `manage_slash_commands` if need list custom commands. + operationId: ListCommands + parameters: + - name: team_id + in: query + description: The team id. + schema: + type: string + - name: custom_only + in: query + description: > + 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. + schema: + type: boolean + default: false + responses: + "200": + description: List Commands retrieve successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Command" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/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(, true) + "/api/v4/teams/{team_id}/commands/autocomplete": + get: + tags: + - commands + summary: List autocomplete commands + description: | + List autocomplete commands in the team. + ##### Permissions + `view_team` for the team. + operationId: ListAutocompleteCommands + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + responses: + "200": + description: Autocomplete commands retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Command" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + // ListAutocompleteCommands + listCommands, resp := Client.ListAutocompleteCommands() + '/teams/{team_id}/commands/autocomplete_suggestions': + get: + tags: + - commands + summary: List commands' autocomplete data + description: | + List commands' autocomplete data for the team. + ##### Permissions + `view_team` for the team. + __Minimum server version__: 5.24 + operationId: ListCommandAutocompleteSuggestions + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + - name: user_input + in: query + description: String inputted by the user. + required: true + schema: + type: string + responses: + "200": + description: Commands' autocomplete data retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/AutocompleteSuggestion" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: 'Go' + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + // ListCommandAutocompleteSuggestions + teamID := "4xp9fdt77pncbef59f4k1qe83o" + userInput := "/jira" + listCommands, resp := Client.ListCommandAutocompleteSuggestions(userInput, teamID) + "/api/v4/commands/{command_id}": + get: + tags: + - commands + summary: Get a command + description: > + Get a command definition based on command id string. + + ##### Permissions + + Must have `manage_slash_commands` permission for the team the command is in. + + + __Minimum server version__: 5.22 + operationId: GetCommandById + parameters: + - in: path + name: command_id + description: ID of the command to get + required: true + schema: + type: string + responses: + "200": + description: Command get successful + content: + application/json: + schema: + $ref: "#/components/schemas/Command" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + // GetCommand + cmd, resp := Client.GetCommand() + put: + tags: + - commands + summary: Update a command + description: > + Update a single command based on command id string and Command struct. + + ##### Permissions + + Must have `manage_slash_commands` permission for the team the command is in. + operationId: UpdateCommand + parameters: + - in: path + name: command_id + description: ID of the command to update + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/Command" + required: true + responses: + "200": + description: Command updated successful + content: + application/json: + schema: + $ref: "#/components/schemas/Command" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + cmdToUpdate := &model.Command{ + CreatorId: , + TeamId: , + URL: "", + Trigger: , + Id: , + } + + // UpdateCommand + listCommands, resp := Client.UpdateCommand(cmdToUpdate) + delete: + tags: + - commands + summary: Delete a command + description: > + Delete a command based on command id string. + + ##### Permissions + + Must have `manage_slash_commands` permission for the team the command is in. + operationId: DeleteCommand + parameters: + - in: path + name: command_id + description: ID of the command to delete + required: true + schema: + type: string + responses: + "200": + description: Command deletion successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + // DeleteCommand + ok, resp := Client.DeleteCommand() + "/api/v4/commands/{command_id}/move": + put: + tags: + - commands + summary: Move a command + description: > + Move a command to a different team based on command id string. + + ##### Permissions + + Must have `manage_slash_commands` permission for the team the command is currently in and the destination team. + + + __Minimum server version__: 5.22 + operationId: MoveCommand + parameters: + - in: path + name: command_id + description: ID of the command to move + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + team_id: + type: string + description: Destination teamId + required: true + responses: + "200": + description: Command move successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + // MoveCommand + ok, resp := Client.MoveCommand(,) + "/api/v4/commands/{command_id}/regen_token": + put: + tags: + - commands + summary: Generate a new token + description: > + Generate a new token for the command based on command id string. + + ##### Permissions + + Must have `manage_slash_commands` permission for the team the command is in. + operationId: RegenCommandToken + parameters: + - in: path + name: command_id + description: ID of the command to generate the new token + required: true + schema: + type: string + responses: + "200": + description: Token generation successful + content: + application/json: + schema: + type: object + properties: + token: + description: The new token + type: string + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + // RegenCommandToken + newToken, resp := Client.RegenCommandToken() + /api/v4/commands/execute: + post: + tags: + - commands + summary: Execute a command + description: > + Execute a command on a team. + + ##### Permissions + + Must have `use_slash_commands` permission for the team the command is in. + operationId: ExecuteCommand + requestBody: + content: + application/json: + schema: + type: object + required: + - channel_id + - command + properties: + channel_id: + type: string + description: Channel Id where the command will execute + command: + type: string + description: "The slash command to execute, including parameters. Eg, `'/echo bounces around the room'`" + description: command to be executed + required: true + responses: + "200": + description: Command execution successful + content: + application/json: + schema: + $ref: "#/components/schemas/CommandResponse" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" diff --git a/api/v4/source/compliance.yaml b/api/v4/source/compliance.yaml new file mode 100644 index 0000000000..b224957c30 --- /dev/null +++ b/api/v4/source/compliance.yaml @@ -0,0 +1,127 @@ + /api/v4/compliance/reports: + post: + tags: + - compliance + summary: Create report + description: | + Create and save a compliance report. + ##### Permissions + Must have `manage_system` permission. + operationId: CreateComplianceReport + responses: + "201": + description: Compliance report creation successful + content: + application/json: + schema: + $ref: "#/components/schemas/Compliance" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + get: + tags: + - compliance + summary: Get reports + description: > + Get a list of compliance reports previously created by page, selected + with `page` and `per_page` query parameters. + + ##### Permissions + + Must have `manage_system` permission. + operationId: GetComplianceReports + parameters: + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of reports per page. + schema: + type: integer + default: 60 + responses: + "200": + description: Compliance reports retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Compliance" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + "/api/v4/compliance/reports/{report_id}": + get: + tags: + - compliance + summary: Get a report + description: | + Get a compliance reports previously created. + ##### Permissions + Must have `manage_system` permission. + operationId: GetComplianceReport + parameters: + - name: report_id + in: path + description: Compliance report GUID + required: true + schema: + type: string + responses: + "200": + description: Compliance report retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/Compliance" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + "/api/v4/compliance/reports/{report_id}/download": + get: + tags: + - compliance + summary: Download a report + description: | + Download the full contents of a report as a file. + ##### Permissions + Must have `manage_system` permission. + operationId: DownloadComplianceReport + parameters: + - name: report_id + in: path + description: Compliance report GUID + required: true + schema: + type: string + responses: + "200": + description: The compliance report file + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" diff --git a/api/v4/source/dataretention.yaml b/api/v4/source/dataretention.yaml new file mode 100644 index 0000000000..2458164ea5 --- /dev/null +++ b/api/v4/source/dataretention.yaml @@ -0,0 +1,676 @@ + /api/v4/data_retention/policy: + get: + tags: + - data retention + summary: Get the global data retention policy + description: | + Gets the current global 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 + + ##### Permissions + Requires an active session but no other permissions. + + ##### License + Requires an E20 license. + operationId: GetDataRetentionPolicy + responses: + "200": + description: Global data retention policy details retrieved successfully. + content: + application/json: + schema: + $ref: "#/components/schemas/GlobalDataRetentionPolicy" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + /api/v4/data_retention/policies_count: + get: + tags: + - data retention + summary: Get the number of granular data retention policies + description: | + Gets the number of granular (i.e. team or channel-specific) data retention + policies from the server. + + __Minimum server version__: 5.35 + + ##### Permissions + Must have the `sysconsole_read_compliance_data_retention` permission. + + ##### License + Requires an E20 license. + operationId: GetDataRetentionPoliciesCount + responses: + "200": + description: Number of retention policies retrieved successfully. + content: + application/json: + schema: + type: object + properties: + total_count: + type: integer + description: The number of granular retention policies. + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + /api/v4/data_retention/policies: + get: + tags: + - data retention + summary: Get the granular data retention policies + description: | + Gets details about the granular (i.e. team or channel-specific) data retention + policies from the server. + + __Minimum server version__: 5.35 + + ##### Permissions + Must have the `sysconsole_read_compliance_data_retention` permission. + + ##### License + Requires an E20 license. + operationId: GetDataRetentionPolicies + parameters: + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of policies per page. There is a maximum limit of 200 per page. + schema: + type: integer + default: 60 + responses: + "200": + description: Retention policies' details retrieved successfully. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/DataRetentionPolicyWithTeamAndChannelCounts" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + post: + tags: + - data retention + summary: Create a new granular data retention policy + description: | + Creates a new granular data retention policy with the specified display + name and post duration. + + __Minimum server version__: 5.35 + + ##### Permissions + Must have the `sysconsole_write_compliance_data_retention` permission. + + ##### License + Requires an E20 license. + operationId: CreateDataRetentionPolicy + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/DataRetentionPolicyCreate" + responses: + "201": + description: Retention policy successfully created. + content: + application/json: + schema: + $ref: "#/components/schemas/DataRetentionPolicyWithTeamAndChannelCounts" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + "/api/v4/data_retention/policies/{policy_id}": + get: + tags: + - data retention + summary: Get a granular data retention policy + description: | + Gets details about a granular data retention policies by ID. + + __Minimum server version__: 5.35 + + ##### Permissions + Must have the `sysconsole_read_compliance_data_retention` permission. + + ##### License + Requires an E20 license. + operationId: GetDataRetentionPolicyByID + parameters: + - name: policy_id + in: path + description: The ID of the granular retention policy. + required: true + schema: + type: string + responses: + "200": + description: Retention policy's details retrieved successfully. + content: + application/json: + schema: + $ref: "#/components/schemas/DataRetentionPolicyWithTeamAndChannelCounts" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + patch: + tags: + - data retention + summary: Patch a granular data retention policy + description: | + Patches (i.e. replaces the fields of) a granular data retention policy. + If any fields are omitted, they will not be changed. + + __Minimum server version__: 5.35 + + ##### Permissions + Must have the `sysconsole_write_compliance_data_retention` permission. + + ##### License + Requires an E20 license. + operationId: PatchDataRetentionPolicy + parameters: + - name: policy_id + in: path + description: The ID of the granular retention policy. + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/DataRetentionPolicyWithTeamAndChannelIds" + responses: + "200": + description: Retention policy successfully patched. + content: + application/json: + schema: + $ref: "#/components/schemas/DataRetentionPolicyWithTeamAndChannelCounts" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + delete: + tags: + - data retention + summary: Delete a granular data retention policy + description: | + Deletes a granular data retention policy. + + __Minimum server version__: 5.35 + + ##### Permissions + Must have the `sysconsole_write_compliance_data_retention` permission. + + ##### License + Requires an E20 license. + operationId: DeleteDataRetentionPolicy + parameters: + - name: policy_id + in: path + description: The ID of the granular retention policy. + required: true + schema: + type: string + responses: + "200": + description: Retention policy successfully deleted. + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + "/api/v4/data_retention/policies/{policy_id}/teams": + get: + tags: + - data retention + summary: Get the teams for a granular data retention policy + description: | + Gets the teams to which a granular data retention policy is applied. + + __Minimum server version__: 5.35 + + ##### Permissions + Must have the `sysconsole_read_compliance_data_retention` permission. + + ##### License + Requires an E20 license. + operationId: GetTeamsForRetentionPolicy + parameters: + - name: policy_id + in: path + description: The ID of the granular retention policy. + required: true + schema: + type: string + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of teams per page. There is a maximum limit of 200 per page. + schema: + type: integer + default: 60 + responses: + "200": + description: Teams for retention policy successfully retrieved. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Team" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + post: + tags: + - data retention + summary: Add teams to a granular data retention policy + description: | + Adds teams to a granular data retention policy. + + __Minimum server version__: 5.35 + + ##### Permissions + Must have the `sysconsole_write_compliance_data_retention` permission. + + ##### License + Requires an E20 license. + operationId: AddTeamsToRetentionPolicy + parameters: + - name: policy_id + in: path + description: The ID of the granular retention policy. + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + type: string + description: The IDs of the teams to add to the policy. + responses: + "200": + description: Teams successfully added to retention policy. + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + delete: + tags: + - data retention + summary: Delete teams from a granular data retention policy + description: | + Delete teams from a granular data retention policy. + + __Minimum server version__: 5.35 + + ##### Permissions + Must have the `sysconsole_write_compliance_data_retention` permission. + + ##### License + Requires an E20 license. + operationId: RemoveTeamsFromRetentionPolicy + parameters: + - name: policy_id + in: path + description: The ID of the granular retention policy. + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + type: string + description: The IDs of the teams to remove from the policy. + responses: + "200": + description: Teams successfully deleted from retention policy. + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + "/api/v4/data_retention/policies/{policy_id}/teams/search": + post: + tags: + - data retention + summary: Search for the teams in a granular data retention policy + description: | + Searches for the teams to which a granular data retention policy is applied. + + __Minimum server version__: 5.35 + + ##### Permissions + Must have the `sysconsole_read_compliance_data_retention` permission. + + ##### License + Requires an E20 license. + operationId: SearchTeamsForRetentionPolicy + parameters: + - name: policy_id + in: path + description: The ID of the granular retention policy. + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + term: + type: string + description: The search term to match against the name or display name of teams + responses: + "200": + description: Teams for retention policy successfully retrieved. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Team" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + "/api/v4/data_retention/policies/{policy_id}/channels": + get: + tags: + - data retention + summary: Get the channels for a granular data retention policy + description: | + Gets the channels to which a granular data retention policy is applied. + + __Minimum server version__: 5.35 + + ##### Permissions + Must have the `sysconsole_read_compliance_data_retention` permission. + + ##### License + Requires an E20 license. + operationId: GetChannelsForRetentionPolicy + parameters: + - name: policy_id + in: path + description: The ID of the granular retention policy. + required: true + schema: + type: string + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of channels per page. There is a maximum limit of 200 per page. + schema: + type: integer + default: 60 + responses: + "200": + description: Channels for retention policy successfully retrieved. + content: + application/json: + schema: + $ref: "#/components/schemas/ChannelListWithTeamData" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + post: + tags: + - data retention + summary: Add channels to a granular data retention policy + description: | + Adds channels to a granular data retention policy. + + __Minimum server version__: 5.35 + + ##### Permissions + Must have the `sysconsole_write_compliance_data_retention` permission. + + ##### License + Requires an E20 license. + operationId: AddChannelsToRetentionPolicy + parameters: + - name: policy_id + in: path + description: The ID of the granular retention policy. + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + type: string + description: The IDs of the channels to add to the policy. + responses: + "200": + description: Channels successfully added to retention policy. + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + delete: + tags: + - data retention + summary: Delete channels from a granular data retention policy + description: | + Delete channels from a granular data retention policy. + + __Minimum server version__: 5.35 + + ##### Permissions + Must have the `sysconsole_write_compliance_data_retention` permission. + + ##### License + Requires an E20 license. + operationId: RemoveChannelsFromRetentionPolicy + parameters: + - name: policy_id + in: path + description: The ID of the granular retention policy. + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + type: string + description: The IDs of the channels to add to the policy. + responses: + "200": + description: Channels successfully deleted from retention policy. + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + "/api/v4/data_retention/policies/{policy_id}/channels/search": + post: + tags: + - data retention + summary: Search for the channels in a granular data retention policy + description: | + Searches for the channels to which a granular data retention policy is applied. + + __Minimum server version__: 5.35 + + ##### Permissions + Must have the `sysconsole_read_compliance_data_retention` permission. + + ##### License + Requires an E20 license. + operationId: SearchChannelsForRetentionPolicy + parameters: + - name: policy_id + in: path + description: The ID of the granular retention policy. + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + term: + type: string + description: The string to search in the channel name, display name, and purpose. + team_ids: + type: array + items: + type: string + description: > + Filters results to channels belonging to the given team ids + public: + type: boolean + description: > + Filters results to only return Public / Open channels, can be used in conjunction + with `private` to return both `public` and `private` channels + private: + type: boolean + description: > + Filters results to only return Private channels, can be used in conjunction + with `public` to return both `private` and `public` channels + deleted: + type: boolean + description: > + Filters results to only return deleted / archived channels + responses: + "200": + description: Channels for retention policy successfully retrieved. + content: + application/json: + schema: + $ref: "#/components/schemas/ChannelListWithTeamData" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" diff --git a/api/v4/source/definitions.yaml b/api/v4/source/definitions.yaml new file mode 100644 index 0000000000..1754b75f51 --- /dev/null +++ b/api/v4/source/definitions.yaml @@ -0,0 +1,3646 @@ +components: + securitySchemes: + bearerAuth: # arbitrary name for the security scheme + type: http + scheme: bearer + bearerFormat: Token + responses: + Forbidden: + description: Do not have appropriate permissions + content: + application/json: + schema: + $ref: "#/components/schemas/AppError" + Unauthorized: + description: No access token provided + content: + application/json: + schema: + $ref: "#/components/schemas/AppError" + BadRequest: + description: Invalid or missing parameters in URL or request body + content: + application/json: + schema: + $ref: "#/components/schemas/AppError" + NotFound: + description: Resource not found + content: + application/json: + schema: + $ref: "#/components/schemas/AppError" + TooLarge: + description: Content too large + content: + application/json: + schema: + $ref: "#/components/schemas/AppError" + NotImplemented: + description: Feature is disabled + content: + application/json: + schema: + $ref: "#/components/schemas/AppError" + TooManyRequests: + description: Too many requests + content: + application/json: + schema: + $ref: "#/components/schemas/AppError" + InternalServerError: + description: Something went wrong with the server + content: + application/json: + schema: + $ref: "#/components/schemas/AppError" + schemas: + User: + type: object + properties: + id: + type: string + create_at: + description: The time in milliseconds a user was created + type: integer + format: int64 + update_at: + description: The time in milliseconds a user was last updated + type: integer + format: int64 + delete_at: + description: The time in milliseconds a user was deleted + type: integer + format: int64 + username: + type: string + first_name: + type: string + last_name: + type: string + nickname: + type: string + email: + type: string + email_verified: + type: boolean + auth_service: + type: string + roles: + type: string + locale: + type: string + notify_props: + $ref: "#/components/schemas/UserNotifyProps" + props: + type: object + last_password_update: + type: integer + format: int64 + last_picture_update: + type: integer + format: int64 + failed_attempts: + type: integer + mfa_active: + type: boolean + timezone: + $ref: "#/components/schemas/Timezone" + terms_of_service_id: + description: ID of accepted terms of service, if any. This field is not present + if empty. + type: string + terms_of_service_create_at: + description: The time in milliseconds the user accepted the terms of service + type: integer + format: int64 + UsersStats: + type: object + properties: + total_users_count: + type: integer + KnownUsers: + type: array + properties: + items: + type: string + Team: + type: object + properties: + id: + type: string + create_at: + description: The time in milliseconds a team was created + type: integer + format: int64 + update_at: + description: The time in milliseconds a team was last updated + type: integer + format: int64 + delete_at: + description: The time in milliseconds a team was deleted + type: integer + format: int64 + display_name: + type: string + name: + type: string + description: + type: string + email: + type: string + type: + type: string + allowed_domains: + type: string + invite_id: + type: string + allow_open_invite: + type: boolean + policy_id: + type: string + description: >- + The data retention policy to which this team has been assigned. If no such policy exists, + or the caller does not have the `sysconsole_read_compliance_data_retention` permission, + this field will be null. + TeamStats: + type: object + properties: + team_id: + type: string + total_member_count: + type: integer + active_member_count: + type: integer + TeamExists: + type: object + properties: + exists: + type: boolean + Channel: + type: object + properties: + id: + type: string + create_at: + description: The time in milliseconds a channel was created + type: integer + format: int64 + update_at: + description: The time in milliseconds a channel was last updated + type: integer + format: int64 + delete_at: + description: The time in milliseconds a channel was deleted + type: integer + format: int64 + team_id: + type: string + type: + type: string + display_name: + type: string + name: + type: string + header: + type: string + purpose: + type: string + last_post_at: + description: The time in milliseconds of the last post of a channel + type: integer + format: int64 + total_msg_count: + type: integer + extra_update_at: + description: Deprecated in Mattermost 5.0 release + type: integer + format: int64 + creator_id: + type: string + ChannelStats: + type: object + properties: + channel_id: + type: string + member_count: + type: integer + ChannelMember: + type: object + properties: + channel_id: + type: string + user_id: + type: string + roles: + type: string + last_viewed_at: + description: The time in milliseconds the channel was last viewed by the user + type: integer + format: int64 + msg_count: + type: integer + mention_count: + type: integer + notify_props: + $ref: "#/components/schemas/ChannelNotifyProps" + last_update_at: + description: The time in milliseconds the channel member was last updated + type: integer + format: int64 + ChannelMemberWithTeamData: + allOf: + - $ref: "#/components/schemas/ChannelMember" + - type: object + properties: + team_display_name: + type: string + description: The display name of the team to which this channel belongs. + team_name: + type: string + description: The name of the team to which this channel belongs. + team_update_at: + type: integer + description: The time at which the team to which this channel belongs was last updated. + ChannelData: + type: object + properties: + channel: + $ref: "#/components/schemas/Channel" + member: + $ref: "#/components/schemas/ChannelMember" + ChannelWithTeamData: + allOf: + - $ref: "#/components/schemas/Channel" + - type: object + properties: + team_display_name: + type: string + description: The display name of the team to which this channel belongs. + team_name: + type: string + description: The name of the team to which this channel belongs. + team_update_at: + type: integer + description: The time at which the team to which this channel belongs was last updated. + policy_id: + type: string + description: >- + The data retention policy to which this team has been assigned. If no such policy exists, + or the caller does not have the `sysconsole_read_compliance_data_retention` permission, this field + will be null. + ChannelListWithTeamData: + type: array + items: + $ref: "#/components/schemas/ChannelWithTeamData" + Post: + type: object + properties: + id: + type: string + create_at: + description: The time in milliseconds a post was created + type: integer + format: int64 + update_at: + description: The time in milliseconds a post was last updated + type: integer + format: int64 + delete_at: + description: The time in milliseconds a post was deleted + type: integer + format: int64 + edit_at: + type: integer + format: int64 + user_id: + type: string + channel_id: + type: string + root_id: + type: string + original_id: + type: string + message: + type: string + type: + type: string + props: + type: object + hashtag: + type: string + file_ids: + type: array + items: + type: string + pending_post_id: + type: string + metadata: + $ref: "#/components/schemas/PostMetadata" + FileInfoList: + type: object + properties: + order: + type: array + items: + type: string + example: + - file_info_id1 + - file_info_id2 + file_infos: + type: object + additionalProperties: + $ref: "#/components/schemas/FileInfo" + next_file_id: + type: string + description: The ID of next file info. Not omitted when empty or not relevant. + prev_file_id: + type: string + description: The ID of previous file info. Not omitted when empty or not relevant. + PostList: + type: object + properties: + order: + type: array + items: + type: string + example: + - post_id1 + - post_id12 + posts: + type: object + additionalProperties: + $ref: "#/components/schemas/Post" + next_post_id: + type: string + description: The ID of next post. Not omitted when empty or not relevant. + prev_post_id: + type: string + description: The ID of previous post. Not omitted when empty or not relevant. + has_next: + type: boolean + description: Whether there are more items after this page. + PostListWithSearchMatches: + type: object + properties: + order: + type: array + items: + type: string + example: + - post_id1 + - post_id12 + posts: + type: object + additionalProperties: + $ref: "#/components/schemas/Post" + matches: + description: A mapping of post IDs to a list of matched terms within the post. + This field will only be populated on servers running version 5.1 or + greater with Elasticsearch enabled. + type: object + additionalProperties: + type: array + items: + type: string + example: + post_id1: + - search match 1 + - search match 2 + PostMetadata: + type: object + description: Additional information used to display a post. + properties: + embeds: + type: array + description: > + Information about content embedded in the post including OpenGraph + previews, image link previews, and message attachments. + This field will be null if the post does not contain embedded content. + items: + type: object + properties: + type: + type: string + description: The type of content that is embedded in this point. + enum: + - image + - message_attachment + - opengraph + - link + url: + type: string + description: The URL of the embedded content, if one exists. + data: + type: object + description: > + Any additional information about the embedded content. Only + used at this time to store OpenGraph metadata. + + This field will be null for non-OpenGraph embeds. + emojis: + type: array + description: > + The custom emojis that appear in this point or have been used in + reactions to this post. This field will be null if the post does not contain custom emojis. + items: + $ref: "#/components/schemas/Emoji" + files: + type: array + description: > + The FileInfo objects for any files attached to the post. This field + will be null if the post does not have any file attachments. + items: + $ref: "#/components/schemas/FileInfo" + images: + type: object + description: > + An object mapping the URL of an external image to an object + containing the dimensions of that image. This field will be + null if the post or its embedded content does not reference any external images. + items: + type: object + properties: + height: + type: integer + width: + type: integer + reactions: + type: array + description: > + Any reactions made to this point. This field will be null if no + reactions have been made to this post. + items: + $ref: "#/components/schemas/Reaction" + priority: + type: object + description: > + Post priority set for this post. This field will be null if no + priority metadata has been set. + properties: + priority: + type: string + description: The priority label of a post, could be either empty, important, or urgent. + requested_ack: + type: boolean + description: Whether the post author has requested for acknowledgements or not. + acknowledgements: + type: array + description: > + Any acknowledgements made to this point. + items: + $ref: "#/components/schemas/PostAcknowledgement" + TeamMap: + type: object + description: A mapping of teamIds to teams. + properties: + team_id: + $ref: "#/components/schemas/Team" + TeamMember: + type: object + properties: + team_id: + description: The ID of the team this member belongs to. + type: string + user_id: + description: The ID of the user this member relates to. + type: string + roles: + description: 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. + type: string + delete_at: + description: The time in milliseconds that this team member was deleted. + type: integer + scheme_user: + description: Whether this team member holds the default user role defined by the + team's permissions scheme. + type: boolean + scheme_admin: + description: Whether this team member holds the default admin role defined by the + team's permissions scheme. + type: boolean + explicit_roles: + description: 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. + type: string + TeamUnread: + type: object + properties: + team_id: + type: string + msg_count: + type: integer + mention_count: + type: integer + ChannelUnread: + type: object + properties: + team_id: + type: string + channel_id: + type: string + msg_count: + type: integer + mention_count: + type: integer + ChannelUnreadAt: + type: object + properties: + team_id: + description: The ID of the team the channel belongs to. + type: string + channel_id: + description: The ID of the channel the user has access to.. + type: string + msg_count: + description: No. of messages the user has already read. + type: integer + mention_count: + description: No. of mentions the user has within the unread posts of the channel. + type: integer + last_viewed_at: + description: time in milliseconds when the user last viewed the channel. + type: integer + Session: + type: object + properties: + create_at: + description: The time in milliseconds a session was created + type: integer + format: int64 + device_id: + type: string + expires_at: + description: The time in milliseconds a session will expire + type: integer + format: int64 + id: + type: string + is_oauth: + type: boolean + last_activity_at: + description: The time in milliseconds of the last activity of a session + type: integer + format: int64 + props: + type: object + roles: + type: string + team_members: + type: array + items: + $ref: "#/components/schemas/TeamMember" + token: + type: string + user_id: + type: string + FileInfo: + type: object + properties: + id: + description: The unique identifier for this file + type: string + user_id: + description: The ID of the user that uploaded this file + type: string + post_id: + description: If this file is attached to a post, the ID of that post + type: string + create_at: + description: The time in milliseconds a file was created + type: integer + format: int64 + update_at: + description: The time in milliseconds a file was last updated + type: integer + format: int64 + delete_at: + description: The time in milliseconds a file was deleted + type: integer + format: int64 + name: + description: The name of the file + type: string + extension: + description: The extension at the end of the file name + type: string + size: + description: The size of the file in bytes + type: integer + mime_type: + description: The MIME type of the file + type: string + width: + description: If this file is an image, the width of the file + type: integer + height: + description: If this file is an image, the height of the file + type: integer + has_preview_image: + description: If this file is an image, whether or not it has a preview-sized + version + type: boolean + Preference: + type: object + properties: + user_id: + description: The ID of the user that owns this preference + type: string + category: + type: string + name: + type: string + value: + type: string + UserAuthData: + type: object + properties: + auth_data: + description: Service-specific authentication data + type: string + auth_service: + description: The authentication service such as "email", "gitlab", or "ldap" + type: string + required: + - auth_data + - auth_service + UserAutocomplete: + type: object + properties: + users: + description: A list of users that are the main result of the query + type: array + items: + $ref: "#/components/schemas/User" + out_of_channel: + description: A special case list of users returned when autocompleting in a + specific channel. Omitted when empty or not relevant + type: array + items: + $ref: "#/components/schemas/User" + UserAutocompleteInTeam: + type: object + properties: + in_team: + description: A list of user objects in the team + type: array + items: + $ref: "#/components/schemas/User" + UserAutocompleteInChannel: + type: object + properties: + in_channel: + description: A list of user objects in the channel + type: array + items: + $ref: "#/components/schemas/User" + out_of_channel: + description: A list of user objects not in the channel + type: array + items: + $ref: "#/components/schemas/User" + IncomingWebhook: + type: object + properties: + id: + description: The unique identifier for this incoming webhook + type: string + create_at: + description: The time in milliseconds a incoming webhook was created + type: integer + format: int64 + update_at: + description: The time in milliseconds a incoming webhook was last updated + type: integer + format: int64 + delete_at: + description: The time in milliseconds a incoming webhook was deleted + type: integer + format: int64 + channel_id: + description: The ID of a public channel or private group that receives the + webhook payloads + type: string + description: + description: The description for this incoming webhook + type: string + display_name: + description: The display name for this incoming webhook + type: string + OutgoingWebhook: + type: object + properties: + id: + description: The unique identifier for this outgoing webhook + type: string + create_at: + description: The time in milliseconds a outgoing webhook was created + type: integer + format: int64 + update_at: + description: The time in milliseconds a outgoing webhook was last updated + type: integer + format: int64 + delete_at: + description: The time in milliseconds a outgoing webhook was deleted + type: integer + format: int64 + creator_id: + description: The Id of the user who created the webhook + type: string + team_id: + description: The ID of the team that the webhook watchs + type: string + channel_id: + description: The ID of a public channel that the webhook watchs + type: string + description: + description: The description for this outgoing webhook + type: string + display_name: + description: The display name for this outgoing webhook + type: string + trigger_words: + description: List of words for the webhook to trigger on + type: array + items: + type: string + trigger_when: + description: When to trigger the webhook, `0` when a trigger word is present at + all and `1` if the message starts with a trigger word + type: integer + callback_urls: + description: The URLs to POST the payloads to when the webhook is triggered + type: array + items: + type: string + content_type: + description: The format to POST the data in, either `application/json` or + `application/x-www-form-urlencoded` + default: application/x-www-form-urlencoded + type: string + Reaction: + type: object + properties: + user_id: + description: The ID of the user that made this reaction + type: string + post_id: + description: The ID of the post to which this reaction was made + type: string + emoji_name: + description: The name of the emoji that was used for this reaction + type: string + create_at: + description: The time in milliseconds this reaction was made + type: integer + format: int64 + TopReaction: + type: object + properties: + emoji_name: + description: The name of the emoji used for this reaction. + type: string + count: + description: The number of the times this emoji has been used. + type: integer + format: int64 + NewTeamMember: + type: object + properties: + id: + description: The user's ID. + type: string + username: + type: string + first_name: + type: string + last_name: + type: string + nickname: + type: string + position: + description: The user's position field value. + type: string + create_at: + description: The creation timestamp of the team member record. + type: integer + TopReactionList: + type: object + properties: + has_next: + description: Indicates if there is another page of reactions that can be fetched. + type: boolean + items: + description: List of reactions. + type: array + items: + $ref: "#/components/schemas/TopReaction" + NewTeamMembersList: + type: object + properties: + has_next: + description: Indicates if there is another page of new team members that can be fetched. + type: boolean + items: + description: List of new team members. + type: array + items: + $ref: "#/components/schemas/NewTeamMember" + total_count: + description: The total count of new team members for the given time range. + type: integer + TopChannel: + type: object + properties: + id: + type: string + type: + type: string + display_name: + type: string + name: + type: string + team_id: + type: string + message_count: + description: The number of messages posted in the channel by users over the given time period (not including messages posted by bots). + type: string + TopChannelList: + type: object + properties: + has_next: + description: Indicates if there is another page of channels that can be fetched. + type: boolean + items: + description: List of channels. + type: array + items: + $ref: "#/components/schemas/TopChannel" + InsightUserInformation: + type: object + properties: + id: + type: string + first_name: + type: string + last_name: + type: string + nickname: + type: string + username: + type: string + last_picture_update: + type: string + create_at: + type: integer + format: int64 + TopThread: + type: object + properties: + post: + $ref: "#/components/schemas/Post" + channel_id: + type: string + channel_display_name: + type: string + channel_name: + type: string + Participants: + type: array + items: + type: string + user_information: + description: User who created the post + $ref: "#/components/schemas/InsightUserInformation" + TopThreadList: + type: object + properties: + has_next: + description: Indicates if there is another page of top threads that can be fetched. + type: boolean + items: + description: List of top threads. + type: array + items: + $ref: "#/components/schemas/TopThread" + TopDMInsightUserInformation: + allOf: + - $ref: "#/components/schemas/InsightUserInformation" + - type: object + properties: + position: + type: string + TopDM: + type: object + properties: + post_count: + type: integer + format: int64 + outgoing_message_count: + type: integer + format: int64 + second_participant: + $ref: "#/components/schemas/TopDMInsightUserInformation" + TopDMList: + type: object + properties: + has_next: + description: Indicates if there is another page of top DMs that can be fetched. + type: boolean + items: + description: List of top DMs. + type: array + items: + $ref: "#/components/schemas/TopDM" + Emoji: + type: object + properties: + id: + description: The ID of the emoji + type: string + creator_id: + description: The ID of the user that made the emoji + type: string + name: + description: The name of the emoji + type: string + create_at: + description: The time in milliseconds the emoji was made + type: integer + format: int64 + update_at: + description: The time in milliseconds the emoji was last updated + type: integer + format: int64 + delete_at: + description: The time in milliseconds the emoji was deleted + type: integer + format: int64 + Command: + type: object + properties: + id: + description: The ID of the slash command + type: string + token: + description: The token which is used to verify the source of the payload + type: string + create_at: + description: The time in milliseconds the command was created + type: integer + update_at: + description: The time in milliseconds the command was last updated + type: integer + format: int64 + delete_at: + description: The time in milliseconds the command was deleted, 0 if never deleted + type: integer + format: int64 + creator_id: + description: The user id for the commands creator + type: string + team_id: + description: The team id for which this command is configured + type: string + trigger: + description: The string that triggers this command + type: string + method: + description: Is the trigger done with HTTP Get ('G') or HTTP Post ('P') + type: string + username: + description: What is the username for the response post + type: string + icon_url: + description: The url to find the icon for this users avatar + type: string + auto_complete: + description: Use auto complete for this command + type: boolean + auto_complete_desc: + description: The description for this command shown when selecting the command + type: string + auto_complete_hint: + description: The hint for this command + type: string + display_name: + description: Display name for the command + type: string + description: + description: Description for this command + type: string + url: + description: The URL that is triggered + type: string + AutocompleteSuggestion: + type: object + properties: + Complete: + description: Completed suggestion + type: string + Suggestion: + description: Predicted text user might want to input + type: string + Hint: + description: Hint about suggested input + type: string + Description: + description: Description of the suggested command + type: string + IconData: + description: Base64 encoded svg image + type: string + CommandResponse: + type: object + properties: + ResponseType: + description: The response type either in_channel or ephemeral + type: string + Text: + type: string + Username: + type: string + IconURL: + type: string + GotoLocation: + type: string + Attachments: + type: array + items: + $ref: "#/components/schemas/SlackAttachment" + SlackAttachment: + type: object + properties: + Id: + type: string + Fallback: + type: string + Color: + type: string + Pretext: + type: string + AuthorName: + type: string + AuthorLink: + type: string + AuthorIcon: + type: string + Title: + type: string + TitleLink: + type: string + Text: + type: string + Fields: + type: array + items: + $ref: "#/components/schemas/SlackAttachmentField" + ImageURL: + type: string + ThumbURL: + type: string + Footer: + type: string + FooterIcon: + type: string + Timestamp: + description: The timestamp of the slack attachment, either type of string or integer + type: string + SlackAttachmentField: + type: object + properties: + Title: + type: string + Value: + description: The value of the attachment, set as string but capable with golang interface + type: string + Short: + type: boolean + StatusOK: + type: object + properties: + status: + description: Will contain "ok" if the request was successful and there was nothing else to return + type: string + OpenGraph: + type: object + description: OpenGraph metadata of a webpage + properties: + type: + type: string + url: + type: string + title: + type: string + description: + type: string + determiner: + type: string + site_name: + type: string + locale: + type: string + locales_alternate: + type: array + items: + type: string + images: + type: array + items: + type: object + description: Image object used in OpenGraph metadata of a webpage + properties: + url: + type: string + secure_url: + type: string + type: + type: string + width: + type: integer + height: + type: integer + videos: + type: array + items: + type: object + description: Video object used in OpenGraph metadata of a webpage + properties: + url: + type: string + secure_url: + type: string + type: + type: string + width: + type: integer + height: + type: integer + audios: + type: array + items: + type: object + description: Audio object used in OpenGraph metadata of a webpage + properties: + url: + type: string + secure_url: + type: string + type: + type: string + article: + type: object + description: Article object used in OpenGraph metadata of a webpage, if type is + article + properties: + published_time: + type: string + modified_time: + type: string + expiration_time: + type: string + section: + type: string + tags: + type: array + items: + type: string + authors: + type: array + items: + type: object + properties: + first_name: + type: string + last_name: + type: string + username: + type: string + gender: + type: string + book: + type: object + description: Book object used in OpenGraph metadata of a webpage, if type is book + properties: + isbn: + type: string + release_date: + type: string + tags: + type: array + items: + type: string + authors: + type: array + items: + type: object + properties: + first_name: + type: string + last_name: + type: string + username: + type: string + gender: + type: string + profile: + type: object + properties: + first_name: + type: string + last_name: + type: string + username: + type: string + gender: + type: string + Audit: + type: object + properties: + id: + type: string + create_at: + description: The time in milliseconds a audit was created + type: integer + format: int64 + user_id: + type: string + action: + type: string + extra_info: + type: string + ip_address: + type: string + session_id: + type: string + Config: + type: object + properties: + ServiceSettings: + type: object + properties: + SiteURL: + type: string + ListenAddress: + type: string + ConnectionSecurity: + type: string + TLSCertFile: + type: string + TLSKeyFile: + type: string + UseLetsEncrypt: + type: boolean + LetsEncryptCertificateCacheFile: + type: string + Forward80To443: + type: boolean + ReadTimeout: + type: integer + WriteTimeout: + type: integer + MaximumLoginAttempts: + type: integer + SegmentDeveloperKey: + type: string + GoogleDeveloperKey: + type: string + EnableOAuthServiceProvider: + type: boolean + EnableIncomingWebhooks: + type: boolean + EnableOutgoingWebhooks: + type: boolean + EnableCommands: + type: boolean + EnableOnlyAdminIntegrations: + type: boolean + EnablePostUsernameOverride: + type: boolean + EnablePostIconOverride: + type: boolean + EnableTesting: + type: boolean + EnableDeveloper: + type: boolean + EnableSecurityFixAlert: + type: boolean + EnableInsecureOutgoingConnections: + type: boolean + EnableMultifactorAuthentication: + type: boolean + EnforceMultifactorAuthentication: + type: boolean + AllowCorsFrom: + type: string + SessionLengthWebInDays: + type: integer + SessionLengthMobileInDays: + type: integer + SessionLengthSSOInDays: + type: integer + SessionCacheInMinutes: + type: integer + WebsocketSecurePort: + type: integer + WebsocketPort: + type: integer + WebserverMode: + type: string + EnableCustomEmoji: + type: boolean + RestrictCustomEmojiCreation: + type: string + TeamSettings: + type: object + properties: + SiteName: + type: string + MaxUsersPerTeam: + type: integer + EnableTeamCreation: + type: boolean + EnableUserCreation: + type: boolean + EnableOpenServer: + type: boolean + RestrictCreationToDomains: + type: string + EnableCustomBrand: + type: boolean + CustomBrandText: + type: string + CustomDescriptionText: + type: string + RestrictDirectMessage: + type: string + RestrictTeamInvite: + type: string + RestrictPublicChannelManagement: + type: string + RestrictPrivateChannelManagement: + type: string + RestrictPublicChannelCreation: + type: string + RestrictPrivateChannelCreation: + type: string + RestrictPublicChannelDeletion: + type: string + RestrictPrivateChannelDeletion: + type: string + UserStatusAwayTimeout: + type: integer + MaxChannelsPerTeam: + type: integer + MaxNotificationsPerChannel: + type: integer + SqlSettings: + type: object + properties: + DriverName: + type: string + DataSource: + type: string + DataSourceReplicas: + type: array + items: + type: string + MaxIdleConns: + type: integer + MaxOpenConns: + type: integer + Trace: + type: boolean + AtRestEncryptKey: + type: string + LogSettings: + type: object + properties: + EnableConsole: + type: boolean + ConsoleLevel: + type: string + EnableFile: + type: boolean + FileLevel: + type: string + FileLocation: + type: string + EnableWebhookDebugging: + type: boolean + EnableDiagnostics: + type: boolean + PasswordSettings: + type: object + properties: + MinimumLength: + type: integer + Lowercase: + type: boolean + Number: + type: boolean + Uppercase: + type: boolean + Symbol: + type: boolean + FileSettings: + type: object + properties: + MaxFileSize: + type: integer + DriverName: + type: string + Directory: + type: string + EnablePublicLink: + type: boolean + PublicLinkSalt: + type: string + ThumbnailWidth: + type: integer + ThumbnailHeight: + type: integer + PreviewWidth: + type: integer + PreviewHeight: + type: integer + ProfileWidth: + type: integer + ProfileHeight: + type: integer + InitialFont: + type: string + AmazonS3AccessKeyId: + type: string + AmazonS3SecretAccessKey: + type: string + AmazonS3Bucket: + type: string + AmazonS3Region: + type: string + AmazonS3Endpoint: + type: string + AmazonS3SSL: + type: boolean + EmailSettings: + type: object + properties: + EnableSignUpWithEmail: + type: boolean + EnableSignInWithEmail: + type: boolean + EnableSignInWithUsername: + type: boolean + SendEmailNotifications: + type: boolean + RequireEmailVerification: + type: boolean + FeedbackName: + type: string + FeedbackEmail: + type: string + FeedbackOrganization: + type: string + SMTPUsername: + type: string + SMTPPassword: + type: string + SMTPServer: + type: string + SMTPPort: + type: string + ConnectionSecurity: + type: string + InviteSalt: + type: string + PasswordResetSalt: + type: string + SendPushNotifications: + type: boolean + PushNotificationServer: + type: string + PushNotificationContents: + type: string + EnableEmailBatching: + type: boolean + EmailBatchingBufferSize: + type: integer + EmailBatchingInterval: + type: integer + RateLimitSettings: + type: object + properties: + Enable: + type: boolean + PerSec: + type: integer + MaxBurst: + type: integer + MemoryStoreSize: + type: integer + VaryByRemoteAddr: + type: boolean + VaryByHeader: + type: string + PrivacySettings: + type: object + properties: + ShowEmailAddress: + type: boolean + ShowFullName: + type: boolean + SupportSettings: + type: object + properties: + TermsOfServiceLink: + type: string + PrivacyPolicyLink: + type: string + AboutLink: + type: string + HelpLink: + type: string + ReportAProblemLink: + type: string + SupportEmail: + type: string + GitLabSettings: + type: object + properties: + Enable: + type: boolean + Secret: + type: string + Id: + type: string + Scope: + type: string + AuthEndpoint: + type: string + TokenEndpoint: + type: string + UserApiEndpoint: + type: string + GoogleSettings: + type: object + properties: + Enable: + type: boolean + Secret: + type: string + Id: + type: string + Scope: + type: string + AuthEndpoint: + type: string + TokenEndpoint: + type: string + UserApiEndpoint: + type: string + Office365Settings: + type: object + properties: + Enable: + type: boolean + Secret: + type: string + Id: + type: string + Scope: + type: string + AuthEndpoint: + type: string + TokenEndpoint: + type: string + UserApiEndpoint: + type: string + LdapSettings: + type: object + properties: + Enable: + type: boolean + LdapServer: + type: string + LdapPort: + type: integer + ConnectionSecurity: + type: string + BaseDN: + type: string + BindUsername: + type: string + BindPassword: + type: string + UserFilter: + type: string + FirstNameAttribute: + type: string + LastNameAttribute: + type: string + EmailAttribute: + type: string + UsernameAttribute: + type: string + NicknameAttribute: + type: string + IdAttribute: + type: string + PositionAttribute: + type: string + SyncIntervalMinutes: + type: integer + SkipCertificateVerification: + type: boolean + QueryTimeout: + type: integer + MaxPageSize: + type: integer + LoginFieldName: + type: string + ComplianceSettings: + type: object + properties: + Enable: + type: boolean + Directory: + type: string + EnableDaily: + type: boolean + LocalizationSettings: + type: object + properties: + DefaultServerLocale: + type: string + DefaultClientLocale: + type: string + AvailableLocales: + type: string + SamlSettings: + type: object + properties: + Enable: + type: boolean + Verify: + type: boolean + Encrypt: + type: boolean + IdpUrl: + type: string + IdpDescriptorUrl: + type: string + AssertionConsumerServiceURL: + type: string + IdpCertificateFile: + type: string + PublicCertificateFile: + type: string + PrivateKeyFile: + type: string + FirstNameAttribute: + type: string + LastNameAttribute: + type: string + EmailAttribute: + type: string + UsernameAttribute: + type: string + NicknameAttribute: + type: string + LocaleAttribute: + type: string + PositionAttribute: + type: string + LoginButtonText: + type: string + NativeAppSettings: + type: object + properties: + AppDownloadLink: + type: string + AndroidAppDownloadLink: + type: string + IosAppDownloadLink: + type: string + ClusterSettings: + type: object + properties: + Enable: + type: boolean + InterNodeListenAddress: + type: string + InterNodeUrls: + type: array + items: + type: string + MetricsSettings: + type: object + properties: + Enable: + type: boolean + BlockProfileRate: + type: integer + ListenAddress: + type: string + AnalyticsSettings: + type: object + properties: + MaxUsersForStatistics: + type: integer + EnvironmentConfig: + type: object + properties: + ServiceSettings: + type: object + properties: + SiteURL: + type: boolean + ListenAddress: + type: boolean + ConnectionSecurity: + type: boolean + TLSCertFile: + type: boolean + TLSKeyFile: + type: boolean + UseLetsEncrypt: + type: boolean + LetsEncryptCertificateCacheFile: + type: boolean + Forward80To443: + type: boolean + ReadTimeout: + type: boolean + WriteTimeout: + type: boolean + MaximumLoginAttempts: + type: boolean + SegmentDeveloperKey: + type: boolean + GoogleDeveloperKey: + type: boolean + EnableOAuthServiceProvider: + type: boolean + EnableIncomingWebhooks: + type: boolean + EnableOutgoingWebhooks: + type: boolean + EnableCommands: + type: boolean + EnableOnlyAdminIntegrations: + type: boolean + EnablePostUsernameOverride: + type: boolean + EnablePostIconOverride: + type: boolean + EnableTesting: + type: boolean + EnableDeveloper: + type: boolean + EnableSecurityFixAlert: + type: boolean + EnableInsecureOutgoingConnections: + type: boolean + EnableMultifactorAuthentication: + type: boolean + EnforceMultifactorAuthentication: + type: boolean + AllowCorsFrom: + type: boolean + SessionLengthWebInDays: + type: boolean + SessionLengthMobileInDays: + type: boolean + SessionLengthSSOInDays: + type: boolean + SessionCacheInMinutes: + type: boolean + WebsocketSecurePort: + type: boolean + WebsocketPort: + type: boolean + WebserverMode: + type: boolean + EnableCustomEmoji: + type: boolean + RestrictCustomEmojiCreation: + type: boolean + TeamSettings: + type: object + properties: + SiteName: + type: boolean + MaxUsersPerTeam: + type: boolean + EnableTeamCreation: + type: boolean + EnableUserCreation: + type: boolean + EnableOpenServer: + type: boolean + RestrictCreationToDomains: + type: boolean + EnableCustomBrand: + type: boolean + CustomBrandText: + type: boolean + CustomDescriptionText: + type: boolean + RestrictDirectMessage: + type: boolean + RestrictTeamInvite: + type: boolean + RestrictPublicChannelManagement: + type: boolean + RestrictPrivateChannelManagement: + type: boolean + RestrictPublicChannelCreation: + type: boolean + RestrictPrivateChannelCreation: + type: boolean + RestrictPublicChannelDeletion: + type: boolean + RestrictPrivateChannelDeletion: + type: boolean + UserStatusAwayTimeout: + type: boolean + MaxChannelsPerTeam: + type: boolean + MaxNotificationsPerChannel: + type: boolean + SqlSettings: + type: object + properties: + DriverName: + type: boolean + DataSource: + type: boolean + DataSourceReplicas: + type: boolean + MaxIdleConns: + type: boolean + MaxOpenConns: + type: boolean + Trace: + type: boolean + AtRestEncryptKey: + type: boolean + LogSettings: + type: object + properties: + EnableConsole: + type: boolean + ConsoleLevel: + type: boolean + EnableFile: + type: boolean + FileLevel: + type: boolean + FileLocation: + type: boolean + EnableWebhookDebugging: + type: boolean + EnableDiagnostics: + type: boolean + PasswordSettings: + type: object + properties: + MinimumLength: + type: boolean + Lowercase: + type: boolean + Number: + type: boolean + Uppercase: + type: boolean + Symbol: + type: boolean + FileSettings: + type: object + properties: + MaxFileSize: + type: boolean + DriverName: + type: boolean + Directory: + type: boolean + EnablePublicLink: + type: boolean + PublicLinkSalt: + type: boolean + ThumbnailWidth: + type: boolean + ThumbnailHeight: + type: boolean + PreviewWidth: + type: boolean + PreviewHeight: + type: boolean + ProfileWidth: + type: boolean + ProfileHeight: + type: boolean + InitialFont: + type: boolean + AmazonS3AccessKeyId: + type: boolean + AmazonS3SecretAccessKey: + type: boolean + AmazonS3Bucket: + type: boolean + AmazonS3Region: + type: boolean + AmazonS3Endpoint: + type: boolean + AmazonS3SSL: + type: boolean + EmailSettings: + type: object + properties: + EnableSignUpWithEmail: + type: boolean + EnableSignInWithEmail: + type: boolean + EnableSignInWithUsername: + type: boolean + SendEmailNotifications: + type: boolean + RequireEmailVerification: + type: boolean + FeedbackName: + type: boolean + FeedbackEmail: + type: boolean + FeedbackOrganization: + type: boolean + SMTPUsername: + type: boolean + SMTPPassword: + type: boolean + SMTPServer: + type: boolean + SMTPPort: + type: boolean + ConnectionSecurity: + type: boolean + InviteSalt: + type: boolean + PasswordResetSalt: + type: boolean + SendPushNotifications: + type: boolean + PushNotificationServer: + type: boolean + PushNotificationContents: + type: boolean + EnableEmailBatching: + type: boolean + EmailBatchingBufferSize: + type: boolean + EmailBatchingInterval: + type: boolean + RateLimitSettings: + type: object + properties: + Enable: + type: boolean + PerSec: + type: boolean + MaxBurst: + type: boolean + MemoryStoreSize: + type: boolean + VaryByRemoteAddr: + type: boolean + VaryByHeader: + type: boolean + PrivacySettings: + type: object + properties: + ShowEmailAddress: + type: boolean + ShowFullName: + type: boolean + SupportSettings: + type: object + properties: + TermsOfServiceLink: + type: boolean + PrivacyPolicyLink: + type: boolean + AboutLink: + type: boolean + HelpLink: + type: boolean + ReportAProblemLink: + type: boolean + SupportEmail: + type: boolean + GitLabSettings: + type: object + properties: + Enable: + type: boolean + Secret: + type: boolean + Id: + type: boolean + Scope: + type: boolean + AuthEndpoint: + type: boolean + TokenEndpoint: + type: boolean + UserApiEndpoint: + type: boolean + GoogleSettings: + type: object + properties: + Enable: + type: boolean + Secret: + type: boolean + Id: + type: boolean + Scope: + type: boolean + AuthEndpoint: + type: boolean + TokenEndpoint: + type: boolean + UserApiEndpoint: + type: boolean + Office365Settings: + type: object + properties: + Enable: + type: boolean + Secret: + type: boolean + Id: + type: boolean + Scope: + type: boolean + AuthEndpoint: + type: boolean + TokenEndpoint: + type: boolean + UserApiEndpoint: + type: boolean + LdapSettings: + type: object + properties: + Enable: + type: boolean + LdapServer: + type: boolean + LdapPort: + type: boolean + ConnectionSecurity: + type: boolean + BaseDN: + type: boolean + BindUsername: + type: boolean + BindPassword: + type: boolean + UserFilter: + type: boolean + FirstNameAttribute: + type: boolean + LastNameAttribute: + type: boolean + EmailAttribute: + type: boolean + UsernameAttribute: + type: boolean + NicknameAttribute: + type: boolean + IdAttribute: + type: boolean + PositionAttribute: + type: boolean + SyncIntervalMinutes: + type: boolean + SkipCertificateVerification: + type: boolean + QueryTimeout: + type: boolean + MaxPageSize: + type: boolean + LoginFieldName: + type: boolean + ComplianceSettings: + type: object + properties: + Enable: + type: boolean + Directory: + type: boolean + EnableDaily: + type: boolean + LocalizationSettings: + type: object + properties: + DefaultServerLocale: + type: boolean + DefaultClientLocale: + type: boolean + AvailableLocales: + type: boolean + SamlSettings: + type: object + properties: + Enable: + type: boolean + Verify: + type: boolean + Encrypt: + type: boolean + IdpUrl: + type: boolean + IdpDescriptorUrl: + type: boolean + AssertionConsumerServiceURL: + type: boolean + IdpCertificateFile: + type: boolean + PublicCertificateFile: + type: boolean + PrivateKeyFile: + type: boolean + FirstNameAttribute: + type: boolean + LastNameAttribute: + type: boolean + EmailAttribute: + type: boolean + UsernameAttribute: + type: boolean + NicknameAttribute: + type: boolean + LocaleAttribute: + type: boolean + PositionAttribute: + type: boolean + LoginButtonText: + type: boolean + NativeAppSettings: + type: object + properties: + AppDownloadLink: + type: boolean + AndroidAppDownloadLink: + type: boolean + IosAppDownloadLink: + type: boolean + ClusterSettings: + type: object + properties: + Enable: + type: boolean + InterNodeListenAddress: + type: boolean + InterNodeUrls: + type: boolean + MetricsSettings: + type: object + properties: + Enable: + type: boolean + BlockProfileRate: + type: boolean + ListenAddress: + type: boolean + AnalyticsSettings: + type: object + properties: + MaxUsersForStatistics: + type: boolean + SamlCertificateStatus: + type: object + properties: + idp_certificate_file: + description: Status is good when `true` + type: boolean + public_certificate_file: + description: Status is good when `true` + type: boolean + private_key_file: + description: Status is good when `true` + type: boolean + Compliance: + type: object + properties: + id: + type: string + create_at: + type: integer + format: int64 + user_id: + type: string + status: + type: string + count: + type: integer + desc: + type: string + type: + type: string + start_at: + type: integer + format: int64 + end_at: + type: integer + format: int64 + keywords: + type: string + emails: + type: string + ClusterInfo: + type: object + properties: + id: + description: The unique ID for the node + type: string + version: + description: The server version the node is on + type: string + config_hash: + description: The hash of the configuartion file the node is using + type: string + internode_url: + description: The URL used to communicate with those node from other nodes + type: string + hostname: + description: The hostname for this node + type: string + last_ping: + description: The time of the last ping to this node + type: integer + is_alive: + description: Whether or not the node is alive and well + type: boolean + AppError: + type: object + properties: + status_code: + type: integer + id: + type: string + message: + type: string + request_id: + type: string + Status: + type: object + properties: + user_id: + type: string + status: + type: string + manual: + type: boolean + last_activity_at: + type: integer + format: int64 + OAuthApp: + type: object + properties: + id: + type: string + description: The client id of the application + client_secret: + type: string + description: The client secret of the application + name: + type: string + description: The name of the client application + description: + type: string + description: A short description of the application + icon_url: + type: string + description: A URL to an icon to display with the application + callback_urls: + type: array + items: + type: string + description: A list of callback URLs for the appliation + homepage: + type: string + description: A link to the website of the application + is_trusted: + type: boolean + description: Set this to `true` to skip asking users for permission + create_at: + type: integer + description: The time of registration for the application + format: int64 + update_at: + type: integer + description: The last time of update for the application + format: int64 + Job: + type: object + properties: + id: + type: string + description: The unique id of the job + type: + type: string + description: The type of job + create_at: + type: integer + description: The time at which the job was created + format: int64 + start_at: + type: integer + description: The time at which the job was started + format: int64 + last_activity_at: + type: integer + description: The last time at which the job had activity + format: int64 + status: + type: string + description: The status of the job + progress: + type: integer + description: The progress (as a percentage) of the job + data: + type: object + description: A freeform data field containing additional information about the job + UserAccessToken: + type: object + properties: + id: + type: string + description: Unique identifier for the token + token: + type: string + description: The token used for authentication + user_id: + type: string + description: The user the token authenticates for + description: + type: string + description: A description of the token usage + UserAccessTokenSanitized: + type: object + properties: + id: + type: string + description: Unique identifier for the token + user_id: + type: string + description: The user the token authenticates for + description: + type: string + description: A description of the token usage + is_active: + type: boolean + description: Indicates whether the token is active + GlobalDataRetentionPolicy: + type: object + properties: + message_deletion_enabled: + type: boolean + description: Indicates whether data retention policy deletion of messages is + enabled globally. + file_deletion_enabled: + type: boolean + description: Indicates whether data retention policy deletion of file attachments + is enabled globally. + message_retention_cutoff: + type: integer + description: The current server timestamp before which messages should be deleted. + file_retention_cutoff: + type: integer + description: The current server timestamp before which files should be deleted. + DataRetentionPolicyWithoutId: + type: object + properties: + display_name: + type: string + description: The display name for this retention policy. + post_duration: + type: integer + description: > + The number of days a message will be retained before being deleted by this policy. + If this value is less than 0, the policy has infinite retention (i.e. messages + are never deleted). + DataRetentionPolicy: + allOf: + - $ref: "#/components/schemas/DataRetentionPolicyWithoutId" + - type: object + properties: + id: + type: string + description: The ID of this retention policy. + DataRetentionPolicyWithTeamAndChannelCounts: + allOf: + - $ref: "#/components/schemas/DataRetentionPolicy" + - type: object + properties: + team_count: + type: integer + description: The number of teams to which this policy is applied. + channel_count: + type: integer + description: The number of channels to which this policy is applied. + DataRetentionPolicyWithTeamAndChannelIds: + allOf: + - $ref: "#/components/schemas/DataRetentionPolicyWithoutId" + - type: object + properties: + team_ids: + type: array + items: + type: string + description: The IDs of the teams to which this policy should be applied. + channel_ids: + type: array + items: + type: string + description: The IDs of the channels to which this policy should be applied. + DataRetentionPolicyCreate: + allOf: + - $ref: "#/components/schemas/DataRetentionPolicyWithTeamAndChannelIds" + required: + - display_name + - post_duration + DataRetentionPolicyForTeam: + type: object + properties: + team_id: + type: string + description: The team ID. + post_duration: + type: integer + description: The number of days a message will be retained before being deleted by this policy. + RetentionPolicyForTeamList: + type: object + properties: + policies: + type: array + items: + $ref: "#/components/schemas/DataRetentionPolicyForTeam" + description: The list of team policies. + total_count: + type: integer + description: The total number of team policies. + DataRetentionPolicyForChannel: + type: object + properties: + channel_id: + type: string + description: The channel ID. + post_duration: + type: integer + description: The number of days a message will be retained before being deleted by this policy. + RetentionPolicyForChannelList: + type: object + properties: + policies: + type: array + items: + $ref: "#/components/schemas/DataRetentionPolicyForChannel" + description: The list of channel policies. + total_count: + type: integer + description: The total number of channel policies. + UserNotifyProps: + type: object + properties: + email: + type: string + description: Set to "true" to enable email notifications, "false" to disable. + Defaults to "true". + push: + type: string + description: Set to "all" to receive push notifications for all activity, + "mention" for mentions and direct messages only, and "none" to + disable. Defaults to "mention". + desktop: + type: string + description: Set to "all" to receive desktop notifications for all activity, + "mention" for mentions and direct messages only, and "none" to + disable. Defaults to "all". + desktop_sound: + type: string + description: Set to "true" to enable sound on desktop notifications, "false" to + disable. Defaults to "true". + mention_keys: + type: string + description: A comma-separated list of words to count as mentions. Defaults to + username and @username. + channel: + type: string + description: Set to "true" to enable channel-wide notifications (@channel, @all, + etc.), "false" to disable. Defaults to "true". + first_name: + type: string + description: Set to "true" to enable mentions for first name. Defaults to "true" + if a first name is set, "false" otherwise. + Timezone: + type: object + properties: + useAutomaticTimezone: + type: boolean + description: Set to "true" to use the browser/system timezone, "false" to set + manually. Defaults to "true". + manualTimezone: + type: string + description: Value when setting manually the timezone, i.e. "Europe/Berlin". + automaticTimezone: + type: string + description: This value is set automatically when the "useAutomaticTimezone" is + set to "true". + ChannelNotifyProps: + type: object + properties: + email: + type: string + description: Set to "true" to enable email notifications, "false" to disable, or + "default" to use the global user notification setting. + push: + type: string + description: Set to "all" to receive push notifications for all activity, + "mention" for mentions and direct messages only, "none" to disable, + or "default" to use the global user notification setting. + desktop: + type: string + description: Set to "all" to receive desktop notifications for all activity, + "mention" for mentions and direct messages only, "none" to disable, + or "default" to use the global user notification setting. + mark_unread: + type: string + description: Set to "all" to mark the channel unread for any new message, + "mention" to mark unread for new mentions only. Defaults to "all". + PluginManifest: + type: object + properties: + id: + type: string + description: Globally unique identifier that represents the plugin. + name: + type: string + description: Name of the plugin. + description: + type: string + description: Description of what the plugin is and does. + version: + type: string + description: Version number of the plugin. + min_server_version: + type: string + description: | + The minimum Mattermost server version required for the plugin. + + Available as server version 5.6. + backend: + type: object + description: Deprecated in Mattermost 5.2 release. + properties: + executable: + type: string + description: Path to the executable binary. + server: + type: object + properties: + executables: + type: object + description: Paths to executable binaries, specifying multiple entry points + for different platforms when bundled together in a single + plugin. + properties: + linux-amd64: + type: string + darwin-amd64: + type: string + windows-amd64: + type: string + executable: + type: string + description: Path to the executable binary. + webapp: + type: object + properties: + bundle_path: + type: string + description: Path to the webapp JavaScript bundle. + settings_schema: + type: object + description: Settings schema used to define the System Console UI for the plugin. + MarketplacePlugin: + type: object + properties: + homepage_url: + type: string + description: URL that leads to the homepage of the plugin. + icon_data: + type: string + description: Base64 encoding of a plugin icon SVG. + download_url: + type: string + description: URL to download the plugin. + release_notes_url: + type: string + description: URL that leads to the release notes of the plugin. + labels: + type: array + items: + type: string + description: A list of the plugin labels. + signature: + type: string + description: Base64 encoded signature of the plugin. + manifest: + $ref: "#/components/schemas/PluginManifest" + installed_version: + type: string + description: Version number of the already installed plugin, if any. + PushNotification: + type: object + properties: + ack_id: + type: string + platform: + type: string + server_id: + type: string + device_id: + type: string + post_id: + type: string + category: + type: string + sound: + type: string + message: + type: string + badge: + type: number + cont_ava: + type: number + team_id: + type: string + channel_id: + type: string + root_id: + type: string + channel_name: + type: string + type: + type: string + sender_id: + type: string + sender_name: + type: string + override_username: + type: string + override_icon_url: + type: string + from_webhook: + type: string + version: + type: string + is_id_loaded: + type: boolean + PluginStatus: + type: object + properties: + plugin_id: + type: string + description: Globally unique identifier that represents the plugin. + name: + type: string + description: Name of the plugin. + description: + type: string + description: Description of what the plugin is and does. + version: + type: string + description: Version number of the plugin. + cluster_id: + type: string + description: ID of the cluster in which plugin is running + plugin_path: + type: string + description: Path to the plugin on the server + state: + type: number + description: State of the plugin + enum: + - NotRunning + - Starting + - Running + - FailedToStart + - FailedToStayRunning + - Stopping + + + PluginManifestWebapp: + type: object + properties: + id: + type: string + description: Globally unique identifier that represents the plugin. + version: + type: string + description: Version number of the plugin. + webapp: + type: object + properties: + bundle_path: + type: string + description: Path to the webapp JavaScript bundle. + Role: + type: object + properties: + id: + type: string + description: The unique identifier of the role. + name: + type: string + description: The unique name of the role, used when assigning roles to + users/groups in contexts. + display_name: + type: string + description: The human readable name for the role. + description: + type: string + description: A human readable description of the role. + permissions: + type: array + items: + type: string + description: A list of the unique names of the permissions this role grants. + scheme_managed: + type: boolean + description: indicates if this role is managed by a scheme (true), or is a custom + stand-alone role (false). + Scheme: + type: object + properties: + id: + type: string + description: The unique identifier of the scheme. + name: + type: string + description: The human readable name for the scheme. + description: + type: string + description: A human readable description of the scheme. + create_at: + type: integer + format: int64 + description: The time at which the scheme was created. + update_at: + type: integer + format: int64 + description: The time at which the scheme was last updated. + delete_at: + type: integer + format: int64 + description: The time at which the scheme was deleted. + scope: + type: string + description: The scope to which this scheme can be applied, either "team" or + "channel". + default_team_admin_role: + type: string + description: The id of the default team admin role for this scheme. + default_team_user_role: + type: string + description: The id of the default team user role for this scheme. + default_channel_admin_role: + type: string + description: The id of the default channel admin role for this scheme. + default_channel_user_role: + type: string + description: The id of the default channel user role for this scheme. + TermsOfService: + type: object + properties: + id: + type: string + description: The unique identifier of the terms of service. + create_at: + type: integer + format: int64 + description: The time at which the terms of service was created. + user_id: + type: string + description: The unique identifier of the user who created these terms of service. + text: + type: string + description: The text of terms of service. Supports Markdown. + UserTermsOfService: + type: object + properties: + user_id: + type: string + description: The unique identifier of the user who performed this terms of + service action. + terms_of_service_id: + type: string + description: The unique identifier of the terms of service the action was + performed on. + create_at: + description: The time in milliseconds that this action was performed. + type: integer + format: int64 + PostIdToReactionsMap: + type: object + additionalProperties: + type: array + items: + $ref: "#/components/schemas/Reaction" + Product: + type: object + properties: + id: + type: string + name: + type: string + description: + type: string + price_per_seat: + type: string + add_ons: + type: array + items: + $ref: "#/components/schemas/AddOn" + AddOn: + type: object + properties: + id: + type: string + name: + type: string + display_name: + type: string + price_per_seat: + type: string + ProductLimits: + type: object + properties: + boards: + $ref: "#/components/schemas/BoardsLimits" + nullable: true + files: + $ref: "#/components/schemas/FilesLimits" + nullable: true + integrations: + $ref: "#/components/schemas/IntegrationsLimits" + nullable: true + messages: + $ref: "#/components/schemas/MessagesLimits" + nullable: true + teams: + $ref: "#/components/schemas/TeamsLimits" + nullable: true + BoardsLimits: + type: object + properties: + cards: + type: integer + nullable: true + views: + type: integer + nullable: true + FilesLimits: + type: object + properties: + total_storage: + type: integer + format: int64 + nullable: true + IntegrationsLimits: + type: object + properties: + enabled: + type: integer + nullable: true + MessagesLimits: + type: object + properties: + history: + type: integer + nullable: true + TeamsLimits: + type: object + properties: + active: + type: integer + nullable: true + PaymentSetupIntent: + type: object + properties: + id: + type: string + client_secret: + type: string + PaymentMethod: + type: object + properties: + type: + type: string + last_four: + type: integer + exp_month: + type: integer + exp_year: + type: integer + card_brand: + type: string + name: + type: string + Address: + type: object + properties: + city: + type: string + country: + type: string + line1: + type: string + line2: + type: string + postal_code: + type: string + state: + type: string + CloudCustomer: + type: object + properties: + id: + type: string + creator_id: + type: string + create_at: + type: integer + format: int64 + email: + type: string + name: + type: string + num_employees: + type: string + contact_first_name: + type: string + contact_last_name: + type: string + billing_address: + $ref: "#/components/schemas/Address" + company_address: + $ref: "#/components/schemas/Address" + payment_method: + $ref: "#/components/schemas/PaymentMethod" + Subscription: + type: object + properties: + id: + type: string + customer_id: + type: string + product_id: + type: string + add_ons: + type: array + items: + type: string + start_at: + type: integer + format: int64 + end_at: + type: integer + format: int64 + create_at: + type: integer + format: int64 + seats: + type: integer + dns: + type: string + SubscriptionStats: + type: object + properties: + remaining_seats: + type: integer + is_paid_tier: + type: string + Invoice: + type: object + properties: + id: + type: string + number: + type: string + create_at: + type: integer + format: int64 + total: + type: integer + format: int64 + tax: + type: integer + format: int64 + status: + type: string + period_start: + type: integer + format: int64 + period_end: + type: integer + format: int64 + subscription_id: + type: string + item: + type: array + items: + $ref: "#/components/schemas/InvoiceLineItem" + InvoiceLineItem: + type: object + properties: + price_id: + type: string + total: + type: integer + format: int64 + quantity: + type: integer + format: int64 + price_per_unit: + type: integer + format: int64 + description: + type: string + metadata: + type: array + items: + type: string + Group: + type: object + properties: + id: + type: string + name: + type: string + display_name: + type: string + description: + type: string + source: + type: string + remote_id: + type: string + create_at: + type: integer + format: int64 + update_at: + type: integer + format: int64 + delete_at: + type: integer + format: int64 + has_syncables: + type: boolean + GroupSyncableTeam: + type: object + properties: + team_id: + type: string + group_id: + type: string + auto_add: + type: boolean + create_at: + type: integer + format: int64 + delete_at: + type: integer + format: int64 + update_at: + type: integer + format: int64 + GroupSyncableChannel: + type: object + properties: + channel_id: + type: string + group_id: + type: string + auto_add: + type: boolean + create_at: + type: integer + format: int64 + delete_at: + type: integer + format: int64 + update_at: + type: integer + format: int64 + GroupSyncableTeams: + type: object + properties: + team_id: + type: string + team_display_name: + type: string + team_type: + type: string + group_id: + type: string + auto_add: + type: boolean + create_at: + type: integer + format: int64 + delete_at: + type: integer + format: int64 + update_at: + type: integer + format: int64 + GroupSyncableChannels: + type: object + properties: + channel_id: + type: string + channel_display_name: + type: string + channel_type: + type: string + team_id: + type: string + team_display_name: + type: string + team_type: + type: string + group_id: + type: string + auto_add: + type: boolean + create_at: + type: integer + format: int64 + delete_at: + type: integer + format: int64 + update_at: + type: integer + format: int64 + ChannelModeration: + type: object + properties: + name: + type: string + roles: + $ref: "#/components/schemas/ChannelModeratedRoles" + ChannelModeratedRoles: + type: object + properties: + guests: + $ref: "#/components/schemas/ChannelModeratedRole" + members: + $ref: "#/components/schemas/ChannelModeratedRole" + ChannelModeratedRole: + type: object + properties: + value: + type: boolean + enabled: + type: boolean + ChannelModeratedRolesPatch: + type: object + properties: + guests: + type: boolean + members: + type: boolean + ChannelModerationPatch: + type: object + properties: + name: + type: string + roles: + $ref: "#/components/schemas/ChannelModeratedRolesPatch" + ChannelMemberCountByGroup: + description: An object describing group member information in a channel + type: object + properties: + group_id: + type: string + description: ID of the group + channel_member_count: + type: number + description: Total number of group members in the channel + channel_member_timezones_count: + type: number + description: Total number of unique timezones for the group members in the channel + LDAPGroupsPaged: + description: A paged list of LDAP groups + type: object + properties: + count: + type: number + description: Total number of groups + groups: + type: array + items: + $ref: "#/components/schemas/LDAPGroup" + LDAPGroup: + description: A LDAP group + type: object + properties: + has_syncables: + type: boolean + mattermost_group_id: + type: string + primary_key: + type: string + name: + type: string + SidebarCategory: + description: User's sidebar category + type: object + properties: + id: + type: string + user_id: + type: string + team_id: + type: string + display_name: + type: string + type: + type: string + enum: + - channels + - custom + - direct_messages + - favorites + SidebarCategoryWithChannels: + description: User's sidebar category with it's channels + type: object + properties: + id: + type: string + user_id: + type: string + team_id: + type: string + display_name: + type: string + type: + type: string + enum: + - channels + - custom + - direct_messages + - favorites + channel_ids: + type: array + items: + type: string + OrderedSidebarCategories: + description: List of user's categories with their channels + type: object + properties: + order: + type: array + items: + type: string + categories: + type: array + items: + $ref: "#/components/schemas/SidebarCategoryWithChannels" + Bot: + description: A bot account + type: object + properties: + user_id: + description: The user id of the associated user entry. + type: string + create_at: + description: The time in milliseconds a bot was created + type: integer + format: int64 + update_at: + description: The time in milliseconds a bot was last updated + type: integer + format: int64 + delete_at: + description: The time in milliseconds a bot was deleted + type: integer + format: int64 + username: + type: string + display_name: + type: string + description: + type: string + owner_id: + description: The user id of the user that currently owns this bot. + type: string + Server_Busy: + type: object + properties: + busy: + description: True if the server is marked as busy (under high load) + type: boolean + expires: + description: timestamp - number of seconds since Jan 1, 1970 UTC. + type: integer + format: int64 + GroupWithSchemeAdmin: + description: group augmented with scheme admin information + type: object + properties: + group: + $ref: "#/components/schemas/Group" + scheme_admin: + type: boolean + GroupsAssociatedToChannels: + description: a map of channel id(s) to the set of groups that constrain the corresponding channel in a team + type: object + additionalProperties: + type: array + items: + $ref: "#/components/schemas/GroupWithSchemeAdmin" + + OrphanedRecord: + description: an object containing information about an orphaned record. + type: object + properties: + parent_id: + type: string + description: the id of the parent relation (table) entry. + child_id: + type: string + description: the id of the child relation (table) entry. + UserThread: + description: a thread that user is following + type: object + properties: + id: + type: string + description: ID of the post that is this thread's root + reply_count: + type: integer + description: number of replies in this thread + last_reply_at: + type: integer + format: int64 + description: timestamp of the last post to this thread + last_viewed_at: + type: integer + format: int64 + description: timestamp of the last time the user viewed this thread + participants: + type: array + description: list of users participating in this thread. only includes IDs unless 'extended' was set to 'true' + items: + $ref: "#/components/schemas/Post" + post: + $ref: "#/components/schemas/Post" + RelationalIntegrityCheckData: + description: an object containing the results of a relational integrity check. + type: object + properties: + parent_name: + type: string + description: the name of the parent relation (table). + child_name: + type: string + description: the name of the child relation (table). + parent_id_attr: + type: string + description: the name of the attribute (column) containing the parent id. + child_id_attr: + type: string + description: the name of the attribute (column) containing the child id. + records: + description: the list of orphaned records found. + type: array + items: + $ref: "#/components/schemas/OrphanedRecord" + IntegrityCheckResult: + description: an object with the result of the integrity check. + type: object + properties: + data: + $ref: "#/components/schemas/RelationalIntegrityCheckData" + err: + type: string + description: a string value set in case of error. + UploadSession: + description: an object containing information used to keep track of a file upload. + type: object + properties: + id: + description: The unique identifier for the upload. + type: string + type: + description: The type of the upload. + type: string + enum: + - attachment + - import + create_at: + description: The time the upload was created in milliseconds. + type: integer + format: int64 + user_id: + description: The ID of the user performing the upload. + type: string + channel_id: + description: The ID of the channel to upload to. + type: string + filename: + description: The name of the file to upload. + type: string + file_size: + description: The size of the file to upload in bytes. + type: integer + format: int64 + file_offset: + description: The amount of data uploaded in bytes. + type: integer + format: int64 + Notice: + type: object + properties: + id: + description: Notice ID + type: string + sysAdminOnly: + description: Does this notice apply only to sysadmins + type: boolean + teamAdminOnly: + description: Does this notice apply only to team admins + type: boolean + action: + description: "Optional action to perform on action button click. (defaults to closing the notice)" + type: string + actionParam: + description: "Optional action parameter. \nExample: {\"action\": \"url\", actionParam: \"/console/some-page\"}" + type: string + actionText: + description: Optional override for the action button text (defaults to OK) + type: string + description: + description: "Notice content. Use {{Mattermost}} instead of plain text to support white-labeling. Text supports Markdown." + type: string + image: + description: URL of image to display + type: string + title: + description: "Notice title. Use {{Mattermost}} instead of plain text to support white-labeling. Text supports Markdown." + type: string + SharedChannel: + type: object + properties: + id: + description: Channel id of the shared channel + type: string + team_id: + type: string + home: + description: Is this the home cluster for the shared channel + type: boolean + readonly: + description: Is this shared channel shared as read only + type: boolean + name: + description: Channel name as it is shared (may be different than original channel name) + type: string + display_name: + description: Channel display name as it appears locally + type: string + purpose: + type: string + header: + type: string + creator_id: + description: Id of the user that shared the channel + type: string + create_at: + description: Time in milliseconds that the channel was shared + type: integer + update_at: + description: Time in milliseconds that the shared channel record was last updated + type: integer + remote_id: + description: Id of the remote cluster where the shared channel is homed + type: string + RemoteClusterInfo: + type: object + properties: + display_name: + description: The display name for the remote cluster + type: string + create_at: + description: The time in milliseconds a remote cluster was created + type: integer + format: int64 + last_ping_at: + description: The time in milliseconds a remote cluster was last pinged successfully + type: integer + format: int64 + SystemStatusResponse: + type: object + properties: + AndroidLatestVersion: + description: Latest Android version supported + type: string + AndroidMinVersion: + description: Minimum Android version supported + type: string + DesktopLatestVersion: + description: Latest desktop version supported + type: string + DesktopMinVersion: + description: Minimum desktop version supported + type: string + IosLatestVersion: + description: Latest iOS version supported + type: string + IosMinVersion: + description: Minimum iOS version supported + type: string + database_status: + description: Status of database ("OK" or "UNHEALTHY"). Included when get_server_status parameter set. + type: string + filestore_status: + description: Status of filestore ("OK" or "UNHEALTHY"). Included when get_server_status parameter set. + type: string + status: + description: Status of server ("OK" or "UNHEALTHY"). Included when get_server_status parameter set. + type: string + CanReceiveNotifications: + description: Whether the device id provided can receive notifications ("true", "false" or "unknown"). Included when device_id parameter set. + type: string + UserThreads: + type: object + properties: + total: + description: Total number of threads (used for paging) + type: integer + threads: + description: Array of threads + type: array + items: + $ref: "#/components/schemas/UserThread" + LicenseRenewalLink: + type: object + properties: + renewal_link: + description: License renewal link + type: string + System: + type: object + properties: + name: + description: System property name + type: string + value: + description: System property value + type: string + PostsUsage: + type: object + properties: + count: + type: number + description: Total no. of posts + StorageUsage: + type: object + properties: + bytes: + type: number + description: Total file storage usage for the instance in bytes rounded down to the most significant digit + PostAcknowledgement: + type: object + properties: + user_id: + description: The ID of the user that made this acknowledgement. + type: string + post_id: + description: The ID of the post to which this acknowledgement was made. + type: string + acknowledged_at: + description: The time in milliseconds in which this acknowledgement was made. + type: integer + format: int64 +externalDocs: + description: Find out more about Mattermost + url: 'https://about.mattermost.com' +security: + - bearerAuth: [] diff --git a/api/v4/source/elasticsearch.yaml b/api/v4/source/elasticsearch.yaml new file mode 100644 index 0000000000..ded2e0c4e6 --- /dev/null +++ b/api/v4/source/elasticsearch.yaml @@ -0,0 +1,61 @@ + /api/v4/elasticsearch/test: + post: + tags: + - elasticsearch + summary: Test Elasticsearch configuration + description: > + 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 + + ##### Permissions + + Must have `manage_system` permission. + operationId: TestElasticsearch + responses: + "200": + description: Elasticsearch test successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + /api/v4/elasticsearch/purge_indexes: + post: + tags: + - elasticsearch + summary: Purge all Elasticsearch indexes + description: > + 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 + + ##### Permissions + + Must have `manage_system` permission. + operationId: PurgeElasticsearchIndexes + responses: + "200": + description: Indexes purged successfully. + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" diff --git a/api/v4/source/emoji.yaml b/api/v4/source/emoji.yaml new file mode 100644 index 0000000000..d2a7439346 --- /dev/null +++ b/api/v4/source/emoji.yaml @@ -0,0 +1,308 @@ + /api/v4/emoji: + post: + tags: + - emoji + summary: Create a custom emoji + description: | + Create a custom emoji for the team. + ##### Permissions + Must be authenticated. + operationId: CreateEmoji + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + image: + description: A file to be uploaded + type: string + format: binary + emoji: + description: A JSON object containing a `name` field with the name of the + emoji and a `creator_id` field with the id of the + authenticated user. + type: string + required: + - image + - emoji + responses: + "201": + description: Emoji creation successful + content: + application/json: + schema: + $ref: "#/components/schemas/Emoji" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "413": + $ref: "#/components/responses/TooLarge" + "501": + $ref: "#/components/responses/NotImplemented" + get: + tags: + - emoji + summary: Get a list of custom emoji + description: > + Get a page of metadata for custom emoji on the system. Since server + version 4.7, sort using the `sort` query parameter. + + ##### Permissions + + Must be authenticated. + operationId: GetEmojiList + parameters: + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of emojis per page. + schema: + type: integer + default: 60 + - name: sort + in: query + description: Either blank for no sorting or "name" to sort by emoji names. + Minimum server version for sorting is 4.7. + schema: + type: string + default: "" + responses: + "200": + description: Emoji list retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/Emoji" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + "/api/v4/emoji/{emoji_id}": + get: + tags: + - emoji + summary: Get a custom emoji + description: | + Get some metadata for a custom emoji. + ##### Permissions + Must be authenticated. + operationId: GetEmoji + parameters: + - name: emoji_id + in: path + description: Emoji GUID + required: true + schema: + type: string + responses: + "200": + description: Emoji retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/Emoji" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "404": + $ref: "#/components/responses/NotFound" + "501": + $ref: "#/components/responses/NotImplemented" + delete: + tags: + - emoji + summary: Delete a custom emoji + description: > + Delete a custom emoji. + + ##### Permissions + + Must have the `manage_team` or `manage_system` permissions or be the user who created the emoji. + operationId: DeleteEmoji + parameters: + - name: emoji_id + in: path + description: Emoji GUID + required: true + schema: + type: string + responses: + "200": + description: Emoji delete successful + content: + application/json: + schema: + $ref: "#/components/schemas/Emoji" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + "/api/v4/emoji/name/{emoji_name}": + get: + tags: + - emoji + summary: Get a custom emoji by name + description: | + Get some metadata for a custom emoji using its name. + ##### Permissions + Must be authenticated. + + __Minimum server version__: 4.7 + operationId: GetEmojiByName + parameters: + - name: emoji_name + in: path + description: Emoji name + required: true + schema: + type: string + responses: + "200": + description: Emoji retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/Emoji" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "404": + $ref: "#/components/responses/NotFound" + "501": + $ref: "#/components/responses/NotImplemented" + "/api/v4/emoji/{emoji_id}/image": + get: + tags: + - emoji + summary: Get custom emoji image + description: | + Get the image for a custom emoji. + ##### Permissions + Must be authenticated. + operationId: GetEmojiImage + parameters: + - name: emoji_id + in: path + description: Emoji GUID + required: true + schema: + type: string + responses: + "200": + description: Emoji image retrieval successful + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + /api/v4/emoji/search: + post: + tags: + - emoji + summary: Search custom emoji + description: > + Search for custom emoji by name based on search criteria provided in the + request body. A maximum of 200 results are returned. + + ##### Permissions + + Must be authenticated. + + + __Minimum server version__: 4.7 + operationId: SearchEmoji + requestBody: + content: + application/json: + schema: + type: object + required: + - term + properties: + term: + description: The term to match against the emoji name. + type: string + prefix_only: + description: Set to only search for names starting with the search term. + type: string + description: Search criteria + required: true + responses: + "200": + description: Emoji list retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Emoji" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + /api/v4/emoji/autocomplete: + get: + tags: + - emoji + summary: Autocomplete custom emoji + description: > + Get a list of custom emoji with names starting with or matching the + provided name. Returns a maximum of 100 results. + + ##### Permissions + + Must be authenticated. + + + __Minimum server version__: 4.7 + operationId: AutocompleteEmoji + parameters: + - name: name + in: query + description: The emoji name to search. + required: true + schema: + type: string + responses: + "200": + description: Emoji list retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/Emoji" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" diff --git a/api/v4/source/exports.yaml b/api/v4/source/exports.yaml new file mode 100644 index 0000000000..90e6b2d53b --- /dev/null +++ b/api/v4/source/exports.yaml @@ -0,0 +1,132 @@ + "/api/v4/exports": + get: + tags: + - exports + summary: List export files + description: > + Lists all available export files. + + __Minimum server version__: 5.33 + + ##### Permissions + + Must have `manage_system` permissions. + operationId: ListExports + responses: + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + exports, response := Client.ListExports() + - lang: Curl + source: | + curl 'http://localhost:8065/api/v4/exports' \ + -H 'Authorization: Bearer 9kg8nqrnxprd9jbykqeg4r51hw' + "/api/v4/exports/{export_name}": + get: + tags: + - exports + summary: Download an export file + description: | + Downloads an export file. + + + __Minimum server version__: 5.33 + + ##### Permissions + + Must have `manage_system` permissions. + operationId: DownloadExport + parameters: + - name: export_name + in: path + description: The name of the export file to download + required: true + schema: + type: string + responses: + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "500": + $ref: "#/components/responses/InternalServerError" + x-code-samples: + - lang: Go + source: | + import ( + "os" + + "github.com/mattermost/mattermost-server/v5/model" + } + + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + outFile, _ := os.Create("export.zip") + + n, response := Client.DownloadExport("export.zip", outFile, 0) + - lang: Curl + source: | + curl 'http://localhost:8065/api/v4/exports/export.zip' \ + -H 'Authorization: Bearer 9kg8nqrnxprd9jbykqeg4r51hw' + delete: + tags: + - exports + summary: Delete an export file + description: | + Deletes an export file. + + + __Minimum server version__: 5.33 + + ##### Permissions + + Must have `manage_system` permissions. + operationId: DeleteExport + parameters: + - name: export_name + in: path + description: The name of the export file to delete + required: true + schema: + type: string + responses: + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + ok, response := Client.DeleteExport("export.zip") + - lang: Curl + source: | + curl -X DELETE 'http://localhost:8065/api/v4/exports/export.zip' \ + -H 'Authorization: Bearer 9kg8nqrnxprd9jbykqeg4r51hw' diff --git a/api/v4/source/files.yaml b/api/v4/source/files.yaml new file mode 100644 index 0000000000..a3721787a8 --- /dev/null +++ b/api/v4/source/files.yaml @@ -0,0 +1,520 @@ + /api/v4/files: + post: + tags: + - files + summary: Upload a file + description: > + 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. + + + ##### Permissions + + Must have `upload_file` permission. + operationId: UploadFile + parameters: + - name: channel_id + in: query + description: The ID of the channel that this file will be uploaded to + required: false + schema: + type: string + - name: filename + in: query + description: The name of the file to be uploaded + required: false + schema: + type: string + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + files: + description: A file to be uploaded + type: string + format: binary + channel_id: + description: The ID of the channel that this file will be uploaded to + type: string + client_ids: + description: A unique identifier for the file that will be returned in + the response + type: string + responses: + "201": + description: Corresponding lists of the provided client_ids and the metadata that + has been stored in the database for each one + content: + application/json: + schema: + type: object + properties: + file_infos: + description: A list of file metadata that has been stored in the + database + type: array + items: + $ref: "#/components/schemas/FileInfo" + client_ids: + description: A list of the client_ids that were provided in the request + type: array + items: + type: string + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "413": + $ref: "#/components/responses/TooLarge" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/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) + - lang: Curl + source: | + curl -F 'files=@PATH/TO/LOCAL/FILE' \ + -F 'channel_id=CHANNEL_ID' \ + --header 'authorization: Bearer c49adc55z3f53ck7xtp8ebq1ir' + https://your-mattermost-url.com/api/v4/files + "/api/v4/files/{file_id}": + get: + tags: + - files + summary: Get a file + description: | + Gets a file that has been uploaded previously. + ##### Permissions + Must have `read_channel` permission or be uploader of the file. + operationId: GetFile + parameters: + - name: file_id + in: path + description: The ID of the file to get + required: true + schema: + type: string + responses: + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + description: Do not have appropriate permissions + content: + application/json: + schema: + $ref: "#/components/schemas/AppError" + headers: + First-Inaccessible-File-Time: + schema: + type: integer + description: This header is included with the value "1" if the file is past the cloud's plan limit. + "404": + $ref: "#/components/responses/NotFound" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + fileID := "4xp9fdt77pncbef59f4k1qe83o" + + data, resp := Client.GetFile(fileID) + "/api/v4/files/{file_id}/thumbnail": + get: + tags: + - files + summary: Get a file's thumbnail + description: | + Gets a file's thumbnail. + ##### Permissions + Must have `read_channel` permission or be uploader of the file. + operationId: GetFileThumbnail + parameters: + - name: file_id + in: path + description: The ID of the file to get + required: true + schema: + type: string + responses: + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + description: Do not have appropriate permissions + content: + application/json: + schema: + $ref: "#/components/schemas/AppError" + headers: + First-Inaccessible-File-Time: + schema: + type: integer + description: This header is included with the value "1" if the file is past the cloud's plan limit. + "404": + $ref: "#/components/responses/NotFound" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + fileID := "4xp9fdt77pncbef59f4k1qe83o" + + data, resp := Client.GetFileThumbnail(fileID) + "/api/v4/files/{file_id}/preview": + get: + tags: + - files + summary: Get a file's preview + description: | + Gets a file's preview. + ##### Permissions + Must have `read_channel` permission or be uploader of the file. + operationId: GetFilePreview + parameters: + - name: file_id + in: path + description: The ID of the file to get + required: true + schema: + type: string + responses: + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + description: Do not have appropriate permissions + content: + application/json: + schema: + $ref: "#/components/schemas/AppError" + headers: + First-Inaccessible-File-Time: + schema: + type: integer + description: This header is included with the value "1" if the file is past the cloud's plan limit. + "404": + $ref: "#/components/responses/NotFound" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + fileID := "4xp9fdt77pncbef59f4k1qe83o" + + data, resp := Client.GetFilePreview(fileID) + "/api/v4/files/{file_id}/link": + get: + tags: + - files + summary: Get a public file link + description: > + Gets a public link for a file that can be accessed without logging into + Mattermost. + + ##### Permissions + + Must have `read_channel` permission or be uploader of the file. + operationId: GetFileLink + parameters: + - name: file_id + in: path + description: The ID of the file to get a link for + required: true + schema: + type: string + responses: + "200": + description: A publicly accessible link to the given file + content: + application/json: + schema: + type: object + properties: + link: + type: string + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + description: Do not have appropriate permissions + content: + application/json: + schema: + $ref: "#/components/schemas/AppError" + headers: + First-Inaccessible-File-Time: + schema: + type: integer + description: This header is included with the value "1" if the file is past the cloud's plan limit. + "404": + $ref: "#/components/responses/NotFound" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + fileID := "4xp9fdt77pncbef59f4k1qe83o" + + data, resp := Client.GetFileLink(fileID) + "/api/v4/files/{file_id}/info": + get: + tags: + - files + summary: Get metadata for a file + description: | + Gets a file's info. + ##### Permissions + Must have `read_channel` permission or be uploader of the file. + operationId: GetFileInfo + parameters: + - name: file_id + in: path + description: The ID of the file info to get + required: true + schema: + type: string + responses: + "200": + description: The stored metadata for the given file + content: + application/json: + schema: + $ref: "#/components/schemas/FileInfo" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + description: Do not have appropriate permissions + content: + application/json: + schema: + $ref: "#/components/schemas/AppError" + headers: + First-Inaccessible-File-Time: + schema: + type: integer + description: This header is included with the value "1" if the file is past the cloud's plan limit. + "404": + $ref: "#/components/responses/NotFound" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + fileID := "4xp9fdt77pncbef59f4k1qe83o" + + info, resp := Client.GetFileInfo(fileID) + "/api/v4/files/{file_id}/public": + get: + tags: + - files + summary: Get a public file + description: | + ##### Permissions + No permissions required. + operationId: GetFilePublic + parameters: + - name: file_id + in: path + description: The ID of the file to get + required: true + schema: + type: string + - name: h + in: query + description: File hash + required: true + schema: + type: string + responses: + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + description: Do not have appropriate permissions + content: + application/json: + schema: + $ref: "#/components/schemas/AppError" + headers: + First-Inaccessible-File-Time: + schema: + type: integer + description: This header is included with the value "1" if the file is past the cloud's plan limit. + "404": + $ref: "#/components/responses/NotFound" + "501": + $ref: "#/components/responses/NotImplemented" + + "/api/v4/teams/{team_id}/files/search": + post: + tags: + - teams + - files + - search + summary: Search files in a team + description: > + Search for files in a team based on file name, extention and file + content (if file content extraction is enabled and supported for the + files). + + __Minimum server version__: 5.34 + + ##### Permissions + + Must be authenticated and have the `view_team` permission. + operationId: SearchFiles + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + requestBody: + content: + multipart/form-data: + schema: + type: object + required: + - terms + - is_or_search + properties: + terms: + type: string + description: The search terms as inputed by the user. To search for files + from a user include `from:someusername`, using a user's + username. To search in a specific channel include + `in:somechannel`, using the channel name (not the display + name). To search for specific extensions included `ext:extension`. + is_or_search: + type: boolean + description: Set to true if an Or search should be performed vs an And + search. + time_zone_offset: + type: integer + default: 0 + description: Offset from UTC of user timezone for date searches. + include_deleted_channels: + type: boolean + description: Set to true if deleted channels should be included in the + search. (archived channels) + page: + type: integer + default: 0 + description: The page to select. (Only works with Elasticsearch) + per_page: + type: integer + default: 60 + description: The number of posts per page. (Only works with Elasticsearch) + description: The search terms and logic to use in the search. + required: true + responses: + "200": + description: Files list retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/FileInfoList" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + teamID := "zWEyrTZ7GZ22aBSfoX60iWryTY" + + fileInfoList, resp := Client.SearchFiles(teamID, "filename", false) + - lang: curl + source: > + curl -X POST \ + https://your-mattermost-url.com/api/v4/teams/zWEyrTZ7GZ22aBSfoX60iWryTY/files/search \ + -H 'Authorization: Bearer frn8fu5rtpyc5m4xy6q3oj4yur' \ + -H 'Content-Type: application/json' \ + -d '{"terms": "filename", "is_or_search": false}' diff --git a/api/v4/source/groups.yaml b/api/v4/source/groups.yaml new file mode 100644 index 0000000000..91c8030d08 --- /dev/null +++ b/api/v4/source/groups.yaml @@ -0,0 +1,1110 @@ + /api/v4/groups: + get: + tags: + - groups + summary: Get groups + description: > + 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 + operationId: GetGroups + parameters: + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of groups per page. + schema: + type: integer + default: 60 + - name: q + in: query + description: String to pattern match the `name` and `display_name` field. Will + return all groups whose `name` and `display_name` field match any of + the text. + schema: + type: string + - name: include_member_count + in: query + description: Boolean which adds the `member_count` attribute to each group JSON + object + schema: + type: boolean + - name: not_associated_to_team + in: query + description: Team GUID which is used to return all the groups not associated to + this team + required: true + schema: + type: string + - name: not_associated_to_channel + in: query + description: Group GUID which is used to return all the groups not associated to + this channel + required: true + schema: + type: string + - name: since + in: query + description: > + Only return groups that have been modified since the given Unix + timestamp (in milliseconds). All modified groups, including deleted + and created groups, will be returned. + + __Minimum server version__: 5.24 + schema: + type: integer + - name: filter_allow_reference + in: query + description: Boolean which filters the group entries with the `allow_reference` attribute set. + schema: + type: boolean + default: false + responses: + "200": + description: Group list retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Group" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + post: + tags: + - groups + summary: Create a custom group + description: | + Create a `custom` type group. + + #### Permission + Must have `create_custom_group` permission. + + __Minimum server version__: 6.3 + operationId: CreateGroup + requestBody: + content: + application/json: + schema: + type: object + required: + - group + - user_ids + properties: + group: + type: object + required: + - name + - display_name + - source + - allow_reference + description: Group object to create. + properties: + name: + type: string + description: The unique group name used for at-mentioning. + display_name: + type: string + description: The display name of the group which can include spaces. + source: + type: string + description: Must be `custom` + allow_reference: + type: boolean + description: Must be true + user_ids: + type: array + description: The user ids of the group members to add. + items: + type: string + description: Group object and initial members. + required: true + responses: + "501": + description: | + Group has an invalid `source`, or + `allow_reference` is not `true`, or + group has a `remote_id`. + "400": + $ref: "#/components/responses/BadRequest" + "201": + description: Group creation and memberships successful. + "403": + $ref: "#/components/responses/Forbidden" + "/api/v4/groups/{group_id}": + get: + tags: + - groups + summary: Get a group + description: | + Get group from the provided group id string + + ##### Permissions + Must have `manage_system` permission. + + __Minimum server version__: 5.11 + operationId: GetGroup + parameters: + - name: group_id + in: path + description: Group GUID + required: true + schema: + type: string + responses: + "200": + description: Group retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/Group" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + delete: + tags: + - groups + summary: Deletes a custom group + description: | + Soft deletes a custom group. + + ##### Permissions + Must have `custom_group_delete` permission for the given group. + + __Minimum server version__: 6.3 + operationId: DeleteGroup + parameters: + - name: group_id + in: path + description: The ID of the group. + required: true + schema: + type: string + responses: + "403": + $ref: "#/components/responses/Forbidden" + "501": + description: The group doesn't have a `source` value of `custom`. + "404": + description: Group is already deleted or doesn't exist. + "200": + description: Successfully deleted the group. + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "/api/v4/groups/{group_id}/patch": + put: + tags: + - groups + summary: Patch a group + description: > + 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. + + + ##### Permissions + + Must have `manage_system` permission. + + + __Minimum server version__: 5.11 + operationId: PatchGroup + parameters: + - name: group_id + in: path + description: Group GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + display_name: + type: string + description: + type: string + description: Group object that is to be updated + required: true + responses: + "200": + description: Group patch successful + content: + application/json: + schema: + $ref: "#/components/schemas/Group" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + "/api/v4/groups/{group_id}/teams/{team_id}/link": + post: + tags: + - groups + summary: Link a team to a group + description: | + Link a team to a group + ##### Permissions + Must have `manage_team` permission. + + __Minimum server version__: 5.11 + operationId: LinkGroupSyncableForTeam + parameters: + - name: group_id + in: path + description: Group GUID + required: true + schema: + type: string + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + responses: + "201": + description: Team successfully linked to group + content: + application/json: + schema: + $ref: "#/components/schemas/GroupSyncableTeam" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + delete: + tags: + - groups + summary: Delete a link from a team to a group + description: | + Delete a link from a team to a group + ##### Permissions + Must have `manage_team` permission. + + __Minimum server version__: 5.11 + operationId: UnlinkGroupSyncableForTeam + parameters: + - name: group_id + in: path + description: Group GUID + required: true + schema: + type: string + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + responses: + "200": + description: Successfully deleted link between team and group + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + "/api/v4/groups/{group_id}/channels/{channel_id}/link": + post: + tags: + - groups + summary: Link a channel to a group + description: > + Link a channel to a group + + ##### Permissions + + 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 + operationId: LinkGroupSyncableForChannel + parameters: + - name: group_id + in: path + description: Group GUID + required: true + schema: + type: string + - name: channel_id + in: path + description: Channel GUID + required: true + schema: + type: string + responses: + "201": + description: Channel successfully linked to group + content: + application/json: + schema: + $ref: "#/components/schemas/GroupSyncableChannel" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + delete: + tags: + - groups + summary: Delete a link from a channel to a group + description: > + Delete a link from a channel to a group + + ##### Permissions + + 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 + operationId: UnlinkGroupSyncableForChannel + parameters: + - name: group_id + in: path + description: Group GUID + required: true + schema: + type: string + - name: channel_id + in: path + description: Channel GUID + required: true + schema: + type: string + responses: + "200": + description: Successfully deleted link between channel and group + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + "/api/v4/groups/{group_id}/teams/{team_id}": + get: + tags: + - groups + summary: Get GroupSyncable from Team ID + description: | + Get the GroupSyncable object with group_id and team_id from params + ##### Permissions + Must have `manage_system` permission. + + __Minimum server version__: 5.11 + operationId: GetGroupSyncableForTeamId + parameters: + - name: group_id + in: path + description: Group GUID + required: true + schema: + type: string + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + responses: + "200": + description: GroupSyncable object retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/GroupSyncableTeam" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + "/api/v4/groups/{group_id}/channels/{channel_id}": + get: + tags: + - groups + summary: Get GroupSyncable from channel ID + description: | + Get the GroupSyncable object with group_id and channel_id from params + ##### Permissions + Must have `manage_system` permission. + + __Minimum server version__: 5.11 + operationId: GetGroupSyncableForChannelId + parameters: + - name: group_id + in: path + description: Group GUID + required: true + schema: + type: string + - name: channel_id + in: path + description: Channel GUID + required: true + schema: + type: string + responses: + "200": + description: GroupSyncable object retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/GroupSyncableChannel" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + "/api/v4/groups/{group_id}/teams": + get: + tags: + - groups + summary: Get group teams + description: | + Retrieve the list of teams associated to the group + ##### Permissions + Must have `manage_system` permission. + + __Minimum server version__: 5.11 + operationId: GetGroupSyncablesTeams + parameters: + - name: group_id + in: path + description: Group GUID + required: true + schema: + type: string + responses: + "200": + description: Teams list retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/GroupSyncableTeams" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + "/api/v4/groups/{group_id}/channels": + get: + tags: + - groups + summary: Get group channels + description: | + Retrieve the list of channels associated to the group + ##### Permissions + Must have `manage_system` permission. + + __Minimum server version__: 5.11 + operationId: GetGroupSyncablesChannels + parameters: + - name: group_id + in: path + description: Group GUID + required: true + schema: + type: string + responses: + "200": + description: Channel list retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/GroupSyncableChannels" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + "/api/v4/groups/{group_id}/teams/{team_id}/patch": + put: + tags: + - groups + summary: Patch a GroupSyncable associated to Team + description: > + 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. + + + ##### Permissions + + Must have `manage_system` permission. + + + __Minimum server version__: 5.11 + operationId: PatchGroupSyncableForTeam + parameters: + - name: group_id + in: path + description: Group GUID + required: true + schema: + type: string + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + requestBody: + description: GroupSyncable object that is to be updated + required: true + content: + application/json: + schema: + type: object + properties: + auto_add: + type: boolean + + responses: + "200": + description: GroupSyncable patch successful + content: + application/json: + schema: + $ref: "#/components/schemas/GroupSyncableTeam" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + "/api/v4/groups/{group_id}/channels/{channel_id}/patch": + put: + tags: + - groups + summary: Patch a GroupSyncable associated to Channel + description: > + 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. + + + ##### Permissions + + Must have `manage_system` permission. + + + __Minimum server version__: 5.11 + operationId: PatchGroupSyncableForChannel + parameters: + - name: group_id + in: path + description: Group GUID + required: true + schema: + type: string + - name: channel_id + in: path + description: Channel GUID + required: true + schema: + type: string + requestBody: + description: GroupSyncable object that is to be updated + required: true + content: + application/json: + schema: + type: object + properties: + auto_add: + type: boolean + responses: + "200": + description: GroupSyncable patch successful + content: + application/json: + schema: + $ref: "#/components/schemas/GroupSyncableChannel" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + "/api/v4/groups/{group_id}/members": + get: + tags: + - groups + summary: Get group users + description: | + Retrieve the list of users associated with a given group. + + ##### Permissions + Must have `manage_system` permission. + + __Minimum server version__: 5.11 + operationId: GetGroupUsers + parameters: + - name: group_id + in: path + description: Group GUID + required: true + schema: + type: string + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of groups per page. + schema: + type: integer + default: 60 + responses: + "200": + description: User list retrieval successful + content: + application/json: + schema: + type: object + properties: + members: + type: array + items: + $ref: "#/components/schemas/User" + total_member_count: + type: integer + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + delete: + tags: + - groups + summary: Removes members from a custom group + description: | + Soft deletes a custom group members. + + ##### Permissions + Must have `custom_group_manage_members` permission for the given group. + + __Minimum server version__: 6.3 + operationId: DeleteGroupMembers + parameters: + - name: group_id + in: path + description: The ID of the group to delete. + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + type: object + description: An object containing the user ids of the members to remove. + properties: + user_ids: + type: array + items: + type: string + responses: + "403": + $ref: "#/components/responses/Forbidden" + "501": + description: If the group does not have a `source` value of `custom`. + "404": + description: Can't find the group. + "200": + description: Successfully deleted the group members. + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + post: + tags: + - groups + summary: Adds members to a custom group + description: | + Adds members to a custom group. + + ##### Permissions + Must have `custom_group_manage_members` permission for the given group. + + __Minimum server version__: 6.3 + operationId: AddGroupMembers + parameters: + - name: group_id + in: path + description: The ID of the group. + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + type: object + description: An object containing the user ids of the members to add. + properties: + user_ids: + type: array + items: + type: string + responses: + "403": + $ref: "#/components/responses/Forbidden" + "501": + description: If the group does not have a `source` value of `custom`. + "404": + description: Can't find the group. + "200": + description: Successfully added the group members. + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "/api/v4/groups/{group_id}/stats": + get: + tags: + - groups + summary: Get group stats + description: | + Retrieve the stats of a given group. + + ##### Permissions + Must have `manage_system` permission. + + __Minimum server version__: 5.26 + operationId: GetGroupStats + parameters: + - name: group_id + in: path + description: Group GUID + required: true + schema: + type: string + responses: + "200": + description: Group stats retrieval successful + content: + application/json: + schema: + type: object + properties: + group_id: + type: string + total_member_count: + type: integer + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + "/api/v4/channels/{channel_id}/groups": + get: + tags: + - groups + summary: Get channel groups + description: | + Retrieve the list of groups associated with a given channel. + + ##### Permissions + Must have `manage_system` permission. + + __Minimum server version__: 5.11 + operationId: GetGroupsByChannel + parameters: + - name: channel_id + in: path + description: Channel GUID + required: true + schema: + type: string + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of groups per page. + schema: + type: integer + default: 60 + - name: filter_allow_reference + in: query + description: Boolean which filters the group entries with the `allow_reference` attribute set. + schema: + type: boolean + default: false + responses: + "200": + description: Group list retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Group" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + "/api/v4/teams/{team_id}/groups": + get: + tags: + - groups + summary: Get team groups + description: | + Retrieve the list of groups associated with a given team. + + __Minimum server version__: 5.11 + operationId: GetGroupsByTeam + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of groups per page. + schema: + type: integer + default: 60 + - name: filter_allow_reference + in: query + description: Boolean which filters in the group entries with the `allow_reference` attribute set. + schema: + type: boolean + default: false + responses: + "200": + description: Group list retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Group" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + "/api/v4/teams/{team_id}/groups_by_channels": + get: + tags: + - groups + summary: Get team groups by channels + description: | + Retrieve the set of groups associated with the channels in the given team grouped by channel. + + ##### Permissions + Must have `manage_system` permission or can access only for current user + + __Minimum server version__: 5.11 + operationId: GetGroupsAssociatedToChannelsByTeam + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of groups per page. + schema: + type: integer + default: 60 + - name: filter_allow_reference + in: query + description: Boolean which filters in the group entries with the `allow_reference` attribute set. + schema: + type: boolean + default: false + - name: paginate + in: query + description: Boolean to determine whether the pagination should be applied or not + schema: + type: boolean + default: false + responses: + "200": + description: Group list retrieval successful + content: + application/json: + schema: + type: object + items: + $ref: "#/components/schemas/GroupsAssociatedToChannels" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + "/api/v4/users/{user_id}/groups": + get: + tags: + - groups + summary: Get groups for a userId + description: | + Retrieve the list of groups associated to the user + + __Minimum server version__: 5.24 + operationId: GetGroupsByUserId + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + responses: + "200": + description: Group list retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Group" + "400": + $ref: "#/components/responses/BadRequest" + "501": + $ref: "#/components/responses/NotImplemented" diff --git a/api/v4/source/imports.yaml b/api/v4/source/imports.yaml new file mode 100644 index 0000000000..5d9af3d21f --- /dev/null +++ b/api/v4/source/imports.yaml @@ -0,0 +1,39 @@ + "/api/v4/imports": + get: + tags: + - imports + summary: List import files + description: > + Lists all available import files. + + + __Minimum server version__: 5.31 + + ##### Permissions + + Must have `manage_system` permissions. + operationId: ListImports + responses: + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + imports, response := Client.ListImports() + - lang: Curl + source: | + curl 'http://localhost:8065/api/v4/imports' \ + -H 'Authorization: Bearer 9kg8nqrnxprd9jbykqeg4r51hw' diff --git a/api/v4/source/insights.yaml b/api/v4/source/insights.yaml new file mode 100644 index 0000000000..a0026c2013 --- /dev/null +++ b/api/v4/source/insights.yaml @@ -0,0 +1,439 @@ + /api/v4/teams/{team_id}/top/reactions: + get: + tags: + - insights + summary: Get a list of the top reactions for a team. + description: | + Get a list of the top reactions across all public and private channels (the user is a member of) for a given team. + ##### Permissions + Must have `view_team` permission for the team. + operationId: GetTopReactionsForTeam + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + - name: time_range + in: query + description: > + Time range can be "today", "7_day", or "28_day". + + - `today`: reactions posted on the current day. + + - `7_day`: reactions posted in the last 7 days. + + - `28_day`: reactions posted in the last 28 days. + required: true + schema: + type: string + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of items per page, up to a maximum of 200. + schema: + type: integer + default: 60 + responses: + "200": + description: Top reactions retrieved successfully. + content: + application/json: + schema: + type: object + $ref: "#/components/schemas/TopReactionList" + "400": + $ref: "#/components/responses/BadRequest" + "403": + $ref: "#/components/responses/Forbidden" + /api/v4/users/me/top/reactions: + get: + tags: + - insights + summary: Get a list of the top reactions for a user. + description: | + Get a list of the top reactions across all public and private channels (the user is a member of) for a given user. + If no `team_id` is provided, this will also include reactions posted by the given user in direct and group messages. + ##### Permissions + Must be logged in as the user. + operationId: GetTopReactionsForUser + parameters: + - name: time_range + in: query + description: > + Time range can be "today", "7_day", or "28_day". + + - `today`: reactions posted on the current day. + + - `7_day`: reactions posted in the last 7 days. + + - `28_day`: reactions posted in the last 28 days. + required: true + schema: + type: string + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of items per page, up to a maximum of 200. + schema: + type: integer + default: 60 + - name: team_id + in: query + description: > + Team ID will scope the response to a given team and exclude direct and group messages. + + ##### Permissions + + Must have `view_team` permission for the team. + schema: + type: string + responses: + "200": + description: Top reactions retrieved successfully. + content: + application/json: + schema: + type: object + $ref: "#/components/schemas/TopReactionList" + "400": + $ref: "#/components/responses/BadRequest" + "403": + $ref: "#/components/responses/Forbidden" + /api/v4/teams/{team_id}/top/channels: + get: + tags: + - insights + summary: Get a list of the top channels for a team. + description: | + Get a list of the top public and private channels (the user is a member of) for a given team. + ##### Permissions + Must have `view_team` permission for the team. + operationId: GetTopChannelsForTeam + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + - name: time_range + in: query + description: > + Time range can be "today", "7_day", or "28_day". + + - `today`: channels with posts on the current day. + + - `7_day`: channels with posts in the last 7 days. + + - `28_day`: channels with posts in the last 28 days. + required: true + schema: + type: string + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of items per page, up to a maximum of 200. + schema: + type: integer + default: 60 + responses: + "200": + description: Top channels retrieved successfully. + content: + application/json: + schema: + type: object + $ref: "#/components/schemas/TopChannelList" + "400": + $ref: "#/components/responses/BadRequest" + "403": + $ref: "#/components/responses/Forbidden" + /api/v4/users/me/top/channels: + get: + tags: + - insights + summary: Get a list of the top channels for a user. + description: | + Get a list of the top public and private channels (the user is a member of) for a given user. + ##### Permissions + Must be logged in as the user. + operationId: GetTopChannelsForUser + parameters: + - name: time_range + in: query + description: > + Time range can be "today", "7_day", or "28_day". + + - `today`: channels with posts on the current day. + + - `7_day`: channels with posts in the last 7 days. + + - `28_day`: channels with posts in the last 28 days. + required: true + schema: + type: string + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of items per page, up to a maximum of 200. + schema: + type: integer + default: 60 + - name: team_id + in: query + description: > + Team ID will scope the response to a given team. + + ##### Permissions + + Must have `view_team` permission for the team. + schema: + type: string + responses: + "200": + description: Top channels retrieved successfully. + content: + application/json: + schema: + type: object + $ref: "#/components/schemas/TopChannelList" + "400": + $ref: "#/components/responses/BadRequest" + "403": + $ref: "#/components/responses/Forbidden" + /api/v4/teams/{team_id}/top/team_members: + get: + tags: + - insights + summary: Get a list of new team members. + description: | + Get a list of all of the new team members that have joined the given team during the given time period. + ##### Permissions + Must have `view_team` permission for the team. + operationId: GetNewTeamMembers + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + - name: time_range + in: query + description: > + Time range can be "today", "7_day", or "28_day". + + - `today`: team members who joined during the current day. + + - `7_day`: team members who joined in the last 7 days. + + - `28_day`: team members who joined in the last 28 days. + required: true + schema: + type: string + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of items per page. + schema: + type: integer + default: 60 + responses: + "200": + description: New team members retrieved successfully. + content: + application/json: + schema: + type: object + $ref: "#/components/schemas/NewTeamMembersList" + "400": + $ref: "#/components/responses/BadRequest" + "403": + $ref: "#/components/responses/Forbidden" + /api/v4/teams/{team_id}/top/threads: + get: + tags: + - insights + summary: Get a list of the top threads for a team. + description: | + Get a list of the top threads from public and private channels (the user is a member of) for a given team. + ##### Permissions + Must have `view_team` permission for the team. + operationId: GetTopThreadsForTeam + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + - name: time_range + in: query + description: > + Time range can be "today", "7_day", or "28_day". + + - `today`: threads with activity on the current day. + + - `7_day`: threads with activity in the last 7 days. + + - `28_day`: threads with activity in the last 28 days. + required: true + schema: + type: string + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of items per page, up to a maximum of 200. + schema: + type: integer + default: 60 + responses: + "200": + description: Top threads retrieved successfully. + content: + application/json: + schema: + type: object + $ref: "#/components/schemas/TopThreadList" + "400": + $ref: "#/components/responses/BadRequest" + "403": + $ref: "#/components/responses/Forbidden" + /api/v4/users/me/top/threads: + get: + tags: + - insights + summary: Get a list of the top threads for a user. + description: | + Get a list of the top threads from public and private channels (the user is a member of and participating in the thread) for a given user. + ##### Permissions + Must be logged in as the user. + operationId: GetTopThreadsForUser + parameters: + - name: time_range + in: query + description: > + Time range can be "today", "7_day", or "28_day". + + - `today`: threads with activity on the current day. + + - `7_day`: threads with activity in the last 7 days. + + - `28_day`: threads with activity in the last 28 days. + required: true + schema: + type: string + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of items per page, up to a maximum of 200. + schema: + type: integer + default: 60 + - name: team_id + in: query + description: > + Team ID will scope the response to a given team. + + ##### Permissions + + Must have `view_team` permission for the team. + schema: + type: string + responses: + "200": + description: Top threads retrieved successfully. + content: + application/json: + schema: + type: object + $ref: "#/components/schemas/TopThreadList" + "400": + $ref: "#/components/responses/BadRequest" + "403": + $ref: "#/components/responses/Forbidden" + /api/v4/users/me/top/dms: + get: + tags: + - insights + summary: Get a list of the top dms for a user. + description: | + Get a list of the top dms for a given user. + ##### Permissions + Must be logged in as the user. + operationId: GetTopDMsForUser + parameters: + - name: time_range + in: query + description: > + Time range can be "today", "7_day", or "28_day". + + - `today`: threads with activity on the current day. + + - `7_day`: threads with activity in the last 7 days. + + - `28_day`: threads with activity in the last 28 days. + required: true + schema: + type: string + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of items per page, up to a maximum of 200. + schema: + type: integer + default: 60 + responses: + "200": + description: Top dms retrieved successfully. + content: + application/json: + schema: + type: object + $ref: "#/components/schemas/TopDMList" + "400": + $ref: "#/components/responses/BadRequest" + "403": + $ref: "#/components/responses/Forbidden" diff --git a/api/v4/source/introduction.yaml b/api/v4/source/introduction.yaml new file mode 100644 index 0000000000..2b3c6ac175 --- /dev/null +++ b/api/v4/source/introduction.yaml @@ -0,0 +1,647 @@ +openapi: 3.0.0 +info: + description: > + There is also a work-in-progress [Postman API + reference](https://documenter.getpostman.com/view/4508214/RW8FERUn). + version: 4.0.0 + title: Mattermost API Reference + termsOfService: https://about.mattermost.com/default-terms/ + contact: + email: feedback@mattermost.com + x-logo: + url: https://mattermost.com/wp-content/uploads/2022/02/logoHorizontal.png + backgroundColor: "#FFFFFF" +tags: + - name: introduction + description: > + The Mattermost Web Services API is used by Mattermost clients and third + party applications to interact with the server. [JavaScript and Golang + drivers for](/#tag/drivers) connecting to the APIs are also available. + + + ### Support + + + 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](https://community.mattermost.com) to ask questions in the Developers channel, [or post questions to our Developer Discussion forum](https://forum.mattermost.org/c/dev). + + + [Bug reports](https://github.com/mattermost/mattermost-api-reference/issues) in the documentation or the API are also welcome, as are pull requests to fix the issues. + + + ### Contributing + + + When you have answers to API questions not addressed in our documentation we ask you to consider making a pull request to improve our reference. [Small changes](https://github.com/mattermost/mattermost-api-reference/commit/d574c0c1e95dc2228dc96663afd562f1305e3ece) and [larger changes](https://github.com/mattermost/mattermost-api-reference/commit/1ae3314f0935eebba8c885d8969dcad72f801501) are all welcome. + + + We also have [Help Wanted tickets](https://github.com/mattermost/mattermost-api-reference/issues) available for community members who would like to help others more easily use the APIs. We acknowledge everyone's contribution in the [release notes of our next version](https://docs.mattermost.com/administration/changelog.html#contributors). + + + The source code for this API reference is hosted at https://github.com/mattermost/mattermost-api-reference. + - name: schema + description: > + 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. + - name: drivers + description: > + The easiest way to interact with the Mattermost Web Service API is through + a language specific driver. + + + #### Official Drivers + + * [Mattermost JavaScript Driver](https://github.com/mattermost/mattermost-redux/blob/master/src/client/client4.ts) + + * [Mattermost Golang Driver](https://github.com/mattermost/mattermost/blob/master/server/public/model/client4.go) + + + #### Community-built Drivers + + * [PHP Driver](https://github.com/gnello/php-mattermost-driver) - built by [@gnello](https://github.com/gnello) and [@prixone](https://github.com/prixone) + + * [Python Driver](https://github.com/Vaelor/python-mattermost-driver) - built by [@Vaelor](https://github.com/Vaelor) + + + For other community-built drivers and API wrappers, see [our app directory](https://mattermost.com/marketplace/). + - name: authentication + description: > + There are multiple ways to authenticate against the Mattermost API. + + + All examples assume there is a Mattermost instance running at http://localhost:8065. + + + #### Session Token + + + 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. + + + #### Personal Access Tokens + + + Using [personal access tokens](https://docs.mattermost.com/developer/personal-access-tokens.html) is very similar to using a session token. The only real difference is that session tokens will expire, while personal access tokens will live until they are manually revoked by the user or an admin. + + + 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 + + ``` + + + #### OAuth 2.0 + + + Mattermost has the ability to act as an [OAuth 2.0](https://tools.ietf.org/html/rfc6749) service provider. + + + The official documentation for [using your Mattermost server as an OAuth 2.0 service provider can be found here.](https://docs.mattermost.com/developer/oauth-2-0-applications.html) + + + For an example on how to register an OAuth 2.0 app with your Mattermost instance, please see the [Mattermost-Zapier integration documentation](https://docs.mattermost.com/integrations/zapier.html#register-zapier-as-an-oauth-2-0-application). + - name: errors + description: > + 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 + } + + ``` + - name: rate limiting + description: > + 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 + + ``` + - name: WebSocket + description: > + 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](https://tools.ietf.org/html/rfc6455#section-1.3) to the `/api/v4/websocket` endpoint of Mattermost. + + + #### Authentication + + + The Mattermost WebSocket can be authenticated using [the standard API authentication methods](/#tag/authentication) (by a cookie or with an explicit Authorization header) 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. + + + #### Events + + + 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: + + - added_to_team + + - authentication_challenge + + - channel_converted + + - channel_created + + - channel_deleted + + - channel_member_updated + + - channel_updated + + - channel_viewed + + - config_changed + + - delete_team + + - direct_added + + - emoji_added + + - ephemeral_message + + - group_added + + - hello + + - leave_team + + - license_changed + + - memberrole_updated + + - new_user + + - plugin_disabled + + - plugin_enabled + + - plugin_statuses_changed + + - post_deleted + + - post_edited + + - post_unread + + - posted + + - preference_changed + + - preferences_changed + + - preferences_deleted + + - reaction_added + + - reaction_removed + + - response + + - role_updated + + - status_change + + - typing + + - update_team + + - user_added + + - user_removed + + - user_role_updated + + - user_updated + + - dialog_opened + + - thread_updated + + - thread_follow_changed + + - thread_read_changed + + + #### WebSocket API + + + 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 `data` field is used to add any additional data along with the request. The server supports binary websocket messages as well in case the client has such a requirement. + + + 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: + + - user_typing + + - get_statuses + + - get_statuses_by_ids + + + To see how these actions work, please refer to either the [Golang WebSocket driver](https://github.com/mattermost/mattermost-server/blob/master/model/websocket_client.go) or our [JavaScript WebSocket driver](https://github.com/mattermost/mattermost-redux/blob/master/src/client/websocket_client.ts). + - name: APIv3 Deprecation + description: > + 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 + + + 1. Set your server's log level to `DEBUG` in **System Console > General > Logging > File Log Level** to print detailed logs for API requests. + + 2. In **System Console > Logs**, search for requests hitting `/api/v3/` endpoints. Any requests hitting these endpoints are from integrations that should be migrated to API v4. + - For in-house or self-built integrations, update them to use v4 with the help of [this API reference](https://api.mattermost.com). Most v3 endpoints have direct counterparts in v4 and should be migrated easily. + - For third-party integrations, visit their homepage (on GitHub, GitLab, etc.). Check if they already have a version that uses the Mattermost v4 API. If they do not, consider opening an issue asking them if support is planned. + 3. Once all integrations have been migrated to API v4, review the server logs with log level set to `DEBUG`. Confirm no requests hit `/api/v3/` endpoints. + + 4. Set **Allow use of API v3 endpoints** to `false` in **System Console > General > Configuration**, or set `EnableAPIv3` to `false` in `config.json`. This setting disables API v3 on your server. Any time a v3 endpoint is used, an error is logged in **System Console > Logs**. + + 5. Set your server's log level back to `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: + + + 1. Endpoint URLs only require team IDs when necessary. For example, getting a channel by ID no longer requires a team ID in v4. + + 2. Collection endpoints now generally return lists and include paging as part of the query string. + + 3. User ID is now included in most user endpoints. This allows admins to modify other users through v4 endpoints. + + + If you have any questions about the API v3 deprecation, or about migrating from v3 to v4, [join our daily build server at community.mattermost.com](https://community.mattermost.com) and ask questions in the [APIv4 channel](https://community.mattermost.com/core/channels/apiv4). + - name: users + description: > + 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. + - name: bots + description: Endpoints for creating, getting and updating bot users. + - name: teams + description: Endpoints for creating, getting and interacting with teams. + - name: channels + description: Endpoints for creating, getting and interacting with channels. + - name: posts + description: Endpoints for creating, getting and interacting with posts. + - name: files + description: Endpoints for uploading and interacting with files. + - name: uploads + description: Endpoints for creating and performing file uploads. + - name: preferences + description: Endpoints for saving and modifying user preferences. + - name: status + description: Endpoints for getting and updating user statuses. + - name: emoji + description: Endpoints for creating, getting and interacting with emojis. + - name: reactions + description: Endpoints for creating, getting and removing emoji reactions. + - name: webhooks + description: Endpoints for creating, getting and updating webhooks. + - name: commands + description: Endpoints for creating, getting and updating slash commands. + - name: OpenGraph + description: Endpoint for getting Open Graph metadata. + - name: system + description: General endpoints for interacting with the server, such as configuration and logging. + - name: brand + description: + Endpoints related to custom branding and white-labeling. See [our branding + documentation](https://docs.mattermost.com/administration/branding.html) + for more information. + - name: OAuth + description: + Endpoints for configuring and interacting with Mattermost as an OAuth 2.0 + service provider. + - name: SAML + description: Endpoints for configuring and interacting with SAML. + - name: LDAP + description: Endpoints for configuring and interacting with LDAP. + - name: groups + description: Endpoints related to LDAP groups. + - name: compliance + description: Endpoints for creating, getting and downloading compliance reports. + - name: cluster + description: Endpoints for configuring and interacting with high availability clusters. + - name: elasticsearch + description: Endpoints for configuring and interacting with Elasticsearch. + - name: data retention + description: Endpoint for getting data retention policy settings. + - name: jobs + description: + Endpoints related to various background jobs that can be run by the server + or separately by job servers. + - name: plugins + description: Endpoints related to uploading and managing plugins. + - name: roles + description: Endpoints for creating, getting and updating roles. + - name: schemes + description: Endpoints for creating, getting and updating and deleting schemes. + - name: integration_actions + description: Endpoints for interactive actions for use by integrations. + - name: shared channels + description: Endpoints for getting information about shared channels. + - name: insights + description: Endpoints for getting insights into teams and users. + - name: terms of service + description: Endpoints for getting and updating custom terms of service. + - name: imports + description: Endpoints related to import files. + - name: exports + description: Endpoints related to export files. +x-tagGroups: + - name: Overview + tags: + - introduction + - schema + - APIv3 Deprecation + - name: Standard Features + tags: + - drivers + - authentication + - errors + - rate limiting + - WebSocket + - name: Endpoints + tags: + - users + - bots + - teams + - channels + - posts + - threads + - files + - uploads + - preferences + - status + - emoji + - reactions + - webhooks + - commands + - OpenGraph + - system + - brand + - OAuth + - SAML + - LDAP + - groups + - compliance + - cluster + - cloud + - elasticsearch + - bleve + - data retention + - jobs + - plugins + - roles + - schemes + - integration_actions + - shared channels + - insights + - terms of service + - imports + - permissions + - exports + - usage +servers: + - url: http://your-mattermost-url.com + - url: https://your-mattermost-url.com +paths: diff --git a/api/v4/source/jobs.yaml b/api/v4/source/jobs.yaml new file mode 100644 index 0000000000..eb7baca517 --- /dev/null +++ b/api/v4/source/jobs.yaml @@ -0,0 +1,225 @@ + /api/v4/jobs: + get: + tags: + - jobs + summary: Get the jobs. + description: > + Get a page of jobs. Use the query parameters to modify the behaviour of + this endpoint. + + __Minimum server version: 4.1__ + + ##### Permissions + + Must have `manage_jobs` permission. + operationId: GetJobs + parameters: + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of jobs per page. + schema: + type: integer + default: 60 + responses: + "200": + description: Job list retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Job" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + post: + tags: + - jobs + summary: Create a new job. + description: | + Create a new job. + __Minimum server version: 4.1__ + ##### Permissions + Must have `manage_jobs` permission. + operationId: CreateJob + requestBody: + content: + application/json: + schema: + type: object + required: + - type + properties: + type: + type: string + description: The type of job to create + data: + type: object + description: An object containing any additional data required for this + job type + description: Job object to be created + required: true + responses: + "201": + description: Job creation successful + content: + application/json: + schema: + $ref: "#/components/schemas/Job" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "/api/v4/jobs/{job_id}": + get: + tags: + - jobs + summary: Get a job. + description: | + Gets a single job. + __Minimum server version: 4.1__ + ##### Permissions + Must have `manage_jobs` permission. + operationId: GetJob + parameters: + - name: job_id + in: path + description: Job GUID + required: true + schema: + type: string + responses: + "200": + description: Job retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/Job" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "/api/v4/jobs/{job_id}/download": + get: + tags: + - jobs + summary: Download the results of a job. + description: | + Download the result of a single job. + __Minimum server version: 5.28__ + ##### Permissions + Must have `manage_jobs` permission. + operationId: DownloadJob + parameters: + - name: job_id + in: path + description: Job GUID + required: true + schema: + type: string + responses: + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "/api/v4/jobs/{job_id}/cancel": + post: + tags: + - jobs + summary: Cancel a job. + description: | + Cancel a job. + __Minimum server version: 4.1__ + ##### Permissions + Must have `manage_jobs` permission. + operationId: CancelJob + parameters: + - name: job_id + in: path + description: Job GUID + required: true + schema: + type: string + responses: + "200": + description: Job canceled successfully + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "/api/v4/jobs/type/{type}": + get: + tags: + - jobs + summary: Get the jobs of the given type. + description: > + 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__ + + ##### Permissions + + Must have `manage_jobs` permission. + operationId: GetJobsByType + parameters: + - name: type + in: path + description: Job type + required: true + schema: + type: string + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of jobs per page. + schema: + type: integer + default: 60 + responses: + "200": + description: Job list retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Job" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" diff --git a/api/v4/source/ldap.yaml b/api/v4/source/ldap.yaml new file mode 100644 index 0000000000..f61f4a9e3f --- /dev/null +++ b/api/v4/source/ldap.yaml @@ -0,0 +1,327 @@ + /api/v4/ldap/sync: + post: + tags: + - LDAP + summary: Sync with LDAP + description: > + Synchronize any user attribute changes in the configured AD/LDAP server + with Mattermost. + + ##### Permissions + + Must have `manage_system` permission. + operationId: SyncLdap + responses: + "200": + description: LDAP sync successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "501": + $ref: "#/components/responses/NotImplemented" + /api/v4/ldap/test: + post: + tags: + - LDAP + summary: Test LDAP configuration + description: > + Test the current AD/LDAP configuration to see if the AD/LDAP server can + be contacted successfully. + + ##### Permissions + + Must have `manage_system` permission. + operationId: TestLdap + responses: + "200": + description: LDAP test successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + /api/v4/ldap/groups: + get: + tags: + - ldap + summary: Returns a list of LDAP groups + description: > + ##### Permissions + + Must have `manage_system` permission. + + __Minimum server version__: 5.11 + operationId: GetLdapGroups + parameters: + - name: q + in: query + description: Search term + required: false + schema: + type: string + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of users per page. There is a maximum limit of 200 users + per page. + schema: + type: integer + default: 60 + responses: + "200": + description: LDAP group page retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/LDAPGroupsPaged" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + /api/v4/ldap/groups/{remote_id}/link: + post: + tags: + - ldap + summary: Link a LDAP group + description: > + ##### Permissions + + Must have `manage_system` permission. + + __Minimum server version__: 5.11 + operationId: LinkLdapGroup + parameters: + - name: remote_id + in: path + description: Group GUID + required: true + schema: + type: string + responses: + "201": + description: LDAP group successfully linked + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + delete: + tags: + - groups + summary: Delete a link for LDAP group + description: > + ##### Permissions + + Must have `manage_system` permission. + + __Minimum server version__: 5.11 + operationId: UnlinkLdapGroup + parameters: + - name: remote_id + in: path + description: Group GUID + required: true + schema: + type: string + responses: + "200": + description: Successfully deleted ldap group link + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + /api/v4/ldap/migrateid: + post: + tags: + - LDAP + summary: Migrate Id LDAP + description: > + Migrate LDAP IdAttribute to new value. + + ##### Permissions + + Must have `manage_system` permission. + + __Minimum server version__: 5.26 + operationId: MigrateIdLdap + requestBody: + content: + application/json: + schema: + type: object + required: + - toAttribute + properties: + toAttribute: + description: New IdAttribute value + type: string + required: true + responses: + "200": + description: Migration successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + /api/v4/ldap/certificate/public: + post: + tags: + - LDAP + summary: Upload public certificate + description: > + Upload the public certificate to be used for TLS verification. The server will pick a hard-coded filename for the + PublicCertificateFile setting in your `config.json`. + + ##### Permissions + + Must have `manage_system` permission. + operationId: UploadLdapPublicCertificate + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + certificate: + description: The public certificate file + type: string + format: binary + required: + - certificate + responses: + "200": + description: LDAP certificate upload successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + delete: + tags: + - LDAP + summary: Remove public certificate + description: > + Delete the current public certificate being used for TLS verification. + + ##### Permissions + + Must have `manage_system` permission. + operationId: DeleteLdapPublicCertificate + responses: + "200": + description: LDAP certificate delete successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + /api/v4/ldap/certificate/private: + post: + tags: + - LDAP + summary: Upload private key + description: > + Upload the private key to be used for TLS verification. The server will pick a hard-coded filename for the + PrivateKeyFile setting in your `config.json`. + + ##### Permissions + + Must have `manage_system` permission. + operationId: UploadLdapPrivateCertificate + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + certificate: + description: The private key file + type: string + format: binary + required: + - certificate + responses: + "200": + description: LDAP certificate upload successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + delete: + tags: + - LDAP + summary: Remove private key + description: > + Delete the current private key being used with your TLS verification. + + ##### Permissions + + Must have `manage_system` permission. + operationId: DeleteLdapPrivateCertificate + responses: + "200": + description: LDAP certificate delete successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" diff --git a/api/v4/source/oauth.yaml b/api/v4/source/oauth.yaml new file mode 100644 index 0000000000..a75ca7d8bb --- /dev/null +++ b/api/v4/source/oauth.yaml @@ -0,0 +1,387 @@ + /api/v4/oauth/apps: + post: + tags: + - OAuth + summary: Register OAuth app + description: > + Register an OAuth 2.0 client application with Mattermost as the service + provider. + + ##### Permissions + + Must have `manage_oauth` permission. + operationId: CreateOAuthApp + requestBody: + content: + application/json: + schema: + type: object + required: + - name + - description + - callback_urls + - homepage + properties: + name: + type: string + description: The name of the client application + description: + type: string + description: A short description of the application + icon_url: + type: string + description: A URL to an icon to display with the application + callback_urls: + type: array + items: + type: string + description: A list of callback URLs for the appliation + homepage: + type: string + description: A link to the website of the application + is_trusted: + type: boolean + description: Set this to `true` to skip asking users for permission + description: OAuth application to register + required: true + responses: + "201": + description: App registration successful + content: + application/json: + schema: + $ref: "#/components/schemas/OAuthApp" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + get: + tags: + - OAuth + summary: Get OAuth apps + description: > + Get a page of OAuth 2.0 client applications registered with Mattermost. + + ##### Permissions + + 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. + operationId: GetOAuthApps + parameters: + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of apps per page. + schema: + type: integer + default: 60 + responses: + "200": + description: OAuthApp list retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/OAuthApp" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + "/api/v4/oauth/apps/{app_id}": + get: + tags: + - OAuth + summary: Get an OAuth app + description: > + Get an OAuth 2.0 client application registered with Mattermost. + + ##### Permissions + + If app creator, must have `mange_oauth` permission otherwise `manage_system_wide_oauth` permission is required. + operationId: GetOAuthApp + parameters: + - name: app_id + in: path + description: Application client id + required: true + schema: + type: string + responses: + "200": + description: App retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/OAuthApp" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "501": + $ref: "#/components/responses/NotImplemented" + put: + tags: + - OAuth + summary: Update an OAuth app + description: > + Update an OAuth 2.0 client application based on OAuth struct. + + ##### Permissions + + If app creator, must have `mange_oauth` permission otherwise `manage_system_wide_oauth` permission is required. + operationId: UpdateOAuthApp + parameters: + - name: app_id + in: path + description: Application client id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - id + - name + - description + - callback_urls + - homepage + properties: + id: + type: string + description: The id of the client application + name: + type: string + description: The name of the client application + description: + type: string + description: A short description of the application + icon_url: + type: string + description: A URL to an icon to display with the application + callback_urls: + type: array + items: + type: string + description: A list of callback URLs for the appliation + homepage: + type: string + description: A link to the website of the application + is_trusted: + type: boolean + description: Set this to `true` to skip asking users for permission. It + will be set to false if value is not provided. + description: OAuth application to update + required: true + responses: + "200": + description: App update successful + content: + application/json: + schema: + $ref: "#/components/schemas/OAuthApp" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + appToUpdate := &model.OAuthApp{ + Id: , + Name: , + Description: , + IconURL: , + CallbackUrls: [, ], + Homepage: , + IsTrusted: + } + + // UpdateOAuthApp + updatedApp, resp := Client.UpdateOAuthApp(appToUpdate) + delete: + tags: + - OAuth + summary: Delete an OAuth app + description: > + Delete and unregister an OAuth 2.0 client application + + ##### Permissions + + If app creator, must have `mange_oauth` permission otherwise `manage_system_wide_oauth` permission is required. + operationId: DeleteOAuthApp + parameters: + - name: app_id + in: path + description: Application client id + required: true + schema: + type: string + responses: + "200": + description: App deletion successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "501": + $ref: "#/components/responses/NotImplemented" + "/api/v4/oauth/apps/{app_id}/regen_secret": + post: + tags: + - OAuth + summary: Regenerate OAuth app secret + description: > + Regenerate the client secret for an OAuth 2.0 client application + registered with Mattermost. + + ##### Permissions + + If app creator, must have `mange_oauth` permission otherwise `manage_system_wide_oauth` permission is required. + operationId: RegenerateOAuthAppSecret + parameters: + - name: app_id + in: path + description: Application client id + required: true + schema: + type: string + responses: + "200": + description: Secret regeneration successful + content: + application/json: + schema: + $ref: "#/components/schemas/OAuthApp" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "501": + $ref: "#/components/responses/NotImplemented" + "/api/v4/oauth/apps/{app_id}/info": + get: + tags: + - OAuth + summary: Get info on an OAuth app + description: > + Get public information about an OAuth 2.0 client application registered + with Mattermost. The application's client secret will be blanked out. + + ##### Permissions + + Must be authenticated. + operationId: GetOAuthAppInfo + parameters: + - name: app_id + in: path + description: Application client id + required: true + schema: + type: string + responses: + "200": + description: App retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/OAuthApp" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "404": + $ref: "#/components/responses/NotFound" + "501": + $ref: "#/components/responses/NotImplemented" + "/api/v4/users/{user_id}/oauth/apps/authorized": + get: + tags: + - OAuth + summary: Get authorized OAuth apps + description: > + Get a page of OAuth 2.0 client applications authorized to access a + user's account. + + ##### Permissions + + Must be authenticated as the user or have `edit_other_users` permission. + operationId: GetAuthorizedOAuthAppsForUser + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of apps per page. + schema: + type: integer + default: 60 + responses: + "200": + description: OAuthApp list retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/OAuthApp" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" diff --git a/api/v4/source/opengraph.yaml b/api/v4/source/opengraph.yaml new file mode 100644 index 0000000000..3cde79d4be --- /dev/null +++ b/api/v4/source/opengraph.yaml @@ -0,0 +1,38 @@ + /api/v4/opengraph: + post: + tags: + - OpenGraph + summary: Get open graph metadata for url + description: > + 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 + + + ##### Permissions + + No permission required but must be logged in. + operationId: OpenGraph + requestBody: + content: + application/json: + schema: + type: object + required: + - url + properties: + url: + type: string + description: The URL to get Open Graph Metadata. + required: true + responses: + "200": + description: Open Graph retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/OpenGraph" + "501": + $ref: "#/components/responses/NotImplemented" diff --git a/api/v4/source/permissions.yaml b/api/v4/source/permissions.yaml new file mode 100644 index 0000000000..c2ed4360cb --- /dev/null +++ b/api/v4/source/permissions.yaml @@ -0,0 +1,32 @@ + /api/v4/permissions/ancillary: + get: + tags: + - permissions + summary: Return all system console subsection ancillary permissions + description: > + Returns all the ancillary permissions for the corresponding system console + subsection permissions appended to the requested permission subsections. + + + __Minimum server version__: 5.35 + operationId: GetAncillaryPermissions + parameters: + - name: subsection_permissions + in: query + description: > + The subsection permissions to return the ancillary permissions for. + These values are comma seperated. + Ex. subsection_permissions=sysconsole_read_reporting_site_statistics,sysconsole_write_reporting_site_statistics,sysconsole_write_user_management_channels + schema: + type: string + responses: + "200": + description: Successfully returned all ancillary and requested permissions + content: + application/json: + schema: + type: array + items: + type: string + "400": + $ref: '#/components/responses/BadRequest' diff --git a/api/v4/source/plugins.yaml b/api/v4/source/plugins.yaml new file mode 100644 index 0000000000..a41a89949e --- /dev/null +++ b/api/v4/source/plugins.yaml @@ -0,0 +1,616 @@ + /api/v4/plugins: + post: + tags: + - plugins + summary: Upload plugin + description: > + 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. + + + ##### Permissions + + Must have `manage_system` permission. + + + __Minimum server version__: 4.4 + operationId: UploadPlugin + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + plugin: + description: The plugin image to be uploaded + type: string + format: binary + force: + description: Set to 'true' to overwrite a previously installed plugin + with the same ID, if any + type: string + required: + - plugin + responses: + "201": + description: Plugin upload successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "413": + $ref: "#/components/responses/TooLarge" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: > + import ( + "bytes" + "io/ioutil" + "log" + + "github.com/mattermost/mattermost-server/v5/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)) + get: + tags: + - plugins + summary: Get plugins + description: > + Get a list of inactive and a list of active plugin manifests. Plugins + must be enabled in the server's config settings. + + + ##### Permissions + + Must have `manage_system` permission. + + + __Minimum server version__: 4.4 + operationId: GetPlugins + responses: + "200": + description: Plugins retrieval successful + content: + application/json: + schema: + type: object + properties: + active: + type: array + items: + $ref: "#/components/schemas/PluginManifest" + inactive: + type: array + items: + $ref: "#/components/schemas/PluginManifest" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + pluginsResp, resp := Client.GetPlugins() + /api/v4/plugins/install_from_url: + post: + tags: + - plugins + summary: Install plugin from url + description: > + Supply a URL to a plugin compressed in a .tar.gz file. Plugins must be + enabled in the server's config settings. + + + ##### Permissions + + Must have `manage_system` permission. + + + __Minimum server version__: 5.14 + operationId: InstallPluginFromUrl + parameters: + - name: plugin_download_url + in: query + description: URL used to download the plugin + required: true + schema: + type: string + - name: force + in: query + description: Set to 'true' to overwrite a previously installed plugin with the + same ID, if any + required: false + schema: + type: string + responses: + "201": + description: Plugin install successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import ( + "github.com/mattermost/mattermost-server/v5/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) + "/api/v4/plugins/{plugin_id}": + delete: + tags: + - plugins + summary: Remove plugin + description: > + 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. + + + ##### Permissions + + Must have `manage_system` permission. + + + __Minimum server version__: 4.4 + operationId: RemovePlugin + parameters: + - name: plugin_id + description: Id of the plugin to be removed + in: path + required: true + schema: + type: string + responses: + "200": + description: Plugin removed successfully + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/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) + "/api/v4/plugins/{plugin_id}/enable": + post: + tags: + - plugins + summary: Enable plugin + description: > + Enable a previously uploaded plugin. Plugins must be enabled in the + server's config settings. + + + ##### Permissions + + Must have `manage_system` permission. + + + __Minimum server version__: 4.4 + operationId: EnablePlugin + parameters: + - name: plugin_id + description: Id of the plugin to be enabled + in: path + required: true + schema: + type: string + responses: + "200": + description: Plugin enabled successfully + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/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) + "/api/v4/plugins/{plugin_id}/disable": + post: + tags: + - plugins + summary: Disable plugin + description: > + Disable a previously enabled plugin. Plugins must be enabled in the + server's config settings. + + + ##### Permissions + + Must have `manage_system` permission. + + + __Minimum server version__: 4.4 + operationId: DisablePlugin + parameters: + - name: plugin_id + description: Id of the plugin to be disabled + in: path + required: true + schema: + type: string + responses: + "200": + description: Plugin disabled successfully + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/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) + /api/v4/plugins/webapp: + get: + tags: + - plugins + summary: Get webapp plugins + description: | + Get a list of web app plugins installed and activated on the server. + + ##### Permissions + No permissions required. + + __Minimum server version__: 4.4 + operationId: GetWebappPlugins + responses: + "200": + description: Plugin deactivated successfully + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/PluginManifestWebapp" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + manifests, resp := Client.GetWebappPlugins() + /api/v4/plugins/statuses: + get: + tags: + - plugins + summary: Get plugins status + description: | + Returns the status for plugins installed anywhere in the cluster + + ##### Permissions + No permissions required. + + __Minimum server version__: 4.4 + operationId: GetPluginStatuses + responses: + "200": + description: Plugin status retreived successfully + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/PluginStatus" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + manifests, resp := Client.GetPluginStatuses() + /api/v4/plugins/marketplace: + post: + tags: + - plugins + summary: Installs a marketplace plugin + description: | + Installs a plugin listed in the marketplace server. + + ##### Permissions + Must have `manage_system` permission. + + __Minimum server version__: 5.16 + operationId: InstallMarketplacePlugin + requestBody: + content: + application/json: + schema: + type: object + required: + - id + - version + properties: + id: + type: string + description: The ID of the plugin to install. + version: + type: string + description: The version of the plugin to install. + description: The metadata identifying the plugin to install. + required: true + responses: + "200": + description: Plugin installed successfully + content: + application/json: + schema: + $ref: "#/components/schemas/PluginManifest" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + plugin := &model.InstallMarketplacePluginRequest{ + Id: "antivirus", + } + + ok, resp = Client.InstallMarketplacePlugin(plugin) + get: + tags: + - plugins + summary: Gets all the marketplace plugins + description: > + Gets all plugins from the marketplace server, merging data from locally + installed plugins as well as prepackaged plugins shipped with the + server. + + + ##### Permissions + + Must have `manage_system` permission. + + + __Minimum server version__: 5.16 + operationId: GetMarketplacePlugins + parameters: + - name: page + in: query + description: Page number to be fetched. (not yet implemented) + required: false + schema: + type: integer + - name: per_page + in: query + description: Number of item per page. (not yet implemented) + required: false + schema: + type: integer + - name: filter + in: query + description: Set to filter plugins by ID, name, or description. + required: false + schema: + type: string + - name: server_version + in: query + description: Set to filter minimum plugin server version. (not yet implemented) + required: false + schema: + type: string + - name: local_only + in: query + description: Set true to only retrieve local plugins. + required: false + schema: + type: boolean + responses: + "200": + description: Plugins retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/MarketplacePlugin" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/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) + /api/v4/plugins/marketplace/first_admin_visit: + get: + tags: + - plugins + summary: Get if the Plugin Marketplace has been visited by at least an admin. + description: | + Retrieves the status that specifies that at least one System Admin has visited the in-product Plugin Marketplace. + __Minimum server version: 5.33__ + ##### Permissions + Must have `manage_system` permissions. + operationId: GetMarketplaceVisitedByAdmin + responses: + "200": + description: Retrieves the system-level status + content: + application/json: + schema: + $ref: "#/components/schemas/System" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + post: + tags: + - system + summary: Stores that the Plugin Marketplace has been visited by at least an admin. + description: | + Stores the system-level status that specifies that at least an admin has visited the in-product Plugin Marketplace. + __Minimum server version: 5.33__ + ##### Permissions + Must have `manage_system` permissions. + operationId: UpdateMarketplaceVisitedByAdmin + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/System" + required: true + responses: + "200": + description: setting has been successfully set + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" diff --git a/api/v4/source/posts.yaml b/api/v4/source/posts.yaml new file mode 100644 index 0000000000..962743f833 --- /dev/null +++ b/api/v4/source/posts.yaml @@ -0,0 +1,1063 @@ + /api/v4/posts: + post: + tags: + - posts + summary: Create a post + description: > + Create a new post in a channel. To create the post as a comment on + another post, provide `root_id`. + + ##### Permissions + + Must have `create_post` permission for the channel the post is being created in. + operationId: CreatePost + parameters: + - name: set_online + in: query + description: Whether to set the user status as online or not. + required: false + schema: + type: boolean + requestBody: + content: + application/json: + schema: + type: object + required: + - channel_id + - message + properties: + channel_id: + type: string + description: The channel ID to post in + message: + type: string + description: The message contents, can be formatted with Markdown + root_id: + type: string + description: The post ID to comment on + file_ids: + type: array + description: 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. + items: + type: string + props: + description: A general JSON property bag to attach to the post + type: object + metadata: + description: A JSON object to add post metadata, e.g the post's priority + type: object + properties: + priority: + type: object + description: An object containing the post's priority properties + properties: + priority: + type: string + description: The priority label of the post, could empty, important, or urgent + requested_ack: + type: boolean + description: Set to true to request for acknowledgements + description: Post object to create + required: true + responses: + "201": + description: Post creation successful + content: + application/json: + schema: + $ref: "#/components/schemas/Post" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + /api/v4/posts/ephemeral: + post: + tags: + - posts + summary: Create a ephemeral post + description: > + Create a new ephemeral post in a channel. + + ##### Permissions + + Must have `create_post_ephemeral` permission (currently only given to system admin) + operationId: CreatePostEphemeral + requestBody: + content: + application/json: + schema: + type: object + required: + - user_id + - post + properties: + user_id: + type: string + description: The target user id for the ephemeral post + post: + type: object + required: + - channel_id + - message + description: Post object to create + properties: + channel_id: + type: string + description: The channel ID to post in + message: + type: string + description: The message contents, can be formatted with Markdown + description: Ephemeral Post object to send + required: true + responses: + "201": + description: Post creation successful + content: + application/json: + schema: + $ref: "#/components/schemas/Post" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + client := model.NewAPIv4Client("https://your-mattermost-url.com") + client.Login("email@domain.com", "Password1") + + ephemeralPost := &model.PostEphemeral{ + UserID: "", + Post: &model.Post{ + ChannelId: "", + Message: "", + }, + } + + createdPost, response := client.CreatePostEphemeral(ephemeralPost) + "/api/v4/posts/{post_id}": + get: + tags: + - posts + summary: Get a post + description: > + Get a single post. + + ##### Permissions + + 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. + operationId: GetPost + parameters: + - name: post_id + in: path + description: ID of the post to get + required: true + schema: + type: string + - name: include_deleted + in: query + description: Defines if result should include deleted posts, must have 'manage_system' (admin) permission. + required: false + schema: + type: boolean + default: false + responses: + "200": + description: Post retrieval successful + headers: + Has-Inaccessible-Posts: + schema: + type: boolean + description: This header is included with the value "true" if the post is past the cloud's plan limit. + content: + application/json: + schema: + $ref: "#/components/schemas/Post" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + delete: + tags: + - posts + summary: Delete a post + description: > + Soft deletes a post, by marking the post as deleted in the database. + Soft deleted posts will not be returned in post queries. + + ##### Permissions + + Must be logged in as the user or have `delete_others_posts` permission. + operationId: DeletePost + parameters: + - name: post_id + in: path + description: ID of the post to delete + required: true + schema: + type: string + responses: + "200": + description: Post deletion successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + put: + tags: + - posts + summary: Update a post + description: > + Update a post. Only the fields listed below are updatable, omitted + fields will be treated as blank. + + ##### Permissions + + Must have `edit_post` permission for the channel the post is in. + operationId: UpdatePost + parameters: + - name: post_id + in: path + description: ID of the post to update + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - id + properties: + id: + description: ID of the post to update + type: string + is_pinned: + description: Set to `true` to pin the post to the channel it is in + type: boolean + message: + description: The message text of the post + type: string + has_reactions: + description: Set to `true` if the post has reactions to it + type: boolean + props: + description: A general JSON property bag to attach to the post + type: string + description: Post object that is to be updated + required: true + responses: + "200": + description: Post update successful + content: + application/json: + schema: + $ref: "#/components/schemas/Post" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "/api/v4/users/{user_id}/posts/{post_id}/set_unread": + post: + tags: + - posts + summary: Mark as unread from a post. + description: > + Mark a channel as being unread from a given post. + + ##### Permissions + + 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 + operationId: SetPostUnread + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + - name: post_id + in: path + description: Post GUID + required: true + schema: + type: string + responses: + "200": + description: Post marked as unread successfully + content: + application/json: + schema: + $ref: "#/components/schemas/ChannelUnreadAt" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "/api/v4/posts/{post_id}/patch": + put: + tags: + - posts + summary: Patch a post + description: > + 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. + + ##### Permissions + + Must have the `edit_post` permission. + operationId: PatchPost + parameters: + - name: post_id + in: path + description: Post GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + is_pinned: + description: Set to `true` to pin the post to the channel it is in + type: boolean + message: + description: The message text of the post + type: string + file_ids: + description: The list of files attached to this post + type: array + items: + type: string + has_reactions: + description: Set to `true` if the post has reactions to it + type: boolean + props: + description: A general JSON property bag to attach to the post + type: string + description: Post object that is to be updated + required: true + responses: + "200": + description: Post patch successful + content: + application/json: + schema: + $ref: "#/components/schemas/Post" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "/api/v4/posts/{post_id}/thread": + get: + tags: + - posts + summary: Get a thread + description: > + Get a post and the rest of the posts in the same thread. + + ##### Permissions + + 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. + operationId: GetPostThread + parameters: + - name: post_id + in: path + description: ID of a post in the thread + required: true + schema: + type: string + - name: perPage + in: query + description: The number of posts per page + schema: + type: integer + default: 0 + - name: fromPost + in: query + description: The post_id to return the next page of posts from + schema: + type: string + default: "" + - name: fromCreateAt + in: query + description: The create_at timestamp to return the next page of posts from + schema: + type: integer + default: 0 + - name: direction + in: query + description: The direction to return the posts. Either up or down. + schema: + type: string + default: "" + - name: skipFetchThreads + in: query + description: Whether to skip fetching threads or not + schema: + type: boolean + default: false + - name: collapsedThreads + in: query + description: Whether the client uses CRT or not + schema: + type: boolean + default: false + - name: collapsedThreadsExtended + in: query + description: Whether to return the associated users as part of the response or not + schema: + type: boolean + default: false + responses: + "200": + description: Post list retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/PostList" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "/api/v4/users/{user_id}/posts/flagged": + get: + tags: + - posts + summary: Get a list of flagged posts + description: > + 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. Will only return + posts from channels in which the user is member. + + ##### Permissions + + Must be user or have `manage_system` permission. + operationId: GetFlaggedPostsForUser + parameters: + - name: user_id + in: path + description: ID of the user + required: true + schema: + type: string + - name: team_id + in: query + description: Team ID + schema: + type: string + - name: channel_id + in: query + description: Channel ID + schema: + type: string + - name: page + in: query + description: The page to select + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of posts per page + schema: + type: integer + default: 60 + responses: + "200": + description: Post list retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/PostList" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "/api/v4/posts/{post_id}/files/info": + get: + tags: + - posts + summary: Get file info for post + description: > + Gets a list of file information objects for the files attached to a + post. + + ##### Permissions + + Must have `read_channel` permission for the channel the post is in. + operationId: GetFileInfosForPost + parameters: + - name: post_id + in: path + description: ID of the post + required: true + schema: + type: string + - name: include_deleted + in: query + description: Defines if result should include deleted posts, must have 'manage_system' (admin) permission. + required: false + schema: + type: boolean + default: false + responses: + "200": + description: File info retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/FileInfo" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "/api/v4/channels/{channel_id}/posts": + get: + tags: + - posts + summary: Get posts for a channel + description: > + Get a page of posts in a channel. Use the query parameters to modify the + behaviour of this endpoint. The parameter `since` must not be used with any of + `before`, `after`, `page`, and `per_page` parameters. + + If `since` is used, it will always return all posts modified since that time, + ordered by their create time limited till 1000. A caveat with this parameter is that + there is no guarantee that the returned posts will be consecutive. It is left to the clients + to maintain state and fill any missing holes in the post order. + + ##### Permissions + + Must have `read_channel` permission for the channel. + operationId: GetPostsForChannel + parameters: + - name: channel_id + in: path + description: The channel ID to get the posts for + required: true + schema: + type: string + - name: page + in: query + description: The page to select + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of posts per page + schema: + type: integer + default: 60 + - name: since + in: query + description: Provide a non-zero value in Unix time milliseconds to select posts + modified after that time + schema: + type: integer + - name: before + in: query + description: A post id to select the posts that came before this one + schema: + type: string + - name: after + in: query + description: A post id to select the posts that came after this one + schema: + type: string + - name: include_deleted + in: query + description: Whether to include deleted posts or not. Must have system admin permissions. + schema: + type: boolean + default: false + responses: + "200": + description: Post list retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/PostList" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "/api/v4/users/{user_id}/channels/{channel_id}/posts/unread": + get: + tags: + - posts + summary: Get posts around oldest unread + description: > + Get the oldest unread post in the channel for the given user as well as + the posts around it. + The returned list is sorted in descending order (most recent post first). + + ##### Permissions + + 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 + operationId: GetPostsAroundLastUnread + parameters: + - name: user_id + in: path + description: ID of the user + required: true + schema: + type: string + - name: channel_id + in: path + description: The channel ID to get the posts for + required: true + schema: + type: string + - name: limit_before + in: query + description: Number of posts before the oldest unread posts. Maximum is 200 posts + if limit is set greater than that. + schema: + type: integer + default: 60 + maximum: 200 + minimum: 0 + - name: limit_after + in: query + description: Number of posts after and including the oldest unread post. Maximum is + 200 posts if limit is set greater than that. + schema: + type: integer + default: 60 + maximum: 200 + minimum: 1 + - name: skipFetchThreads + in: query + description: Whether to skip fetching threads or not + schema: + type: boolean + default: false + - name: collapsedThreads + in: query + description: Whether the client uses CRT or not + schema: + type: boolean + default: false + - name: collapsedThreadsExtended + in: query + description: Whether to return the associated users as part of the response or not + schema: + type: boolean + default: false + responses: + "200": + description: Post list retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/PostList" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "/api/v4/teams/{team_id}/posts/search": + post: + tags: + - posts + summary: Search for team posts + description: | + Search posts in the team and from the provided terms string. + ##### Permissions + Must be authenticated and have the `view_team` permission. + operationId: SearchPosts + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - terms + - is_or_search + properties: + terms: + type: string + description: The search terms as inputed by the user. To search for posts + from a user include `from:someusername`, using a user's + username. To search in a specific channel include + `in:somechannel`, using the channel name (not the display + name). + is_or_search: + type: boolean + description: Set to true if an Or search should be performed vs an And + search. + time_zone_offset: + type: integer + default: 0 + description: Offset from UTC of user timezone for date searches. + include_deleted_channels: + type: boolean + description: Set to true if deleted channels should be included in the + search. (archived channels) + page: + type: integer + default: 0 + description: The page to select. (Only works with Elasticsearch) + per_page: + type: integer + default: 60 + description: The number of posts per page. (Only works with Elasticsearch) + description: The search terms and logic to use in the search. + required: true + responses: + "200": + description: Post list retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/PostListWithSearchMatches" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "/api/v4/posts/{post_id}/pin": + post: + tags: + - posts + summary: Pin a post to the channel + description: > + Pin a post to a channel it is in based from the provided post id string. + + ##### Permissions + + Must be authenticated and have the `read_channel` permission to the channel the post is in. + operationId: PinPost + parameters: + - name: post_id + in: path + description: Post GUID + required: true + schema: + type: string + responses: + "200": + description: Pinned post successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "/api/v4/posts/{post_id}/unpin": + post: + tags: + - posts + summary: Unpin a post to the channel + description: > + Unpin a post to a channel it is in based from the provided post id + string. + + ##### Permissions + + Must be authenticated and have the `read_channel` permission to the channel the post is in. + operationId: UnpinPost + parameters: + - name: post_id + in: path + description: Post GUID + required: true + schema: + type: string + responses: + "200": + description: Unpinned post successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "/api/v4/posts/{post_id}/actions/{action_id}": + post: + tags: + - posts + summary: Perform a post action + description: > + Perform a post action, which allows users to interact with integrations + through posts. + + ##### Permissions + + Must be authenticated and have the `read_channel` permission to the channel the post is in. + operationId: DoPostAction + parameters: + - name: post_id + in: path + description: Post GUID + required: true + schema: + type: string + - name: action_id + in: path + description: Action GUID + required: true + schema: + type: string + responses: + "200": + description: Post action successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "/api/v4/posts/ids": + post: + tags: + - posts + summary: Get posts by a list of ids + description: > + Fetch a list of posts based on the provided postIDs + + ##### Permissions + + 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. + operationId: getPostsByIds + requestBody: + content: + application/json: + schema: + type: array + items: + type: string + description: List of post ids + required: true + responses: + "200": + description: Post list retrieval successful + headers: + Has-Inaccessible-Posts: + schema: + type: boolean + description: Indicates whether the posts have been truncated as per the cloud's plan limit. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Post" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "/api/v4/users/{user_id}/posts/{post_id}/reminder": + post: + tags: + - posts + summary: Set a post reminder + description: > + Set a reminder for the user for the post. + + ##### Permissions + + Must have `read_channel` permission for the channel the post is in. + + + __Minimum server version__: 7.2 + operationId: SetPostReminder + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + - name: post_id + in: path + description: Post GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - target_time + properties: + target_time: + type: integer + description: Target time for the reminder + description: Target time for the reminder + required: true + responses: + "200": + description: Reminder set successfully + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "/api/v4/users/{user_id}/posts/{post_id}/ack": + post: + tags: + - posts + summary: Acknowledge a post + description: > + Acknowledge a post that has a request for acknowledgements. + + ##### Permissions + + Must have `read_channel` permission for the channel the post is in.
+ Must be logged in as the user or have `edit_other_users` permission. + + + __Minimum server version__: 7.7 + operationId: SaveAcknowledgementForPost + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + - name: post_id + in: path + description: Post GUID + required: true + schema: + type: string + responses: + "200": + description: Acknowledgement saved successfully + content: + application/json: + schema: + $ref: "#/components/schemas/PostAcknowledgement" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + delete: + tags: + - posts + summary: Delete a post acknowledgement + description: > + Delete an acknowledgement form a post that you had previously acknowledged. + + ##### Permissions + + Must have `read_channel` permission for the channel the post is in.
+ Must be logged in as the user or have `edit_other_users` permission.
+ The post must have been acknowledged in the previous 5 minutes. + + + __Minimum server version__: 7.7 + operationId: SaveAcknowledgementForPost + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + - name: post_id + in: path + description: Post GUID + required: true + schema: + type: string + responses: + "200": + description: Acknowledgement deleted successfully + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" diff --git a/api/v4/source/preferences.yaml b/api/v4/source/preferences.yaml new file mode 100644 index 0000000000..4956051660 --- /dev/null +++ b/api/v4/source/preferences.yaml @@ -0,0 +1,202 @@ + "/api/v4/users/{user_id}/preferences": + get: + tags: + - preferences + summary: Get the user's preferences + description: > + Get a list of the user's preferences. + + ##### Permissions + + Must be logged in as the user being updated or have the `edit_other_users` permission. + operationId: GetPreferences + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + responses: + "200": + description: User preferences retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Preference" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + put: + tags: + - preferences + summary: Save the user's preferences + description: > + Save a list of the user's preferences. + + ##### Permissions + + Must be logged in as the user being updated or have the `edit_other_users` permission. + operationId: UpdatePreferences + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + requestBody: + description: List of preference objects + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Preference' + responses: + "200": + description: User preferences saved successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "/api/v4/users/{user_id}/preferences/delete": + post: + tags: + - preferences + summary: Delete user's preferences + description: > + Delete a list of the user's preferences. + + ##### Permissions + + Must be logged in as the user being updated or have the `edit_other_users` permission. + operationId: DeletePreferences + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + requestBody: + description: List of preference objects + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Preference' + responses: + "200": + description: User preferences saved successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "/api/v4/users/{user_id}/preferences/{category}": + get: + tags: + - preferences + summary: List a user's preferences by category + description: > + Lists the current user's stored preferences in the given category. + + ##### Permissions + + Must be logged in as the user being updated or have the `edit_other_users` permission. + operationId: GetPreferencesByCategory + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + - name: category + in: path + description: The category of a group of preferences + required: true + schema: + type: string + responses: + "200": + description: A list of all of the current user's preferences in the given category + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Preference" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "/api/v4/users/{user_id}/preferences/{category}/name/{preference_name}": + get: + tags: + - preferences + summary: Get a specific user preference + description: > + Gets a single preference for the current user with the given category + and name. + + ##### Permissions + + Must be logged in as the user being updated or have the `edit_other_users` permission. + operationId: GetPreferencesByCategoryByName + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + - name: category + in: path + description: The category of a group of preferences + required: true + schema: + type: string + - name: preference_name + in: path + description: The name of the preference + required: true + schema: + type: string + responses: + "200": + description: > + A single preference for the current user in the current categorylist + of all of the current user's preferences in the given category. + content: + application/json: + schema: + $ref: "#/components/schemas/Preference" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" diff --git a/api/v4/source/reactions.yaml b/api/v4/source/reactions.yaml new file mode 100644 index 0000000000..f852ad34ac --- /dev/null +++ b/api/v4/source/reactions.yaml @@ -0,0 +1,137 @@ + /api/v4/reactions: + post: + tags: + - reactions + summary: Create a reaction + description: | + Create a reaction. + ##### Permissions + Must have `read_channel` permission for the channel the post is in. + operationId: SaveReaction + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/Reaction" + description: The user's reaction with its post_id, user_id, and emoji_name fields + set + required: true + responses: + "201": + description: Reaction creation successful + content: + application/json: + schema: + $ref: "#/components/schemas/Reaction" + "400": + $ref: "#/components/responses/BadRequest" + "403": + $ref: "#/components/responses/Forbidden" + "/api/v4/posts/{post_id}/reactions": + get: + tags: + - reactions + summary: Get a list of reactions to a post + description: | + Get a list of reactions made by all users to a given post. + ##### Permissions + Must have `read_channel` permission for the channel the post is in. + operationId: GetReactions + parameters: + - name: post_id + in: path + description: ID of a post + required: true + schema: + type: string + responses: + "200": + description: List reactions retrieve successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Reaction" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "/api/v4/users/{user_id}/posts/{post_id}/reactions/{emoji_name}": + delete: + tags: + - reactions + summary: Remove a reaction from a post + description: | + Deletes a reaction made by a user from the given post. + ##### Permissions + Must be user or have `manage_system` permission. + operationId: DeleteReaction + parameters: + - name: user_id + in: path + description: ID of the user + required: true + schema: + type: string + - name: post_id + in: path + description: ID of the post + required: true + schema: + type: string + - name: emoji_name + in: path + description: emoji name + required: true + schema: + type: string + responses: + "200": + description: Reaction deletion successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + /api/v4/posts/ids/reactions: + post: + tags: + - reactions + summary: Bulk get the reaction for posts + description: | + Get a list of reactions made by all users to a given post. + ##### Permissions + Must have `read_channel` permission for the channel the post is in. + + __Minimum server version__: 5.8 + operationId: GetBulkReactions + requestBody: + content: + application/json: + schema: + type: array + items: + type: string + description: Array of post IDs + required: true + responses: + "200": + description: Reactions retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/PostIdToReactionsMap" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" diff --git a/api/v4/source/roles.yaml b/api/v4/source/roles.yaml new file mode 100644 index 0000000000..f70a24045a --- /dev/null +++ b/api/v4/source/roles.yaml @@ -0,0 +1,214 @@ + "/api/v4/roles": + get: + tags: + - roles + summary: Get a list of all the roles + description: | + ##### Permissions + + `manage_system` permission is required. + + __Minimum server version__: 5.33 + operationId: GetAllRoles + responses: + "200": + description: Roles retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Role" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + roles, resp := Client.GetAllRoles() + + "/api/v4/roles/{role_id}": + get: + tags: + - roles + summary: Get a role + description: | + Get a role from the provided role id. + + ##### Permissions + Requires an active session but no other permissions. + + __Minimum server version__: 4.9 + operationId: GetRole + parameters: + - name: role_id + in: path + description: Role GUID + required: true + schema: + type: string + responses: + "200": + description: Role retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/Role" + "401": + $ref: "#/components/responses/Unauthorized" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + role, resp := Client.GetRole(, "") + "/api/v4/roles/name/{role_name}": + get: + tags: + - roles + summary: Get a role + description: | + Get a role from the provided role name. + + ##### Permissions + Requires an active session but no other permissions. + + __Minimum server version__: 4.9 + operationId: GetRoleByName + parameters: + - name: role_name + in: path + description: Role Name + required: true + schema: + type: string + responses: + "200": + description: Role retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/Role" + "401": + $ref: "#/components/responses/Unauthorized" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + role, resp := Client.GetRoleByName(, "") + "/api/v4/roles/{role_id}/patch": + put: + tags: + - roles + summary: Patch a role + description: > + 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. + + + ##### Permissions + + `manage_system` permission is required. + + + __Minimum server version__: 4.9 + operationId: PatchRole + parameters: + - name: role_id + in: path + description: Role GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + permissions: + type: array + items: + type: string + description: The permissions the role should grant. + description: Role object to be updated + required: true + responses: + "200": + description: Role patch successful + content: + application/json: + schema: + $ref: "#/components/schemas/Role" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + /api/v4/roles/names: + post: + tags: + - roles + summary: Get a list of roles by name + description: | + Get a list of roles from their names. + + ##### Permissions + Requires an active session but no other permissions. + + __Minimum server version__: 4.9 + operationId: GetRolesByNames + requestBody: + content: + application/json: + schema: + type: array + items: + type: string + description: List of role names + required: true + responses: + "200": + description: Role list retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Role" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + roleNames := []string{, , ...} + + roles, resp := Client.GetRolesByNames(roleNames) diff --git a/api/v4/source/saml.yaml b/api/v4/source/saml.yaml new file mode 100644 index 0000000000..9f4e36f966 --- /dev/null +++ b/api/v4/source/saml.yaml @@ -0,0 +1,323 @@ + /api/v4/saml/metadata: + get: + tags: + - SAML + summary: Get metadata + description: | + Get SAML metadata from the server. SAML must be configured properly. + ##### Permissions + No permission required. + operationId: GetSamlMetadata + responses: + "200": + description: SAML metadata retrieval successful + content: + application/json: + schema: + type: string + "501": + $ref: "#/components/responses/NotImplemented" + /api/v4/saml/metadatafromidp: + post: + tags: + - SAML + summary: Get metadata from Identity Provider + description: | + Get SAML metadata from the Identity Provider. SAML must be configured properly. + ##### Permissions + No permission required. + operationId: GetSamlMetadataFromIdp + requestBody: + content: + application/json: + schema: + type: object + properties: + saml_metadata_url: + type: string + description: The URL from which to retrieve the SAML IDP data. + responses: + "200": + description: SAML metadata retrieval successful + content: + application/json: + schema: + type: string + "501": + $ref: "#/components/responses/NotImplemented" + /api/v4/saml/certificate/idp: + post: + tags: + - SAML + summary: Upload IDP certificate + description: > + 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`. + + ##### Permissions + + Must have `sysconsole_write_authentication` permission. + operationId: UploadSamlIdpCertificate + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + certificate: + description: The IDP certificate file + type: string + format: binary + required: + - certificate + responses: + "200": + description: SAML certificate upload successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + delete: + tags: + - SAML + summary: Remove IDP certificate + description: > + 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. + + ##### Permissions + + Must have `sysconsole_write_authentication` permission. + operationId: DeleteSamlIdpCertificate + responses: + "200": + description: SAML certificate delete successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + /api/v4/saml/certificate/public: + post: + tags: + - SAML + summary: Upload public certificate + description: > + 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`. + + ##### Permissions + + Must have `sysconsole_write_authentication` permission. + operationId: UploadSamlPublicCertificate + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + certificate: + description: The public certificate file + type: string + format: binary + required: + - certificate + responses: + "200": + description: SAML certificate upload successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + delete: + tags: + - SAML + summary: Remove public certificate + description: > + 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. + + ##### Permissions + + Must have `sysconsole_write_authentication` permission. + operationId: DeleteSamlPublicCertificate + responses: + "200": + description: SAML certificate delete successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + /api/v4/saml/certificate/private: + post: + tags: + - SAML + summary: Upload private key + description: > + 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`. + + ##### Permissions + + Must have `sysconsole_write_authentication` permission. + operationId: UploadSamlPrivateCertificate + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + certificate: + description: The private key file + type: string + format: binary + required: + - certificate + responses: + "200": + description: SAML certificate upload successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + delete: + tags: + - SAML + summary: Remove private key + description: > + 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. + + ##### Permissions + + Must have `sysconsole_write_authentication` permission. + operationId: DeleteSamlPrivateCertificate + responses: + "200": + description: SAML certificate delete successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + /api/v4/saml/certificate/status: + get: + tags: + - SAML + summary: Get certificate status + description: > + Get the status of the uploaded certificates and keys in use by your SAML + configuration. + + ##### Permissions + + Must have `sysconsole_write_authentication` permission. + operationId: GetSamlCertificateStatus + responses: + "200": + description: SAML certificate status retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/SamlCertificateStatus" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + /api/v4/saml/reset_auth_data: + post: + tags: + - SAML + summary: Reset AuthData to Email + description: > + Reset the AuthData field of SAML users to their email. This is meant to be + used when the "id" attribute is set to an empty value ("") from a previously + non-empty value. + + __Minimum server version__: 5.35 + + ##### Permissions + + Must have `manage_system` permission. + operationId: ResetSamlAuthDataToEmail + requestBody: + content: + application/json: + schema: + type: object + properties: + include_deleted: + type: boolean + default: false + description: Whether to include deleted users. + dry_run: + type: boolean + default: false + description: If set to true, the number of users who would be affected is returned. + user_ids: + type: array + items: + type: string + default: [] + description: If set to a non-empty array, then users whose IDs are not in the array will be excluded. + responses: + "200": + description: AuthData successfully reset + content: + application/json: + schema: + type: object + properties: + num_affected: + type: integer + description: The number of users whose AuthData field was reset. + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" diff --git a/api/v4/source/schemes.yaml b/api/v4/source/schemes.yaml new file mode 100644 index 0000000000..9192c6bc5a --- /dev/null +++ b/api/v4/source/schemes.yaml @@ -0,0 +1,341 @@ + /api/v4/schemes: + get: + tags: + - schemes + summary: Get the schemes. + description: > + Get a page of schemes. Use the query parameters to modify the behaviour + of this endpoint. + + + ##### Permissions + + Must have `manage_system` permission. + + + __Minimum server version__: 5.0 + operationId: GetSchemes + parameters: + - name: scope + in: query + description: Limit the results returned to the provided scope, either `team` or + `channel`. + schema: + type: string + default: "" + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of schemes per page. + schema: + type: integer + default: 60 + responses: + "200": + description: Scheme list retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Scheme" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + post: + tags: + - schemes + summary: Create a scheme + description: | + Create a new scheme. + + ##### Permissions + Must have `manage_system` permission. + + __Minimum server version__: 5.0 + operationId: CreateScheme + requestBody: + content: + application/json: + schema: + type: object + required: + - name + - scope + properties: + name: + type: string + description: The name of the scheme + description: + type: string + description: The description of the scheme + scope: + type: string + description: The scope of the scheme ("team" or "channel") + description: Scheme object to create + required: true + responses: + "201": + description: Scheme creation successful + content: + application/json: + schema: + $ref: "#/components/schemas/Scheme" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + "/api/v4/schemes/{scheme_id}": + get: + tags: + - schemes + summary: Get a scheme + description: | + Get a scheme from the provided scheme id. + + ##### Permissions + Must have `manage_system` permission. + + __Minimum server version__: 5.0 + operationId: GetScheme + parameters: + - name: scheme_id + in: path + description: Scheme GUID + required: true + schema: + type: string + responses: + "200": + description: Scheme retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/Scheme" + "401": + $ref: "#/components/responses/Unauthorized" + "404": + $ref: "#/components/responses/NotFound" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + scheme, resp := Client.GetScheme(, "") + delete: + tags: + - schemes + summary: Delete a scheme + description: | + Soft deletes a scheme, by marking the scheme as deleted in the database. + + ##### Permissions + Must have `manage_system` permission. + + __Minimum server version__: 5.0 + operationId: DeleteScheme + parameters: + - name: scheme_id + in: path + description: ID of the scheme to delete + required: true + schema: + type: string + responses: + "200": + description: Scheme deletion successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + "/api/v4/schemes/{scheme_id}/patch": + put: + tags: + - schemes + summary: Patch a scheme + description: > + 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. + + + ##### Permissions + + `manage_system` permission is required. + + + __Minimum server version__: 5.0 + operationId: PatchScheme + parameters: + - name: scheme_id + in: path + description: Scheme GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: The human readable name of the scheme + description: + type: string + description: The description of the scheme + description: Scheme object to be updated + required: true + responses: + "200": + description: Scheme patch successful + content: + application/json: + schema: + $ref: "#/components/schemas/Scheme" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "501": + $ref: "#/components/responses/NotImplemented" + "/api/v4/schemes/{scheme_id}/teams": + get: + tags: + - schemes + summary: Get a page of teams which use this scheme. + description: > + 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. + + + ##### Permissions + + `manage_system` permission is required. + + + __Minimum server version__: 5.0 + operationId: GetTeamsForScheme + parameters: + - name: scheme_id + in: path + description: Scheme GUID + required: true + schema: + type: string + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of teams per page. + schema: + type: integer + default: 60 + responses: + "200": + description: Team list retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Team" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "/api/v4/schemes/{scheme_id}/channels": + get: + tags: + - schemes + summary: Get a page of channels which use this scheme. + description: > + 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. + + + ##### Permissions + + `manage_system` permission is required. + + + __Minimum server version__: 5.0 + operationId: GetChannelsForScheme + parameters: + - name: scheme_id + in: path + description: Scheme GUID + required: true + schema: + type: string + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of channels per page. + schema: + type: integer + default: 60 + responses: + "200": + description: Channel list retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Channel" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" diff --git a/api/v4/source/service_terms.yaml b/api/v4/source/service_terms.yaml new file mode 100644 index 0000000000..c3f0699dbc --- /dev/null +++ b/api/v4/source/service_terms.yaml @@ -0,0 +1,45 @@ + /api/v4/terms_of_service: + get: + tags: + - terms of service + summary: Get latest terms of service + description: | + Get latest terms of service from the server + + __Minimum server version__: 5.4 + ##### Permissions + Must be authenticated. + operationId: GetTermsOfService + responses: + "200": + description: Terms of service fetched successfully + content: + application/json: + schema: + $ref: "#/components/schemas/TermsOfService" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + post: + tags: + - terms of service + summary: Creates a new terms of service + description: | + Creates new terms of service + + __Minimum server version__: 5.4 + ##### Permissions + Must have `manage_system` permission. + operationId: CreateTermsOfService + responses: + "200": + description: terms of service fetched successfully + content: + application/json: + schema: + $ref: "#/components/schemas/TermsOfService" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" diff --git a/api/v4/source/sharedchannels.yaml b/api/v4/source/sharedchannels.yaml new file mode 100644 index 0000000000..f2f81bbd2c --- /dev/null +++ b/api/v4/source/sharedchannels.yaml @@ -0,0 +1,116 @@ + "/api/v4/sharedchannels/{team_id}": + get: + tags: + - shared channels + summary: Get all shared channels for team. + description: | + Get all shared channels for a team. + + __Minimum server version__: 5.50 + + ##### Permissions + Must be authenticated. + operationId: GetAllSharedChannels + parameters: + - name: team_id + in: path + description: Team Id + required: true + schema: + type: string + - name: page + description: The page to select. + in: query + schema: + type: integer + default: 0 + - name: per_page + description: The number of sharedchannels per page. + in: query + schema: + type: integer + default: 0 + responses: + "200": + description: Shared channels fetch successful. Result may be empty. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/SharedChannel" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + teamID := "4xp9fdt77pncbef59f4k1qe83o" + + shared_channels, err := Client.GetAllSharedChannels(teamID, 0, 100) + - lang: curl + source: | + curl -X POST \ + 'http://your-mattermost-url.com/api/v4/sharedchannels/4xp9fdt77pncbef59f4k1qe83o' \ + -H 'Authorization: Bearer kno8tcdotpbx3dj1gzcbx9jrqy' + + "/api/v4/sharedchannels/remote_info/{remote_id}": + get: + tags: + - shared channels + summary: Get remote cluster info by ID for user. + description: | + Get remote cluster info based on remoteId. + + __Minimum server version__: 5.50 + + ##### Permissions + Must be authenticated and user must belong to at least one channel shared with the remote cluster. + operationId: GetRemoteClusterInfo + parameters: + - name: remote_id + in: path + description: Remote Cluster GUID + required: true + schema: + type: string + responses: + "200": + description: Remote cluster info retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/RemoteClusterInfo" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + remoteID := "4xp9fdt77pncbef59f4k1qe83o" + + info, err := Client.GetRemoteClusterInfo(remoteID) + - lang: curl + source: | + curl -X POST \ + 'http://your-mattermost-url.com/api/v4/sharedchannels/getremote/4xp9fdt77pncbef59f4k1qe83o' \ + -H 'Authorization: Bearer kno8tcdotpbx3dj1gzcbx9jrqy' + diff --git a/api/v4/source/status.yaml b/api/v4/source/status.yaml new file mode 100644 index 0000000000..628ce601ae --- /dev/null +++ b/api/v4/source/status.yaml @@ -0,0 +1,280 @@ + "/api/v4/users/{user_id}/status": + get: + tags: + - status + summary: Get user status + description: | + Get user status by id from the server. + ##### Permissions + Must be authenticated. + operationId: GetUserStatus + parameters: + - name: user_id + in: path + description: User ID + required: true + schema: + type: string + responses: + "200": + description: User status retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/Status" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + put: + tags: + - status + summary: Update user status + description: > + 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. + + ##### Permissions + + Must have `edit_other_users` permission for the team. + operationId: UpdateUserStatus + parameters: + - name: user_id + in: path + description: User ID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - status + - user_id + properties: + user_id: + type: string + description: User ID + status: + type: string + description: User status, can be `online`, `away`, `offline` and `dnd` + dnd_end_time: + type: integer + description: Time in epoch seconds at which a dnd status would be unset. + description: Status object that is to be updated + required: true + responses: + "200": + description: User status update successful + content: + application/json: + schema: + $ref: "#/components/schemas/Status" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + /api/v4/users/status/ids: + post: + tags: + - status + summary: Get user statuses by id + description: | + Get a list of user statuses by id from the server. + ##### Permissions + Must be authenticated. + operationId: GetUsersStatusesByIds + requestBody: + content: + application/json: + schema: + type: array + items: + type: string + description: List of user ids to fetch + required: true + responses: + "200": + description: User statuses retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Status" + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + "/api/v4/users/{user_id}/status/custom": + put: + tags: + - status + summary: Update user custom status + description: | + Updates a user's custom status by setting the value in the user's props and updates the user. Also save the given custom status to the recent custom statuses in the user's props + ##### Permissions + Must be logged in as the user whose custom status is being updated. + operationId: UpdateUserCustomStatus + parameters: + - name: user_id + in: path + description: User ID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - emoji + - text + properties: + emoji: + type: string + description: Any emoji + text: + type: string + description: Any custom status text + duration: + type: string + description: Duration of custom status, can be `thirty_minutes`, `one_hour`, `four_hours`, `today`, `this_week` or `date_and_time` + expires_at: + type: string + description: The time at which custom status should be expired. It should be in ISO format. + description: Custom status object that is to be updated + required: true + responses: + "200": + description: User custom status update successful + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + + delete: + tags: + - status + summary: Unsets user custom status + description: | + Unsets a user's custom status by updating the user's props and updates the user + ##### Permissions + Must be logged in as the user whose custom status is being removed. + operationId: UnsetUserCustomStatus + parameters: + - name: user_id + in: path + description: User ID + required: true + schema: + type: string + responses: + "200": + description: User custom status delete successful + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "/api/v4/users/{user_id}/status/custom/recent": + delete: + tags: + - status + summary: Delete user's recent custom status + description: | + Deletes a user's recent custom status by removing the specific status from the recentCustomStatuses in the user's props and updates the user. + ##### Permissions + Must be logged in as the user whose recent custom status is being deleted. + operationId: RemoveRecentCustomStatus + parameters: + - name: user_id + in: path + description: User ID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - emoji + - text + - duration + - expires_at + properties: + emoji: + type: string + description: Any emoji + text: + type: string + description: Any custom status text + duration: + type: string + description: Duration of custom status, can be `thirty_minutes`, `one_hour`, `four_hours`, `today`, `this_week` or `date_and_time` + expires_at: + type: string + description: The time at which custom status should be expired. It should be in ISO format. + description: Custom Status object that is to be removed from the recent custom statuses. + required: true + responses: + "200": + description: User recent custom status delete successful + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "/api/v4/users/{user_id}/status/custom/recent/delete": + post: + tags: + - status + summary: Delete user's recent custom status + description: | + Deletes a user's recent custom status by removing the specific status from the recentCustomStatuses in the user's props and updates the user. + ##### Permissions + Must be logged in as the user whose recent custom status is being deleted. + operationId: PostUserRecentCustomStatusDelete + parameters: + - name: user_id + in: path + description: User ID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - emoji + - text + - duration + - expires_at + properties: + emoji: + type: string + description: Any emoji + text: + type: string + description: Any custom status text + duration: + type: string + description: Duration of custom status, can be `thirty_minutes`, `one_hour`, `four_hours`, `today`, `this_week` or `date_and_time` + expires_at: + type: string + description: The time at which custom status should be expired. It should be in ISO format. + description: Custom Status object that is to be removed from the recent custom statuses. + required: true + responses: + "200": + description: User recent custom status delete successful + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" diff --git a/api/v4/source/system.yaml b/api/v4/source/system.yaml new file mode 100644 index 0000000000..37504535a7 --- /dev/null +++ b/api/v4/source/system.yaml @@ -0,0 +1,1535 @@ + /api/v4/system/timezones: + get: + tags: + - system + summary: Retrieve a list of supported timezones + description: > + __Minimum server version__: 3.10 + + ##### Permissions + + Must be logged in. + operationId: GetSupportedTimezone + responses: + "200": + description: List of timezones retrieval successful + content: + application/json: + schema: + type: array + items: + type: string + "500": + $ref: "#/components/responses/InternalServerError" + /api/v4/system/ping: + get: + tags: + - system + summary: Check system health + description: > + 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 + + If a "device_id" is passed in the query, it will test the Push Notification + Proxy in order to discover whether the device is able to receive notifications. + The response will have a "CanReceiveNotifications" property with one of the + following values: + - true: It can receive notifications + - false: It cannot receive notifications + - unknown: There has been an unknown error, and it is not certain whether it can + receive notifications. + + __Minimum server version__: 6.5 + + ##### Permissions + + None. + operationId: GetPing + parameters: + - name: get_server_status + in: query + description: Check the status of the database and file storage as well + required: false + schema: + type: boolean + - name: device_id + in: query + description: Check whether this device id can receive push notifications + required: false + schema: + type: string + responses: + "200": + description: Status of the system + content: + application/json: + schema: + $ref: "#/components/schemas/SystemStatusResponse" + "500": + $ref: "#/components/responses/InternalServerError" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + // GetPing + status, resp := Client.GetPing() + + // Get server status with database and storage checks + status, resp = Client.GetPingWithServerStatus() + "/api/v4/system/notices/{teamId}": + get: + tags: + - system + summary: Get notices for logged in user in specified team + description: > + Will return appropriate product notices for current user in the team specified by teamId parameter. + + __Minimum server version__: 5.26 + + ##### Permissions + + Must be logged in. + operationId: GetNotices + parameters: + - name: clientVersion + in: query + description: Version of the client (desktop/mobile/web) that issues the request + required: true + schema: + type: string + - name: locale + in: query + description: Client locale + required: false + schema: + type: string + - name: client + in: query + description: Client type (web/mobile-ios/mobile-android/desktop) + required: true + schema: + type: string + - name: teamId + in: path + description: ID of the team + required: true + schema: + type: string + responses: + "200": + description: List notices retrieve successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Notice" + + "500": + $ref: "#/components/responses/InternalServerError" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + notices, resp := Client.GetNotices(0, teamId, "mobile-android", "1.2.3", "enUS") + /api/v4/system/notices/view: + put: + tags: + - system + summary: Update notices as 'viewed' + description: > + Will mark the specified notices as 'viewed' by the logged in user. + + __Minimum server version__: 5.26 + + ##### Permissions + + Must be logged in. + operationId: MarkNoticesViewed + requestBody: + content: + application/json: + schema: + type: array + items: + type: string + description: Array of notice IDs + required: true + responses: + "200": + description: Update successfull + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "500": + $ref: "#/components/responses/InternalServerError" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + notices := []string{"id1","id2"} + resp := Client.MarkNoticesViewed(notices) + + /api/v4/database/recycle: + post: + tags: + - system + summary: Recycle database connections + description: > + Recycle database connections by closing and reconnecting all connections + to master and read replica databases. + + ##### Permissions + + Must have `manage_system` permission. + operationId: DatabaseRecycle + responses: + "200": + description: Database recycle successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + ok, resp := Client.DatabaseRecycle() + /api/v4/email/test: + post: + tags: + - system + summary: Send a test email + description: > + 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. + + ##### Permissions + + Must have `manage_system` permission. + operationId: TestEmail + requestBody: + description: Mattermost configuration + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Config" + responses: + "200": + description: Email successful sent + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + config := model.Config{ + EmailSettings: model.EmailSettings{ + SMTPServer: , + SMTPPort: , + SMTPUsername: , + SMTPPassword: , + }, + } + + // TestEmail + ok, resp := Client.TestEmail(&config) + /api/v4/site_url/test: + post: + tags: + - system + summary: Checks the validity of a Site URL + description: > + Sends a Ping request to the mattermost server using the specified Site + URL. + + + ##### Permissions + + Must have `manage_system` permission. + + + __Minimum server version__: 5.16 + operationId: TestSiteURL + requestBody: + content: + application/json: + schema: + type: object + required: + - site_url + properties: + site_url: + type: string + description: The Site URL to test + required: true + responses: + "200": + description: Site URL is valid + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + siteURL := "https://your-new-mattermost-url.com" + + // TestSiteURL + ok, resp := Client.TestSiteURL(siteUrl) + /api/v4/file/s3_test: + post: + tags: + - system + summary: Test AWS S3 connection + description: > + 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. + + ##### Permissions + + Must have `manage_system` permission. + + __Minimum server version__: 4.8 + operationId: TestS3Connection + requestBody: + description: Mattermost configuration + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Config" + responses: + "200": + description: S3 Test successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + config := model.Config{ + FileSettings: model.FileSettings{ + DriverName: model.NewString(model.IMAGE_DRIVER_S3), + AmazonS3AccessKeyId: , + AmazonS3SecretAccessKey: , + AmazonS3Bucket: , + AmazonS3Endpoint: + }, + } + + // TestS3Connection + ok, resp := Client.TestS3Connection(&config) + /api/v4/config: + get: + tags: + - system + summary: Get configuration + description: | + Retrieve the current server configuration + ##### Permissions + Must have `manage_system` permission. + operationId: GetConfig + responses: + "200": + description: Configuration retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/Config" + "400": + $ref: "#/components/responses/BadRequest" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + // GetConfig + config, resp := Client.GetConfig() + put: + tags: + - system + summary: Update configuration + description: > + 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. + + Note that the parameters that aren't set in the configuration that you + provide will be reset to default values. Therefore, if you want to + change a configuration parameter and leave the other ones unchanged, + you need to get the existing configuration first, change the field that + you want, then put that new configuration. + + ##### Permissions + + Must have `manage_system` permission. + operationId: UpdateConfig + requestBody: + description: Mattermost configuration + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Config" + responses: + "200": + description: Configuration update successful + content: + application/json: + schema: + $ref: "#/components/schemas/Config" + "400": + $ref: "#/components/responses/BadRequest" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + // GetConfig + config, resp := Client.GetConfig() + + config.TeamSettings.SiteName = "MyFancyName" + + // UpdateConfig + updatedConfig, resp := Client.UpdateConfig(config) + /api/v4/config/reload: + post: + tags: + - system + summary: Reload configuration + description: | + Reload the configuration file to pick up on any changes made to it. + ##### Permissions + Must have `manage_system` permission. + operationId: ReloadConfig + responses: + "200": + description: Configuration reload successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + // ReloadConfig + ok, resp := Client.ReloadConfig() + /api/v4/config/client: + get: + tags: + - system + summary: Get client configuration + description: | + Get a subset of the server configuration needed by the client. + ##### Permissions + No permission required. + operationId: GetClientConfig + parameters: + - name: format + in: query + required: true + description: Must be `old`, other formats not implemented yet + schema: + type: string + responses: + "200": + description: Configuration retrieval successful + "400": + $ref: "#/components/responses/BadRequest" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + // GetOldClientConfig + ok, resp := Client.GetOldClientConfig() + /api/v4/config/environment: + get: + tags: + - system + summary: Get configuration made through environment variables + description: > + 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 + + + ##### Permissions + + Must have `manage_system` permission. + operationId: GetEnvironmentConfig + responses: + "200": + description: Configuration retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/EnvironmentConfig" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + /api/v4/config/patch: + put: + tags: + - system + summary: Patch configuration + description: > + Submit configuration to patch. As of server version 4.8, the + `PluginSettings.EnableUploads` setting cannot be modified by this + endpoint. + + ##### Permissions + + Must have `manage_system` permission. + + __Minimum server version__: 5.20 + + ##### Note + + The Plugins are stored as a map, and since a map may recursively go + down to any depth, individual fields of a map are not changed. + Consider using the `update config` (PUT api/v4/config) endpoint + to update a plugins configurations. + operationId: PatchConfig + requestBody: + description: Mattermost configuration + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Config" + responses: + "200": + description: Configuration update successful + content: + application/json: + schema: + $ref: "#/components/schemas/Config" + "400": + $ref: "#/components/responses/BadRequest" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + // GetConfig + config, resp := Client.GetConfig() + + config.TeamSettings.SiteName = "MyFancyName" + + // UpdateConfig + updatedConfig, resp := Client.PatchConfig(config) + /api/v4/license: + post: + tags: + - system + summary: Upload license file + description: | + Upload a license to enable enterprise features. + + __Minimum server version__: 4.0 + + ##### Permissions + Must have `manage_system` permission. + operationId: UploadLicenseFile + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + license: + description: The license to be uploaded + type: string + format: binary + required: + - license + responses: + "201": + description: License file upload successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "413": + $ref: "#/components/responses/TooLarge" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + file, err := os.Open("") + 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()) + delete: + tags: + - system + summary: Remove license file + description: > + Remove the license file from the server. This will disable all + enterprise features. + + + __Minimum server version__: 4.0 + + + ##### Permissions + + Must have `manage_system` permission. + operationId: RemoveLicenseFile + responses: + "200": + description: License removal successful + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + /api/v4/license/client: + get: + tags: + - system + summary: Get client license + description: > + Get a subset of the server license needed by the client. + + ##### Permissions + + No permission required but having the `manage_system` permission returns more information. + operationId: GetClientLicense + parameters: + - name: format + in: query + required: true + description: Must be `old`, other formats not implemented yet + schema: + type: string + responses: + "200": + description: License retrieval successful + "400": + $ref: "#/components/responses/BadRequest" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + // GetOldClientLicense + license, resp := Client.GetOldClientLicense() + /api/v4/license/renewal: + get: + tags: + - system + summary: Request the license renewal link + description: > + Request the renewal link that would be used to start the license renewal process + + __Minimum server version__: 5.32 + + ##### Permissions + + Must have `sysconsole_write_about` permission. + operationId: RequestLicenseRenewalLink + responses: + "200": + description: License renewal link obtained + content: + application/json: + schema: + $ref: "#/components/schemas/LicenseRenewalLink" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + /api/v4/trial-license: + post: + tags: + - system + summary: Request and install a trial license for your server + description: > + Request and install a trial license for your server + + __Minimum server version__: 5.25 + + ##### Permissions + + Must have `manage_system` permission. + operationId: RequestTrialLicense + requestBody: + description: License request + required: true + content: + application/json: + schema: + type: object + required: + - users + properties: + users: + type: integer + description: Number of users requested (20% extra is going to be added) + responses: + "200": + description: Trial license obtained and installed + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + // RequestTrialLicense + resp := Client.RequestTrialLicense() + /api/v4/trial-license/prev: + get: + tags: + - system + summary: Get last trial license used + operationId: GetPrevTrialLicense + description: > + Get the last trial license used on the sevrer + + __Minimum server version__: 5.36 + + ##### Permissions + + Must have `manage_systems` permissions. + responses: + "200": + description: License fetched successfully. + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + /api/v4/audits: + get: + tags: + - system + summary: Get audits + description: > + Get a page of audits for all users on the system, selected with `page` + and `per_page` query parameters. + + ##### Permissions + + Must have `manage_system` permission. + operationId: GetAudits + parameters: + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of audits per page. + schema: + type: integer + default: 60 + responses: + "200": + description: Audits retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Audit" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + // GetAudits + audits, resp := Client.GetAudits(0, 100, "") + /api/v4/caches/invalidate: + post: + tags: + - system + summary: Invalidate all the caches + description: > + 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. + + ##### Permissions + + Must have `manage_system` permission. + operationId: InvalidateCaches + responses: + "200": + description: Caches invalidate successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + // InvalidateCaches + ok, resp := Client.InvalidateCaches() + /api/v4/logs: + get: + tags: + - system + summary: Get logs + description: > + Get a page of server logs, selected with `page` and `logs_per_page` + query parameters. + + ##### Permissions + + Must have `manage_system` permission. + operationId: GetLogs + parameters: + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: logs_per_page + in: query + description: The number of logs per page. There is a maximum limit of 10000 logs + per page. + schema: + type: string + default: "10000" + responses: + "200": + description: Logs retrieval successful + content: + application/json: + schema: + type: array + items: + type: string + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + // GetLogs + logs, resp := Client.GetLogs(0, 10) + post: + tags: + - system + summary: Add log message + description: > + Add log messages to the server logs. + + ##### Permissions + + 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`. + operationId: PostLog + requestBody: + content: + application/json: + schema: + type: object + required: + - level + - message + properties: + level: + type: string + description: The error level, ERROR or DEBUG + message: + type: string + description: Message to send to the server logs + required: true + responses: + "200": + description: Logs sent successful + content: + application/json: + schema: + type: object + items: + type: string + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + message := make(map[string]string) + message["level"] = "ERROR" + message["message"] = "this is a test" + + // PostLog + _, resp := Client.PostLog(message) + /api/v4/analytics/old: + get: + tags: + - system + summary: Get analytics + description: > + 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 + + + ##### Permissions + + Must have `manage_system` permission. + operationId: GetAnalyticsOld + parameters: + - name: name + in: query + required: false + description: Possible values are "standard", "bot_post_counts_day", + "post_counts_day", "user_counts_with_posts_day" or "extra_counts" + schema: + type: string + default: standard + - name: team_id + in: query + required: false + description: The team ID to filter the data by + schema: + type: string + responses: + "200": + description: Analytics retrieval successful + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + /api/v4/server_busy: + post: + tags: + - system + summary: Set the server busy (high load) flag + description: > + 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 + + + ##### Permissions + + Must have `manage_system` permission. + operationId: SetServerBusy + parameters: + - name: seconds + in: query + required: false + description: Number of seconds until server is automatically marked as not busy. + schema: + type: string + default: "3600" + responses: + "200": + description: Server busy flag set successfully + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + ok, resp := Client.SetServerBusy(300) + - lang: curl + source: | + curl -X POST \ + 'http://your-mattermost-url.com/api/v4/server_busy?seconds=3600' \ + -H 'Authorization: Bearer kno8tcdotpbx3dj1gzcbx9jrqy' + get: + tags: + - system + summary: Get server busy expiry time. + description: > + Gets the timestamp corresponding to when the server busy flag will be + automatically cleared. + + + __Minimum server version__: 5.20 + + + ##### Permissions + + Must have `manage_system` permission. + operationId: GetServerBusyExpires + responses: + "200": + description: Server busy expires timestamp retrieved successfully + content: + application/json: + schema: + $ref: "#/components/schemas/Server_Busy" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + // expires is a time.Time + expires, resp := Client.GetServerBusyExpires() + - lang: curl + source: | + curl -X GET \ + 'http://your-mattermost-url.com/api/v4/server_busy' \ + -H 'Authorization: Bearer kno8tcdotpbx3dj1gzcbx9jrqy' \ + -H 'Content-Type: application/json' + delete: + tags: + - system + summary: Clears the server busy (high load) flag + description: > + 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 + + + ##### Permissions + + Must have `manage_system` permission. + operationId: ClearServerBusy + responses: + "200": + description: Server busy flag cleared successfully + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + ok, resp := Client.ClearServerBusy() + - lang: curl + source: | + curl -X DELETE \ + 'http://your-mattermost-url.com/api/v4/server_busy' \ + -H 'Authorization: Bearer kno8tcdotpbx3dj1gzcbx9jrqy' + /api/v4/notifications/ack: + post: + tags: + - root + summary: Acknowledge receiving of a notification + description: > + __Minimum server version__: 3.10 + + ##### Permissions + + Must be logged in. + operationId: AcknowledgeNotification + responses: + "200": + description: Status of the system + content: + application/json: + schema: + $ref: "#/components/schemas/PushNotification" + "404": + $ref: "#/components/responses/NotFound" + /api/v4/redirect_location: + get: + tags: + - system + summary: Get redirect location + description: > + __Minimum server version__: 3.10 + + ##### Permissions + + Must be logged in. + operationId: GetRedirectLocation + parameters: + - name: url + in: query + required: true + description: Url to check + schema: + type: string + responses: + "200": + description: Got redirect location + content: + image/*: + schema: + type: object + properties: + location: + type: string + "404": + $ref: "#/components/responses/NotFound" + /api/v4/image: + get: + tags: + - system + summary: Get an image by url + description: > + Fetches an image via Mattermost image proxy. + + __Minimum server version__: 3.10 + + ##### Permissions + + Must be logged in. + operationId: GetImageByUrl + responses: + "200": + description: Image found + content: + image/*: + schema: + type: string + format: binary + "404": + $ref: "#/components/responses/NotFound" + + /api/v4/upgrade_to_enterprise: + post: + tags: + - system + summary: Executes an inplace upgrade from Team Edition to Enterprise Edition + description: > + It downloads the Mattermost Enterprise Edition of your current version + and replace your current version with it. After the upgrade you need to + restart the Mattermost server. + + __Minimum server version__: 5.27 + + ##### Permissions + + Must have `manage_system` permission. + operationId: UpgradeToEnterprise + responses: + "202": + description: Upgrade started + content: + application/json: + schema: + $ref: "#/components/schemas/PushNotification" + "403": + $ref: "#/components/responses/Forbidden" + "429": + $ref: "#/components/responses/TooManyRequests" + + /api/v4/upgrade_to_enterprise/status: + get: + tags: + - system + summary: Get the current status for the inplace upgrade from Team Edition to Enterprise Edition + description: > + It returns the percentage of completion of the current upgrade or the + error if there is any. + + __Minimum server version__: 5.27 + + ##### Permissions + + Must have `manage_system` permission. + operationId: UpgradeToEnterpriseStatus + responses: + "200": + description: Upgrade status + content: + application/json: + schema: + type: object + properties: + percentage: + type: integer + description: Current percentage of the upgrade + error: + type: string + description: Error happened during the upgrade + "403": + $ref: "#/components/responses/Forbidden" + + /api/v4/restart: + post: + tags: + - system + summary: Restart the system after an upgrade from Team Edition to Enterprise Edition + description: > + It restarts the current running mattermost instance to execute the new + Enterprise binary. + + __Minimum server version__: 5.27 + + ##### Permissions + + Must have `manage_system` permission. + operationId: RestartServer + responses: + "200": + description: Restart started + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "403": + $ref: "#/components/responses/Forbidden" + + /api/v4/warn_metrics/status: + get: + tags: + - system + summary: Get the warn metrics status (enabled or disabled) + description: | + Get the status of a set of metrics (enabled or disabled) from the Systems table. + + The returned JSON contains the metrics that we need to warn the admin on with regard + to their status (we return the ones whose status is "true", which means that they are + in a "warnable" state - e.g. a threshold has been crossed or some other condition has + been fulfilled). + + __Minimum server version__: 5.26 + + ##### Permissions + + Must have `manage_system` permission. + operationId: GetWarnMetricsStatus + responses: + "200": + description: Warn metrics retrieval was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + + /api/v4/warn_metrics/ack/{warn_metric_id}: + post: + tags: + - system + summary: Acknowledge a warning of a metric status + description: | + Acknowledge a warning for the warn_metric_id metric crossing a threshold (or some + similar condition being fulfilled) - attempts to send an ack email to + acknowledge@mattermost.com and sets the "ack" status for all the warn metrics in the system. + + __Minimum server version__: 5.26 + + ##### Permissions + + Must have `manage_system` permission. + operationId: SendWarnMetricAck + parameters: + - name: warn_metric_id + in: path + description: Warn Metric Id. + required: true + schema: + type: string + requestBody: + description: payload that contains the ack flag + required: true + content: + application/json: + schema: + type: object + properties: + forceAck: + type: boolean + description: Flag which determines if the ack for the metric warning should be directly stored (without trying to send email first) or not + responses: + "200": + description: The acknowledgement of the warning for the metric has been successful. + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + /api/v4/warn_metrics/trial-license-ack/{warn_metric_id}: + post: + tags: + - system + summary: Request trial license and acknowledge a warning of a metric status + description: | + Request a trial license and acknowledge a warning for the warn_metric_id metric crossing a threshold (or some + similar condition being fulfilled) - sets the "ack" status for all the warn metrics in the system. + + __Minimum server version__: 5.28 + + ##### Permissions + + Must have `manage_system` permission. + operationId: SendTrialLicenseWarnMetricAck + parameters: + - name: warn_metric_id + in: path + description: Warn Metric Id. + required: true + schema: + type: string + responses: + "200": + description: The trial license request and the subsequent acknowledgement of the warning for the metric have been successful. + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + /api/v4/integrity: + post: + tags: + - system + summary: Perform a database integrity check + description: | + Performs a database integrity check. + + + __Note__: This check may temporarily harm system performance. + + + __Minimum server version__: 5.28.0 + + + __Local mode only__: This endpoint is only available through [local mode](https://docs.mattermost.com/administration/mmctl-cli-tool.html#local-mode). + operationId: CheckIntegrity + responses: + "200": + description: Integrity check successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/IntegrityCheckResult" + x-code-samples: + - lang: Go + source: | + import ( + "net" + "net/http" + + "github.com/mattermost/mattermost-server/v5/model" + ) + + Client := model.NewAPIv4SocketClient(socketPath) + + ok, resp := Client.CheckIntegrity() + /api/v4/system/support_packet: + get: + tags: + - system + summary: Download a zip file which contains helpful and useful information for troubleshooting your mattermost instance. + description: | + Download a zip file which contains helpful and useful information for troubleshooting your mattermost instance. + __Minimum server version: 5.32__ + ##### Permissions + Must have any of the system console read permissions. + ##### License + Requires either a E10 or E20 license. + operationId: GenerateSupportPacket + responses: + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" diff --git a/api/v4/source/teams.yaml b/api/v4/source/teams.yaml new file mode 100644 index 0000000000..341e71f402 --- /dev/null +++ b/api/v4/source/teams.yaml @@ -0,0 +1,3090 @@ + /api/v4/teams: + post: + tags: + - teams + summary: Create a team + description: | + Create a new team on the system. + ##### Permissions + Must be authenticated and have the `create_team` permission. + operationId: CreateTeam + requestBody: + content: + application/json: + schema: + type: object + required: + - name + - display_name + - type + properties: + name: + type: string + description: Unique handler for a team, will be present in the team URL + display_name: + type: string + description: Non-unique UI name for the team + type: + type: string + description: "`'O'` for open, `'I'` for invite only" + description: Team that is to be created + required: true + responses: + "201": + description: Team creation successful + content: + application/json: + schema: + $ref: "#/components/schemas/Team" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + newTeam, err := Client.CreateTeam(&model.Team{ + Name: "teamName", + DisplayName: "TeamDisplayName", + Type: "O", + }) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $resp = $driver->getTeamModel()->createTeam([ + "name" => "teamName", + "display_name" => "TeamDisplayName", + "type" => "O", + ]); + + if ($resp->getStatusCode() == 200) { + $newTeam = json_decode($resp->getBody()); + } + get: + tags: + - teams + summary: Get teams + description: > + 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. + + ##### Permissions + + Must be authenticated. "manage_system" permission is required to show all teams. + operationId: GetAllTeams + parameters: + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of teams per page. + schema: + type: integer + default: 60 + - name: include_total_count + description: >- + Appends a total count of returned teams inside the response object - ex: `{ "teams": [], "total_count" : 0 }`. + in: query + schema: + type: boolean + default: false + - name: exclude_policy_constrained + in: query + schema: + type: boolean + default: false + description: >- + If set to true, teams which are part of a data retention policy will be excluded. + The `sysconsole_read_compliance` permission is required to use this parameter. + + __Minimum server version__: 5.35 + responses: + "200": + description: Team list retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Team" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + teams, resp := Client.GetAllTeams("", 0, 100) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $resp = $driver->getTeamModel()->getTeams([ + "page" => 0, + "per_page" => 100, + "include_total_count" => false, + ]); + + if ($resp->getStatusCode() == 200) { + $teams = json_decode($resp->getBody()); + } + "/api/v4/teams/{team_id}": + get: + tags: + - teams + summary: Get a team + description: | + Get a team on the system. + ##### Permissions + Must be authenticated and have the `view_team` permission. + operationId: GetTeam + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + responses: + "200": + description: Team retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/Team" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + teamID := "4xp9fdt77pncbef59f4k1qe83o" + + t, err := Client.GetTeam(teamID, "") + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $teamID = "4xp9fdt77pncbef59f4k1qe83o"; + + $resp = $driver->getTeamModel()->getTeam($teamID); + + if ($resp->getStatusCode() == 200) { + $t = json_decode($resp->getBody()); + } + put: + tags: + - teams + summary: Update a team + description: > + 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. + + ##### Permissions + + Must have the `manage_team` permission. + operationId: UpdateTeam + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - id + - display_name + - description + - company_name + - allowed_domains + - invite_id + - allow_open_invite + properties: + id: + type: string + display_name: + type: string + description: + type: string + company_name: + type: string + allowed_domains: + type: string + invite_id: + type: string + allow_open_invite: + type: string + description: Team to update + required: true + responses: + "200": + description: Team update successful + content: + application/json: + schema: + $ref: "#/components/schemas/Team" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + teamID := "4xp9fdt77pncbef59f4k1qe83o" + inviteID := "qjda3stwafbgpqjaxej3k76sga" + + uteam, resp := Client.UpdateTeam(&model.Team{ + Id: teamID, + DisplayName: "displayName", + Description: "description", + CompanyName: "companyName", + AllowedDomains: "allowedDomains", + InviteId: inviteID, + AllowOpenInvite: false, + }) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $teamID = "4xp9fdt77pncbef59f4k1qe83o"; + $inviteID = "qjda3stwafbgpqjaxej3k76sga"; + + $resp = $driver->getTeamModel()->updateTeam($teamID, [ + "id" => $teamID, + "display_name" => "displayName", + "description" => "description", + "company_name" => "companyName", + "allowed_domains" => "allowedDomains", + "invite_id" => $inviteID, + "allow_open_invite" => false, + ]); + + if ($resp->getStatusCode() == 200) { + $uteam = json_decode($resp->getBody()); + } + delete: + tags: + - teams + summary: Delete a team + description: > + 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. + + ##### Permissions + + Must have the `manage_team` permission. + operationId: SoftDeleteTeam + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + - name: permanent + in: query + description: Permanently delete the team, to be used for compliance reasons only. + As of server version 5.0, `ServiceSettings.EnableAPITeamDeletion` + must be set to `true` in the server's configuration. + required: false + schema: + type: boolean + default: false + responses: + "200": + description: Team deletion successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/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}) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $teamID = "4xp9fdt77pncbef59f4k1qe83o"; + + // Non-permanent deletion + $resp = $driver->getTeamModel()->deleteTeam($teamID, [ + "permanent" => false, + ]); + + // Permanent deletion + $resp = $driver->getTeamModel()->deleteTeam($teamID, [ + "permanent" => true, + ]); + + if ($resp->getStatusCode() == 200) { + $ok = json_decode($resp->getBody())->status; + } + "/api/v4/teams/{team_id}/patch": + put: + tags: + - teams + summary: Patch a team + description: > + 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. + + ##### Permissions + + Must have the `manage_team` permission. + operationId: PatchTeam + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + display_name: + type: string + description: + type: string + company_name: + type: string + invite_id: + type: string + allow_open_invite: + type: boolean + description: Team object that is to be updated + required: true + responses: + "200": + description: team patch successful + content: + application/json: + schema: + $ref: "#/components/schemas/Team" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + patch := &model.TeamPatch{} + patch.DisplayName = model.NewString("Other name") + patch.Description = model.NewString("Other description") + patch.CompanyName = model.NewString("Other company name") + patch.AllowOpenInvite = model.NewBool(true) + + teamID := "4xp9fdt77pncbef59f4k1qe83o" + + team, resp := Client.PatchTeam(teamID, patch) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $teamID = "4xp9fdt77pncbef59f4k1qe83o"; + + $resp = $driver->getTeamModel()->patchTeam($teamID, [ + "display_name" => "Other name", + "description" => "Other description", + "company_name" => "Other company name", + "allow_open_invite" => true, + ]); + + if ($resp->getStatusCode() == 200) { + $team = json_decode($resp->getBody()); + } + "/api/v4/teams/{team_id}/privacy": + put: + tags: + - teams + summary: Update teams's privacy + description: > + Updates team's privacy allowing changing a team from Public (open) to + Private (invitation only) and back. + + + __Minimum server version__: 5.24 + + + ##### Permissions + + `manage_team` permission for the team of the team. + operationId: UpdateTeamPrivacy + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - privacy + properties: + privacy: + type: string + description: "Team privacy setting: 'O' for a public (open) team, 'I' for + a private (invitation only) team" + required: true + responses: + "200": + description: Team conversion successful + content: + application/json: + schema: + $ref: "#/components/schemas/Team" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + + // Update team's privacy to Public + + updatedTeam, resp := Client.UpdateTeamPrivacy(, model.TEAM_OPEN) + + + // Update team's privacy to Private + + updatedTeam, resp := Client.UpdateTeamPrivacy(, model.TEAM_INVITE) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + // Update team's privacy to Public + $resp = $driver->getTeamModel()->updateTeamPrivacy(, [ + "privacy" => "0", + ]); + + // Update team's privacy to Private + $resp = $driver->getTeamModel()->updateTeamPrivacy(, [ + "privacy" => "1", + ]); + + if ($resp->getStatusCode() == 200) { + $updatedTeam = json_decode($resp->getBody()); + } + "/api/v4/teams/{team_id}/restore": + post: + tags: + - teams + summary: Restore a team + description: | + Restore a team that was previously soft deleted. + + __Minimum server version__: 5.24 + + ##### Permissions + Must have the `manage_team` permission. + operationId: RestoreTeam + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + responses: + "200": + description: Team restore successful + content: + application/json: + schema: + $ref: "#/components/schemas/Team" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + teamID := "4xp9fdt77pncbef59f4k1qe83o" + team, resp := Client.RestoreTeam(teamID) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $teamID = "4xp9fdt77pncbef59f4k1qe83o"; + + $resp = $driver->getTeamModel()->restoreTeam($teamID); + + if ($resp->getStatusCode() == 200) { + $team = json_decode($resp->getBody()); + } + "/api/v4/teams/name/{name}": + get: + tags: + - teams + summary: Get a team by name + description: > + Get a team based on provided name string + + ##### Permissions + + Must be authenticated, team type is open and have the `view_team` permission. + operationId: GetTeamByName + parameters: + - name: name + in: path + description: Team Name + required: true + schema: + type: string + responses: + "200": + description: Team retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/Team" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + team, resp := Client.GetTeamByName("teamName", "") + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $resp = $driver->getTeamModel()->getTeamByName("teamName"); + + if ($resp->getStatusCode() == 200) { + $team = json_decode($resp->getBody()); + } + /api/v4/teams/search: + post: + tags: + - teams + summary: Search teams + description: | + Search teams based on search term and options provided in the request body. + + ##### Permissions + Logged in user only shows open teams + Logged in user with "manage_system" permission shows all teams + operationId: SearchTeams + requestBody: + content: + application/json: + schema: + type: object + properties: + term: + description: The search term to match against the name or display name of + teams + type: string + page: + type: string + description: The page number to return, if paginated. If this parameter + is not present with the `per_page` parameter then the + results will be returned un-paged. + per_page: + type: string + description: The number of entries to return per page, if paginated. If + this parameter is not present with the `page` parameter then + the results will be returned un-paged. + allow_open_invite: + type: boolean + description: > + Filters results to teams where `allow_open_invite` is set to true or false, + excludes group constrained channels if this filter option is passed. + + If this filter option is not passed then the query will remain unchanged. + + __Minimum server version__: 5.28 + group_constrained: + type: boolean + description: > + Filters results to teams where `group_constrained` is set to true or false, returns the union of results when used with `allow_open_invite` + + If the filter option is not passed then the query will remain unchanged. + + __Minimum server version__: 5.28 + exclude_policy_constrained: + type: boolean + default: false + description: > + If set to true, only teams which do not have a granular retention policy assigned to + them will be returned. The `sysconsole_read_compliance_data_retention` permission is + required to use this parameter. + + __Minimum server version__: 5.35 + description: Search criteria + required: true + responses: + "200": + description: 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.) + content: + application/json: + schema: + type: object + properties: + teams: + type: array + description: The teams that matched the query. + items: + $ref: "#/components/schemas/Team" + total_count: + type: number + description: The total number of results, regardless of page and + per_page requested. + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + + teams, resp := Client.SearchTeams(&model.TeamSearch{Term: "searchTerm"}) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $resp = $driver->getTeamModel()->searchTeams([ + "term" => "searchTerm" + ]); + + if ($resp->getStatusCode() == 200) { + $teams = json_decode($resp->getBody())->teams; + } + "/api/v4/teams/name/{name}/exists": + get: + tags: + - teams + summary: Check if team exists + description: | + Check if the team exists based on a team name. + ##### Permissions + Must be authenticated. + operationId: TeamExists + parameters: + - name: name + in: path + description: Team Name + required: true + schema: + type: string + responses: + "200": + description: Team retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/TeamExists" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + exists, resp := Client.TeamExists("teamName", "") + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $resp = $driver->getTeamModel()->checkTeamExists("teamName"); + + if ($resp->getStatusCode() == 200) { + $exists = json_decode($resp->getBody())->exists; + } + "/api/v4/users/{user_id}/teams": + get: + tags: + - teams + summary: Get a user's teams + description: > + Get a list of teams that a user is on. + + ##### Permissions + + Must be authenticated as the user or have the `manage_system` permission. + operationId: GetTeamsForUser + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + responses: + "200": + description: Team list retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Team" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + userID := "4xp9fdt77pncbef59f4k1qe83o" + + teams, resp := Client.GetTeamsForUser(userID, "") + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $userID = "4xp9fdt77pncbef59f4k1qe83o"; + + $resp = $driver->getTeamModel()->getUserTeams($userID); + + if ($resp->getStatusCode() == 200) { + $teams = json_decode($resp->getBody()); + } + "/api/v4/teams/{team_id}/members": + get: + tags: + - teams + summary: Get team members + description: > + Get a page team members list based on query string parameters - team id, + page and per page. + + ##### Permissions + + Must be authenticated and have the `view_team` permission. + operationId: GetTeamMembers + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of users per page. + schema: + type: integer + default: 60 + responses: + "200": + description: Team members retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/TeamMember" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + teamID := "4xp9fdt77pncbef59f4k1qe83o" + + members, resp := Client.GetTeamMembers(teamID, 0, 100, "") + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $teamID = "4xp9fdt77pncbef59f4k1qe83o"; + + $resp = $driver->getTeamModel()->getTeamMembers($teamID, [ + "page" => 0, + "per_page" => 100, + ]); + + if ($resp->getStatusCode() == 200) { + $members = json_decode($resp->getBody()); + } + post: + tags: + - teams + summary: Add user to team + description: > + Add user to the team by user_id. + + ##### Permissions + + Must be authenticated and team be open to add self. For adding another user, authenticated user must have the `add_user_to_team` permission. + operationId: AddTeamMember + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + team_id: + type: string + user_id: + type: string + required: true + responses: + "201": + description: Team member creation successful + content: + application/json: + schema: + $ref: "#/components/schemas/TeamMember" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + teamID := "4xp9fdt77pncbef59f4k1qe83o" + userID := "qjda3stwafbgpqjaxej3k76sga" + + teamMember, resp := Client.AddTeamMember(teamID, userID) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $teamID = "4xp9fdt77pncbef59f4k1qe83o"; + $userID = "qjda3stwafbgpqjaxej3k76sga"; + + $resp = $driver->getTeamModel()->addUser($teamID, [ + "user_id" => $userID, + "team_id" => $teamID, + ]); + + if ($resp->getStatusCode() == 200) { + $teamMember = json_decode($resp->getBody()); + } + /api/v4/teams/members/invite: + post: + tags: + - teams + summary: Add user to team from invite + description: > + Using either an invite id or hash/data pair from an email invite link, + add a user to a team. + + ##### Permissions + + Must be authenticated. + operationId: AddTeamMemberFromInvite + parameters: + - name: token + in: query + description: Token id from the invitation + required: true + schema: + type: string + responses: + "201": + description: Team member creation successful + content: + application/json: + schema: + $ref: "#/components/schemas/TeamMember" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + tokenID := "qjda3stwafbgpqjaxej3k76sga" + + tm, resp = Client.AddTeamMemberFromInvite(tokenID, "") + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $tokenID = "qjda3stwafbgpqjaxej3k76sga"; + + $resp = $driver->getTeamModel()->addUserFromInvite([ + "token" => $tokenID + ]); + + if ($resp->getStatusCode() == 200) { + $tm = json_decode($resp->getBody()); + } + "/api/v4/teams/{team_id}/members/batch": + post: + tags: + - teams + summary: Add multiple users to team + description: > + Add a number of users to the team by user_id. + + ##### Permissions + + Must be authenticated. Authenticated user must have the `add_user_to_team` permission. + operationId: AddTeamMembers + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + - name: graceful + in: query + description: '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 `[{"member": {...}, "user_id", + "...", "error": {...}}]`' + required: false + schema: + type: boolean + requestBody: + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/TeamMember" + required: true + responses: + "201": + description: Team members created successfully. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/TeamMember" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + teamID := "IJyUQLwh1CO9ahbzaQwWwc0ZnV" + + userID := "zWEyrTZ7GZ22aBSfoX60iWryTY" + userID2 := "NqCSr5HMDZjrWS74IEmedvlOYf" + + tm, resp := Client.AddTeamMembers(teamID, []string{userID, userID2}) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $teamID = "IJyUQLwh1CO9ahbzaQwWwc0ZnV"; + + $userID = "zWEyrTZ7GZ22aBSfoX60iWryTY"; + $userID2 = "NqCSr5HMDZjrWS74IEmedvlOYf"; + + $resp = $driver->getTeamModel()->addMultipleUsers($teamID, [ + [ + "user_id" => $userID, + ], + [ + "user_id" => $userID2, + ], + ]); + + if ($resp->getStatusCode() == 200) { + $tm = json_decode($resp->getBody()); + } + "/api/v4/users/{user_id}/teams/members": + get: + tags: + - teams + summary: Get team members for a user + description: > + 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. + + ##### Permissions + + Must be logged in as the user or have the `edit_other_users` permission. + operationId: GetTeamMembersForUser + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + responses: + "200": + description: Team members retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/TeamMember" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + userID := "zWEyrTZ7GZ22aBSfoX60iWryTY" + + teamMembers, resp = Client.GetTeamMembersForUser(userID, "") + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $userID = "zWEyrTZ7GZ22aBSfoX60iWryTY"; + + $resp = $driver->getTeamModel()->getTeamMembersForUser($userID); + + if ($resp->getStatusCode() == 200) { + $teamMembers = json_decode($resp->getBody()); + } + "/api/v4/teams/{team_id}/members/{user_id}": + get: + tags: + - teams + summary: Get a team member + description: | + Get a team member on the system. + ##### Permissions + Must be authenticated and have the `view_team` permission. + operationId: GetTeamMember + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + responses: + "200": + description: Team member retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/TeamMember" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/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, "") + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $teamID = "zWEyrTZ7GZ22aBSfoX60iWryTY"; + $userID = "NqCSr5HMDZjrWS74IEmedvlOYf"; + + $resp = $driver->getTeamModel()->getTeamMember($teamID, $userID); + + if ($resp->getStatusCode() == 200) { + $teamMember = json_decode($resp->getBody()); + } + delete: + tags: + - teams + summary: Remove user from team + description: > + Delete the team member object for a user, effectively removing them from + a team. + + ##### Permissions + + Must be logged in as the user or have the `remove_user_from_team` permission. + operationId: RemoveTeamMember + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + responses: + "200": + description: Team member deletion successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/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) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $teamID = "zWEyrTZ7GZ22aBSfoX60iWryTY"; + $userID = "NqCSr5HMDZjrWS74IEmedvlOYf"; + + $resp = $driver->getTeamModel()->removeUser($teamID, $userID); + + if ($resp->getStatusCode() == 200) { + $ok = json_decode($resp->getBody())->status; + } + "/api/v4/teams/{team_id}/members/ids": + post: + tags: + - teams + summary: Get team members by ids + description: | + Get a list of team members based on a provided array of user ids. + ##### Permissions + Must have `view_team` permission for the team. + operationId: GetTeamMembersByIds + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: array + items: + type: string + description: List of user ids + required: true + responses: + "200": + description: Team members retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/TeamMember" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + + teamID := zWEyrTZ7GZ22aBSfoX60iWryTY + + + userID := "NqCSr5HMDZjrWS74IEmedvlOYf" + + userID2 := "UAFalLvtKwNKABAnmwR7uGB5md" + + + tm, resp := Client.GetTeamMembersByIds(teamID, []string{userID, userID2}) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $teamID = "zWEyrTZ7GZ22aBSfoX60iWryTY"; + + $userID = "NqCSr5HMDZjrWS74IEmedvlOYf"; + $userID2 = "UAFalLvtKwNKABAnmwR7uGB5md"; + + $resp = $driver->getTeamModel()->getTeamMembersByIds($teamID, [ + $userID, + $userID2, + ]); + + if ($resp->getStatusCode() == 200) { + $tm = json_decode($resp->getBody()); + } + "/api/v4/teams/{team_id}/stats": + get: + tags: + - teams + summary: Get a team stats + description: | + Get a team stats on the system. + ##### Permissions + Must be authenticated and have the `view_team` permission. + operationId: GetTeamStats + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + responses: + "200": + description: Team stats retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/TeamStats" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + teamID := "zWEyrTZ7GZ22aBSfoX60iWryTY" + + stats, resp := Client.GetTeamStats(teamID, "") + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $teamID = "zWEyrTZ7GZ22aBSfoX60iWryTY"; + + $resp = $driver->getTeamModel()->getTeamStats($teamID); + + if ($resp->getStatusCode() == 200) { + $stats = json_decode($resp->getBody()); + } + "/api/v4/teams/{team_id}/regenerate_invite_id": + post: + tags: + - teams + summary: Regenerate the Invite ID from a Team + description: | + Regenerates the invite ID used in invite links of a team + ##### Permissions + Must be authenticated and have the `manage_team` permission. + operationId: RegenerateTeamInviteId + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + responses: + "200": + description: Team Invite ID regenerated + content: + application/json: + schema: + $ref: "#/components/schemas/Team" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + teamID := "zWEyrTZ7GZ22aBSfoX60iWryTY" + + team, resp := Client.RegenerateTeamInviteId(teamID) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $teamID = "zWEyrTZ7GZ22aBSfoX60iWryTY"; + + $resp = $driver->getTeamModel()->regenerateInviteID($teamID); + + if ($resp->getStatusCode() == 200) { + $team = json_decode($resp->getBody()); + } + "/api/v4/teams/{team_id}/image": + get: + tags: + - teams + summary: Get the team icon + description: > + Get the team icon of the team. + + + __Minimum server version__: 4.9 + + + ##### Permissions + + User must be authenticated. In addition, team must be open or the user must have the `view_team` permission. + operationId: GetTeamIcon + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + responses: + "200": + description: Team icon retrieval successful + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + teamID := "zWEyrTZ7GZ22aBSfoX60iWryTY" + + icon, resp = Client.GetTeamIcon(teamID, "") + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $teamID = "zWEyrTZ7GZ22aBSfoX60iWryTY"; + + $resp = $driver->getTeamModel()->getTeamIcon($teamID); + + if ($resp->getStatusCode() == 200) { + $icon = json_decode($resp->getBody()); + } + post: + tags: + - teams + summary: Sets the team icon + description: | + Sets the team icon for the team. + + __Minimum server version__: 4.9 + + ##### Permissions + Must be authenticated and have the `manage_team` permission. + operationId: SetTeamIcon + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + image: + description: The image to be uploaded + type: string + format: binary + required: + - image + responses: + "200": + description: Team icon successfully set + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import ( + "io/ioutil" + "log" + + "github.com/mattermost/mattermost-server/v5/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) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $teamID = "zWEyrTZ7GZ22aBSfoX60iWryTY"; + $resource = fopen("icon.png", 'rb'); + + if ($resource === false) { + throw new \Exeption("Failure."); + } + + $data = new \GuzzleHttp\Psr7\Stream($resource); + + $resp = $driver->getTeamModel()->setTeamIcon($teamID, [ + "image" => $data, + ]); + + fclose($resource); + + if ($resp->getStatusCode() == 200) { + $ok = json_decode($resp->getBody())->status; + } + delete: + tags: + - teams + summary: Remove the team icon + description: | + Remove the team icon for the team. + + __Minimum server version__: 4.10 + + ##### Permissions + Must be authenticated and have the `manage_team` permission. + operationId: RemoveTeamIcon + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + responses: + "200": + description: Team icon successfully remove + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + teamID := "zWEyrTZ7GZ22aBSfoX60iWryTY" + + ok, resp = Client.RemoveTeamIcon(teamID) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $teamID = "zWEyrTZ7GZ22aBSfoX60iWryTY"; + + $resp = $driver->getTeamModel()->removeTeamIcon($teamID); + + if ($resp->getStatusCode() == 200) { + $ok = json_decode($resp->getBody())->status; + } + "/api/v4/teams/{team_id}/members/{user_id}/roles": + put: + tags: + - teams + summary: Update a team member roles + description: > + Update a team member roles. Valid team roles are "team_user", + "team_admin" or both of them. Overwrites any previously assigned team + roles. + + ##### Permissions + + Must be authenticated and have the `manage_team_roles` permission. + operationId: UpdateTeamMemberRoles + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - roles + properties: + roles: + type: string + description: Space-delimited team roles to assign to the user + required: true + responses: + "200": + description: Team member roles update successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + + teamID := "zWEyrTZ7GZ22aBSfoX60iWryTY" + + userID := "NqCSr5HMDZjrWS74IEmedvlOYf" + + + ok, resp := Client.UpdateTeamMemberRoles(teamID, userID, "team_user team_admin") + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $teamID = "zWEyrTZ7GZ22aBSfoX60iWryTY"; + $userID = "NqCSr5HMDZjrWS74IEmedvlOYf"; + + $resp = $driver->getTeamModel()->updateTeamMemberRoles($teamID, $userID, [ + "roles" => "team_user team_admin", + ]); + + if ($resp->getStatusCode() == 200) { + $ok = json_decode($resp->getBody())->status; + } + "/api/v4/teams/{team_id}/members/{user_id}/schemeRoles": + put: + tags: + - teams + summary: Update the scheme-derived roles of a team member. + description: > + 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 + + + ##### Permissions + + Must be authenticated and have the `manage_team_roles` permission. + operationId: UpdateTeamMemberSchemeRoles + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - scheme_admin + - scheme_user + properties: + scheme_admin: + type: boolean + scheme_user: + type: boolean + description: Scheme properties. + required: true + responses: + "200": + description: Team member's scheme-derived roles updated successfully. + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + + teamID := "zWEyrTZ7GZ22aBSfoX60iWryTY" + + userID := "NqCSr5HMDZjrWS74IEmedvlOYf" + + + ok, resp := Client.UpdateTeamMemberSchemeRoles(teamID, userID, &model.SchemeRoles{ + SchemeAdmin: true, + SchemeUser: true, + }) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $teamID = "zWEyrTZ7GZ22aBSfoX60iWryTY"; + $userID = "NqCSr5HMDZjrWS74IEmedvlOYf"; + + $resp = $driver->getTeamModel()->updateSchemeDerivedRolesOfMember($teamID, $userID, [ + "scheme_admin" => true, + "scheme_user" => true, + ]); + + if ($resp->getStatusCode() == 200) { + $ok = json_decode($resp->getBody())->status; + } + "/api/v4/users/{user_id}/teams/unread": + get: + tags: + - teams + summary: Get team unreads for a user + description: > + Get the count for unread messages and mentions in the teams the user is + a member of. + + ##### Permissions + + Must be logged in. + operationId: GetTeamsUnreadForUser + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + - name: exclude_team + in: query + description: Optional team id to be excluded from the results + required: true + schema: + type: string + - name: include_collapsed_threads + in: query + description: Boolean to determine whether the collapsed threads should be included or not + required: false + schema: + type: boolean + default: false + responses: + "200": + description: Team unreads retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/TeamUnread" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/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) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $userID = "NqCSr5HMDZjrWS74IEmedvlOYf"; + $teamID = "zWEyrTZ7GZ22aBSfoX60iWryTY"; + + $resp = $driver->getTeamModel()->getUserTotalUnreadMessagesFromTeams($userID, [ + "exclude_team" => $teamID, + ]); + + if ($resp->getStatusCode() == 200) { + $teams = json_decode($resp->getBody()); + } + "/api/v4/users/{user_id}/teams/{team_id}/unread": + get: + tags: + - teams + summary: Get unreads for a team + description: > + Get the unread mention and message counts for a team for the specified + user. + + ##### Permissions + + Must be the user or have `edit_other_users` permission and have `view_team` permission for the team. + operationId: GetTeamUnread + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + responses: + "200": + description: Team unread count retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/TeamUnread" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/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) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $userID = "NqCSr5HMDZjrWS74IEmedvlOYf"; + $teamID = "zWEyrTZ7GZ22aBSfoX60iWryTY"; + + $resp = $driver->getTeamModel()->getUserTotalUnreadMessagesFromTeam($userID, $teamID); + + if ($resp->getStatusCode() == 200) { + $teamUnread = json_decode($resp->getBody()); + } + "/api/v4/teams/{team_id}/invite/email": + post: + tags: + - teams + summary: Invite users to the team by email + description: | + Invite users to the existing team using the user's email. + + The number of emails that can be sent is rate limited to 20 per hour with a burst of 20 emails. If the rate limit exceeds, the error message contains details on when to retry and when the timer will be reset. + ##### Permissions + Must have `invite_user` and `add_user_to_team` permissions for the team. + operationId: InviteUsersToTeam + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: array + items: + type: string + description: List of user's email + required: true + responses: + "200": + description: Users invite successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "413": + $ref: "#/components/responses/TooLarge" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + + teamID := "zWEyrTZ7GZ22aBSfoX60iWryTY" + + + ok, resp := Client.InviteUsersToTeam(teamID, []string{"test@domain.com", "test2@domain.com"}) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $teamID = "zWEyrTZ7GZ22aBSfoX60iWryTY"; + + $resp = $driver->getTeamModel()->inviteUsersByEmail($teamID, [ + "test@domain.com", + "test2@domain.com", + ]); + + if ($resp->getStatusCode() == 200) { + $ok = json_decode($resp->getBody())->status; + } + "/api/v4/teams/{team_id}/invite-guests/email": + post: + tags: + - teams + summary: Invite guests to the team by email + description: | + Invite guests to existing team channels usign the user's email. + + The number of emails that can be sent is rate limited to 20 per hour with a burst of 20 emails. If the rate limit exceeds, the error message contains details on when to retry and when the timer will be reset. + + __Minimum server version__: 5.16 + + ##### Permissions + Must have `invite_guest` permission for the team. + operationId: InviteGuestsToTeam + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - emails + - channels + properties: + emails: + type: array + items: + type: string + description: List of emails + channels: + type: array + items: + type: string + description: List of channel ids + message: + type: string + description: Message to include in the invite + description: Guests invite information + required: true + responses: + "200": + description: Guests invite successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "413": + $ref: "#/components/responses/TooLarge" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + + teamID := "zWEyrTZ7GZ22aBSfoX60iWryTY" + + channel1ID := "wu6wyxm9spgwtjaycjrcihnqtr" + + channel2ID := "ymzsgjw1tprniqtzyb7g3cmuuc" + + + ok, resp := Client.InviteGuestsToTeam(teamID, []string{"test@domain.com", "test2@domain.com"}, []string{channel1ID, channel2ID}, "Please join to our mattermost team to keep working in the project") + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $teamID = "zWEyrTZ7GZ22aBSfoX60iWryTY"; + + $channel1ID = "wu6wyxm9spgwtjaycjrcihnqtr"; + $channel2ID = "ymzsgjw1tprniqtzyb7g3cmuuc"; + + $resp = $driver->getTeamModel()->inviteGuestsByEmail($teamID, [ + "emails" => ["test@domain.com", "test2@domain.com"], + "channels" => [$channel1ID, $channel2ID], + "message" => "Please join to our mattermost team to keep working in the project", + ]); + + if ($resp->getStatusCode() == 200) { + $ok = json_decode($resp->getBody())->status; + } + /api/v4/teams/invites/email: + delete: + tags: + - teams + summary: Invalidate active email invitations + description: > + Invalidate active email invitations that have not been accepted by the + user. + + ##### Permissions + + Must have `sysconsole_write_authentication` permission. + operationId: InvalidateEmailInvites + responses: + "200": + description: Email invites successfully revoked + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + ok, resp := Client.InvalidateEmailInvites() + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $resp = $driver->getTeamModel()->invalidateActiveEmailInvitations(); + + if ($resp->getStatusCode() == 200) { + $ok = json_decode($resp->getBody())->status; + } + "/api/v4/teams/{team_id}/import": + post: + tags: + - teams + summary: Import a Team from other application + description: > + Import a team into a existing team. Import users, channels, posts, + hooks. + + ##### Permissions + + Must have `permission_import_team` permission. + operationId: ImportTeam + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + file: + description: A file to be uploaded in zip format. + type: string + format: binary + filesize: + description: The size of the zip file to be imported. + type: integer + importFrom: + description: String that defines from which application the team was + exported to be imported into Mattermost. + type: string + required: + - file + - filesize + - importFrom + responses: + "200": + description: JSON object containing a base64 encoded text file of the import logs + in its `results` property. + content: + application/json: + schema: + type: object + properties: + results: + type: string + "400": + $ref: "#/components/responses/BadRequest" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: > + import ( + "encoding/binary" + "io/ioutil" + "log" + + "github.com/mattermost/mattermost-server/v5/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) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $teamID = "zWEyrTZ7GZ22aBSfoX60iWryTY"; + $resource = fopen("to_import.zip", 'rb'); + + if ($resource === false) { + throw new \Exeption("Error while reading file."); + } + + $data = new \GuzzleHttp\Psr7\Stream($resource); + + $resp = $driver->getTeamModel()->importTeamFromOtherApplication($teamID, [ + "file" => $data, + "filesize" => $data->getSize(), + "importFrom" => "slack", + ]); + + fclose($resource); + + if ($resp->getStatusCode() == 200) { + $fileResp = json_decode($resp->getBody())->results; + } + "/api/v4/teams/invite/{invite_id}": + get: + tags: + - teams + summary: Get invite info for a team + description: > + Get the `name`, `display_name`, `description` and `id` for a team from + the invite id. + + + __Minimum server version__: 4.0 + + + ##### Permissions + + No authentication required. + operationId: GetTeamInviteInfo + parameters: + - name: invite_id + in: path + description: Invite id for a team + required: true + schema: + type: string + responses: + "200": + description: Team invite info retrieval successful + content: + application/json: + schema: + type: object + properties: + id: + type: string + name: + type: string + display_name: + type: string + description: + type: string + "400": + $ref: "#/components/responses/BadRequest" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + inviteID := "zWEyrTZ7GZ22aBSfoX60iWryTY" + + team, resp = Client.GetTeamInviteInfo(inviteID) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $inviteID = "zWEyrTZ7GZ22aBSfoX60iWryTY"; + + $resp = $driver->getTeamModel()->getInviteInfoForTeam($inviteID); + + if ($resp->getStatusCode() == 200) { + $team = json_decode($resp->getBody()); + } + "/api/v4/teams/{team_id}/scheme": + put: + tags: + - teams + summary: Set a team's scheme + description: > + Set a team's scheme, more specifically sets the scheme_id value of a + team record. + + + ##### Permissions + + Must have `manage_system` permission. + + + __Minimum server version__: 5.0 + operationId: UpdateTeamScheme + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - scheme_id + properties: + scheme_id: + type: string + description: The ID of the scheme. + description: Scheme GUID + required: true + responses: + "200": + description: Update team scheme successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + teamID := "4xp9fdt77pncbef59f4k1qe83o" + schemeID := "qjda3stwafbgpqjaxej3k76sga" + + ok, resp := UpdateTeamScheme(teamID, schemeID) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $teamID = "4xp9fdt77pncbef59f4k1qe83o"; + $schemeID = "qjda3stwafbgpqjaxej3k76sga"; + + $resp = $driver->getTeamModel()->setTeamScheme($teamID, [ + "scheme_id" => $schemeID, + ]); + + if ($resp->getStatusCode() == 200) { + $ok = json_decode($resp->getBody())->status; + } + - lang: curl + source: > + curl -X PUT \ + https://your-mattermost-url.com/api/v4/teams/4xp9fdt77pncbef59f4k1qe83o/scheme \ + -H 'Authorization: Bearer frn8fu5rtpyc5m4xy6q3oj4yur' \ + -H 'Content-Type: application/json' \ + -d '{"scheme_id": "qjda3stwafbgpqjaxej3k76sga"}' + "/api/v4/teams/{team_id}/members_minus_group_members": + get: + tags: + - teams + summary: Team members minus group members. + description: > + 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. + + + ##### Permissions + + Must have `manage_system` permission. + + + __Minimum server version__: 5.14 + operationId: TeamMembersMinusGroupMembers + parameters: + - name: team_id + in: path + description: Team GUID + required: true + schema: + type: string + - name: group_ids + in: query + description: A comma-separated list of group ids. + required: true + schema: + type: string + default: "" + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of users per page. + schema: + type: integer + default: 0 + responses: + "200": + description: Successfully returns users specified by the pagination, and the + total_count. + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $teamID = "fcnst115y3y7xmzzp5uq34u8ce"; + + $groupID = "eoezijg8zffgjmch8icy5bjd1e"; + $groupID2 = "ugaw6wjc3tfxpcr1eq5u5k8dhe"; + + $resp = $driver->getTeamModel()->getTeamMembersMinusGroupMembers($teamID, [ + "group_ids" => [$groupID, $groupID2], + "page" => 0, + "per_page" => 100, + ]); + + if ($resp->getStatusCode() == 200) { + $members = json_decode($resp->getBody()); + } + - lang: curl + source: > + 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' diff --git a/api/v4/source/uploads.yaml b/api/v4/source/uploads.yaml new file mode 100644 index 0000000000..bf143a45ef --- /dev/null +++ b/api/v4/source/uploads.yaml @@ -0,0 +1,195 @@ + "/api/v4/uploads": + post: + tags: + - uploads + summary: Create an upload + description: > + Creates a new upload session. + + + __Minimum server version__: 5.28 + + ##### Permissions + + Must have `upload_file` permission. + + operationId: CreateUpload + requestBody: + content: + application/json: + schema: + type: object + required: + - channel_id + - filename + - file_size + properties: + channel_id: + description: The ID of the channel to upload to. + type: string + filename: + description: The name of the file to upload. + type: string + file_size: + description: The size of the file to upload in bytes. + type: integer + format: int64 + required: true + responses: + "201": + description: Upload creation successful. + content: + application/json: + schema: + $ref: "#/components/schemas/UploadSession" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "413": + $ref: "#/components/responses/TooLarge" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + us := &model.UploadSession{ + ChannelId: "4i6jn8r483nnuqnibnmgz8jo4o", + Filename: "file.png", + FileSize: 512000, + } + + us, response := Client.CreateUpload(us) + - lang: Curl + source: | + curl 'http://localhost:8065/api/v4/uploads' \ + -H 'Authorization: Bearer 9kg8nqrnxprd9jbykqeg4r51hw' \ + -H 'Content-Type: application/json' \ + --data-binary '{"channel_id": "4i6jn8r483nnuqnibnmgz8jo4o", "filename": "test.png", "file_size": 512000}' + "/api/v4/uploads/{upload_id}": + get: + tags: + - uploads + summary: Get an upload session + description: | + Gets an upload session that has been previously created. + + ##### Permissions + Must be logged in as the user who created the upload session. + operationId: GetUpload + parameters: + - name: upload_id + in: path + description: The ID of the upload session to get. + required: true + schema: + type: string + responses: + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + us, response := Client.GetUpload("nuyrh9ymridqmenof7exe3a6aw") + - lang: Curl + source: | + curl 'http://localhost:8065/api/v4/uploads/nuyrh9ymridqmenof7exe3a6aw' \ + -H 'Authorization: Bearer 9kg8nqrnxprd9jbykqeg4r51hw' + post: + tags: + - uploads + summary: Perform a file upload + description: | + Starts or resumes a file upload. + To resume an existing (incomplete) upload, data should be sent starting from the offset specified in the upload session object. + + The request body can be in one of two formats: + - Binary file content streamed in request's body + - multipart/form-data + + ##### Permissions + Must be logged in as the user who created the upload session. + operationId: UploadData + parameters: + - name: upload_id + in: path + description: The ID of the upload session the data belongs to. + required: true + schema: + type: string + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + responses: + "201": + description: Upload successful + content: + application/json: + schema: + $ref: "#/components/schemas/FileInfo" + "204": + description: Upload incomplete + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "413": + $ref: "#/components/responses/TooLarge" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: > + import ( + "os" + + "github.com/mattermost/mattermost-server/v5/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) + return + } + + info, err := Client.UploadData(us, file) + - lang: Curl + source: | + # Binary file content in request's body + curl -X POST 'http://localhost:8065/api/v4/uploads/qyxbzmprrjbdpdaprsxm98m6qe' \ + -H 'Authorization: Bearer 9kg8nqrnxprd9jbykqeg4r51hw' --data-binary @file.png + + # multipart/form-data upload + curl 'http://localhost:8065/api/v4/uploads/qyxbzmprrjbdpdaprsxm98m6qe' \ + -H 'Authorization: Bearer 9kg8nqrnxprd9jbykqeg4r51hw' -F data=@file.png diff --git a/api/v4/source/usage.yaml b/api/v4/source/usage.yaml new file mode 100644 index 0000000000..1c63f44413 --- /dev/null +++ b/api/v4/source/usage.yaml @@ -0,0 +1,52 @@ + /api/v4/usage/posts: + get: + tags: + - usage + summary: Get current usage of posts + description: > + Retrieve rounded off total no. of posts for this instance. + Example: returns 4000 instead of 4321 + + ##### Permissions + + Must be authenticated. + + __Minimum server version__: 7.0 + operationId: GetPostsUsage + responses: + "200": + description: Total no. of posts returned successfully + content: + application/json: + schema: + $ref: "#/components/schemas/PostsUsage" + "401": + $ref: "#/components/responses/Unauthorized" + "500": + $ref: "#/components/responses/InternalServerError" + /api/v4/usage/storage: + get: + tags: + - usage + summary: Get the total file storage usage for the instance in bytes. + description: > + Get the total file storage usage for the instance in bytes rounded down to the most significant digit. + Example: returns 4000 instead of 4321 + + ##### Permissions + + Must be authenticated. + + __Minimum server version__: 7.1 + operationId: GetStorageUsage + responses: + "200": + description: The total file storage usage for the instance in bytes rounded down to the most significant digit. + content: + application/json: + schema: + $ref: "#/components/schemas/StorageUsage" + "401": + $ref: "#/components/responses/Unauthorized" + "500": + $ref: "#/components/responses/InternalServerError" diff --git a/api/v4/source/users.yaml b/api/v4/source/users.yaml new file mode 100644 index 0000000000..58032ce57c --- /dev/null +++ b/api/v4/source/users.yaml @@ -0,0 +1,5265 @@ + /api/v4/users/login: + post: + tags: + - users + summary: Login to Mattermost server + description: > + ##### Permissions + + No permission required + operationId: Login + requestBody: + content: + application/json: + schema: + type: object + properties: + id: + type: string + login_id: + type: string + token: + type: string + device_id: + type: string + ldap_only: + type: boolean + password: + description: The password used for email authentication. + type: string + description: User authentication object + required: true + responses: + "201": + description: User login successful + content: + application/json: + schema: + $ref: "#/components/schemas/User" + "400": + $ref: "#/components/responses/BadRequest" + "403": + $ref: "#/components/responses/Forbidden" + /api/v4/users/login/cws: + post: + tags: + - users + summary: Auto-Login to Mattermost server using CWS token + description: > + CWS stands for Customer Web Server which is the cloud service used to + manage cloud instances. + + ##### Permissions + + A Cloud license is required + operationId: LoginByCwsToken + requestBody: + content: + application/json: + schema: + type: object + properties: + login_id: + type: string + cws_token: + type: string + description: User authentication object + required: true + responses: + "302": + description: Login successful, it'll redirect to login page to perform the autologin + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + /api/v4/users/logout: + post: + tags: + - users + summary: Logout from the Mattermost server + description: > + ##### Permissions + + An active session is required + operationId: Logout + responses: + "201": + description: User logout successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "403": + $ref: "#/components/responses/Forbidden" + + /api/v4/users: + post: + tags: + - users + summary: Create a user + description: > + 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. + + ##### Permissions + + No permission required for creating email/username accounts on an open server. Auth Token is required for other authentication types such as LDAP or SAML. + operationId: CreateUser + parameters: + - name: t + in: query + description: Token id from an email invitation + required: false + schema: + type: string + - name: iid + in: query + description: Token id from an invitation link + required: false + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - email + - username + properties: + email: + type: string + username: + type: string + first_name: + type: string + last_name: + type: string + nickname: + type: string + auth_data: + description: Service-specific authentication data, such as email address. + type: string + auth_service: + description: The authentication service, one of "email", "gitlab", + "ldap", "saml", "office365", "google", and "". + type: string + password: + description: The password used for email authentication. + type: string + locale: + type: string + props: + type: object + notify_props: + $ref: "#/components/schemas/UserNotifyProps" + description: User object to be created + required: true + responses: + "201": + description: User creation successful + content: + application/json: + schema: + $ref: "#/components/schemas/User" + "400": + $ref: "#/components/responses/BadRequest" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + user := &model.User{ + Username: "username", + Email: "email@domain.com", + Password: "Password1", + } + + createdUser, response := Client.CreateUser(user) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $resp = $driver->getUserModel()->createUser([ + "username" => "username", + "email" => "email@domain.com", + "password" => "Password1" + ]); + + if ($resp->getStatusCode() == 200) { + $createdUser = json_decode($resp->getBody()); + } + get: + tags: + - users + summary: Get users + description: > + 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. + + ##### Permissions + + Requires an active session and (if specified) membership to the channel or team being selected from. + operationId: GetUsers + parameters: + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of users per page. There is a maximum limit of 200 users + per page. + schema: + type: integer + default: 60 + - name: in_team + in: query + description: The ID of the team to get users for. + schema: + type: string + - name: not_in_team + in: query + description: The ID of the team to exclude users for. Must not be used with + "in_team" query parameter. + schema: + type: string + - name: in_channel + in: query + description: The ID of the channel to get users for. + schema: + type: string + - name: not_in_channel + in: query + description: The ID of the channel to exclude users for. Must be used with + "in_channel" query parameter. + schema: + type: string + - name: in_group + in: query + description: The ID of the group to get users for. Must have `manage_system` permission. + schema: + type: string + - name: group_constrained + in: query + description: When used with `not_in_channel` or `not_in_team`, returns only the + users that are allowed to join the channel or team based on its + group constrains. + schema: + type: boolean + - name: without_team + in: query + description: Whether or not to list users that are not on any team. This option + takes precendence over `in_team`, `in_channel`, and + `not_in_channel`. + schema: + type: boolean + - name: active + in: query + description: Whether or not to list only users that are active. This option + cannot be used along with the `inactive` option. + schema: + type: boolean + - name: inactive + in: query + description: Whether or not to list only users that are deactivated. This option + cannot be used along with the `active` option. + schema: + type: boolean + - name: role + in: query + description: Returns users that have this role. + schema: + type: string + - name: sort + in: query + description: > + Sort is only available in conjunction with certain options below. + The paging parameter is also always available. + + + ##### `in_team` + + Can be "", "last_activity_at" or "create_at". + + When left blank, sorting is done by username. + + __Minimum server version__: 4.0 + + ##### `in_channel` + + Can be "", "status". + + When left blank, sorting is done by username. `status` will sort by User's current status (Online, Away, DND, Offline), then by Username. + + __Minimum server version__: 4.7 + + ##### `in_group` + + Can be "", "display_name". + + When left blank, sorting is done by username. `display_name` will sort alphabetically by user's display name. + + __Minimum server version__: 7.7 + schema: + type: string + - name: roles + in: query + description: > + Comma separated string used to filter users based on any of the specified system roles + + + Example: `?roles=system_admin,system_user` will return users that are either system admins or system users + + + __Minimum server version__: 5.26 + schema: + type: string + - name: channel_roles + in: query + description: > + Comma separated string used to filter users based on any of the specified channel roles, can only be used in conjunction with `in_channel` + + + Example: `?in_channel=4eb6axxw7fg3je5iyasnfudc5y&channel_roles=channel_user` will return users that are only channel users and not admins or guests + + + __Minimum server version__: 5.26 + schema: + type: string + - name: team_roles + in: query + description: > + Comma separated string used to filter users based on any of the specified team roles, can only be used in conjunction with `in_team` + + + Example: `?in_team=4eb6axxw7fg3je5iyasnfudc5y&team_roles=team_user` will return users that are only team users and not admins or guests + + + __Minimum server version__: 5.26 + schema: + type: string + responses: + "200": + description: User page retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/User" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/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, "") + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + //get users + $resp = $driver->getUserModel()->getUsers([ + "page" => 0, + "per_page" => 60, + ]); + + //get users in channel + $resp = $driver->getUserModel()->getUsers([ + "in_channel" => "channelid", + "page" => 0, + "per_page" => 60, + ]); + + //get users not in channel + $resp = $driver->getUserModel()->getUsers([ + "in_team" => "teamid", + "not_in_channel" => "channelid", + "page" => 0, + "per_page" => 60, + ]); + + //get users in team + $resp = $driver->getUserModel()->getUsers([ + "in_team" => "teamid", + "page" => 0, + "per_page" => 60, + ]); + + //get users not in team + $resp = $driver->getUserModel()->getUsers([ + "not_in_team" => "teamid", + "page" => 0, + "per_page" => 60, + ]); + + //get users without team + $resp = $driver->getUserModel()->getUsers([ + "without_team" => true, + "page" => 0, + "per_page" => 60, + ]); + + if ($resp->getStatusCode() == 200) { + $users = json_decode($resp->getBody()); + } + delete: + tags: + - users + summary: Permanent delete all users + description: > + Permanently deletes all users and all their related information, including posts. + + + __Minimum server version__: 5.26.0 + + + __Local mode only__: This endpoint is only available through [local mode](https://docs.mattermost.com/administration/mmctl-cli-tool.html#local-mode). + operationId: PermanentDeleteAllUsers + responses: + "200": + description: Delete request was successful + x-code-samples: + - lang: Go + source: | + import ( + "net" + "net/http" + + "github.com/mattermost/mattermost-server/v5/model" + ) + + tr := &http.Transport{ + Dial: func(network, addr string) (net.Conn, error) { + return net.Dial("unix", socketPath) + }, + } + + Client := model.NewAPIv4Client("http://_") + Client.HttpClient = &http.Client{Transport: tr} + + ok, resp := Client.PermanentDeleteAllUsers() + /api/v4/users/ids: + post: + tags: + - users + summary: Get users by ids + description: | + Get a list of users based on a provided list of user ids. + ##### Permissions + Requires an active session but no other permissions. + operationId: GetUsersByIds + parameters: + - name: since + in: query + description: > + Only return users that have been modified since the given Unix + timestamp (in milliseconds). + + + __Minimum server version__: 5.14 + schema: + type: integer + requestBody: + content: + application/json: + schema: + type: array + items: + type: string + description: List of user ids + required: true + responses: + "200": + description: User list retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/User" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + /api/v4/users/group_channels: + post: + tags: + - users + summary: Get users by group channels ids + description: | + 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. + ##### Permissions + Requires an active session but no other permissions. + + __Minimum server version__: 5.14 + operationId: GetUsersByGroupChannelIds + requestBody: + content: + application/json: + schema: + type: array + items: + type: string + description: List of group channel ids + required: true + responses: + "200": + description: User list retrieval successful + content: + application/json: + schema: + type: object + properties: + : + type: array + items: + $ref: "#/components/schemas/User" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + /api/v4/users/usernames: + post: + tags: + - users + summary: Get users by usernames + description: | + Get a list of users based on a provided list of usernames. + ##### Permissions + Requires an active session but no other permissions. + operationId: GetUsersByUsernames + requestBody: + content: + application/json: + schema: + type: array + items: + type: string + description: List of usernames + required: true + responses: + "200": + description: User list retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/User" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + + users, resp := Client.GetUsersByUsernames([]string{"username1", "username2"}) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $resp = $driver->getUserModel()->getUsersByUsernames([ + "username1", + "username2", + ]); + + if ($resp->getStatusCode() == 200) { + $users = json_decode($resp->getBody()); + } + /api/v4/users/search: + post: + tags: + - users + summary: Search users + description: > + 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. + + ##### Permissions + + Requires an active session and `read_channel` and/or `view_team` permissions for any channels or teams specified in the request body. + operationId: SearchUsers + requestBody: + content: + application/json: + schema: + type: object + required: + - term + properties: + term: + description: The term to match against username, full name, nickname and + email + type: string + team_id: + description: If provided, only search users on this team + type: string + not_in_team_id: + description: If provided, only search users not on this team + type: string + in_channel_id: + description: If provided, only search users in this channel + type: string + not_in_channel_id: + description: If provided, only search users not in this channel. Must + specifiy `team_id` when using this option + type: string + in_group_id: + description: If provided, only search users in this group. Must + have `manage_system` permission. + type: string + group_constrained: + description: When used with `not_in_channel_id` or `not_in_team_id`, + returns only the users that are allowed to join the channel + or team based on its group constrains. + type: boolean + allow_inactive: + description: When `true`, include deactivated users in the results + type: boolean + without_team: + type: boolean + description: Set this to `true` if you would like to search for users + that are not on a team. This option takes precendence over + `team_id`, `in_channel_id`, and `not_in_channel_id`. + limit: + description: > + The maximum number of users to return in the results + + + __Available as of server version 5.6. Defaults to `100` if not provided or on an earlier server version.__ + type: integer + default: 100 + description: Search criteria + required: true + responses: + "200": + description: User list retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/User" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + teamID := "4xp9fdt77pncbef59f4k1qe83o" + teamID2 := "JhMjDX9rAlCdBf0l9oyq4eGhxw" + channelID := "Ej3SKOHlWIKAblkUTK5Xvkj2cm" + channelID2 := "dWdfrUSdjJ7kyBvyBCgCav67Kz" + + users, resp := Client.SearchUsers(&model.UserSearch{ + Term: "searchTerm", + TeamId: teamID, + NotInTeamId: teamID2, + InChannelId: channelID, + NotInChannelId: channelID2, + AllowInactive: true, + WithoutTeam: true, + Limit: 100, + Role: "admin", + }) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $teamID = "4xp9fdt77pncbef59f4k1qe83o"; + $teamID2 = "JhMjDX9rAlCdBf0l9oyq4eGhxw"; + $channelID = "Ej3SKOHlWIKAblkUTK5Xvkj2cm"; + $channelID2 = "dWdfrUSdjJ7kyBvyBCgCav67Kz"; + + $resp = $driver->getUserModel()->searchUsers([ + "term" => "searchTerm", + "team_id" => $teamID, + "not_in_team_id" => $teamID2, + "in_channel_id" => $channelID, + "not_in_channel_id" => $channelID2, + "allow_inactive" => true, + "without_team" => true, + "limit" => 100, + ]); + + if ($resp->getStatusCode() == 200) { + $users = json_decode($resp->getBody()); + } + /api/v4/users/autocomplete: + get: + tags: + - users + summary: Autocomplete users + description: > + 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. + + ##### Permissions + + Requires an active session and `view_team` and `read_channel` on any teams or channels used to filter the results further. + operationId: AutocompleteUsers + parameters: + - name: team_id + in: query + description: Team ID + schema: + type: string + - name: channel_id + in: query + description: Channel ID + schema: + type: string + - name: name + in: query + description: Username, nickname first name or last name + required: true + schema: + type: string + - name: limit + in: query + description: > + The maximum number of users to return in each subresult + + + __Available as of server version 5.6. Defaults to `100` if not provided or on an earlier server version.__ + schema: + type: integer + default: 100 + responses: + "200": + description: User autocomplete successful + content: + application/json: + schema: + $ref: "#/components/schemas/UserAutocomplete" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/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, "") + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $teamID = "4xp9fdt77pncbef59f4k1qe83o"; + $channelID = "Ej3SKOHlWIKAblkUTK5Xvkj2cm"; + $username = "testUsername"; + + $resp = $driver->getUserModel()->autocompleteUsers([ + "team_id" => $teamID, + "channel_id" => $channelID, + "name" => $username, + "limit" => 100, + ]); + + if ($resp->getStatusCode() == 200) { + $users = json_decode($resp->getBody()); + } + /api/v4/users/known: + get: + tags: + - users + summary: Get user IDs of known users + description: | + Get the list of user IDs of users with any direct relationship with a + user. That means any user sharing any channel, including direct and + group channels. + ##### Permissions + Must be authenticated. + + __Minimum server version__: 5.23 + operationId: GetKnownUsers + responses: + "200": + description: Known users' IDs retrieval successful + content: + application/json: + schema: + type: array + $ref: "#/components/schemas/KnownUsers" + "401": + $ref: "#/components/responses/Unauthorized" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + userIds, resp := Client.GetKnownUsers() + + /api/v4/users/stats: + get: + tags: + - users + summary: Get total count of users in the system + description: | + Get a total count of users in the system. + ##### Permissions + Must be authenticated. + operationId: GetTotalUsersStats + responses: + "200": + description: User stats retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/UsersStats" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + stats, resp := Client.GetTotalUsersStats("") + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $resp = $driver->getUserModel()->getTotalCountOfUsersInTheSystem(); + + if ($resp->getStatusCode() == 200) { + $stats = json_decode($resp->getBody())->total_users_count; + } + /api/v4/users/stats/filtered: + get: + tags: + - users + summary: Get total count of users in the system matching the specified filters + description: | + Get a count of users in the system matching the specified filters. + + __Minimum server version__: 5.26 + + ##### Permissions + Must have `manage_system` permission. + operationId: GetTotalUsersStatsFiltered + parameters: + - name: in_team + in: query + description: The ID of the team to get user stats for. + schema: + type: string + - name: in_channel + in: query + description: The ID of the channel to get user stats for. + schema: + type: string + - name: include_deleted + in: query + description: If deleted accounts should be included in the count. + schema: + type: boolean + - name: include_bots + in: query + description: If bot accounts should be included in the count. + schema: + type: boolean + - name: roles + in: query + description: > + Comma separated string used to filter users based on any of the specified system roles + + + Example: `?roles=system_admin,system_user` will include users that are either system admins or system users + schema: + type: string + - name: channel_roles + in: query + description: > + Comma separated string used to filter users based on any of the specified channel roles, can only be used in conjunction with `in_channel` + + + Example: `?in_channel=4eb6axxw7fg3je5iyasnfudc5y&channel_roles=channel_user` will include users that are only channel users and not admins or guests + schema: + type: string + - name: team_roles + in: query + description: > + Comma separated string used to filter users based on any of the specified team roles, can only be used in conjunction with `in_team` + + + Example: `?in_team=4eb6axxw7fg3je5iyasnfudc5y&team_roles=team_user` will include users that are only team users and not admins or guests + schema: + type: string + responses: + "200": + description: Filtered User stats retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/UsersStats" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "/api/v4/users/{user_id}": + get: + tags: + - users + summary: Get a user + description: | + Get a user a object. Sensitive information will be sanitized out. + ##### Permissions + Requires an active session but no other permissions. + operationId: GetUser + parameters: + - name: user_id + in: path + description: User GUID. This can also be "me" which will point to the current user. + required: true + schema: + type: string + responses: + "200": + description: User retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/User" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + userID := "4xp9fdt77pncbef59f4k1qe83o" + + user, resp := Client.GetUser(userID, "") + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $userID = "4xp9fdt77pncbef59f4k1qe83o"; + + $resp = $driver->getUserModel()->getUser($userID); + + if ($resp->getStatusCode() == 200) { + $user = json_decode($resp->getBody()); + } + put: + tags: + - users + summary: Update a user + description: > + 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. + + ##### Permissions + + Must be logged in as the user being updated or have the `edit_other_users` permission. + operationId: UpdateUser + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - id + - email + - username + properties: + id: + type: string + email: + type: string + username: + type: string + first_name: + type: string + last_name: + type: string + nickname: + type: string + locale: + type: string + position: + type: string + timezone: + $ref: "#/components/schemas/Timezone" + props: + type: object + notify_props: + $ref: "#/components/schemas/UserNotifyProps" + description: User object that is to be updated + required: true + responses: + "200": + description: User update successful + content: + application/json: + schema: + $ref: "#/components/schemas/User" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + userID := "4xp9fdt77pncbef59f4k1qe83o" + email := "test@domain.com" + username := "testUsername" + firstName := "testFirstname" + lastName := "testLastname" + nickname := "testNickname" + locale := "en" + position := "testPosition" + props := model.StringMap{} + props["testPropKey"] = "testPropValue" + notifyProps := model.StringMap{} + notifyProps["comment"] = "somethingrandom" + + user, resp := Client.UpdateUser(&model.User{ + Id: userID, + Email: email, + Username: username, + FirstName: firstName, + LastName: lastName, + Nickname: nickname, + Locale: locale, + Position: position, + Props: props, + NotifyProps: notifyProps, + }) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $userID = "4xp9fdt77pncbef59f4k1qe83o"; + $email = "test@domain.com"; + $username = "testUsername"; + $firstName = "testFirstname"; + $lastName = "testLastname"; + $nickname = "testNickname"; + $locale = "en"; + $position = "testPosition"; + $props = []; + $props["testPropKey"] = "testPropValue"; + $notifyProps = []; + $notifyProps["comment"] = "somethingrandom"; + + $resp = $driver->getUserModel()->updateUser($userID, [ + "email" => $email, + "username" => $username, + "first_name" => $firstName, + "last_name" => $lastName, + "nickname" => $nickname, + "locale" => $locale, + "position" => $position, + "props" => $props, + "notify_props" => $notifyProps, + ]); + + if ($resp->getStatusCode() == 200) { + $user = json_decode($resp->getBody()); + } + delete: + tags: + - users + summary: Deactivate a user account. + description: > + Deactivates the user and revokes all its sessions by archiving its user + object. + + + As of server version 5.28, optionally use the `permanent=true` query parameter to permanently delete the user for compliance reasons. To use this feature `ServiceSettings.EnableAPIUserDeletion` must be set to `true` in the server's configuration. + + ##### Permissions + + Must be logged in as the user being deactivated or have the `edit_other_users` permission. + operationId: DeleteUser + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + responses: + "200": + description: User deactivation successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + userID := "4xp9fdt77pncbef59f4k1qe83o" + + ok, resp := Client.DeleteUser(userID) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $userID = "4xp9fdt77pncbef59f4k1qe83o"; + + $resp = $driver->getUserModel()->deactivateUserAccount($userID); + + if ($resp->getStatusCode() == 200) { + $ok = json_decode($resp->getBody())->status; + } + "/api/v4/users/{user_id}/patch": + put: + tags: + - users + summary: Patch a user + description: > + 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. + + ##### Permissions + + Must be logged in as the user being updated or have the `edit_other_users` permission. + operationId: PatchUser + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + email: + type: string + username: + type: string + first_name: + type: string + last_name: + type: string + nickname: + type: string + locale: + type: string + position: + type: string + props: + type: object + notify_props: + $ref: "#/components/schemas/UserNotifyProps" + description: User object that is to be updated + required: true + responses: + "200": + description: User patch successful + content: + application/json: + schema: + $ref: "#/components/schemas/User" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + userID := "4xp9fdt77pncbef59f4k1qe83o" + + patch := &model.UserPatch{} + patch.Email = model.NewString("test@domain.com") + patch.Username = model.NewString("testUsername") + patch.FirstName = model.NewString("testFirstname") + patch.LastName = model.NewString("testLastname") + patch.Nickname = model.NewString("testNickname") + patch.Locale = model.NewString("en") + patch.Position = model.NewString("testPosition") + patch.Props = model.StringMap{} + patch.Props["testPropKey"] = "testPropValue" + patch.NotifyProps = model.StringMap{} + patch.NotifyProps["comment"] = "somethingrandom" + + user, resp := Client.PatchUser(userID, patch) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $userID = "4xp9fdt77pncbef59f4k1qe83o"; + $email = "test@domain.com"; + $username = "testUsername"; + $firstName = "testFirstname"; + $lastName = "testLastname"; + $nickname = "testNickname"; + $locale = "en"; + $position = "testPosition"; + $props = []; + $props["testPropKey"] = "testPropValue"; + $notifyProps = []; + $notifyProps["comment"] = "somethingrandom"; + + $resp = $driver->getUserModel()->patchUser($userID, [ + "email" => $email, + "username" => $username, + "first_name" => $firstName, + "last_name" => $lastName, + "nickname" => $nickname, + "locale" => $locale, + "position" => $position, + "props" => $props, + "notify_props" => $notifyProps, + ]); + + if ($resp->getStatusCode() == 200) { + $user = json_decode($resp->getBody()); + } + "/api/v4/users/{user_id}/roles": + put: + tags: + - users + summary: Update a user's roles + description: > + 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. + + ##### Permissions + + Must have the `manage_roles` permission. + operationId: UpdateUserRoles + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - roles + properties: + roles: + type: string + description: Space-delimited system roles to assign to the user + required: true + responses: + "200": + description: User roles update successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + userID := "4xp9fdt77pncbef59f4k1qe83o" + roles := "team_user team_admin" + + ok, resp = Client.UpdateUserRoles(userID, roles) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $userID = "4xp9fdt77pncbef59f4k1qe83o"; + $roles = "team_user team_admin"; + + $resp = $driver->getUserModel()->updateUserRoles($userID, [ + "roles" => $roles, + ]); + + if ($resp->getStatusCode() == 200) { + $ok = json_decode($resp->getBody())->status; + } + "/api/v4/users/{user_id}/active": + put: + tags: + - users + summary: Update user active status + description: > + 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.__ + + ##### Permissions + + User can deactivate themselves. + + User with `manage_system` permission can activate or deactivate a user. + operationId: UpdateUserActive + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - active + properties: + active: + type: boolean + description: Use `true` to set the user active, `false` for inactive + required: true + responses: + "200": + description: User active status update successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + userID := "4xp9fdt77pncbef59f4k1qe83o" + + ok, resp := Client.UpdateUserActive(userID, true) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $userID = "4xp9fdt77pncbef59f4k1qe83o"; + + $resp = $driver->getUserModel()->updateUserActive($userID, [ + "active" => true, + ]); + + if ($resp->getStatusCode() == 200) { + $ok = json_decode($resp->getBody())->status; + } + "/api/v4/users/{user_id}/image": + get: + tags: + - users + summary: Get user's profile image + description: | + Get a user's profile image based on user_id string parameter. + ##### Permissions + Must be logged in. + operationId: GetProfileImage + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + - name: _ + in: query + description: Not used by the server. Clients can pass in the last picture update time of the user to potentially take advantage of caching + required: false + schema: + type: number + responses: + "200": + description: User's profile image + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + userID := "4xp9fdt77pncbef59f4k1qe83o" + + data, resp := Client.GetProfileImage(userID, "") + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $userID = "4xp9fdt77pncbef59f4k1qe83o"; + + $resp = $driver->getUserModel()->getUserProfileImage($userID); + + if ($resp->getStatusCode() == 200) { + $data = json_decode($resp->getBody()); + } + post: + tags: + - users + summary: Set user's profile image + description: > + Set a user's profile image based on user_id string parameter. + + ##### Permissions + + Must be logged in as the user being updated or have the `edit_other_users` permission. + operationId: SetProfileImage + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + image: + description: The image to be uploaded + type: string + format: binary + required: + - image + responses: + "200": + description: Profile image set successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import ( + "io/ioutil" + "log" + + "github.com/mattermost/mattermost-server/v5/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) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $userID = "4xp9fdt77pncbef59f4k1qe83o"; + $resource = fopen("profile_pic.png", 'rb'); + + if ($resource === false) { + throw new \Exeption("Failure."); + } + + $data = new \GuzzleHttp\Psr7\Stream($resource); + + $resp = $driver->getUserModel()->setUserProfileImage($userID, [ + "image" => $data, + ]); + + fclose($resource); + + if ($resp->getStatusCode() == 200) { + $ok = json_decode($resp->getBody()->status; + } + delete: + tags: + - users + summary: Delete user's profile image + description: > + Delete user's profile image and reset to default image based on user_id + string parameter. + + ##### Permissions + + Must be logged in as the user being updated or have the `edit_other_users` permission. + + __Minimum server version__: 5.5 + operationId: SetDefaultProfileImage + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + responses: + "200": + description: Profile image reset successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/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) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $userID = "4xp9fdt77pncbef59f4k1qe83o"; + + $resp = $driver->getUserModel()->deleteUserProfileImage($userID); + + if ($resp->getStatusCode() == 200) { + $ok = json_decode($resp->getBody()->status; + } + "/api/v4/users/{user_id}/image/default": + get: + tags: + - users + summary: Return user's default (generated) profile image + description: > + Returns the default (generated) user profile image based on user_id + string parameter. + + ##### Permissions + + Must be logged in. + + __Minimum server version__: 5.5 + operationId: GetDefaultProfileImage + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + responses: + "200": + description: Default profile image + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + userID := "4xp9fdt77pncbef59f4k1qe83o" + + ok, resp := Client.SetDefaultProfileImage(userID) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $userID = "4xp9fdt77pncbef59f4k1qe83o"; + + $resp = $driver->getUserModel()->returnUserDefaultProfileImage($userID); + + if ($resp->getStatusCode() == 200) { + $ok = json_decode($resp->getBody(); + } + "/api/v4/users/username/{username}": + get: + tags: + - users + summary: Get a user by username + description: > + Get a user object by providing a username. Sensitive information will be + sanitized out. + + ##### Permissions + + Requires an active session but no other permissions. + operationId: GetUserByUsername + parameters: + - name: username + in: path + description: Username + required: true + schema: + type: string + responses: + "200": + description: User retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/User" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + userID := "4xp9fdt77pncbef59f4k1qe83o" + + user, resp := Client.GetUserByUsername(userID, "") + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $username = "username"; + + $resp = $driver->getUserModel()->getUserByUsername($username); + + if ($resp->getStatusCode() == 200) { + $user = json_decode($resp->getBody()); + } + /api/v4/users/password/reset: + post: + tags: + - users + summary: Reset password + description: > + 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. + + ##### Permissions + + No permissions required. + operationId: ResetPassword + requestBody: + content: + application/json: + schema: + type: object + required: + - code + - new_password + properties: + code: + description: The recovery code + type: string + new_password: + description: The new password for the user + type: string + required: true + responses: + "200": + description: User password update successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + code := "4xp9fdt77pncbef59f4k1qe83o" + newPassword := "awesomePassword" + + success, resp = Client.ResetPassword(code, newPassword) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $code = "4xp9fdt77pncbef59f4k1qe83o"; + $newPassword = "awesomePassword"; + + $resp = $driver->getUserModel()->resetPassword([ + "code" => $code, + "newPassword" => $newPassword, + ]); + + if ($resp->getStatusCode() == 200) { + $success = json_decode($resp->getBody())->status; + } + "/api/v4/users/{user_id}/mfa": + put: + tags: + - users + summary: Update a user's MFA + description: > + 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. + + ##### Permissions + + Must be logged in as the user being updated or have the `edit_other_users` permission. + operationId: UpdateUserMfa + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - activate + properties: + activate: + description: Use `true` to activate, `false` to deactivate + type: boolean + code: + description: The code produced by your MFA client. Required if `activate` + is true + type: string + required: true + responses: + "200": + description: User MFA update successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + userID := "BbaYBYDV5IDOZFiJGBSzkw1k5u" + code := "4xp9fdt77pncbef59f4k1qe83o" + + ok, resp := Client.UpdateUserMfa(userID, code, true) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $userID = "BbaYBYDV5IDOZFiJGBSzkw1k5u"; + $code = "4xp9fdt77pncbef59f4k1qe83o"; + + $resp = $driver->getUserModel()->updateUserMfa($userID, [ + "activate" => true, + "code" => $code, + ]); + + if ($resp->getStatusCode() == 200) { + $ok = json_decode($resp->getBody()->status; + } + "/api/v4/users/{user_id}/mfa/generate": + post: + tags: + - users + summary: Generate MFA secret + description: > + Generates an multi-factor authentication secret for a user and returns + it as a string and as base64 encoded QR code image. + + ##### Permissions + + Must be logged in as the user or have the `edit_other_users` permission. + operationId: GenerateMfaSecret + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + responses: + "200": + description: MFA secret generation successful + content: + application/json: + schema: + type: object + properties: + secret: + description: The MFA secret as a string + type: string + qr_code: + description: A base64 encoded QR code image + type: string + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + userID := "BbaYBYDV5IDOZFiJGBSzkw1k5u" + + mfaSecret, resp = Client.GenerateMfaSecret(userID) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $userID = "BbaYBYDV5IDOZFiJGBSzkw1k5u"; + + $resp = $driver->getUserModel()->generateMfaSecret($userID); + + if ($resp->getStatusCode() == 200) { + $mfaSecret = json_decode($resp->getBody()); + } + "/api/v4/users/{user_id}/demote": + post: + tags: + - users + summary: Demote a user to a guest + description: | + 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 + + ##### Permissions + Must be logged in as the user or have the `demote_to_guest` permission. + operationId: DemoteUserToGuest + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + responses: + "200": + description: User successfully demoted + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + userID := "BbaYBYDV5IDOZFiJGBSzkw1k5u" + + ok, resp = Client.demoteUserToGuest(userID) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $userID = "BbaYBYDV5IDOZFiJGBSzkw1k5u"; + + $resp = $driver->getUserModel()->demoteUserToGuest($userID); + + if ($resp->getStatusCode() == 200) { + $ok = json_decode($resp->getBody()->status; + } + "/api/v4/users/{user_id}/promote": + post: + tags: + - users + summary: Promote a guest to user + description: | + 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 + + ##### Permissions + Must be logged in as the user or have the `promote_guest` permission. + operationId: PromoteGuestToUser + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + responses: + "200": + description: Guest successfully promoted + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + userID := "BbaYBYDV5IDOZFiJGBSzkw1k5u" + + ok, resp = Client.PromoteGuestToUser(userID) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $userID = "BbaYBYDV5IDOZFiJGBSzkw1k5u"; + + $resp = $driver->getUserModel()->promoteGuestToUser($userID); + + if ($resp->getStatusCode() == 200) { + $ok = json_decode($resp->getBody()->status; + } + "/api/v4/users/{user_id}/convert_to_bot": + post: + tags: + - bots + - users + summary: Convert a user into a bot + description: | + Convert a user into a bot. + + __Minimum server version__: 5.26 + + ##### Permissions + Must have `manage_system` permission. + operationId: ConvertUserToBot + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + responses: + "200": + description: User successfully converted + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + userId := "BbaYBYDV5IDOZFiJGBSzkw1k5u" + + bot, resp := Client.ConvertUserToBot(userId) + /api/v4/users/mfa: + post: + tags: + - users + summary: Check MFA + description: > + 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. + + ##### Permissions + + No permission required. + operationId: CheckUserMfa + requestBody: + content: + application/json: + schema: + type: object + required: + - login_id + properties: + login_id: + description: The email or username used to login + type: string + required: true + responses: + "200": + description: MFA check successful + content: + application/json: + schema: + type: object + properties: + mfa_required: + description: Value will `true` if MFA is active, `false` otherwise + type: boolean + "400": + $ref: "#/components/responses/BadRequest" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + loginID := "test@domain.com" + + required, resp := Client.CheckUserMfa(loginID) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $loginID = "test@domain.com"; + + $resp = $driver->getUserModel()->checkMfa([ + "login_id" => $loginID, + ]); + + if ($resp->getStatusCode() == 200) { + $required = json_decode($resp->getBody())->mfa_required; + } + "/api/v4/users/{user_id}/password": + put: + tags: + - users + summary: Update a user's password + description: > + 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. + + ##### Permissions + + Must be logged in as the user the password is being changed for or have `manage_system` permission. + operationId: UpdateUserPassword + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - new_password + properties: + current_password: + description: The current password for the user + type: string + new_password: + description: The new password for the user + type: string + required: true + responses: + "200": + description: User password update successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + + userID := "BbaYBYDV5IDOZFiJGBSzkw1k5u" + + currentPassword := "badPassword" + + newPassword := "awesomePassword" + + + ok, resp := Client.UpdateUserPassword(userID, currentPassword, newPassword) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $userID = "BbaYBYDV5IDOZFiJGBSzkw1k5u"; + $currentPassword = "badPassword"; + $newPassword = "awesomePassword"; + + $resp = $driver->getUserModel()->updateUserPassword($userID, [ + "current_password" => $currentPassword, + "new_password" => $newPassword, + ]); + + if ($resp->getStatusCode() == 200) { + $ok = json_decode($resp->getBody())->status; + } + /api/v4/users/password/reset/send: + post: + tags: + - users + summary: Send password reset email + description: > + 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. + + ##### Permissions + + No permissions required. + operationId: SendPasswordResetEmail + requestBody: + content: + application/json: + schema: + type: object + required: + - email + properties: + email: + description: The email of the user + type: string + required: true + responses: + "200": + description: Email sent if account exists + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + email := "test@domain.com" + + pass, resp := Client.SendVerificationEmail(email) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $email = "test@domain.com"; + + $resp = $driver->getUserModel()->sendPasswordResetEmail([ + "email" => $email, + ]); + + if ($resp->getStatusCode() == 200) { + $pass = json_decode($resp->getBody())->status; + } + "/api/v4/users/email/{email}": + get: + tags: + - users + summary: Get a user by email + description: > + Get a user object by providing a user email. Sensitive information will + be sanitized out. + + ##### Permissions + + 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. + operationId: GetUserByEmail + parameters: + - name: email + in: path + description: User Email + required: true + schema: + type: string + responses: + "200": + description: User retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/User" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + email := "test@domain.com" + + user, resp := Client.GetUserByEmail(email, "") + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $email = "test@domain.com"; + + $resp = $driver->getUserModel()->getUserByEmail($email); + + if ($resp->getStatusCode() == 200) { + $user = json_decode($resp->getBody()); + } + "/api/v4/users/{user_id}/sessions": + get: + tags: + - users + summary: Get user's sessions + description: > + Get a list of sessions by providing the user GUID. Sensitive information + will be sanitized out. + + ##### Permissions + + Must be logged in as the user being updated or have the `edit_other_users` permission. + operationId: GetSessions + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + responses: + "200": + description: User session retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Session" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + userID := "zWEyrTZ7GZ22aBSfoX60iWryTY" + + sessions, resp := Client.GetSessions(userID, "") + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $userID = "zWEyrTZ7GZ22aBSfoX60iWryTY"; + + $resp = $driver->getUserModel()->getUserSessions($userID); + + if ($resp->getStatusCode() == 200) { + $sessions = json_decode($resp->getBody()); + } + "/api/v4/users/{user_id}/sessions/revoke": + post: + tags: + - users + summary: Revoke a user session + description: > + Revokes a user session from the provided user id and session id strings. + + ##### Permissions + + Must be logged in as the user being updated or have the `edit_other_users` permission. + operationId: RevokeSession + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - session_id + properties: + session_id: + description: The session GUID to revoke. + type: string + required: true + responses: + "200": + description: User session revoked successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + userID := "zWEyrTZ7GZ22aBSfoX60iWryTY" + sessionID := "adWv1qPZmHdtxk7Lmqh6RtxWxS" + + ok, resp = Client.RevokeSession(userID, sessionID) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $userID = "zWEyrTZ7GZ22aBSfoX60iWryTY"; + $sessionID = "adWv1qPZmHdtxk7Lmqh6RtxWxS"; + + $resp = $driver->getUserModel()->revokeUserSession($userID, [ + "session_id" => $sessionID, + ]); + + if ($resp->getStatusCode() == 200) { + $ok = json_decode($resp->getBody())->status; + } + "/api/v4/users/{user_id}/sessions/revoke/all": + post: + tags: + - users + summary: Revoke all active sessions for a user + description: > + Revokes all user sessions from the provided user id and session id + strings. + + ##### Permissions + + Must be logged in as the user being updated or have the `edit_other_users` permission. + + __Minimum server version__: 4.4 + operationId: RevokeAllSessions + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + responses: + "200": + description: User sessions revoked successfully + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + userID := "zWEyrTZ7GZ22aBSfoX60iWryTY" + + ok, resp := Client.RevokeAllSessions(userID) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $userID = "zWEyrTZ7GZ22aBSfoX60iWryTY"; + + $resp = $driver->getUserModel()->revokeAllUserSessions($userID); + + if ($resp->getStatusCode() == 200) { + $ok = json_decode($resp->getBody())->status; + } + /api/v4/users/sessions/device: + put: + tags: + - users + summary: Attach mobile device + description: > + Attach a mobile device id to the currently logged in session. This will + enable push notifications for a user, if configured by the server. + + ##### Permissions + + Must be authenticated. + operationId: AttachDeviceId + requestBody: + content: + application/json: + schema: + type: object + required: + - device_id + properties: + device_id: + description: Mobile device id. For Android prefix the id with `android:` + and Apple with `apple:` + type: string + required: true + responses: + "200": + description: Device id attach successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + deviceID := "zWEyrTZ7GZ22aBSfoX60iWryTY" + + pass, resp := Client.AttachDeviceId(deviceID) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $deviceID = "zWEyrTZ7GZ22aBSfoX60iWryTY"; + + $resp = $driver->getUserModel()->attachMobileDevice([ + "device_id" => $deviceID, + ]); + + if ($resp->getStatusCode() == 200) { + $pass = json_decode($resp->getBody())->status; + } + "/api/v4/users/{user_id}/audits": + get: + tags: + - users + summary: Get user's audits + description: | + Get a list of audit by providing the user GUID. + ##### Permissions + Must be logged in as the user or have the `edit_other_users` permission. + operationId: GetUserAudits + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + responses: + "200": + description: User audits retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Audit" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + userID := "zWEyrTZ7GZ22aBSfoX60iWryTY" + + audits, resp := Client.GetUserAudits(userID, 0, 100, "") + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $userID = "zWEyrTZ7GZ22aBSfoX60iWryTY"; + + $resp = $driver->getUserModel()->getUserAudits($userID); + + if ($resp->getStatusCode() == 200) { + $audits = json_decode($resp->getBody()); + } + "/api/v4/users/{user_id}/email/verify/member": + post: + tags: + - users + summary: Verify user email by ID + description: | + Verify the email used by a user without a token. + + __Minimum server version__: 5.24 + + ##### Permissions + + Must have `manage_system` permission. + operationId: VerifyUserEmailWithoutToken + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + responses: + "200": + description: User email verification successful + content: + application/json: + schema: + $ref: "#/components/schemas/User" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + userID := "BbaYBYDV5IDOZFiJGBSzkw1k5u + + user, resp := Client.VerifyUserEmailWithoutToken(userID) + /api/v4/users/email/verify: + post: + tags: + - users + summary: Verify user email + description: | + Verify the email used by a user to sign-up their account with. + ##### Permissions + No permissions required. + operationId: VerifyUserEmail + requestBody: + content: + application/json: + schema: + type: object + required: + - token + properties: + token: + description: The token given to validate the email + type: string + required: true + responses: + "200": + description: User email verification successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + token := "zWEyrTZ7GZ22aBSfoX60iWryTY" + + ok, resp := Client.VerifyUserEmail(token) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $token = "zWEyrTZ7GZ22aBSfoX60iWryTY"; + + $resp = $driver->getUserModel()->verifyUserEmail([ + "token" => $token, + ]); + + if ($resp->getStatusCode() == 200) { + $ok = json_decode($resp->getBody())->status; + } + /api/v4/users/email/verify/send: + post: + tags: + - users + summary: Send verification email + description: > + 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. + + ##### Permissions + + No permissions required. + operationId: SendVerificationEmail + requestBody: + content: + application/json: + schema: + type: object + required: + - email + properties: + email: + description: Email of a user + type: string + required: true + responses: + "200": + description: Email send successful if email exists + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + email := "test@domain.com" + + pass, resp := Client.SendVerificationEmail(email) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $email = "test@domain.com"; + + $resp = $driver->getUserModel()->sendVerificationEmail([ + "email" => $email, + ]); + + if ($resp->getStatusCode() == 200) { + $pass = json_decode($resp->getBody())->status; + } + /api/v4/users/login/switch: + post: + tags: + - users + summary: Switch login method + description: > + 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. + + + ##### Permissions + + No current authentication required except when switching from OAuth2/SAML to email. + operationId: SwitchAccountType + requestBody: + content: + application/json: + schema: + type: object + required: + - current_service + - new_service + properties: + current_service: + description: The service the user currently uses to login + type: string + new_service: + description: The service the user will use to login + type: string + email: + description: The email of the user + type: string + password: + description: The password used with the current service + type: string + mfa_code: + description: The MFA code of the current service + type: string + ldap_id: + description: The LDAP/AD id of the user + type: string + required: true + responses: + "200": + description: Login method switch or request successful + content: + application/json: + schema: + type: object + properties: + follow_link: + description: The link for the user to follow to login or to complete + the account switching when the current service is + OAuth2/SAML + type: string + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + currentService := "email" + newService := "gitlab" + email := "test@domain.com" + password := "awesomePassword" + mfaCode := "adWv1qPZmHdtxk7Lmqh6RtxWxS" + ldapLoginID := "RdDjEDlkWgt7ndjyVLwWGvnX8c" + + + link, resp := Client.SwitchAccountType(&model.SwitchRequest{ + CurrentService: currentService, + NewService: newService, + Email: email, + Password: password, + MfaCode: mfaCode, + LdapLoginId: ldapLoginID, + }) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $currentService = "email"; + $newService = "gitlab"; + $email = "test@domain.com"; + $password = "awesomePassword"; + $mfaCode = "adWv1qPZmHdtxk7Lmqh6RtxWxS"; + $ldapLoginID = "RdDjEDlkWgt7ndjyVLwWGvnX8c"; + + $resp = $driver->getUserModel()->switchLoginMethod([ + "current_service" => $currentService, + "new_service" => $newService, + "email" => $email, + "password" => $password, + "mfa_code" => $mfaCode, + "ldap_id" => $ldapLoginID, + ]); + + if ($resp->getStatusCode() == 200) { + $link = json_decode($resp->getBody())->follow_link; + } + "/api/v4/users/{user_id}/tokens": + post: + tags: + - users + summary: Create a user access token + description: > + Generate a user access token that can be used to authenticate with the + Mattermost REST API. + + + __Minimum server version__: 4.1 + + + ##### Permissions + + Must have `create_user_access_token` permission. For non-self requests, must also have the `edit_other_users` permission. + operationId: CreateUserAccessToken + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - description + properties: + description: + description: A description of the token usage + type: string + required: true + responses: + "201": + description: User access token creation successful + content: + application/json: + schema: + $ref: "#/components/schemas/UserAccessToken" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + + userID := "adWv1qPZmHdtxk7Lmqh6RtxWxS" + + + userAccessToken, resp := Client.CreateUserAccessToken(userID, "test token") + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $userID = "adWv1qPZmHdtxk7Lmqh6RtxWxS"; + + $resp = $driver->getUserModel()->createToken($userID, [ + "description" => "test token", + ]); + + if ($resp->getStatusCode() == 200) { + $userAccessToken = json_decode($resp->getBody()); + } + get: + tags: + - users + summary: Get user access tokens + description: > + 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 + + + ##### Permissions + + Must have `read_user_access_token` permission. For non-self requests, must also have the `edit_other_users` permission. + operationId: GetUserAccessTokensForUser + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of tokens per page. + schema: + type: integer + default: 60 + responses: + "200": + description: User access tokens retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/UserAccessTokenSanitized" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + userID := "adWv1qPZmHdtxk7Lmqh6RtxWxS" + + tokens, resp := Client.GetUserAccessTokensForUser(userID, 0, 100) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $userID = "adWv1qPZmHdtxk7Lmqh6RtxWxS"; + + $resp = $driver->getUserModel()->getTokens($userID, [ + "page" => 0, + "per_page" => 100, + ]); + + if ($resp->getStatusCode() == 200) { + $tokens = json_decode($resp->getBody()); + } + /api/v4/users/tokens: + get: + tags: + - users + summary: Get user access tokens + description: > + 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 + + + ##### Permissions + + Must have `manage_system` permission. + operationId: GetUserAccessTokens + parameters: + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of tokens per page. + schema: + type: integer + default: 60 + responses: + "200": + description: User access tokens retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/UserAccessTokenSanitized" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + tokens, resp := Client.GetUserAccessTokens(0, 100) + /api/v4/users/tokens/revoke: + post: + tags: + - users + summary: Revoke a user access token + description: > + Revoke a user access token and delete any sessions using the token. + + + __Minimum server version__: 4.1 + + + ##### Permissions + + Must have `revoke_user_access_token` permission. For non-self requests, must also have the `edit_other_users` permission. + operationId: RevokeUserAccessToken + requestBody: + content: + application/json: + schema: + type: object + required: + - token_id + properties: + token_id: + description: The user access token GUID to revoke + type: string + required: true + responses: + "200": + description: User access token revoke successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + tokenID := "adWv1qPZmHdtxk7Lmqh6RtxWxS" + + ok, resp := Client.RevokeUserAccessToken(tokenID) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $tokenID = "adWv1qPZmHdtxk7Lmqh6RtxWxS"; + + $resp = $driver->getUserModel()->revokeToken([ + "token_id" => $tokenID, + ]); + + if ($resp->getStatusCode() == 200) { + $ok = json_decode($resp->getBody())->status; + } + "/api/v4/users/tokens/{token_id}": + get: + tags: + - users + summary: Get a user access token + description: > + Get a user access token. Does not include the actual authentication + token. + + + __Minimum server version__: 4.1 + + + ##### Permissions + + Must have `read_user_access_token` permission. For non-self requests, must also have the `edit_other_users` permission. + operationId: GetUserAccessToken + parameters: + - name: token_id + in: path + description: User access token GUID + required: true + schema: + type: string + responses: + "200": + description: User access token retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/UserAccessTokenSanitized" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + tokenID := "adWv1qPZmHdtxk7Lmqh6RtxWxS" + + token, resp := Client.GetUserAccessToken(tokenID) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $tokenID = "adWv1qPZmHdtxk7Lmqh6RtxWxS"; + + $resp = $driver->getUserModel()->getToken($tokenID); + + if ($resp->getStatusCode() == 200) { + $token = json_decode($resp->getBody()); + } + /api/v4/users/tokens/disable: + post: + tags: + - users + summary: Disable personal access token + description: > + 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 + + + ##### Permissions + + Must have `revoke_user_access_token` permission. For non-self requests, must also have the `edit_other_users` permission. + operationId: DisableUserAccessToken + requestBody: + content: + application/json: + schema: + type: object + required: + - token_id + properties: + token_id: + description: The personal access token GUID to disable + type: string + required: true + responses: + "200": + description: Personal access token disable successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + tokenID := "adWv1qPZmHdtxk7Lmqh6RtxWxS" + + ok, resp := Client.DisableUserAccessToken(tokenID) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $tokenID = "adWv1qPZmHdtxk7Lmqh6RtxWxS"; + + $resp = $driver->getUserModel()->disablePersonalAccessToken([ + "token_id" => $tokenID + ]); + + if ($resp->getStatusCode() == 200) { + $ok = json_decode($resp->getBody())->status; + } + /api/v4/users/tokens/enable: + post: + tags: + - users + summary: Enable personal access token + description: > + Re-enable a personal access token that has been disabled. + + + __Minimum server version__: 4.4 + + + ##### Permissions + + Must have `create_user_access_token` permission. For non-self requests, must also have the `edit_other_users` permission. + operationId: EnableUserAccessToken + requestBody: + content: + application/json: + schema: + type: object + required: + - token_id + properties: + token_id: + description: The personal access token GUID to enable + type: string + required: true + responses: + "200": + description: Personal access token enable successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + tokenID := "adWv1qPZmHdtxk7Lmqh6RtxWxS" + + ok, resp := Client.EnableUserAccessToken(tokenID) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $tokenID = "adWv1qPZmHdtxk7Lmqh6RtxWxS"; + + $resp = $driver->getUserModel()->enablePersonalAccessToken([ + "token_id" => $tokenID + ]); + + if ($resp->getStatusCode() == 200) { + $ok = json_decode($resp->getBody())->status; + } + /api/v4/users/tokens/search: + post: + tags: + - users + summary: Search tokens + description: > + 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 + + + ##### Permissions + + Must have `manage_system` permission. + operationId: SearchUserAccessTokens + requestBody: + content: + application/json: + schema: + type: object + required: + - term + properties: + term: + description: The search term to match against the token id, user id or + username. + type: string + description: Search criteria + required: true + responses: + "200": + description: Personal access token search successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/UserAccessTokenSanitized" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + + tokenID := "adWv1qPZmHdtxk7Lmqh6RtxWxS" + + + userAccessTokens, resp = Client.SearchUserAccessTokens(&model.UserAccessTokenSearch{Term: tokenID}) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $tokenID = "adWv1qPZmHdtxk7Lmqh6RtxWxS"; + + $resp = $driver->getUserModel()->searchTokens([ + "term" => $tokenID + ]); + + if ($resp->getStatusCode() == 200) { + $userAccessTokens = json_decode($resp->getBody()); + } + "/api/v4/users/{user_id}/auth": + put: + tags: + - users + summary: Update a user's authentication method + description: > + Updates a user's authentication method. This can be used to change them + to/from LDAP authentication for example. + + + __Minimum server version__: 4.6 + + ##### Permissions + + Must have the `edit_other_users` permission. + operationId: UpdateUserAuth + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/UserAuthData" + required: true + responses: + "200": + description: User auth update successful + content: + application/json: + schema: + $ref: "#/components/schemas/UserAuthData" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "501": + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + userID := "adWv1qPZmHdtxk7Lmqh6RtxWxS" + user, resp := Client.GetUser(userID, "") + userAuth := &model.UserAuth{} + userAuth.AuthData = user.AuthData + userAuth.AuthService = user.AuthService + + user, resp := Client.UpdateUserAuth(userID, userAuth) + - lang: PHP + source: | + require 'vendor/autoload.php'; + + use \Gnello\Mattermost\Driver; + + $container = new \Pimple\Container([ + "driver" => [ + "url" => "https://your-mattermost-url.com", + "login_id" => "email@domain.com", + "password" => "Password1", + ] + ]); + + $driver = new Driver($container); + $driver->authenticate(); + + $userID = "adWv1qPZmHdtxk7Lmqh6RtxWxS"; + $resp = $driver->getUserModel()->getUser($userID); + + if ($resp->getStatusCode() == 200) { + $user = json_decode($resp->getBody()); + } else { + throw new \Exception("User not found."); + } + + $userAuth = []; + $userAuth["auth_data"] = $user->auth_data; + $userAuth["auth_service"] = $user->auth_service; + + $resp = $driver->getUserModel()->updateUserAuthenticationMethod($userID, $userAuth); + + if ($resp->getStatusCode() == 200) { + $user = json_decode($resp->getBody()); + } + "/api/v4/users/{user_id}/terms_of_service": + post: + tags: + - users + - terms of service + summary: Records user action when they accept or decline custom terms of service + description: > + 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 + + ##### Permissions + + Must be logged in as the user being acted on. + operationId: RegisterTermsOfServiceAction + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - serviceTermsId + - accepted + properties: + serviceTermsId: + description: terms of service ID on which the user is acting on + type: string + accepted: + description: true or false, indicates whether the user accepted or + rejected the terms of service. + type: string + description: terms of service details + required: true + responses: + "200": + description: Terms of service action recorded successfully + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + + userID := "adWv1qPZmHdtxk7Lmqh6RtxWxS" + + serviceTermsID := "RdDjEDlkWgt7ndjyVLwWGvnX8c" + + + success, resp = Client.RegisterTermsOfServiceAction(userID, serviceTermsID, true) + get: + tags: + - users + - terms of service + summary: Fetches user's latest terms of service action if the latest action was + for acceptance. + description: > + 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 + + ##### Permissions + + Must be logged in as the user being acted on. + operationId: GetUserTermsOfService + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + responses: + "200": + description: User's accepted terms of service action + content: + application/json: + schema: + $ref: "#/components/schemas/UserTermsOfService" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "404": + description: User hasn't performed an action or the latest action was a rejection. + content: + application/json: + schema: + $ref: "#/components/schemas/AppError" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + userID := "adWv1qPZmHdtxk7Lmqh6RtxWxS" + + userTermsOfService, resp := Client.GetUserTermsOfService(userID, "") + /api/v4/users/sessions/revoke/all: + post: + tags: + - users + summary: Revoke all sessions from all users. + description: > + 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 + + + ##### Permissions + + Must have `manage_system` permission. + operationId: RevokeSessionsFromAllUsers + responses: + "200": + description: Sessions successfully revoked. + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: Go + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + response, err := Client.RevokeSessionsFromAllUsers() + + "/api/v4/users/{user_id}/typing": + post: + tags: + - users + summary: Publish a user typing websocket event. + description: > + Notify users in the given channel via websocket that the given user is typing. + + __Minimum server version__: 5.26 + + ##### Permissions + + Must have `manage_system` permission to publish for any user other than oneself. + + operationId: PublishUserTyping + parameters: + - name: user_id + in: path + description: User GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - channel_id + properties: + channel_id: + description: The id of the channel to which to direct the typing event. + type: string + parent_id: + description: The optional id of the root post of the thread to which the user is replying. If unset, the typing event is directed at the entire channel. + type: string + responses: + '200': + description: User typing websocket event accepted for publishing. + '400': + $ref: "#/components/responses/BadRequest" + '401': + $ref: "#/components/responses/Unauthorized" + '403': + $ref: "#/components/responses/Forbidden" + x-code-samples: + - lang: 'Go' + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + ok, response := Client.PublishUserTyping(userID, TypingRequest{ + ChannelId: "channel_id", + ParentId: "post_id", + }) + + "/api/v4/users/{user_id}/uploads": + get: + tags: + - users + summary: Get uploads for a user + description: | + Gets all the upload sessions belonging to a user. + + __Minimum server version__: 5.28 + + ##### Permissions + Must be logged in as the user who created the upload sessions. + operationId: GetUploadsForUser + parameters: + - name: user_id + in: path + description: The ID of the user. This can also be "me" which will point to the current user. + required: true + schema: + type: string + responses: + "200": + description: User's uploads retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/UploadSession" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + uss, response := Client.GetUploadsForUser("fc6suoon9pbbpmhrb9c967paxe") + - lang: Curl + source: | + curl 'http://localhost:8065/api/v4/users/fc6suoon9pbbpmhrb9c967paxe/uploads' \ + -H 'Authorization: Bearer 9kg8nqrnxprd9jbykqeg4r51hw' \ + + "/api/v4/users/{user_id}/channel_members": + get: + tags: + - users + summary: Get all channel members from all teams for a user + description: | + Get all channel members from all teams for a user. + + __Minimum server version__: 6.2.0 + + ##### Permissions + Logged in as the user, or have `edit_other_users` permission. + operationId: GetChannelMembersWithTeamDataForUser + parameters: + - name: user_id + in: path + description: The ID of the user. This can also be "me" which will point to the current user. + required: true + schema: + type: string + - name: page + in: query + description: Page specifies which part of the results to return, by PageSize. + required: false + schema: + type: integer + - name: pageSize + in: query + description: PageSize specifies the size of the returned chunk of results. + required: false + schema: + type: integer + responses: + "200": + description: User's uploads retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/ChannelMemberWithTeamData" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + channels, response, err := Client.GetChannelMembersWithTeamData("fc6suoon9pbbpmhrb9c967paxe", 0, 10) + - lang: Curl + source: | + curl 'http://localhost:8065/api/v4/users/me/channel_members?page=0&per_page=2' \ + -H 'Authorization: Bearer 9kg8nqrnxprd9jbykqeg4r51hw' \ + + /api/v4/users/migrate_auth/ldap: + post: + tags: + - users + - migrate + - authentication + - LDAP + summary: Migrate user accounts authentication type to LDAP. + description: > + Migrates accounts from one authentication provider to another. + For example, you can upgrade your authentication provider from email to LDAP. + + __Minimum server version__: 5.28 + + ##### Permissions + + Must have `manage_system` permission. + + operationId: MigrateAuthToLdap + requestBody: + content: + application/json: + schema: + type: object + required: + - from + - match_field + - force + properties: + from: + description: The current authentication type for the matched users. + type: string + match_field: + description: Foreign user field name to match. + type: string + force: + type: boolean + responses: + '200': + description: Successfully migrated authentication type to LDAP. + '400': + $ref: "#/components/responses/BadRequest" + '401': + $ref: "#/components/responses/Unauthorized" + '403': + $ref: "#/components/responses/Forbidden" + '501': + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: 'Go' + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("sysadmin@domain.com", "Password1") + + ok, response := Client.MigrateAuthToLdap(fromAuthService, matchField, force) + + /api/v4/users/migrate_auth/saml: + post: + tags: + - users + - migrate + - authentication + - SAML + summary: Migrate user accounts authentication type to SAML. + description: > + Migrates accounts from one authentication provider to another. + For example, you can upgrade your authentication provider from email to SAML. + + __Minimum server version__: 5.28 + + ##### Permissions + + Must have `manage_system` permission. + + operationId: MigrateAuthToSaml + requestBody: + content: + application/json: + schema: + type: object + required: + - from + - matches + - auto + properties: + from: + description: The current authentication type for the matched users. + type: string + matches: + description: Users map. + type: object + auto: + type: boolean + responses: + '200': + description: Successfully migrated authentication type to LDAP. + '400': + $ref: "#/components/responses/BadRequest" + '401': + $ref: "#/components/responses/Unauthorized" + '403': + $ref: "#/components/responses/Forbidden" + '501': + $ref: "#/components/responses/NotImplemented" + x-code-samples: + - lang: 'Go' + source: | + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("sysadmin@domain.com", "Password1") + + ok, response := Client.MigrateAuthToSaml(fromAuthService, usersMap, auto) + + "/api/v4/users/{user_id}/teams/{team_id}/threads": + get: + tags: + - threads + summary: Get all threads that user is following + description: | + Get all threads that user is following + + __Minimum server version__: 5.29 + + ##### Permissions + Must be logged in as the user or have `edit_other_users` permission. + operationId: GetUserThreads + parameters: + - name: user_id + in: path + description: The ID of the user. This can also be "me" which will point to the current user. + required: true + schema: + type: string + - name: team_id + in: path + description: The ID of the team in which the thread is. + required: true + schema: + type: string + - name: since + in: query + description: Since filters the threads based on their LastUpdateAt timestamp. + required: false + schema: + type: integer + - name: deleted + in: query + description: Deleted will specify that even deleted threads should be returned (For mobile sync). + required: false + schema: + type: boolean + default: false + - name: extended + in: query + description: Extended will enrich the response with participant details. + required: false + schema: + type: boolean + default: false + - name: page + in: query + description: Page specifies which part of the results to return, by PageSize. + required: false + schema: + type: integer + default: 0 + - name: pageSize + in: query + description: PageSize specifies the size of the returned chunk of results. + required: false + schema: + default: 30 + type: integer + - name: totalsOnly + in: query + description: Setting this to true will only return the total counts. + required: false + schema: + type: boolean + default: false + - name: threadsOnly + in: query + description: Setting this to true will only return threads. + required: false + schema: + type: boolean + default: false + responses: + "200": + description: User's thread retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/UserThreads" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "404": + $ref: "#/components/responses/NotFound" + + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + Client.Login("email@domain.com", "Password1") + + uss, response := Client.GetUserThreads("fc6suoon9pbbpmhrb9c967paxe", "fc6su111111pmhrb9c967paxe", model.GetUserThreadsOpts{ + Deleted: true, + Since: 123123, + Page: 0, + PageSize: 40, + }) + - lang: Curl + source: | + curl 'http://localhost:8065/api/v4/users/fc6suoon9pbbpmhrb9c967paxe/threads' \ + -H 'Authorization: Bearer 9kg8nqrnxprd9jbykqeg4r51hw' \ + + "/api/v4/users/{user_id}/teams/{team_id}/threads/mention_counts": + get: + tags: + - threads + summary: Get all unread mention counts from followed threads, per-channel + description: | + Get all unread mention counts from followed threads + + __Minimum server version__: 5.29 + + ##### Permissions + Must be logged in as the user or have `edit_other_users` permission. + operationId: GetThreadMentionCountsByChannel + parameters: + - name: user_id + in: path + description: The ID of the user. This can also be "me" which will point to the current user. + required: true + schema: + type: string + - name: team_id + in: path + description: The ID of the team in which the thread is. + required: true + schema: + type: string + responses: + "200": + description: Get was successful + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + uss, response := Client.GetThreadMentionsForUserPerChannel("fc6suoon9pbbpmhrb9c967paxe", "fc6su111111pmhrb9c967paxe") + - lang: Curl + source: | + curl -X PUT 'http://localhost:8065/api/v4/users/fc6suoon9pbbpmhrb9c967paxe/threads/mention_counts' \ + -H 'Authorization: Bearer 9kg8nqrnxprd9jbykqeg4r51hw' \ + "/api/v4/users/{user_id}/teams/{team_id}/threads/read": + put: + tags: + - threads + summary: Mark all threads that user is following as read + description: | + Mark all threads that user is following as read + + __Minimum server version__: 5.29 + + ##### Permissions + Must be logged in as the user or have `edit_other_users` permission. + operationId: UpdateThreadsReadForUser + parameters: + - name: user_id + in: path + description: The ID of the user. This can also be "me" which will point to the current user. + required: true + schema: + type: string + - name: team_id + in: path + description: The ID of the team in which the thread is. + required: true + schema: + type: string + responses: + "200": + description: User's thread update successful + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + uss, response := Client.UpdateThreadsReadForUser("fc6suoon9pbbpmhrb9c967paxe", "fc6su111111pmhrb9c967paxe") + - lang: Curl + source: | + curl -X PUT 'http://localhost:8065/api/v4/users/fc6suoon9pbbpmhrb9c967paxe/threads/read' \ + -H 'Authorization: Bearer 9kg8nqrnxprd9jbykqeg4r51hw' \ + "/api/v4/users/{user_id}/teams/{team_id}/threads/{thread_id}/read/{timestamp}": + put: + tags: + - threads + summary: Mark a thread that user is following read state to the timestamp + description: | + Mark a thread that user is following as read + + __Minimum server version__: 5.29 + + ##### Permissions + Must be logged in as the user or have `edit_other_users` permission. + operationId: UpdateThreadReadForUser + parameters: + - name: user_id + in: path + description: The ID of the user. This can also be "me" which will point to the current user. + required: true + schema: + type: string + - name: team_id + in: path + description: The ID of the team in which the thread is. + required: true + schema: + type: string + - name: thread_id + in: path + description: The ID of the thread to update + required: true + schema: + type: string + - name: timestamp + in: path + description: The timestamp to which the thread's "last read" state will be reset. + required: true + schema: + type: string + responses: + "200": + description: User's thread update successful + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + uss, response := Client.UpdateThreadReadForUser("fc6suoon9pbbpmhrb9c967paxe", "fc6su111111pmhrb9c967paxe", "f96cv0897624352346e" true) + - lang: Curl + source: | + curl -X PUT 'http://localhost:8065/api/v4/users/fc6suoon9pbbpmhrb9c967paxe/threads/f96345234975624/read' \ + -H 'Authorization: Bearer 9kg8nqrnxprd9jbykqeg4r51hw' + "/api/v4/users/{user_id}/teams/{team_id}/threads/{thread_id}/set_unread/{post_id}": + put: + tags: + - threads + summary: Mark a thread that user is following as unread based on a post id + description: | + Mark a thread that user is following as unread + + __Minimum server version__: 6.7 + + ##### Permissions + Must have `read_channel` permission for the channel the thread 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 thread for himself. + operationId: SetThreadUnreadByPostId + parameters: + - name: user_id + in: path + description: The ID of the user. This can also be "me" which will point to the current user. + required: true + schema: + type: string + - name: team_id + in: path + description: The ID of the team in which the thread is. + required: true + schema: + type: string + - name: thread_id + in: path + description: The ID of the thread to update + required: true + schema: + type: string + - name: post_id + in: path + description: The ID of a post belonging to the thread to mark as unread. + required: true + schema: + type: string + responses: + "200": + description: User's thread update successful + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + uss, response := Client.SetThreadUnreadByPostId("fc6suoon9pbbpmhrb9c967paxe", "fc6su111111pmhrb9c967paxe", "f96cv0897624352346e", "f96cv0897624352346e") + - lang: Curl + source: | + curl -X PUT 'http://localhost:8065/api/v4/users/fc6suoon9pbbpmhrb9c967paxe/teams/fc6su111111pmhrb9c967paxe/threads/f96cv0897624352346e/set_unread' \ + -H 'Authorization: Bearer 9kg8nqrnxprd9jbykqeg4r51hw' + "/api/v4/users/{user_id}/teams/{team_id}/threads/{thread_id}/following": + put: + tags: + - threads + summary: Start following a thread + description: | + Start following a thread + + __Minimum server version__: 5.29 + + ##### Permissions + Must be logged in as the user or have `edit_other_users` permission. + operationId: StartFollowingThread + parameters: + - name: user_id + in: path + description: The ID of the user. This can also be "me" which will point to the current user. + required: true + schema: + type: string + - name: team_id + in: path + description: The ID of the team in which the thread is. + required: true + schema: + type: string + - name: thread_id + in: path + description: The ID of the thread to follow + required: true + schema: + type: string + responses: + "200": + description: User's thread update successful + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + uss, response := Client.UpdateThreadFollowForUser("fc6suoon9pbbpmhrb9c967paxe", "fc6su111111pmhrb9c967paxe", "f96cv0897624352346e" true) + - lang: Curl + source: | + curl -X PUT 'http://localhost:8065/api/v4/users/fc6suoon9pbbpmhrb9c967paxe/threads/f96345234975624/followin' \ + -H 'Authorization: Bearer 9kg8nqrnxprd9jbykqeg4r51hw' \ + delete: + tags: + - threads + summary: Stop following a thread + description: | + Stop following a thread + + __Minimum server version__: 5.29 + + ##### Permissions + Must be logged in as the user or have `edit_other_users` permission. + operationId: StopFollowingThread + parameters: + - name: user_id + in: path + description: The ID of the user. This can also be "me" which will point to the current user. + required: true + schema: + type: string + - name: team_id + in: path + description: The ID of the team in which the thread is. + required: true + schema: + type: string + - name: thread_id + in: path + description: The ID of the thread to update + required: true + schema: + type: string + responses: + "200": + description: User's thread update successful + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + uss, response := Client.UpdateThreadFollowForUser("fc6suoon9pbbpmhrb9c967paxe", "fc6su111111pmhrb9c967paxe", "f96cv0897624352346e" false) + - lang: Curl + source: | + curl -X DELETE 'http://localhost:8065/api/v4/users/fc6suoon9pbbpmhrb9c967paxe/threads/f96345234975624/following' \ + -H 'Authorization: Bearer 9kg8nqrnxprd9jbykqeg4r51hw' \ + "/api/v4/users/{user_id}/teams/{team_id}/threads/{thread_id}": + get: + tags: + - threads + summary: Get a thread followed by the user + description: | + Get a thread + + __Minimum server version__: 5.29 + + ##### Permissions + Must be logged in as the user or have `edit_other_users` permission. + operationId: GetUserThread + parameters: + - name: user_id + in: path + description: The ID of the user. This can also be "me" which will point to the current user. + required: true + schema: + type: string + - name: team_id + in: path + description: The ID of the team in which the thread is. + required: true + schema: + type: string + - name: thread_id + in: path + description: The ID of the thread to follow + required: true + schema: + type: string + responses: + "200": + description: Get was successful + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "404": + $ref: "#/components/responses/NotFound" + x-code-samples: + - lang: Go + source: > + import "github.com/mattermost/mattermost-server/v5/model" + + + Client := model.NewAPIv4Client("https://your-mattermost-url.com") + + Client.Login("email@domain.com", "Password1") + + uss, response := Client.GetUserThread("fc6suoon9pbbpmhrb9c967paxe", "fc6su111111pmhrb9c967paxe", "f96cv0897624352346e") + - lang: Curl + source: | + curl -X GET 'http://localhost:8065/api/v4/users/fc6suoon9pbbpmhrb9c967paxe/threads/f96345234975624' \ + -H 'Authorization: Bearer 9kg8nqrnxprd9jbykqeg4r51hw' \ + "/api/v4/users/{user_id}/data_retention/team_policies": + get: + tags: + - data retention + summary: Get the policies which are applied to a user's teams + description: | + Gets the policies which are applied to the all of the teams to which a user belongs. + + __Minimum server version__: 5.35 + + ##### Permissions + Must be logged in as the user or have the `manage_system` permission. + + ##### License + Requires an E20 license. + operationId: GetTeamPoliciesForUser + parameters: + - name: user_id + in: path + description: The ID of the user. This can also be "me" which will point to the current user. + required: true + schema: + type: string + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of policies per page. There is a maximum limit of 200 per page. + schema: + type: integer + default: 60 + responses: + "200": + description: Teams for retention policy successfully retrieved. + content: + application/json: + schema: + $ref: "#/components/schemas/RetentionPolicyForTeamList" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" + "/api/v4/users/{user_id}/data_retention/channel_policies": + get: + tags: + - data retention + summary: Get the policies which are applied to a user's channels + description: | + Gets the policies which are applied to the all of the channels to which a user belongs. + + __Minimum server version__: 5.35 + + ##### Permissions + Must be logged in as the user or have the `manage_system` permission. + + ##### License + Requires an E20 license. + operationId: GetChannelPoliciesForUser + parameters: + - name: user_id + in: path + description: The ID of the user. This can also be "me" which will point to the current user. + required: true + schema: + type: string + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of policies per page. There is a maximum limit of 200 per page. + schema: + type: integer + default: 60 + responses: + "200": + description: Channels for retention policy successfully retrieved. + content: + application/json: + schema: + $ref: "#/components/schemas/RetentionPolicyForChannelList" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "500": + $ref: "#/components/responses/InternalServerError" + "501": + $ref: "#/components/responses/NotImplemented" diff --git a/api/v4/source/webhooks.yaml b/api/v4/source/webhooks.yaml new file mode 100644 index 0000000000..f4853f9264 --- /dev/null +++ b/api/v4/source/webhooks.yaml @@ -0,0 +1,521 @@ + /api/v4/hooks/incoming: + post: + tags: + - webhooks + summary: Create an incoming webhook + description: | + Create an incoming webhook for a channel. + ##### Permissions + `manage_webhooks` for the team the webhook is in. + + `manage_others_incoming_webhooks` for the team the webhook is in if the user is different than the requester. + operationId: CreateIncomingWebhook + requestBody: + content: + application/json: + schema: + type: object + required: + - channel_id + properties: + channel_id: + type: string + description: The ID of a public channel or private group that receives + the webhook payloads. + user_id: + type: string + description: The ID of the owner of the webhook if different than the requester. Required for [local mode](https://docs.mattermost.com/administration/mmctl-cli-tool.html#local-mode). + display_name: + type: string + description: The display name for this incoming webhook + description: + type: string + description: The description for this incoming webhook + username: + type: string + description: The username this incoming webhook will post as. + icon_url: + type: string + description: The profile picture this incoming webhook will use when + posting. + description: Incoming webhook to be created + required: true + responses: + "201": + description: Incoming webhook creation successful + content: + application/json: + schema: + $ref: "#/components/schemas/IncomingWebhook" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + get: + tags: + - webhooks + summary: List incoming webhooks + description: > + Get a page of a list of incoming webhooks. Optionally filter for a + specific team using query parameters. + + ##### Permissions + + `manage_webhooks` for the system or `manage_webhooks` for the specific team. + operationId: GetIncomingWebhooks + parameters: + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of hooks per page. + schema: + type: integer + default: 60 + - name: team_id + in: query + description: The ID of the team to get hooks for. + schema: + type: string + responses: + "200": + description: Incoming webhooks retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/IncomingWebhook" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "/api/v4/hooks/incoming/{hook_id}": + get: + tags: + - webhooks + summary: Get an incoming webhook + description: > + Get an incoming webhook given the hook id. + + ##### Permissions + + `manage_webhooks` for system or `manage_webhooks` for the specific team or `manage_webhooks` for the channel. + operationId: GetIncomingWebhook + parameters: + - name: hook_id + in: path + description: Incoming Webhook GUID + required: true + schema: + type: string + responses: + "200": + description: Webhook retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/IncomingWebhook" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + delete: + tags: + - webhooks + summary: Delete an incoming webhook + description: > + Delete an incoming webhook given the hook id. + + ##### Permissions + + `manage_webhooks` for system or `manage_webhooks` for the specific team or `manage_webhooks` for the channel. + operationId: DeleteIncomingWebhook + parameters: + - name: hook_id + in: path + description: Incoming webhook GUID + required: true + schema: + type: string + responses: + "200": + description: Webhook deletion successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + put: + tags: + - webhooks + summary: Update an incoming webhook + description: > + Update an incoming webhook given the hook id. + + ##### Permissions + + `manage_webhooks` for system or `manage_webhooks` for the specific team or `manage_webhooks` for the channel. + operationId: UpdateIncomingWebhook + parameters: + - name: hook_id + in: path + description: Incoming Webhook GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - id + - channel_id + - display_name + - description + properties: + id: + type: string + description: Incoming webhook GUID + channel_id: + type: string + description: The ID of a public channel or private group that receives + the webhook payloads. + display_name: + type: string + description: The display name for this incoming webhook + description: + type: string + description: The description for this incoming webhook + username: + type: string + description: The username this incoming webhook will post as. + icon_url: + type: string + description: The profile picture this incoming webhook will use when + posting. + description: Incoming webhook to be updated + required: true + responses: + "200": + description: Webhook update successful + content: + application/json: + schema: + $ref: "#/components/schemas/IncomingWebhook" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + /api/v4/hooks/outgoing: + post: + tags: + - webhooks + summary: Create an outgoing webhook + description: | + Create an outgoing webhook for a team. + ##### Permissions + `manage_webhooks` for the team the webhook is in. + + `manage_others_outgoing_webhooks` for the team the webhook is in if the user is different than the requester. + operationId: CreateOutgoingWebhook + requestBody: + content: + application/json: + schema: + type: object + required: + - team_id + - display_name + - trigger_words + - callback_urls + properties: + team_id: + description: The ID of the team that the webhook watchs + type: string + channel_id: + description: The ID of a public channel that the webhook watchs + type: string + creator_id: + description: The ID of the owner of the webhook if different than the requester. Required in [local mode](https://docs.mattermost.com/administration/mmctl-cli-tool.html#local-mode). + type: string + description: + description: The description for this outgoing webhook + type: string + display_name: + description: The display name for this outgoing webhook + type: string + trigger_words: + description: List of words for the webhook to trigger on + type: array + items: + type: string + trigger_when: + description: When to trigger the webhook, `0` when a trigger word is + present at all and `1` if the message starts with a trigger + word + type: integer + callback_urls: + description: The URLs to POST the payloads to when the webhook is + triggered + type: array + items: + type: string + content_type: + description: The format to POST the data in, either `application/json` or + `application/x-www-form-urlencoded` + default: application/x-www-form-urlencoded + type: string + description: Outgoing webhook to be created + required: true + responses: + "201": + description: Outgoing webhook creation successful + content: + application/json: + schema: + $ref: "#/components/schemas/OutgoingWebhook" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + get: + tags: + - webhooks + summary: List outgoing webhooks + description: > + Get a page of a list of outgoing webhooks. Optionally filter for a + specific team or channel using query parameters. + + ##### Permissions + + `manage_webhooks` for the system or `manage_webhooks` for the specific team/channel. + operationId: GetOutgoingWebhooks + parameters: + - name: page + in: query + description: The page to select. + schema: + type: integer + default: 0 + - name: per_page + in: query + description: The number of hooks per page. + schema: + type: integer + default: 60 + - name: team_id + in: query + description: The ID of the team to get hooks for. + schema: + type: string + - name: channel_id + in: query + description: The ID of the channel to get hooks for. + schema: + type: string + responses: + "200": + description: Outgoing webhooks retrieval successful + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/OutgoingWebhook" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "/api/v4/hooks/outgoing/{hook_id}": + get: + tags: + - webhooks + summary: Get an outgoing webhook + description: > + Get an outgoing webhook given the hook id. + + ##### Permissions + + `manage_webhooks` for system or `manage_webhooks` for the specific team or `manage_webhooks` for the channel. + operationId: GetOutgoingWebhook + parameters: + - name: hook_id + in: path + description: Outgoing webhook GUID + required: true + schema: + type: string + responses: + "200": + description: Outgoing webhook retrieval successful + content: + application/json: + schema: + $ref: "#/components/schemas/OutgoingWebhook" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + delete: + tags: + - webhooks + summary: Delete an outgoing webhook + description: > + Delete an outgoing webhook given the hook id. + + ##### Permissions + + `manage_webhooks` for system or `manage_webhooks` for the specific team or `manage_webhooks` for the channel. + operationId: DeleteOutgoingWebhook + parameters: + - name: hook_id + in: path + description: Outgoing webhook GUID + required: true + schema: + type: string + responses: + "200": + description: Webhook deletion successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + put: + tags: + - webhooks + summary: Update an outgoing webhook + description: > + Update an outgoing webhook given the hook id. + + ##### Permissions + + `manage_webhooks` for system or `manage_webhooks` for the specific team or `manage_webhooks` for the channel. + operationId: UpdateOutgoingWebhook + parameters: + - name: hook_id + in: path + description: outgoing Webhook GUID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - id + - channel_id + - display_name + - description + properties: + id: + type: string + description: Outgoing webhook GUID + channel_id: + type: string + description: The ID of a public channel or private group that receives + the webhook payloads. + display_name: + type: string + description: The display name for this incoming webhook + description: + type: string + description: The description for this incoming webhook + description: Outgoing webhook to be updated + required: true + responses: + "200": + description: Webhook update successful + content: + application/json: + schema: + $ref: "#/components/schemas/OutgoingWebhook" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound" + "/api/v4/hooks/outgoing/{hook_id}/regen_token": + post: + tags: + - webhooks + summary: Regenerate the token for the outgoing webhook. + description: > + Regenerate the token for the outgoing webhook. + + ##### Permissions + + `manage_webhooks` for system or `manage_webhooks` for the specific team or `manage_webhooks` for the channel. + operationId: RegenOutgoingHookToken + parameters: + - name: hook_id + in: path + description: Outgoing webhook GUID + required: true + schema: + type: string + responses: + "200": + description: Webhook token regenerate successful + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOK" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "403": + $ref: "#/components/responses/Forbidden" + "404": + $ref: "#/components/responses/NotFound"