feat: Add standalone outgoing messages count API endpoint (#13419)
This PR adds a new standalone `GET /api/v2/accounts/:id/reports/outgoing_messages_count` endpoint that returns outgoing message counts grouped by agent, team, inbox, or label.
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
tags:
|
||||
- Reports
|
||||
operationId: get-outgoing-messages-count
|
||||
summary: Get outgoing messages count grouped by entity
|
||||
security:
|
||||
- userApiKey: []
|
||||
description: |
|
||||
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.
|
||||
parameters:
|
||||
- in: query
|
||||
name: group_by
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- agent
|
||||
- team
|
||||
- inbox
|
||||
- label
|
||||
description: The entity to group outgoing message counts by.
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/outgoing_messages_count'
|
||||
'403':
|
||||
description: Access denied
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/bad_request_error'
|
||||
@@ -770,6 +770,23 @@
|
||||
get:
|
||||
$ref: './application/reports/inbox_label_matrix.yml'
|
||||
|
||||
# Outgoing messages count report
|
||||
/api/v2/accounts/{account_id}/reports/outgoing_messages_count:
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/account_id'
|
||||
- in: query
|
||||
name: since
|
||||
schema:
|
||||
type: string
|
||||
description: The timestamp from where report should start (Unix timestamp).
|
||||
- in: query
|
||||
name: until
|
||||
schema:
|
||||
type: string
|
||||
description: The timestamp from where report should stop (Unix timestamp).
|
||||
get:
|
||||
$ref: './application/reports/outgoing_messages_count.yml'
|
||||
|
||||
# Conversations Messages
|
||||
/accounts/{account_id}/conversations/{conversation_id}/messages:
|
||||
parameters:
|
||||
|
||||
Reference in New Issue
Block a user