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

# Backfill Analytics

> Re-aggregates evaluation data for a specific date and environment.

Use this to recover analytics if a nightly cron run was missed or produced incorrect aggregates.

## Body

<ParamField body="date" type="string" required>
  Date to re-aggregate, in `YYYY-MM-DD` format.
</ParamField>

<ParamField body="environmentId" type="string" required>
  Must belong to the authenticated organization.
</ParamField>

<RequestExample>
  ```bash theme={null}
  curl -X POST https://nest.feather.mupeni.dev/v1/telemetry/backfill \
    -H "Authorization: Bearer <server_key>" \
    -H "Content-Type: application/json" \
    -d '{ "date": "2024-04-10", "environmentId": "env_01hx..." }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "date": "2024-04-10",
    "environmentId": "env_01hx...",
    "upserted": 24
  }
  ```

  ```json 503 theme={null}
  {
    "error": { "code": "SERVICE_UNAVAILABLE", "message": "Analytics service is not configured." }
  }
  ```
</ResponseExample>
