> For the complete documentation index, see [llms.txt](https://docs.ibexa.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ibexa.ai/developers/rest-api/agents/get-agent-impact-metrics.md).

# Get Agent Impact Metrics

Get aggregated impact-metric totals (e.g. time saved, cost saved) for an agent.

Sums the agent's per-run impact\_metric\_value across its successful executions, grouped by the requested time period, metric\_type and unit (values in different units are never summed together). Requires platform administration role (admin or owner).

```json
{"openapi":"3.1.0","info":{"title":"Ibexa Agentic Marketing Platform","version":"0.1.0"},"security":[{"OAuth2PasswordBearer":[]}],"components":{"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/api/v1/login/access-token"}}}},"schemas":{"UsageGrouping":{"type":"string","enum":["TOTAL","DAY","MONTH","YEAR"],"title":"UsageGrouping","description":"Time-period granularity for aggregated execution usage."},"AgentImpactMetricAggregateResponseSchema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AgentImpactMetricPeriodSchema"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"AgentImpactMetricAggregateResponseSchema","description":"Aggregated impact-metric response for a single agent."},"AgentImpactMetricPeriodSchema":{"properties":{"period":{"type":"string","title":"Period","description":"Period label (e.g. '2024-01-15', '2024-01', '2024')"},"metric_type":{"type":"string","title":"Metric Type"},"unit":{"type":"string","title":"Unit"},"value":{"type":"integer","title":"Value"},"execution_count":{"type":"integer","title":"Execution Count","description":"Number of successful runs contributing to value."}},"type":"object","required":["period","metric_type","unit","value","execution_count"],"title":"AgentImpactMetricPeriodSchema","description":"Aggregated impact-metric value for one metric type/unit in a single time period, for one agent."}}},"paths":{"/api/v1/agents/{agent_id}/impact-metrics":{"get":{"tags":["agents","public"],"summary":"Get Agent Impact Metrics","description":"Get aggregated impact-metric totals (e.g. time saved, cost saved) for an agent.\n\nSums the agent's per-run impact_metric_value across its successful executions,\ngrouped by the requested time period, metric_type and unit (values in different\nunits are never summed together). Requires platform administration role (admin or owner).","operationId":"agents-get_agent_impact_metrics","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"integer","title":"Agent Id"}},{"name":"group","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/UsageGrouping"},{"type":"null"}],"description":"Time grouping granularity. If omitted, all data is aggregated into a single total.","title":"Group"},"description":"Time grouping granularity. If omitted, all data is aggregated into a single total."},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Restrict to executions triggered by this user. Defaults to all users in the organisation.","title":"User Id"},"description":"Restrict to executions triggered by this user. Defaults to all users in the organisation."},{"name":"daterange","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Date range as 'start,end' (ISO 8601 dates). Either part can be omitted, e.g. '2024-01-01,2024-12-31', '2024-01-01,' or ',2024-12-31'. A single date without a comma (e.g. '2024-01-01') is also accepted and sets date_from with an open-ended date_to.","title":"Daterange"},"description":"Date range as 'start,end' (ISO 8601 dates). Either part can be omitted, e.g. '2024-01-01,2024-12-31', '2024-01-01,' or ',2024-12-31'. A single date without a comma (e.g. '2024-01-01') is also accepted and sets date_from with an open-ended date_to."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentImpactMetricAggregateResponseSchema"}}}},"401":{"description":"User not authenticated","content":{"application/json":{}}},"403":{"description":"User lacks permission","content":{"application/json":{}}},"404":{"description":"Resource not found or user has no permission to access it","content":{"application/json":{}}}}}}}}
```
