mattermost/api
Jesse Hallam 4a93939359
MM-63728: Add license load metric endpoint and UI indicator (#30700)
* Add license load metric endpoint and UI indicator

Adds an API endpoint to calculate and return license usage as a load metric, and displays this metric in the About dialog. The metric is calculated as (MAU/licensed users)*100.

Additionally:
- Renamed function to be consistent with API endpoint name
- Added proper i18n strings for error messages and UI elements

* Fix TypeScript null check in about_build_modal.tsx

* MM-63728: Update OpenAPI documentation for license load metric

Update the OpenAPI documentation and code comments to correctly describe the license load metric calculation as using a multiplier of 1000 instead of percentage.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* MM-63728: Use float for license load metric calculation

Modify the license load metric calculation to use floats throughout the computation process while still returning an integer result. This maintains the existing API but improves the precision of the calculation.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* improve tests manually

* Update server/channels/api4/license_test.go

Co-authored-by: Doug Lauder <wiggin77@warpmail.net>

* Update server/channels/api4/license_test.go

Co-authored-by: Doug Lauder <wiggin77@warpmail.net>

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
2025-04-17 17:29:46 -03:00
..
playbooks Move API Reference (#23777) 2023-06-27 11:10:13 -03:00
server Updated API Code Samples (#24141) 2023-08-03 12:45:10 -03:00
v4 MM-63728: Add license load metric endpoint and UI indicator (#30700) 2025-04-17 17:29:46 -03:00
.gitignore Move API Reference (#23777) 2023-06-27 11:10:13 -03:00
.spectral.yaml Move API Reference (#23777) 2023-06-27 11:10:13 -03:00
CONTRIBUTING.md Move API Reference (#23777) 2023-06-27 11:10:13 -03:00
Makefile feat: Switch from Redoc to Stoplight Elements for API documentation (#30591) 2025-04-17 12:31:56 +03:00
package-lock.json chore(deps): pin whatwg-url to 12.0.0+ in /api (#27463) 2024-06-27 20:41:58 -03:00
package.json feat: Switch from Redoc to Stoplight Elements for API documentation (#30591) 2025-04-17 12:31:56 +03:00
README.md feat: Switch from Redoc to Stoplight Elements for API documentation (#30591) 2025-04-17 12:31:56 +03:00

Mattermost API Documentation

This repository holds the API reference documentation for Mattermost available at https://developers.mattermost.com/api-reference.

The Mattermost API reference uses the OpenAPI standard and the ReDoc document generator.

All documentation is available under the terms of a Creative Commons License.

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 directories. APIv4 documentation is in the v4 directory. APIs for Playbooks are retrieved from GitHub at build time and integrated into the final YAML file.

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.

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 Github Actions. When a pull request is merged, it will automatically be deployed to https://developers.mattermost.com/api-reference.