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

# Reporting

> Revenue analytics and PnL reporting

## Get Revenue Report

<ParamField path="GET" type="string" required>
  /v1/reports/revenue
</ParamField>

Get revenue report with breakdown.

### Query Parameters

<ParamField query="start_date" type="string" required>
  Start date (ISO 8601)
</ParamField>

<ParamField query="end_date" type="string" required>
  End date (ISO 8601)
</ParamField>

<ParamField query="group_by" type="string">
  Group by (agent, customer, product)
</ParamField>

<ResponseField name="revenue" type="number">
  Total revenue
</ResponseField>

<ResponseField name="breakdown" type="array">
  Revenue breakdown
</ResponseField>

<RequestExample>
  ```bash theme={null}
  curl -X GET "https://api.valmi.io/v1/reports/revenue?start_date=2024-01-01&end_date=2024-01-31&group_by=agent" \
    -H "Authorization: Bearer sk_api_abc123xyz"
  ```
</RequestExample>

## Get PnL Report

<ParamField path="GET" type="string" required>
  /v1/reports/pnl
</ParamField>

Get profit and loss report.

### Query Parameters

<ParamField query="start_date" type="string" required>
  Start date (ISO 8601)
</ParamField>

<ParamField query="end_date" type="string" required>
  End date (ISO 8601)
</ParamField>

<ResponseField name="revenue" type="number">
  Total revenue
</ResponseField>

<ResponseField name="costs" type="number">
  Total costs
</ResponseField>

<ResponseField name="margin" type="number">
  Margin (revenue - costs)
</ResponseField>

<ResponseField name="margin_percent" type="number">
  Margin percentage
</ResponseField>

<RequestExample>
  ```bash theme={null}
  curl -X GET "https://api.valmi.io/v1/reports/pnl?start_date=2024-01-01&end_date=2024-01-31" \
    -H "Authorization: Bearer sk_api_abc123xyz"
  ```
</RequestExample>
