Skip to main content

Agent Analytics

GET /v1/agents/{agentId}/analytics returns the numbers behind the dashboard's Analytics page, one row per UTC day, for your own reports, BI tools or a daily summary to your team: new conversations, messages, the customers' mood as the AI reads it, conversations that turned angry, and the AI's completed actions. It's read-only and costs no messages. See Analytics for the dashboard page.

How do I get last week's numbers?​

curl "https://api.mojeeb.app/v1/agents/YOUR_AGENT_ID/analytics?from=2026-10-01&to=2026-10-07" \
-H "Authorization: Bearer mk_live_YOUR_KEY_HERE"

from and to are UTC days written YYYY-MM-DD, both included. Leave to out to report up to today. One call returns every metric for each day plus the window's totals, so you never need a call per metric, and a day without activity comes back with zeros, so every day of the window has its row. The longest window you can ask for, and every field, are on the Get an agent's daily analytics reference.

Common questions​

Why don't the numbers match the dashboard?​

The dashboard's preset windows roll by the hour, and its custom range starts at midnight in your browser's time zone, while the API counts whole UTC days. Pick the same UTC days in both to compare. The dashboard's Leads Captured is the API's completed_actions, and its Angry is angry_conversations.

Why is today's row still growing?​

Today isn't over, so its counts keep growing until midnight UTC. For final numbers, report up to yesterday.

Why are early days zero for messages but not for new conversations?​

Every figure but new conversations is counted from the day Mojeeb started recording analytics, so the days before it read zero, with no mood. New conversations come from the conversations themselves, so they go back further.

Why did new conversations jump after a broadcast?​

A conversation counts on the day it's created, whoever writes first, so a broadcast or a template that reaches people who had no conversation yet opens new ones. Test chats count too. A returning customer isn't new again, because their conversation is reused.

Do my team's replies count as messages?​

No. Messages are what customers send plus the AI's text replies. Your team's replies, follow-ups, files the AI sends, broadcasts, templates and API sends don't count.

Is messages the number of messages my plan counts?​

No. messages counts what customers send plus the AI's text replies, while your plan counts the AI's replies and actions, and never what customers send. For the count your plan's limit uses, see Plan and Usage.

Is completed_actions my number of leads?​

No. It counts every AI tool that succeeded, such as saving a lead, booking, adding a sheet row, a Custom API call or a webhook, once per conversation and tool. To count leads, list them with date_from and date_to; see Contacts, Notes and Leads.

How do I work out an angry rate?​

Divide angry_conversations by new_conversations, as the dashboard does. It's a rough rate: a conversation that turned angry today may have started on an earlier day.

Why is there no mood total?​

An average of daily averages would weigh a quiet day like a busy one, so the totals leave mood out. Each day has its own average_sentiment, which is null on a day with no reading.

Can I get hourly numbers, or days in my own time zone?​

Not yet. The report is by UTC day.

Which errors should I handle?​

422 invalid_date_range when to is before from, a date is later than today in UTC, or the window is too long; its message says which. 422 invalid_request_body, with param, when a date isn't written YYYY-MM-DD. See Errors.

Which scope does it need?​

analytics:read, which every key holds today; see Authentication.