Reports API

Reports are saved definitions for the generated analytics documents Seny produces — ad-hoc or on a schedule. This API manages the definitions and their run history; generation runs on its own cadence. Gated on reports.read / reports.write.

The report object

{
  "id":               "uuid",
  "name":             "Monthly performance",
  "widget_ids":       ["uuid"],
  "data_categories":  ["volume", "goals"],
  "format":           "document",
  "frequency":        "monthly",
  "recipients":       ["ops@dealership.example"],
  "schedule_enabled": true
}

widget_ids scopes the report to specific agents — omit it for an org-wide report. format is document, presentation, or raw; frequency is manual, daily, weekly, or monthly.

Run a report on demand

POST /api/v1/rest/reports/:id/run
GET  /api/v1/rest/reports/:id/runs/:run_id

run starts an ad-hoc generation (402 if credits are insufficient) and returns the new run; poll it with the second endpoint until status is succeeded, at which point the response includes a short-lived signed download_url for the artifact.

List & manage

GET    /api/v1/rest/reports
POST   /api/v1/rest/reports
GET    /api/v1/rest/reports/:id
PATCH  /api/v1/rest/reports/:id
DELETE /api/v1/rest/reports/:id

Run history

GET /api/v1/rest/reports/:id/runs

Each run records its status (generating, succeeded, failed) and whether it was triggered manually or by the schedule.