GET Contacts By Tags​
GET
/reports/contacts-by-tags
Paginated contact counts per tag, most-used first.
A LEFT JOIN is used, so tags with no contacts are included with a count of 0 rather than dropped.
contact_count is a SQL aggregate and comes back as a string, not a number.
The pivot join is constrained to object_type = 'FluentCrm\App\Models\Tag' — fc_subscriber_pivot is shared between tags and lists, so the discriminator is what keeps list memberships out of these counts.
Required capability: fcrm_view_dashboard
Enforced by ReportPolicy::verifyRequest(), the policy default for this route group.
Authorizations​
ApplicationPasswords
WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password
Type
API Key (header: Authorization)
Parameters​
Query Parameters
per_page
Tags per page.
Type
integer
Default
20page
Page number.
Type
integer
Default
1Responses​
Paginated tag counts.
application/json
JSON
{
"tags": {
"total": 0,
"per_page": 0,
"current_page": 0,
"last_page": 0,
"from": 0,
"to": 0,
"next_page_url": "string",
"prev_page_url": "string",
"data": [
{
"id": 0,
"title": "string",
"contact_count": "string"
}
]
}
}