curl --request GET \
--url https://app.phonely.ai/api/usage \
--header 'X-Authorization: <api-key>'{
"summary": {
"totalCallCount": 123,
"totalCallMinutes": 123,
"agentCount": 123,
"orgCount": 123
},
"agents": [
{
"agentId": "<string>",
"agentName": "<string>",
"callCount": 123,
"callMinutes": 123,
"orgId": "<string>",
"orgName": "<string>"
}
],
"dateRange": {
"startDate": "2023-12-25",
"endDate": "2023-12-25"
},
"requestedAgentId": "<string>"
}Return usage metrics through the frontend API surface.
curl --request GET \
--url https://app.phonely.ai/api/usage \
--header 'X-Authorization: <api-key>'{
"summary": {
"totalCallCount": 123,
"totalCallMinutes": 123,
"agentCount": 123,
"orgCount": 123
},
"agents": [
{
"agentId": "<string>",
"agentName": "<string>",
"callCount": 123,
"callMinutes": 123,
"orgId": "<string>",
"orgName": "<string>"
}
],
"dateRange": {
"startDate": "2023-12-25",
"endDate": "2023-12-25"
},
"requestedAgentId": "<string>"
}GET/api/usageX-Authorization: Your API key (required)uid (string, required): Your user IDstartDate (string, required): Start date in YYYY-MM-DD formatendDate (string, required): End date in YYYY-MM-DD formatagentId (string, optional): Specific agent ID to get usage for (if not provided, returns usage for all accessible agents){
"summary": {
"totalCallCount": number,
"totalCallMinutes": number,
"agentCount": number,
"orgCount": number
},
"agents": [
{
"agentId": "string",
"agentName": "string",
"callCount": number,
"callMinutes": number,
"orgId": "string",
"orgName": "string"
}
],
"dateRange": {
"startDate": "string",
"endDate": "string"
},
"requestedAgentId": "string"
}
400 Bad Request: Missing required parameters, invalid date format, or invalid date range401 Unauthorized: Invalid or missing API key404 Not Found: User not found or agent not found/access denied500 Internal Server Error: Server errorcurl -X GET "https://app.phonely.ai/api/usage?uid=user123&startDate=2024-01-01&endDate=2024-01-31" \
-H "X-Authorization: your-api-key"
requestedAgentId field is only included when filtering for a specific agentUser ID
Start date in YYYY-MM-DD format
^\d{4}-\d{2}-\d{2}$End date in YYYY-MM-DD format
^\d{4}-\d{2}-\d{2}$Optional agent ID to filter data for specific agent
Successful response
Summary statistics for the usage data
Show child attributes
Usage data for each agent
Show child attributes
Date range for the usage data
Show child attributes
Agent ID that was specifically requested (only present when agentId parameter was provided)