> ## Documentation Index
> Fetch the complete documentation index at: https://docs.peerlogic.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Analyze opportunities

> Use Peerlogic aggregate endpoints to analyze new-patient opportunities, win-backs, values, and per-user results.

Peerlogic provides aggregate endpoints for common opportunity reporting workflows.

| Endpoint | Purpose |
| - | - |
| `GET /api/calls/aggregates/new-patient-opportunities/` | New-patient opportunity totals and outcomes. |
| `GET /api/calls/aggregates/new-patient-winback-opportunities/` | Win-back opportunity totals and outcomes. |
| `GET /api/calls/aggregates/opportunity-values/` | Opportunity value totals. |
| `GET /api/calls/aggregates/opportunities-per-user/` | Opportunity results grouped by user. |

## Scope the report

Use `practice_ids` to select one or more authorized practices. Provide dates in `YYYY-MM-DD` format with `call_start_time_after` and `call_start_time_before`.

The start date is included and the end date is excluded. For example, use `2026-08-01` through `2026-09-01` to cover August.

```bash theme={null}
curl "https://api.prod.peerlogic.com/api/calls/aggregates/new-patient-opportunities/?practice_ids=PRACTICE_ID&call_start_time_after=2026-08-01&call_start_time_before=2026-09-01" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

## Interpret results

Aggregate response shapes differ by endpoint. Use the API Reference for the returned fields, and preserve the `filters` object when present so the report retains the scope Peerlogic applied.

When comparing periods, use adjacent non-overlapping ranges and the same practice scope. Do not combine counts from overlapping ranges.


## Related topics

- [Peerlogic API](/developer-guides.md)
- [Get opportunity](/peerlogic-api-reference/opportunities/get-opportunity.md)
- [Update opportunities](/peerlogic-api-reference/opportunities/update-opportunities.md)
- [List opportunities](/peerlogic-api-reference/opportunities/list-opportunities.md)
- [Get opportunities by practice](/peerlogic-api-reference/call-insights/get-opportunities-by-practice.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.