Skip to content

Group counts for tasks

Request

Return task counts broken down by a field, in a single request — the efficient way to get per-campaign, per-sender or per-type activity without one call per slice.

group_field chooses the breakdown; filter (same fields as List tasks, composable) narrows what's counted. Response is a map of group value → count.

Common queries:

  • Connections sent per campaign (one call): { "group_field": "flow_uuid", "filter": { "type": "linkedin_send_connection_request", "status": "closed" } }
  • One campaign's full action breakdown: { "group_field": "type", "filter": { "flow_uuid": "…", "status": "closed" } }
  • Scope any of the above to a date range by adding "executed_at": { ">=": "2026-07-01", "<=": "2026-08-01" } to the filter.

Grouping is by a field, not by day — for a per-day series, loop date windows on the executed_at filter.

Security
bearerAuth
Bodyapplication/jsonrequired
group_fieldstringrequired

Field to break the counts down by.

Enum:"flow_uuid""sender_profile_uuid""type""status"
filterobject

Optional filter, same fields as List tasks (flow_uuid, type, status, sender_profile_uuid, executed_at range, …), composable.

POST
/flows/api/tasks/group-counts
curl -i -X POST \
  https://leadgen.grinfi.io/flows/api/tasks/group-counts \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "group_field": "flow_uuid",
    "filter": {
      "type": "linkedin_send_connection_request",
      "status": "closed"
    }
  }'

Responses

Map of group value → count.

Bodyapplication/json
property name*integeradditional property
Response
{ "8bc693be-acc2-4897-968a-fcd09fa74bd5": 870, "f64f42a1-e33c-4c15-988b-2b3b7d803277": 5098 }