Skip to main content

Bill8:Reporting - API (OpenAPI)

Sentin8 Bill8:Reporting - report types, runs, scheduled reports.

Generated from the service’s OpenAPI 3.1 spec (docs/openapi.json, served live at GET /openapi.json) - the source of truth is the service’s own #[utoipa::path] annotations.

10 endpoints.

reporting​

POST /v1/internal/report-schedules/run​

POST /v1/internal/report-schedules/run - the Cron proxy-back tick. Creates one run per enabled schedule for the current period; the run's (env, type, period) uniqueness (RPT-2) makes two ticks in one window produce exactly one run.

Gate: sentin8:cron:write

Responses:

StatusDescriptionBody
200Tick processed-

GET /v1/report-runs​

GET /v1/report-runs - list runs.

Gate: bill8:reporting:runs:read

Responses:

StatusDescriptionBody
200List of runsReportRun[]
403Missing bill8:reporting:runs:read-

POST /v1/report-runs​

POST /v1/report-runs - run a report (idempotent per (env_id, type, period); two identical runs yield one row).

Gate: bill8:reporting:runs:write

Request body (application/json):

FieldTypeRequiredDescription
idempotency_keystring,nullnoCaller-supplied idempotency key (a run is idempotent per (env_id, report_type, period)).
period_endstringyesReporting period end.
period_startstringyesReporting period start.
report_type_idstringyesThe report type to run.

Responses:

StatusDescriptionBody
200Report run createdReportRun
403Missing bill8:reporting:runs:write-
409Run already exists for this period (idempotent)-

GET /v1/report-runs/{id}​

GET /v1/report-runs/{id} - read one run.

Gate: bill8:reporting:runs:read

Responses:

StatusDescriptionBody
200The runReportRun
404Run not found-

GET /v1/report-schedules​

GET /v1/report-schedules - list the env's schedules.

Gate: bill8:reporting:schedules:read

Responses:

StatusDescriptionBody
200List of schedulesReportSchedule[]
403Missing bill8:reporting:schedules:read-

POST /v1/report-schedules​

POST /v1/report-schedules - create a schedule.

Gate: bill8:reporting:schedules:write

Request body (application/json):

FieldTypeRequiredDescription
intervalstringyesRun interval (daily / weekly / monthly).
report_type_idstringyesThe report type to schedule.

Responses:

StatusDescriptionBody
200Schedule createdReportSchedule
403Missing bill8:reporting:schedules:write-

DELETE /v1/report-schedules/{id}​

DELETE /v1/report-schedules/{id} - remove a schedule.

Gate: bill8:reporting:schedules:write

Responses:

StatusDescriptionBody
200Schedule deleted-
404Schedule not found-

PATCH /v1/report-schedules/{id}​

PATCH /v1/report-schedules/{id} - enable/disable a schedule.

Gate: bill8:reporting:schedules:write

Request body (application/json):

FieldTypeRequiredDescription
enabledbooleanyesEnable/disable the schedule.

Responses:

StatusDescriptionBody
200Schedule updatedReportSchedule
404Schedule not found-

GET /v1/report-types​

GET /v1/report-types - list report types.

Gate: bill8:reporting:types:read

Responses:

StatusDescriptionBody
200List of report typesReportType[]
403Missing bill8:reporting:types:read-

POST /v1/report-types​

POST /v1/report-types - create a report type.

Gate: bill8:reporting:types:write

Responses:

StatusDescriptionBody
200Report type createdReportType
403Missing bill8:reporting:types:write-