---
title: "Get Usage By Agent"
method: GET
path: "/v1/usage/by-agent"
tags: ["usage"]
---

# Get Usage By Agent

`GET /v1/usage/by-agent`

Get usage broken down by agent for the current calendar week, month, or year.
Includes message count, completed call count, and total call seconds per agent.
Calls/messages with no agent attached are bucketed as "Unassigned".

## Query parameters

- `period` 'week' | 'month' | 'year', required
- `tz` string, nullable — IANA timezone, e.g. America/New_York

## Response `200`

Successful Response

- AgentUsageResponse
  - `data` AgentUsageItem[], required
    - `agentId` string, nullable, required
    - `agentName` string, required
    - `messages` integer, required
    - `calls` integer, required
    - `totalSeconds` integer, required
    - `isOrphan` boolean
  - `period` string, required
  - `periodStart` string, required
  - `periodEnd` string, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/agentphone/apis/agentphone-api.md) · [All operations](https://skmtc.net/agentphone/apis/agentphone-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/agentphone/agentphone-api/versions/3f3aa65dcd20/schema)
