Panduan pembalasan.id
Reports

Get outgoing messages count grouped by entity

GET
/api/v2/accounts/{account_id}/reports/outgoing_messages_count

Get the count of outgoing messages grouped by a specified entity (agent, team, inbox, or label). When grouped by agent, messages sent by bots (AgentBot, Captain::Assistant) are excluded.

Note: This API endpoint is available only in Chatwoot version 4.11.0 and above.

Authorization

userApiKey
api_access_token<token>

This token can be obtained by visiting the profile page or via rails console. Provides access to endpoints based on the user permissions levels. This token can be saved by an external system when user is created via API, to perform activities on behalf of the user.

In: header

Path Parameters

account_id*integer

The numeric ID of the account

Query Parameters

group_by*string

The entity to group outgoing message counts by.

since?string

The timestamp from where report should start (Unix timestamp).

until?string

The timestamp from where report should stop (Unix timestamp).

Response Body

application/json

application/json

curl -X GET "https://example.com/api/v2/accounts/0/reports/outgoing_messages_count?group_by=agent"
[
  {
    "id": 1,
    "name": "Agent One",
    "outgoing_messages_count": 42
  },
  {
    "id": 2,
    "name": "Agent Two",
    "outgoing_messages_count": 18
  }
]
{
  "description": "string",
  "errors": [
    {
      "field": "string",
      "message": "string",
      "code": "string"
    }
  ]
}