Get Usage
Return usage metrics through the frontend API surface.
GET
Get usage data
Retrieves usage statistics for agents within a specified date range.Documentation Index
Fetch the complete documentation index at: https://docs.phonely.ai/llms.txt
Use this file to discover all available pages before exploring further.
Request
Method:GETEndpoint:
/api/usageHeaders:
X-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)
Response
Success Response (200):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 error
Example
Notes
- Date range cannot exceed reasonable limits
- If no agents are found for the user, returns empty arrays with zero counts
- The
requestedAgentIdfield is only included when filtering for a specific agent
Authorizations
Query Parameters
User ID
Start date in YYYY-MM-DD format
Pattern:
^\d{4}-\d{2}-\d{2}$End date in YYYY-MM-DD format
Pattern:
^\d{4}-\d{2}-\d{2}$Optional agent ID to filter data for specific agent
Response
Successful response
Get usage data

