📊 Analytics

Use the Analytics End Points to retrieve performance and engagement data such as contact lists, pending responses, and agent response times. Useful for building dashboards or improving support workflows.

🔽 GET /api/public/analytics/contacts – Get Contacts Info

Retrieves contact information filtered by channel and ordered by field.

Click to expand full details

🔹 URL

GET /api/public/analytics/contacts

🔹 Query Parameters

NameTypeRequiredDescription
channelstringThe channel to retrieve contacts from (e.g., whatsapp)
orderBystringField to sort by (contact_created_at)
pagenumberPage number to retrieve

🔹 Headers

NameTypeRequiredDescription
x-api-keystringYour API key for authorization

🔹 Example Request

curl --request GET \
  'https://iris-backend-production.up.railway.app/api/public/analytics/contacts?channel=whatsapp&orderBy=contact_created_at&page=1' \
  --header 'x-api-key: YOUR_API_KEY'


🔽 GET /api/public/analytics/contacts/pending-responses – Get Contacts with Pending Responses

Returns contacts with unanswered messages, sorted by waiting time (descending).

Click to expand full details

🔹 URL

GET /api/public/analytics/contacts/pending-responses

🔹 Query Parameters

NameTypeRequiredDescription
channelstringChannel (e.g., whatsapp)
pipelineIdstringID of the pipeline to filter by
pagenumberPage number

🔹 Headers

NameTypeRequiredDescription
x-api-keystringYour API key for authorization

🔹 Example Request

curl --request GET \
  'https://iris-backend-production.up.railway.app/api/public/analytics/contacts/pending-responses?channel=whatsapp&pipelineId=pipeline_123&page=1' \
  --header 'x-api-key: YOUR_API_KEY'


🔽 GET /api/public/analytics/agents/response-time – Get Average Response Time by Agent

Returns average response times (in seconds) for each agent in a specified channel.

Click to expand full details

🔹 URL

GET /api/public/analytics/agents/response-time

🔹 Query Parameters

NameTypeRequiredDescription
channelstringChannel to filter (e.g., whatsapp)
pagenumberPage number

🔹 Headers

NameTypeRequiredDescription
x-api-keystringYour API key for authorization

🔹 Example Request

curl --request GET \
  'https://iris-backend-production.up.railway.app/api/public/analytics/agents/response-time?channel=whatsapp&page=1' \
  --header 'x-api-key: YOUR_API_KEY'