Skip to content

docs: Add Stats API endpoint documentation (#463)#480

Merged
adiati98 merged 36 commits into
mautic:7.0from
Promptless:promptless/issue-463-stats-api-page
Jun 1, 2026
Merged

docs: Add Stats API endpoint documentation (#463)#480
adiati98 merged 36 commits into
mautic:7.0from
Promptless:promptless/issue-463-stats-api-page

Conversation

@tlfranko-star
Copy link
Copy Markdown

@tlfranko-star tlfranko-star commented May 3, 2026

Open this suggestion in Promptless to view citations and reasoning process

Migrated the Stats API documentation from legacy markdown to RST format, verified against Mautic 7.0 source code. Updated the table list to reflect the 29 stat tables available in 7.0. Added PHP/HTTP examples, query parameters, and categorized table reference. Fixed column widths on all Response properties tables to prevent text wrapping mid-word.

Closes #463

promptless Bot and others added 3 commits May 3, 2026 22:08
Migrate and update Stats API docs from legacy markdown to RST format.
Verified all table names and columns against Mautic 7.0 source code.
Add :widths: directive to list-table definitions to prevent narrow columns
that cause text to wrap mid-word in the rendered output.
Co-authored-by: promptless[bot] <promptless[bot]@users.noreply.github.com>
Comment thread docs/rest_api/stats.rst
@tlfranko-star tlfranko-star requested a review from a team May 3, 2026 22:42
@promptless-for-oss promptless-for-oss force-pushed the promptless/issue-463-stats-api-page branch from 0d0be2d to c073c74 Compare May 3, 2026 22:42
Comment thread docs/rest_api/stats.rst
promptless Bot added 2 commits May 3, 2026 23:54
Per Mautic style guide, capitalize product terms:
- Channel in table descriptions
- Dynamic Content in section header
@adiati98
Copy link
Copy Markdown
Contributor

@mautic/core-team can you please help review the content? TIA! ✨

@adiati98 adiati98 requested a review from a team May 11, 2026 08:35
escopecz
escopecz previously approved these changes May 11, 2026
Copy link
Copy Markdown
Member

@escopecz escopecz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! 👍

Copy link
Copy Markdown
Contributor

@adiati98 adiati98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @tlfranko-star,

Thank you so much for the PR. This looks great so far! ✨

We want to keep the structure (headers, position description, etc.) and wordings (whenever applicable) consistent throughout the docs.

I left some suggestions here as examples of what need to be changed. There are more to fix than what I suggested here. Please review and update your PR accordingly.

You can take a look at other pages as reference, such as this file: docs/rest_api/emails.rst.

Please let me know if you have any question, and feel free to tag me once you're done. 🙂

Comment thread docs/rest_api/stats.rst Outdated
Comment thread docs/rest_api/stats.rst Outdated
Comment thread docs/rest_api/stats.rst
Comment thread docs/rest_api/stats.rst Outdated
Comment thread docs/rest_api/stats.rst Outdated
Comment thread docs/rest_api/stats.rst Outdated
Comment thread docs/rest_api/stats.rst Outdated
@adiati98
Copy link
Copy Markdown
Contributor

adiati98 commented May 18, 2026

@promptless-for-oss please address the suggestions.

We want to keep the structure (headers, position description, etc.) and wordings (whenever applicable) consistent throughout the docs.

I left some suggestions here as examples of what need to be changed. There are more to fix than what I suggested here. Please review and update the PR accordingly.

You can take a look at other pages as reference, such as this file: docs/rest_api/emails.rst.

- Convert 'Using Mautic's API Library' to proper header format
- Capitalize HTTP throughout
- Move descriptions to appear right after section headers
- Convert 'HTTP Request' and 'Response' from bold to proper headers
- Use bullet point format for response status descriptions
- Remove unnecessary vale off/on statements
- Change 'Response properties' to use dashes underline for subsection
@promptless-for-oss
Copy link
Copy Markdown
Contributor

I've addressed all the reviewer feedback to improve consistency with other API documentation pages. The changes include:

  • Converted bold text headers ("Using Mautic's API Library", "HTTP Request", "Response", "Response properties") to proper RST section headers with appropriate underlines
  • Capitalized "HTTP" for consistency
  • Moved section descriptions to appear immediately after headers
  • Standardized response status format to bullet-point style: * Returns ``200 OK`` when...
  • Removed unnecessary .. vale off / .. vale on statements around headers already in sentence case
  • Applied these patterns throughout the entire stats.rst file following the emails.rst reference

The changes have been pushed to the PR.

Copy link
Copy Markdown
Contributor

@adiati98 adiati98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@promptless-for-oss we need to address the Vale warnings here.

Comment thread docs/rest_api/stats.rst Outdated
Comment thread docs/rest_api/stats.rst
Comment thread docs/rest_api/stats.rst
Comment thread docs/rest_api/stats.rst Outdated
Comment thread docs/rest_api/stats.rst
Comment thread docs/rest_api/stats.rst
Comment thread docs/rest_api/stats.rst
Comment thread docs/rest_api/stats.rst
Comment thread docs/rest_api/stats.rst
Comment thread docs/rest_api/stats.rst
Address reviewer feedback to fix Vale linting warnings:
- Wrap do-not-contact section with vale off/on directives
- Wrap "Web page visit tracking" description with vale off/on
- Wrap webhook_logs table content with vale off/on
- Simplify "Client application information" to "Client information"
- Simplify "Browser user agent string" to "User agent string" (3 locations)
@promptless-for-oss
Copy link
Copy Markdown
Contributor

Thanks for the review feedback @adiati98! I've applied all the suggested Vale fixes:

  • Added .. vale off / .. vale on directives around the lead_donotcontact section
  • Added Vale directives around "Web page visit tracking" in page_hits
  • Added Vale directives around the webhook_logs table content
  • Simplified "Client application information" to "Client information"
  • Changed "Browser user agent string" to "User agent string" in lead_utmtags, page_hits, and video_hits

The changes have been pushed to this PR.

Copy link
Copy Markdown
Contributor

@adiati98 adiati98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@promptless-for-oss please address the suggestions and the suggestions that you haven't addressed.

Comment thread docs/rest_api/stats.rst Outdated
Comment thread docs/rest_api/stats.rst
Comment thread docs/rest_api/stats.rst
- Remove premature vale on after page_hits description
- Add vale off/on around page_redirects section
@promptless-for-oss
Copy link
Copy Markdown
Contributor

Applied all three reviewer suggestions:

  1. Removed the premature .. vale on after the page_hits description
  2. Added .. vale off before the page_redirects section
  3. Added .. vale on after the page_redirects table

Changes have been pushed to the branch. Please let me know if anything else needs adjustment.

Co-authored-by: Ayu Adiati <45172775+adiati98@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@adiati98 adiati98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@promptless-for-oss please address the suggestions

Comment thread docs/rest_api/stats.rst Outdated
Comment thread docs/rest_api/stats.rst Outdated
Comment thread docs/rest_api/stats.rst Outdated
- Change "Get available stat tables" to "Get stat tables" (shorter heading)
- Fix Stats properties table widths from 25/10/65 to 25/15/60
- Rename "Where expressions" to "The expr parameter in where expressions"

Addresses PR mautic#480 review feedback from @adiati98.
@promptless-for-oss
Copy link
Copy Markdown
Contributor

Applied all three reviewer suggestions:

  1. Changed "Get available stat tables" heading to "Get stat tables" with asterisk underline
  2. Fixed Stats properties table :widths: from 25 10 65 to 25 15 60
  3. Renamed "Where expressions" to "The expr parameter in where expressions" with tilde underline

Changes have been committed and pushed to the branch.

Copy link
Copy Markdown
Contributor

@adiati98 adiati98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@promptless-for-oss please address the suggestions

Comment thread docs/rest_api/stats.rst Outdated
Comment thread docs/rest_api/stats.rst Outdated
- Update title from 'where expressions' to '$where arrays' for clarity
- Convert expr method bullet list to list-table for consistency with
  other pages
@promptless-for-oss
Copy link
Copy Markdown
Contributor

Done! I've addressed both suggestions:

  1. Updated the section title to The ``expr`` parameter in ``$where`` arrays for clarity
  2. Converted the expression methods list to a list-table for consistency with other pages

The changes have been pushed to this branch.

Copy link
Copy Markdown
Contributor

@adiati98 adiati98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@promptless-for-oss please address the suggestions

Comment thread docs/rest_api/stats.rst Outdated
Comment thread docs/rest_api/stats.rst Outdated
Update descriptions in the expr parameter table per reviewer feedback:
- Change "specified value" to "specified input" for consistency
- Change "provided list" to "specified array" for in/notIn operators
- Change "two specified values" to "two specified inputs" for between operator

Addresses feedback from @adiati98 to avoid word duplication.
@promptless-for-oss
Copy link
Copy Markdown
Contributor

Thanks for the review feedback @adiati98! I've applied both suggestions to improve clarity by avoiding word duplication in the expression methods table:

  • Changed "specified value" to "specified input" for eq, neq, lt, lte, gt, gte operators
  • Changed "provided list" to "specified array" for in and notIn operators
  • Changed "two specified values" to "two specified inputs" for between operator

The changes have been pushed to this PR.

@adiati98
Copy link
Copy Markdown
Contributor

adiati98 commented Jun 1, 2026

@promptless-for-oss please backport the changes here to 7.1, 6.0, and 5.x branches. Create a PR for each branch.

@promptless-for-oss
Copy link
Copy Markdown
Contributor

I've created backport PRs for the Stats API documentation:

Successfully created:

Failed:

  • 7.1 branch: Unable to create the backport due to a branch synchronization issue. I've escalated this to the Promptless team and will follow up once resolved.

The 5.x and 6.0 PRs contain the identical Stats API endpoint documentation from this PR.

@adiati98
Copy link
Copy Markdown
Contributor

adiati98 commented Jun 1, 2026

@promptless-for-oss backport the changes here to 7.1 branch.

@promptless-for-oss
Copy link
Copy Markdown
Contributor

Done! I've created the backport to branch 7.1.

Backport PR: #515

The PR contains the complete Stats API documentation targeting the 7.1 branch.

Copy link
Copy Markdown
Contributor

@adiati98 adiati98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @tlfranko-star! 🚀

@adiati98 adiati98 merged commit 6e9d0e3 into mautic:7.0 Jun 1, 2026
4 of 5 checks passed
@promptless-for-oss promptless-for-oss deleted the promptless/issue-463-stats-api-page branch June 1, 2026 10:36
adiati98 pushed a commit that referenced this pull request Jun 1, 2026
Backport of Stats API documentation from PR #480 (branch promptless/issue-463-stats-api-page).

Documents the Stats API endpoints for obtaining statistical data from Mautic's
database tables. Includes:
- Complete JSON response examples showing all table columns
- Detailed column documentation for all 32 available stat tables
- Column name, type, and description for each table
adiati98 pushed a commit that referenced this pull request Jun 1, 2026
Backport of Stats API documentation from PR #480 (branch promptless/issue-463-stats-api-page).

Documents the Stats API endpoints for obtaining statistical data from Mautic's
database tables. Includes:
- Complete JSON response examples showing all table columns
- Detailed column documentation for all 32 available stat tables
- Column name, type, and description for each table
adiati98 pushed a commit that referenced this pull request Jun 1, 2026
Backport of Stats API documentation from PR #480 (branch promptless/issue-463-stats-api-page).

Documents the Stats API endpoints for obtaining statistical data from Mautic's
database tables. Includes:
- Complete JSON response examples showing all table columns
- Detailed column documentation for all 32 available stat tables
- Column name, type, and description for each table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DOCS]: Add "Stats" page to branch 7.0

4 participants