Skip to content

docs: Document withContactCounts parameter for Campaigns API#298

Closed
promptless-for-oss wants to merge 1 commit intomautic:5.xfrom
Promptless:promptless/pr-15878-campaign-contact-counts
Closed

docs: Document withContactCounts parameter for Campaigns API#298
promptless-for-oss wants to merge 1 commit intomautic:5.xfrom
Promptless:promptless/pr-15878-campaign-contact-counts

Conversation

@promptless-for-oss
Copy link
Copy Markdown

Open this suggestion in Promptless to view citations and reasoning process

Adds documentation for the new withContactCounts query parameter on the GET /campaigns endpoint. When provided, the API returns contactCount and contactCountFetchedAt fields for each Campaign. Also documents the 12-hour caching behavior for contact counts.

Trigger Events

mautic/mautic PR #15878: Add Contact count to Campaigns API object (#2884)

Promptless Research (1 GitHub PR)

Agent Response

I've completed the documentation update for PR #15878. Here's a summary:

Summary

I created a documentation suggestion that updates the Campaigns API documentation to cover the new withContactCounts query parameter.

Changes Made to docs/rest_api/campaigns.rst:

  1. Added withContactCounts to the Query Parameters table in the List Campaigns section, with a description explaining that it includes contact count fields and notes the 12-hour caching behavior.

  2. Added two new properties to the Campaign Properties table:

    • contactCount (int) - Number of Contacts in the Campaign
    • contactCountFetchedAt (datetime/null) - Timestamp when the Contact count was last fetched

Both new properties are documented as only being included when withContactCounts is set in the request.

Documentation Suggestion

Title: Document withContactCounts parameter for Campaigns API

URL: https://app.gopromptless.ai/suggestions/dea43f1e-23de-4f62-aa45-0a4adf29e825

This PR adds a useful feature for API consumers who need to know how many contacts are in each campaign without making additional API calls. The documentation captures both the functionality and the caching behavior (12-hour TTL) that developers should be aware of when using this parameter.


Tip: Leave inline comments with @Promptless on suggestion diffs in the Promptless dashboard for targeted refinements 💬

Signed-off-by: promptless-for-oss <promptless-for-oss@users.noreply.github.com>
@promptless-for-oss promptless-for-oss requested a review from a team as a code owner February 24, 2026 20:10
@promptless-for-oss promptless-for-oss requested review from adiati98 and favour-chibueze and removed request for a team February 24, 2026 20:10
- Only return currently published entities
* - ``minimal``
- Return only array of entities without additional lists in it
* - ``withContactCounts``
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Citation: Based on PR #15878 which adds withContactCounts query parameter to CampaignApiController.php. The implementation shows the parameter returns contactCount and contactCountFetchedAt fields, with counts cached for 12 hours via campaign_contact_count_cache_ttl.
View source

@adiati98 adiati98 added the duplicate This issue or pull request already exists label Mar 4, 2026
@adiati98
Copy link
Copy Markdown
Contributor

adiati98 commented Mar 4, 2026

@RCheesley FYI, this PR is duplication of #293.
I wonder if Promptless can also run through existing PRs to avoid duplication. 🤔

@promptless-for-oss
Copy link
Copy Markdown
Author

Promptless escalated the following message to you. If you respond, please remember to tag Promptless:

Thanks for catching this, @adiati98! You're absolutely right—my PR is a duplicate of PR #293.

I've closed my duplicate PR. The existing PR #293 has more complete documentation with the detailed note section and style improvements you've already reviewed.

Great question about avoiding duplication in the future. I've updated my workflow to check for existing open PRs in the documentation repository before creating new suggestions. When processing a product PR, I'll now search for any open docs PRs that might already cover the same feature. This should prevent duplicate work going forward. 🙂

@promptless-for-oss
Copy link
Copy Markdown
Author

I've processed your request, but no documentation changes were needed.

@promptless-for-oss
Copy link
Copy Markdown
Author

Closing this duplicate PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants