{"openapi":"3.0.1","info":{"title":"Reports","description":"Import from \"func-asset-api-dev-ae-01\" Function App","version":"v3"},"servers":[{"url":"https://talk.perspio.io/reports/v3","description":"AU Region"},{"url":"https://us-talk.perspio.io/reports/v3","description":"US Region"}],"paths":{"/{id}":{"put":{"tags":["Reports"],"summary":"Update Report","description":"Update a report definition by id.","operationId":"updatereport","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"JSON schema describing the report shape.","example":"repdef-000001"}}],"requestBody":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/UpdateReport-RequestObject"}],"description":"JSON schema describing the report shape."},"example":{"name":"temperature_report","title":"Temperature Report Detailed","description":"Temperature Report Detailed","isCustom":true,"enabled":true,"fromDateUtc":null,"toDateUtc":null,"interval":null,"timezone":null,"format":0,"scope":{"scopeType":3,"objectRefs":["2","27","29","30","11"]},"objectOptions":1,"queryParameters":["temperature"],"reportType":1,"columns":[{"name":"date","columnType":1,"propertyName":"sourceTimeStamp","title":"Date","value":null,"format":"{0:dd/MM/yyyy hh:mm:ss tt}","dataType":null,"display":null},{"name":"key","columnType":1,"propertyName":"key","title":"Property","value":null,"format":null,"dataType":null,"display":null},{"name":"value","columnType":1,"propertyName":"value","title":"Value","value":null,"format":"{0:0.00}","dataType":null,"display":null}]}}}},"responses":{"204":{"description":"The report was updated."},"400":{"description":"Invalid Request"},"401":{"description":"Invalid API Key provided or Invalid Bearer token"},"404":{"description":"Not Found"},"500":{"description":"Internal Server Error"}}},"delete":{"tags":["Reports"],"summary":"Delete Report","description":"Delete a report definition by id.","operationId":"deletereport","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"JSON schema describing the report shape.","example":"repdef-000002"}}],"responses":{"204":{"description":"The report was deleted."},"400":{"description":"Invalid Request"},"401":{"description":"Invalid API Key provided or Invalid Bearer token"},"500":{"description":"Internal Server Error"}}},"get":{"tags":["Reports"],"summary":"Get Report","description":"Fetch a single report definition by id.","operationId":"getReport","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"JSON schema describing the report shape.","example":"repdef-000001"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Display name."},"title":{"type":"string","description":"Title."},"description":{"type":"string","description":"Free-text description."},"metricschart":{"type":"object","properties":{"type":{"type":"string","description":"Record type discriminator."},"labelX":{"type":"string","description":"Label X."},"labelY":{"type":"string","description":"Label Y."}}},"inputs":{"type":"array","items":{"type":"object","properties":{"itemId":{"type":"string","description":"Item Id."},"title":{"type":"string","description":"Title."},"type":{"type":"string","description":"Record type discriminator."},"description":{"description":"Description."},"editable":{"type":"boolean","description":"Editable."},"required":{"type":"boolean","description":"Required."},"visible":{"type":"boolean","description":"Visible."},"relatedLinks":{"type":"array","items":{}},"showInReportHeader":{"type":"boolean","description":"Show In Report Header."},"showRoundingOptions":{"type":"boolean","description":"Show Rounding Options."},"showInReportFooter":{"type":"boolean","description":"Show In Report Footer."},"defaultValue":{"type":"array","items":{"type":"string"}},"choices":{"type":"object","properties":{"104":{"type":"string","description":"104."},"105":{"type":"string","description":"105."},"daily":{"type":"string","description":"Daily."},"monthly":{"type":"string","description":"Monthly."},"1m":{"type":"string","description":"1m."},"3m":{"type":"string","description":"3m."},"6m":{"type":"string","description":"6m."},"assetId":{"type":"string","description":"Asset Id."},"none":{"type":"string","description":"None."},"lastseen":{"type":"string","description":"Lastseen."},"created":{"type":"string","description":"Created."},"24h":{"type":"string","description":"24h."},"48h":{"type":"string","description":"48h."},"72h":{"type":"string","description":"72h."},"7d":{"type":"string","description":"7d."},"14d":{"type":"string","description":"14d."},"30d":{"type":"string","description":"30d."},"byday":{"type":"string","description":"Byday."},"byhour":{"type":"string","description":"Byhour."},"day":{"type":"string","description":"Day."},"onroad":{"type":"string","description":"Onroad."},"offroad":{"type":"string","description":"Offroad."},"preferred":{"type":"string","description":"Preferred."},"actual":{"type":"string","description":"Actual."},"customer":{"type":"string","description":"Customer."},"perspio":{"type":"string","description":"Perspio."},"critical":{"type":"string","description":"Critical."},"major":{"type":"string","description":"Major."},"minor":{"type":"string","description":"Minor."},"info":{"type":"string","description":"Info."},"verbose":{"type":"string","description":"Verbose."},"temperature":{"type":"string","description":"Temperature."},"temperature1":{"type":"string","description":"Temperature1."},"temperature2":{"type":"string","description":"Temperature2."},"zone1ReturnAirTemperature":{"type":"string","description":"Zone1 Return Air Temperature."},"zone1SupplyAirTemperature":{"type":"string","description":"Zone1 Supply Air Temperature."}}}}}},"enabled":{"type":"boolean","description":"Whether the schedule is enabled."},"scope":{"type":"object","properties":{"scopeType":{"type":"number","description":"Scope Type."},"objectRefs":{"type":"array","items":{"type":"string"}}}},"display":{"description":"Display."},"reportType":{"type":"number","description":"Type/category of the report."},"reportCategory":{"type":"string","description":"Report Category."},"columns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Display name."},"columnType":{"type":"number","description":"Column Type."},"propertyName":{"type":"string","description":"Property Name."},"title":{"type":"string","description":"Title."},"value":{"description":"Value."},"format":{"type":"string","description":"Output format of the report (e.g. csv, pdf, json)."},"dataType":{"description":"Data Type."},"summarize":{"type":"boolean","description":"Summarize."},"display":{"type":"object","properties":{"width":{"type":"string","description":"Width."}}},"valueFormatter":{"type":"object","properties":{"conditions":{"type":"array","items":{"type":"object","properties":{"rule":{"type":"object","properties":{"fact":{"type":"string","description":"Fact."},"operator":{"type":"string","description":"Operator."},"value":{"description":"Value."}}},"cssclass":{"type":"string","description":"Cssclass."}}}},"cssclass":{"type":"string","description":"Cssclass."}}},"hideColumn":{"type":"object","properties":{"fact":{"type":"string","description":"Fact."},"operator":{"type":"string","description":"Operator."},"value":{"type":"string","description":"Value."}}},"unitType":{"type":"string","description":"Unit Type."},"chartAxis":{"type":"string","description":"Chart Axis."},"templateColumns":{"description":"Template Columns."}}}},"systemObjectType":{"type":"number","description":"System Object Type."},"isMulti":{"type":"boolean","description":"Is Multi."},"createdBy":{"type":"string","description":"User or system that created the record."},"createdDate":{"type":"string","description":"UTC timestamp when the record was created."},"updatedBy":{"description":"Updated By."},"ownedBy":{"description":"Owned By."},"updatedDate":{"type":"string","description":"UTC timestamp when the record was last modified."},"id":{"type":"string","description":"Unique identifier of this record."},"type":{"type":"string","description":"Record type discriminator."},"correlationId":{"description":"Correlation Id."},"_ts":{"type":"number","description":"Ts."}},"description":"JSON schema describing the report shape."},"example":{"name":"Vehicle Utilization Report","title":"Monthly Vehicle Utilization","description":"Report showing monthly vehicle utilization metrics and trends.","metricschart":{"type":"line","labelX":"Month","labelY":"Utilization %"},"inputs":[{"itemId":"period","title":"Reporting Period","type":"dropdown","description":"Select the period for the report","editable":true,"required":true,"visible":true,"relatedLinks":[],"showInReportHeader":true,"showRoundingOptions":false,"showInReportFooter":false,"defaultValue":["monthly"],"choices":{"daily":"Daily","monthly":"Monthly","1m":"Last 1 Month","3m":"Last 3 Months"}},{"itemId":"assetId","title":"Asset","type":"text","description":"ID of the asset to filter the report","editable":true,"required":false,"visible":true,"relatedLinks":[],"showInReportHeader":false,"showRoundingOptions":false,"showInReportFooter":false,"defaultValue":[],"choices":{}}],"enabled":true,"scope":{"scopeType":1,"objectRefs":["asset-12345","asset-67890"]},"display":{"theme":"light","showLegend":true},"reportType":2,"reportCategory":"Fleet Management","columns":[{"name":"month","columnType":1,"propertyName":"month","title":"Month","value":null,"format":"MMM yyyy","dataType":"tabular","summarize":false,"display":{"width":"100px"},"valueFormatter":{"conditions":[],"cssclass":""},"hideColumn":{"fact":"month","operator":"exists","value":"false"},"unitType":"none","chartAxis":"x","templateColumns":{}},{"name":"utilization","columnType":2,"propertyName":"utilization","title":"Utilization (%)","value":null,"format":"0.00","dataType":"number","summarize":true,"display":{"width":"120px"},"valueFormatter":{"conditions":[{"rule":{"fact":"utilization","operator":">","value":80},"cssclass":"high-utilization"},{"rule":{"fact":"utilization","operator":"<=","value":80},"cssclass":"normal-utilization"}],"cssclass":""},"hideColumn":{"fact":"utilization","operator":"exists","value":"false"},"unitType":"percentage","chartAxis":"y","templateColumns":{}}],"systemObjectType":10,"isMulti":false,"createdBy":"admin@example.com","createdDate":"2025-06-26T14:00:00.0000000+00:00","updatedBy":"admin@example.com","ownedBy":"fleet-management","updatedDate":"2025-06-26T15:00:00.0000000+00:00","id":"report-vehicle-utilization-001","type":"ReportDefinition","correlationId":"corr-20250626-0001","_ts":1712000000}}}},"400":{"description":"Invalid Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.Reports.ReportApi.GetReportById","errorType":"ArgumentException","statusCode":400,"request":"GET /api/reports/repdef-000001","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Invalid report id format: 'abc123'. Expected format: repdef-nnnnnn"}}}},"401":{"description":"Invalid API Key provided or Invalid Bearer token"},"404":{"description":"Resource Not Found"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.Reports.ReportApi.GetReportById","errorType":"NullReferenceException","statusCode":500,"request":"GET /api/reports/repdef-000001","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Internal Server Error: Object reference not set to an instance of an object."}}}}}}},"/{id}/data":{"get":{"tags":["Other"],"summary":"Get Report Data","description":"Run a report and return its data.","operationId":"getreportdata","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"JSON schema describing the report shape.","example":"repdef-000001"}},{"name":"timezone","in":"query","description":"Timezone in which the report data is requested","required":true,"schema":{"type":"string","description":"JSON schema describing the report shape.","example":"AUS Eastern Standard Time"}},{"name":"format","in":"query","description":"Format of the report data","required":true,"schema":{"type":"integer","description":"JSON schema describing the report shape.","example":2}},{"name":"daterange","in":"query","description":"Date range for the report data","schema":{"type":"string","description":"JSON schema describing the report shape.","example":"3;week(0)"}},{"name":"objectIds","in":"query","description":"Object IDs to fetch the report data for","schema":{"type":"string","description":"JSON schema describing the report shape.","example":"in-000052"}},{"name":"x-perspio-filter","in":"header","description":"Global data filter (JSON-serialised) scoping results to matching assets. Optional keys, each an array of strings: locationHierarchyL1..L3, productHierarchyL1..L3, operationalHierarchyL1..L3, groupIds; plus boolean 'enabled'. Omit for no additional filtering (security-group scoping always applies). Example: {\"locationHierarchyL1\":[\"NSW\"],\"enabled\":true}","schema":{"type":"string"}}],"responses":{"200":{"description":"The generated report file (CSV/PDF/Excel, depending on the report). The x-perspio-report-run-id header carries the run id when artifacts were stored.","headers":{"x-perspio-report-run-id":{"description":"Id of the stored report run (present when report artifacts were stored).","schema":{"type":"string"},"example":"rr_01HXYZ"}},"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"},"examples":{"default":{"value":null}}}}},"400":{"description":"Invalid Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.Reports.ReportApi.GetReportData","errorType":"ArgumentException","statusCode":400,"request":"GET /api/repdef-000001/data","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Invalid report id format: 'abc123'. Expected format: repdef-nnnnnn"}}}},"401":{"description":"Invalid API Key provided or Invalid Bearer token"},"404":{"description":"Resource Not Found"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.Reports.ReportApi.GetReportData","errorType":"NullReferenceException","statusCode":500,"request":"GET /api/repdef-000001/data","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Internal Server Error: Object reference not set to an instance of an object."}}}}}}},"/":{"get":{"tags":["Reports"],"summary":"Get Reports","description":"List the tenant's report definitions.","operationId":"getreports","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Display name."},"title":{"type":"string","description":"Title."},"description":{"type":"string","description":"Free-text description."},"metricschart":{"type":"object","properties":{"type":{"type":"string","description":"Record type discriminator."},"labelX":{"type":"string","description":"Label X."},"labelY":{"type":"string","description":"Label Y."}}},"inputs":{"type":"array","items":{"type":"object","properties":{"itemId":{"type":"string","description":"Item Id."},"title":{"type":"string","description":"Title."},"type":{"type":"string","description":"Record type discriminator."},"description":{"description":"Description."},"editable":{"type":"boolean","description":"Editable."},"required":{"type":"boolean","description":"Required."},"visible":{"type":"boolean","description":"Visible."},"relatedLinks":{"type":"array","items":{}},"showInReportHeader":{"type":"boolean","description":"Show In Report Header."},"showRoundingOptions":{"type":"boolean","description":"Show Rounding Options."},"showInReportFooter":{"type":"boolean","description":"Show In Report Footer."},"defaultValue":{"type":"array","items":{"type":"string"}},"choices":{"type":"object","properties":{"104":{"type":"string","description":"104."},"105":{"type":"string","description":"105."},"daily":{"type":"string","description":"Daily."},"monthly":{"type":"string","description":"Monthly."},"1m":{"type":"string","description":"1m."},"3m":{"type":"string","description":"3m."},"6m":{"type":"string","description":"6m."},"assetId":{"type":"string","description":"Asset Id."},"none":{"type":"string","description":"None."},"lastseen":{"type":"string","description":"Lastseen."},"created":{"type":"string","description":"Created."},"24h":{"type":"string","description":"24h."},"48h":{"type":"string","description":"48h."},"72h":{"type":"string","description":"72h."},"7d":{"type":"string","description":"7d."},"14d":{"type":"string","description":"14d."},"30d":{"type":"string","description":"30d."},"byday":{"type":"string","description":"Byday."},"byhour":{"type":"string","description":"Byhour."},"day":{"type":"string","description":"Day."},"onroad":{"type":"string","description":"Onroad."},"offroad":{"type":"string","description":"Offroad."},"preferred":{"type":"string","description":"Preferred."},"actual":{"type":"string","description":"Actual."},"customer":{"type":"string","description":"Customer."},"perspio":{"type":"string","description":"Perspio."},"critical":{"type":"string","description":"Critical."},"major":{"type":"string","description":"Major."},"minor":{"type":"string","description":"Minor."},"info":{"type":"string","description":"Info."},"verbose":{"type":"string","description":"Verbose."},"temperature":{"type":"string","description":"Temperature."},"temperature1":{"type":"string","description":"Temperature1."},"temperature2":{"type":"string","description":"Temperature2."},"zone1ReturnAirTemperature":{"type":"string","description":"Zone1 Return Air Temperature."},"zone1SupplyAirTemperature":{"type":"string","description":"Zone1 Supply Air Temperature."}}}}}},"enabled":{"type":"boolean","description":"Whether the schedule is enabled."},"scope":{"type":"object","properties":{"scopeType":{"type":"number","description":"Scope Type."},"objectRefs":{"type":"array","items":{"type":"string"}}}},"display":{"description":"Display."},"reportType":{"type":"number","description":"Type/category of the report."},"reportCategory":{"type":"string","description":"Report Category."},"columns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Display name."},"columnType":{"type":"number","description":"Column Type."},"propertyName":{"type":"string","description":"Property Name."},"title":{"type":"string","description":"Title."},"value":{"description":"Value."},"format":{"type":"string","description":"Output format of the report (e.g. csv, pdf, json)."},"dataType":{"description":"Data Type."},"summarize":{"type":"boolean","description":"Summarize."},"display":{"type":"object","properties":{"width":{"type":"string","description":"Width."}}},"valueFormatter":{"type":"object","properties":{"conditions":{"type":"array","items":{"type":"object","properties":{"rule":{"type":"object","properties":{"fact":{"type":"string","description":"Fact."},"operator":{"type":"string","description":"Operator."},"value":{"description":"Value."}}},"cssclass":{"type":"string","description":"Cssclass."}}}},"cssclass":{"type":"string","description":"Cssclass."}}},"hideColumn":{"type":"object","properties":{"fact":{"type":"string","description":"Fact."},"operator":{"type":"string","description":"Operator."},"value":{"type":"string","description":"Value."}}},"unitType":{"type":"string","description":"Unit Type."},"chartAxis":{"type":"string","description":"Chart Axis."},"templateColumns":{"description":"Template Columns."}}}},"systemObjectType":{"type":"number","description":"System Object Type."},"isMulti":{"type":"boolean","description":"Is Multi."},"createdBy":{"type":"string","description":"User or system that created the record."},"createdDate":{"type":"string","description":"UTC timestamp when the record was created."},"updatedBy":{"description":"Updated By."},"ownedBy":{"description":"Owned By."},"updatedDate":{"type":"string","description":"UTC timestamp when the record was last modified."},"id":{"type":"string","description":"Unique identifier of this record."},"type":{"type":"string","description":"Record type discriminator."},"correlationId":{"description":"Correlation Id."},"_ts":{"type":"number","description":"Ts."}}},"description":"JSON schema describing the report shape."},"example":[{"name":"Vehicle Utilization Report","title":"Monthly Vehicle Utilization","description":"Shows monthly utilization percentages of vehicles in the fleet.","metricschart":{"type":"line","labelX":"Month","labelY":"Utilization (%)"},"inputs":[{"itemId":"period","title":"Reporting Period","type":"dropdown","description":"Select the reporting period for the data","editable":true,"required":true,"visible":true,"relatedLinks":[],"showInReportHeader":true,"showRoundingOptions":false,"showInReportFooter":false,"defaultValue":["monthly"],"choices":{"daily":"Daily","monthly":"Monthly","1m":"Last 1 Month","3m":"Last 3 Months"}}],"enabled":true,"scope":{"scopeType":1,"objectRefs":["fleet123","fleet456"]},"display":{"theme":"light"},"reportType":2,"reportCategory":"Fleet Management","columns":[{"name":"month","columnType":1,"propertyName":"month","title":"Month","value":null,"format":"MMM yyyy","dataType":"tabular","summarize":false,"display":{"width":"100px"},"valueFormatter":{"conditions":[],"cssclass":""},"hideColumn":{"fact":"month","operator":"exists","value":"false"},"unitType":"none","chartAxis":"x","templateColumns":{}},{"name":"utilization","columnType":2,"propertyName":"utilization","title":"Utilization (%)","value":null,"format":"0.00","dataType":"number","summarize":true,"display":{"width":"120px"},"valueFormatter":{"conditions":[{"rule":{"fact":"utilization","operator":">","value":80},"cssclass":"high-utilization"},{"rule":{"fact":"utilization","operator":"<=","value":80},"cssclass":"normal-utilization"}],"cssclass":""},"hideColumn":{"fact":"utilization","operator":"exists","value":"false"},"unitType":"percentage","chartAxis":"y","templateColumns":{}}],"systemObjectType":10,"isMulti":false,"createdBy":"admin@example.com","createdDate":"2025-06-26T14:00:00.0000000+00:00","updatedBy":"admin@example.com","ownedBy":"fleet-management","updatedDate":"2025-06-26T15:00:00.0000000+00:00","id":"report-vehicle-utilization-001","type":"ReportDefinition","correlationId":"corr-20250626-0001","_ts":1712000000},{"name":"Temperature Monitoring Report","title":"Daily Temperature Trends","description":"Tracks daily temperature changes for monitored zones.","metricschart":{"type":"bar","labelX":"Day","labelY":"Temperature (°C)"},"inputs":[{"itemId":"zone","title":"Zone","type":"dropdown","description":"Select the zone to monitor","editable":true,"required":true,"visible":true,"relatedLinks":[],"showInReportHeader":true,"showRoundingOptions":false,"showInReportFooter":false,"defaultValue":["zone1SupplyAirTemperature"],"choices":{"zone1ReturnAirTemperature":"Return Air","zone1SupplyAirTemperature":"Supply Air"}}],"enabled":true,"scope":{"scopeType":2,"objectRefs":["zone1","zone2"]},"display":{"theme":"dark"},"reportType":3,"reportCategory":"Environmental Monitoring","columns":[{"name":"day","columnType":1,"propertyName":"day","title":"Day","value":null,"format":"dd MMM","dataType":"tabular","summarize":false,"display":{"width":"80px"},"valueFormatter":{"conditions":[],"cssclass":""},"hideColumn":{"fact":"day","operator":"exists","value":"false"},"unitType":"none","chartAxis":"x","templateColumns":{}},{"name":"temperature","columnType":2,"propertyName":"temperature","title":"Temperature (°C)","value":null,"format":"0.0","dataType":"number","summarize":true,"display":{"width":"100px"},"valueFormatter":{"conditions":[{"rule":{"fact":"temperature","operator":">","value":25},"cssclass":"high-temp"},{"rule":{"fact":"temperature","operator":"<=","value":25},"cssclass":"normal-temp"}],"cssclass":""},"hideColumn":{"fact":"temperature","operator":"exists","value":"false"},"unitType":"celsius","chartAxis":"y","templateColumns":{}}],"systemObjectType":11,"isMulti":true,"createdBy":"sensoradmin@example.com","createdDate":"2025-06-25T10:00:00.0000000+00:00","updatedBy":"sensoradmin@example.com","ownedBy":"environment-monitoring","updatedDate":"2025-06-26T10:30:00.0000000+00:00","id":"report-temp-monitoring-001","type":"ReportDefinition","correlationId":"corr-20250625-0023","_ts":1711900000}]}}},"400":{"description":"Invalid Request"},"401":{"description":"Invalid API Key provided or Invalid Bearer token"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.Reports.ReportApi.GetReports","errorType":"NullReferenceException","statusCode":500,"request":"GET /api/reports","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Internal Server Error: Object reference not set to an instance of an object."}}}}}},"post":{"tags":["Reports"],"summary":"Create Report","description":"Create a new report definition.","operationId":"createreport","requestBody":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/CreateReport-RequestObject"}],"description":"JSON schema describing the report shape."},"example":{"name":"temperature_report","title":"Temperature Report Detailed","description":"Temperature Report Detailed","isCustom":true,"enabled":true,"fromDateUtc":null,"toDateUtc":null,"interval":null,"timezone":null,"format":0,"scope":{"scopeType":3,"objectRefs":["2","27","29","30","11"]},"objectOptions":1,"queryParameters":["temperature"],"reportType":1,"columns":[{"name":"date","columnType":1,"propertyName":"sourceTimeStamp","title":"Date","value":null,"format":"{0:dd/MM/yyyy hh:mm:ss tt}","dataType":null,"display":null},{"name":"key","columnType":1,"propertyName":"key","title":"Property","value":null,"format":null,"dataType":null,"display":null},{"name":"value","columnType":1,"propertyName":"value","title":"Value","value":null,"format":"{0:0.00}","dataType":null,"display":null}]}}}},"responses":{"201":{"description":"The report definition was created."},"400":{"description":"Invalid Request"},"401":{"description":"Invalid API Key provided or Invalid Bearer token"},"500":{"description":"Internal Server Error"}}}},"/{id}/dictionaries":{"get":{"tags":["Other"],"summary":"Get Report Dictionaries","description":"List the report dictionaries (lookup metadata for report fields).","operationId":"getreportdictionaries","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"JSON schema describing the report shape.","example":"repdef-000001"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"report-types":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string","description":"Value."},"name":{"type":"string","description":"Display name."},"title":{"type":"string","description":"Title."}}}},"aggfunc-names":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string","description":"Value."},"name":{"type":"string","description":"Display name."},"title":{"type":"string","description":"Title."}}}}},"description":"JSON schema describing the report shape."},"example":{"report-types":[{"value":"summary","name":"SummaryReport","title":"Summary Report"},{"value":"detailed","name":"DetailedReport","title":"Detailed Report"},{"value":"trend","name":"TrendReport","title":"Trend Analysis Report"}],"aggfunc-names":[{"value":"sum","name":"Sum","title":"Sum"},{"value":"avg","name":"Average","title":"Average"},{"value":"max","name":"Maximum","title":"Maximum"},{"value":"min","name":"Minimum","title":"Minimum"},{"value":"count","name":"Count","title":"Count"}]}}}},"400":{"description":"Invalid Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.Reports.ReportApi.GetReportDictionaries","errorType":"ArgumentException","statusCode":400,"request":"GET /api/repdef-000001/dictionaries","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Invalid report id format: 'abc123'. Expected format: repdef-nnnnnn"}}}},"401":{"description":"Invalid API Key provided or Invalid Bearer token"},"404":{"description":"Resource Not Found"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.Reports.ReportApi.GetReportDictionaries","errorType":"NullReferenceException","statusCode":500,"request":"GET /api/repdef-000001/dictionaries","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Internal Server Error: Object reference not set to an instance of an object."}}}}}}},"/{id}/schema":{"get":{"tags":["Other"],"summary":"Get Report Schema","description":"Fetch the schema for a report.","operationId":"getreportschema","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"JSON schema describing the report shape.","example":"repdef-000001"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"itemId":{"type":"string","description":"Item Id."},"title":{"type":"string","description":"Title."},"type":{"type":"string","description":"Record type discriminator."},"description":{"description":"Description."},"editable":{"type":"boolean","description":"Editable."},"required":{"type":"boolean","description":"Required."},"visible":{"type":"boolean","description":"Visible."},"relatedLinks":{"type":"array","items":{}},"showInReportHeader":{"type":"boolean","description":"Show In Report Header."},"showRoundingOptions":{"type":"boolean","description":"Show Rounding Options."},"showInReportFooter":{"type":"boolean","description":"Show In Report Footer."},"choices":{"type":"object","properties":{"*":{"type":"string","description":"*."}}}}},"description":"JSON schema describing the report shape."},"example":[{"itemId":"frequency","title":"Report Frequency","type":"select","description":"Select how often the report should be generated","editable":true,"required":true,"visible":true,"relatedLinks":[],"showInReportHeader":true,"showRoundingOptions":false,"showInReportFooter":false,"choices":{"daily":"Daily","weekly":"Weekly","monthly":"Monthly"}},{"itemId":"includeGraphs","title":"Include Graphs","type":"boolean","description":"Whether to include graphs in the report","editable":true,"required":false,"visible":true,"relatedLinks":[],"showInReportHeader":false,"showRoundingOptions":false,"showInReportFooter":true,"choices":{}},{"itemId":"thresholdLevel","title":"Threshold Level","type":"select","description":"Choose the threshold level for alerts","editable":true,"required":false,"visible":true,"relatedLinks":[{"url":"https://example.com/threshold-info","label":"More info"}],"showInReportHeader":true,"showRoundingOptions":true,"showInReportFooter":false,"choices":{"low":"Low","medium":"Medium","high":"High","critical":"Critical"}}]}}},"400":{"description":"Invalid Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.Reports.ReportApi.GetReportSchema","errorType":"ArgumentException","statusCode":400,"request":"GET /api/repdef-000001/schema","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Invalid report id format: 'abc123'. Expected format: repdef-nnnnnn"}}}},"401":{"description":"Invalid API Key provided or Invalid Bearer token"},"404":{"description":"Resource Not Found"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.Reports.ReportApi.GetReportSchema","errorType":"NullReferenceException","statusCode":500,"request":"GET /api/repdef-000001/schema","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Internal Server Error: Object reference not set to an instance of an object."}}}}}}},"/{id}/history":{"get":{"tags":["Other"],"summary":"Get Report History","description":"List the run history for a report.","operationId":"getreporthistory","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"JSON schema describing the report shape.","example":"repdef-000001"}},{"name":"useremail","in":"query","description":"User's email address","required":true,"schema":{"type":"string","description":"JSON schema describing the report shape.","example":"bhanu@inauro.io"}},{"name":"page_size","in":"query","description":"Number of records per page","required":true,"schema":{"type":"integer","description":"JSON schema describing the report shape.","example":10}}],"responses":{"200":{"description":"Success","headers":{"ContinuationToken":{"description":"Token to pass back (ContinuationToken header) for the next page; absent on the last page.","schema":{"type":"string"},"example":"eyJ0b2tlbiI6IjEwMDAifQ=="},"ResultCount":{"description":"Number of items returned in this page.","schema":{"type":"integer","format":"int64"},"example":50},"TotalCount":{"description":"Total number of items matching the request across all pages.","schema":{"type":"integer","format":"int64"},"example":1372}},"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"objectId":{"type":"string","description":"Object Id."},"tenantId":{"description":"Tenant Id."},"correlationId":{"type":"string","description":"Client-supplied correlation id, echoed back for request tracing."},"dateUtc":{"type":"string","description":"Date Utc."},"id":{"description":"Id."},"userIpAddress":{"type":"string","description":"User Ip Address."},"userEmail":{"type":"string","description":"User Email."},"userId":{"type":"string","description":"User Id."},"userName":{"type":"string","description":"User Name."},"backendName":{"type":"string","description":"Backend Name."},"backendUrl":{"type":"string","description":"Backend Url."},"subscription":{"type":"string","description":"Subscription."},"responseCode":{"type":"number","description":"Response Code."},"queryString":{"type":"string","description":"Query String."},"url":{"type":"string","description":"Download URL for the saved report."},"method":{"type":"string","description":"Method."},"durationMilliseconds":{"description":"Duration Milliseconds."}}},"description":"JSON schema describing the report shape."},"example":[{"objectId":"obj12345","tenantId":"tenant98765","correlationId":"corr-abc-001","dateUtc":"2025-06-26T06:30:00.0000000+00:00","id":"log001","userIpAddress":"192.168.1.10","userEmail":"user@example.com","userId":"user-001","userName":"John Doe","backendName":"AuthService","backendUrl":"https://api.example.com/auth","subscription":"sub-555","responseCode":200,"queryString":"action=login&redirect=/dashboard","url":"/api/auth/login","method":"POST","durationMilliseconds":153},{"objectId":"obj12346","tenantId":"tenant98765","correlationId":"corr-abc-002","dateUtc":"2025-06-26T06:35:00.0000000+00:00","id":"log002","userIpAddress":"192.168.1.11","userEmail":"jane.doe@example.com","userId":"user-002","userName":"Jane Doe","backendName":"DataService","backendUrl":"https://api.example.com/data","subscription":"sub-555","responseCode":404,"queryString":"item=1234","url":"/api/data/item","method":"GET","durationMilliseconds":45}]}}},"400":{"description":"Invalid Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.Reports.ReportApi.GetReportHistory","errorType":"ArgumentException","statusCode":400,"request":"GET /api/repdef-000001/history","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Invalid report id format: 'abc123'. Expected format: repdef-nnnnnn"}}}},"401":{"description":"Invalid API Key provided or Invalid Access token"},"404":{"description":"Resource Not Found"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.Reports.ReportApi.GetReportHistory","errorType":"NullReferenceException","statusCode":500,"request":"GET /api/repdef-000001/history","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Internal Server Error: Object reference not set to an instance of an object."}}}}}}},"/{reportId}/schedules":{"post":{"tags":["Scheduled Reports"],"summary":"Create Report Schedule","description":"Create a new schedule for a report.","operationId":"createreportschedule","parameters":[{"name":"reportId","in":"path","required":true,"schema":{"type":"string","description":"JSON schema describing the report shape.","example":"repdef-000001"}}],"requestBody":{"description":"Scheduled report definition","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ScheduledReportDefinition"}],"description":"JSON schema describing the report shape."},"example":{"name":"Weekly Fleet Utilisation","to":["ops@contoso.com","fleet-manager@contoso.com"],"subject":"Weekly Fleet Utilisation Report","reportQuery":"?from=2026-06-23&to=2026-06-30&groupBy=site","schedule":{"frequency":"Weekly","dayOfWeek":"Monday","timeUtc":"2026-08-06T06:00:00.0000000+00:00"},"reportId":"fleet-utilisation"}}}},"responses":{"200":{"description":"The report schedule was created.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ScheduledReportDefinition"}],"description":"JSON schema describing the report shape."},"example":{"id":"sr_01HXYZ","name":"Weekly Fleet Utilisation","to":["ops@contoso.com","fleet-manager@contoso.com"],"subject":"Weekly Fleet Utilisation Report","reportQuery":"?from=2026-06-23&to=2026-06-30&groupBy=site","schedule":{"frequency":"Weekly","dayOfWeek":"Monday","timeUtc":"2026-08-06T06:00:00.0000000+00:00"},"reportId":"fleet-utilisation","lastRunTimeStampUtc":"2026-06-30T06:00:00.0000000+00:00"}}}},"400":{"description":"Invalid Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.Reports.ReportApi.CreateScheduledReport","errorType":"ArgumentException","statusCode":400,"request":"POST /api/repdef-000001/schedules","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Invalid report id format: 'abc123'. Expected format: repdef-nnnnnn"}}}},"401":{"description":"Invalid API Key provided or Invalid Access token"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.Reports.ReportApi.CreateScheduledReport","errorType":"NullReferenceException","statusCode":500,"request":"POST /api/repdef-000001/schedules","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Internal Server Error: Object reference not set to an instance of an object."}}}}}},"get":{"tags":["Scheduled Reports"],"summary":"Get Report Schedules","description":"Fetch all schedules of a report.","operationId":"getreportschedules","parameters":[{"name":"reportId","in":"path","required":true,"schema":{"type":"string","description":"JSON schema describing the report shape.","example":"repdef-000001"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Display name."},"to":{"type":"array","items":{"type":"string"}},"subject":{"type":"string","description":"Subject."},"reportQuery":{"type":"string","description":"Report Query."},"schedule":{"type":"array","items":{"type":"object","properties":{"dayOfWeek":{"type":"number","description":"Day Of Week."},"timeIntervals":{"type":"string","description":"Time Intervals."}}},"description":"Schedule expression/definition."},"id":{"type":"string","description":"Unique identifier of this record."},"reportId":{"description":"Report Id."}},"description":"JSON schema describing the report shape."},"example":{"name":"Weekly Sales Report","to":["manager@example.com","saleslead@example.com"],"subject":"Your Weekly Sales Summary","reportQuery":"SELECT * FROM sales WHERE date >= CURRENT_DATE - INTERVAL '7 days'","schedule":[{"dayOfWeek":1,"timeIntervals":"2026-08-21T08:00:00.0000000-10:00"},{"dayOfWeek":4,"timeIntervals":"2026-08-21T08:00:00.0000000-10:00"}],"id":"report-schedule-001","reportId":"report-1234"}}}},"400":{"description":"Invalid Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.Reports.ReportApi.GetScheduledReports","errorType":"ArgumentException","statusCode":400,"request":"GET /api/repdef-000001/schedules","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Invalid report id format: 'abc123'. Expected format: repdef-nnnnnn"}}}},"401":{"description":"Invalid API Key provided or Invalid Access token"},"404":{"description":"Resource Not Found"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.Reports.ReportApi.GetScheduledReports","errorType":"NullReferenceException","statusCode":500,"request":"GET /api/repdef-000001/schedules","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Internal Server Error: Object reference not set to an instance of an object."}}}}}}},"/{reportId}/schedules/{id}":{"delete":{"tags":["Scheduled Reports"],"summary":"Delete Report Schedule","description":"Delete a report schedule by id.","operationId":"deletereportschedule","parameters":[{"name":"reportId","in":"path","required":true,"schema":{"type":"string","description":"JSON schema describing the report shape.","example":"repdef-000001"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"JSON schema describing the report shape.","example":"in-wf-000079"}}],"responses":{"200":{"description":"The report schedule was deleted."},"400":{"description":"Invalid Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.Reports.ReportApi.DeleteScheduledReport","errorType":"ArgumentException","statusCode":400,"request":"DELETE /api/repdef-000001/schedules/repdef-000001","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Invalid report id format: 'abc123'. Expected format: repdef-nnnnnn"}}}},"401":{"description":"Invalid API Key provided or Invalid Access token"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.Reports.ReportApi.DeleteScheduledReport","errorType":"NullReferenceException","statusCode":500,"request":"DELETE /api/repdef-000001/schedules/repdef-000001","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Internal Server Error: Object reference not set to an instance of an object."}}}}}},"put":{"tags":["Scheduled Reports"],"summary":"Update Report Schedule","description":"Update a report schedule by id.","operationId":"updatereportschedule","parameters":[{"name":"reportId","in":"path","required":true,"schema":{"type":"string","description":"JSON schema describing the report shape.","example":"repdef-000001"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"JSON schema describing the report shape.","example":"in-wf-000079"}}],"requestBody":{"description":"Scheduled report definition to update","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ScheduledReportDefinition"}],"description":"JSON schema describing the report shape."},"example":{"name":"Updated Weekly Sales Report","to":["manager@example.com","finance@example.com"],"subject":"Updated Weekly Sales Report - July 2025","reportQuery":"SELECT * FROM Sales WHERE Date > NOW() - INTERVAL 7 DAY","schedule":{"description":"Schedule expression/definition.","type":"cron","cronExpression":"0 9 * * 1","timeZone":"Australia/Sydney"},"id":"schedule-123","reportId":"report-456","lastRunTimeStampUtc":"2025-07-15T10:00:00.0000000+00:00"}}}},"responses":{"200":{"description":"The report schedule was updated."},"400":{"description":"Invalid Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.Reports.ReportApi.UpdateScheduledReport","errorType":"ArgumentException","statusCode":400,"request":"PUT /api/repdef-000001/schedules/repdef-000001","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Invalid report id format: 'abc123'. Expected format: repdef-nnnnnn"}}}},"401":{"description":"Invalid API Key provided or Invalid Access token"},"404":{"description":"Not Found"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.Reports.ReportApi.UpdateScheduledReport","errorType":"NullReferenceException","statusCode":500,"request":"PUT /api/repdef-000001/schedules/repdef-000001","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Internal Server Error: Object reference not set to an instance of an object."}}}}}},"get":{"tags":["Scheduled Reports"],"summary":"Get Report Schedule","description":"Fetch a single report schedule by id.","operationId":"getReportSchedule","parameters":[{"name":"reportId","in":"path","required":true,"schema":{"type":"string","description":"JSON schema describing the report shape.","example":"repdef-000001"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"JSON schema describing the report shape."}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Display name."},"to":{"type":"array","items":{"type":"string"}},"subject":{"type":"string","description":"Subject."},"reportQuery":{"type":"string","description":"Report Query."},"schedule":{"type":"array","items":{"type":"object","properties":{"dayOfWeek":{"type":"number","description":"Day Of Week."},"timeIntervals":{"type":"string","description":"Time Intervals."}}},"description":"Schedule expression/definition."},"id":{"type":"string","description":"Unique identifier of this record."},"reportId":{"description":"Report Id."}},"description":"JSON schema describing the report shape."},"example":{"name":"Monthly Performance Report","to":["teamlead@example.com","ceo@example.com"],"subject":"Monthly Performance Summary","reportQuery":"SELECT * FROM performance_metrics WHERE month = CURRENT_MONTH","schedule":[{"dayOfWeek":5,"timeIntervals":"2026-08-21T09:00:00.0000000-11:00"}],"id":"schedule-789","reportId":"report-5678"}}}},"400":{"description":"Invalid Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.Reports.ReportApi.GetScheduledReport","errorType":"ArgumentException","statusCode":400,"request":"GET /api/repdef-000001/schedules/repdef-000001","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Invalid report id format: 'abc123'. Expected format: repdef-nnnnnn"}}}},"401":{"description":"Invalid API Key provided or Invalid Access token"},"404":{"description":"Resource Not Found"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.Reports.ReportApi.GetScheduledReport","errorType":"NullReferenceException","statusCode":500,"request":"GET /api/repdef-000001/schedules/repdef-000001","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Internal Server Error: Object reference not set to an instance of an object."}}}}}}},"/reportstask/{id}/data":{"post":{"tags":["Other"],"summary":"Create Report Data Job","description":"Submit an asynchronous report-data job; returns 202 Accepted with the job reference.","operationId":"createReportDataJob","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"JSON schema describing the report shape.","example":"repdef-000001"}},{"name":"timezone","in":"query","description":"Timezone in which the report data is requested","required":true,"schema":{"type":"string","description":"JSON schema describing the report shape.","example":"AUS Eastern Standard Time"}},{"name":"format","in":"query","description":"Format of the report data","required":true,"schema":{"type":"integer","description":"JSON schema describing the report shape.","example":2}},{"name":"daterange","in":"query","description":"Date range for the report data","schema":{"type":"string","description":"JSON schema describing the report shape.","example":"3;week(0)"}},{"name":"objectIds","in":"query","description":"Object IDs to fetch the report data for","schema":{"type":"string","description":"JSON schema describing the report shape.","example":"in-000052"}}],"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"type":"object","properties":{"statusUrl":{"type":"string","description":"Status Url.","nullable":true}},"description":"JSON schema describing the report shape."},"example":{"statusUrl":"https://talk.perspio.dev/tasks/v3/in-task-61667e2d-5268-42fa-bd82-87cf66d7188a"}}}},"400":{"description":"Invalid Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.Reports.ReportApi.SubmitGetReportDataTask","errorType":"ArgumentException","statusCode":400,"request":"POST /api/reportstask/repdef-000001/data","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Invalid report id format: 'abc123'. Expected format: repdef-nnnnnn"}}}},"401":{"description":"Invalid API Key provided or Invalid Bearer token"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.Reports.ReportApi.SubmitGetReportDataTask","errorType":"NullReferenceException","statusCode":500,"request":"POST /api/reportstask/repdef-000001/data","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Internal Server Error: Object reference not set to an instance of an object."}}}}}}},"/scheduled":{"get":{"tags":["Scheduled Reports"],"summary":"Get Tenant Scheduled Reports","description":"List the tenant's scheduled reports.","operationId":"getTenantScheduledReports","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Display name."},"to":{"type":"array","items":{"type":"string"}},"subject":{"type":"string","description":"Subject."},"reportQuery":{"type":"string","description":"Report Query."},"schedule":{"type":"array","items":{"type":"object","properties":{"dayOfWeek":{"type":"number","description":"Day Of Week."},"timeIntervals":{"type":"string","description":"Time Intervals."}}},"description":"Schedule expression/definition."},"id":{"type":"string","description":"Unique identifier of this record."},"reportId":{"type":"string","description":"Unique identifier of the report."}}},"description":"JSON schema describing the report shape."},"example":[{"name":"Weekly Sales Report","to":["sales@example.com","manager@example.com"],"subject":"Weekly Sales Summary","reportQuery":"SELECT * FROM sales_data WHERE week = CURRENT_WEEK","schedule":[{"dayOfWeek":1,"timeIntervals":"2026-08-21T08:00:00.0000000-10:00"}],"id":"schedule-001","reportId":"report-001"},{"name":"Monthly Inventory Report","to":["inventory@example.com"],"subject":"Monthly Inventory Overview","reportQuery":"SELECT * FROM inventory WHERE month = CURRENT_MONTH","schedule":[{"dayOfWeek":5,"timeIntervals":"14:00-16:00"}],"id":"schedule-002","reportId":"report-002"}]}}},"400":{"description":"Invalid Request"},"401":{"description":"Invalid API Key provided or Invalid Access token"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.Reports.ReportApi.GetTenantScheduledReports","errorType":"NullReferenceException","statusCode":500,"request":"GET /api/scheduled","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Internal Server Error: Object reference not set to an instance of an object."}}}}}}},"/saved":{"get":{"tags":["Saved Reports"],"summary":"Get Saved Reports","description":"List the saved report documents.","operationId":"getSavedReports","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of this record."},"taskId":{"type":"string","description":"Task Id."},"reportQuery":{"type":"string","description":"Report Query."},"instanceId":{"type":"string","description":"Instance Id."},"createdDate":{"type":"string","description":"UTC timestamp when the record was created."},"status":{"type":"integer","description":"Current status of the report or job."},"reportUrl":{"type":"string","description":"Report Url."}}},"description":"JSON schema describing the report shape."},"example":[{"id":"run-001","taskId":"task-123","reportQuery":"SELECT * FROM sales WHERE date >= '2025-01-01'","instanceId":"instance-789","createdDate":"2025-06-26T10:00:00.0000000+00:00","status":1,"reportUrl":"https://example.com/reports/run-001"},{"id":"run-002","taskId":"task-456","reportQuery":"SELECT * FROM inventory WHERE quantity < 10","instanceId":"instance-101","createdDate":"2025-06-25T15:30:00.0000000+00:00","status":2,"reportUrl":"https://example.com/reports/run-002"}]}}},"400":{"description":"Invalid Request"},"401":{"description":"Invalid API Key provided or Invalid Access token"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.Reports.ReportApi.GetSavedReports","errorType":"NullReferenceException","statusCode":500,"request":"GET /api/saved","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Internal Server Error: Object reference not set to an instance of an object."}}}}}}},"/saved/{id}/file":{"get":{"tags":["Saved Reports"],"summary":"Get Saved Report","description":"Fetch a saved report document by name.","operationId":"getSavedReport","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"JSON schema describing the report shape.","example":"repdef-000001"}},{"name":"name","in":"query","description":"File Path","required":true,"schema":{"type":"string","description":"JSON schema describing the report shape.","example":"repdef-000003/rep-e7aa98ef-f1b7-495f-97e7-0a285a79bf42"}},{"name":"includeReferences","in":"query","description":"When true, include referenced objects in the saved report response.","schema":{"type":"boolean"},"example":"False"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReportDocumentsResponseObject"},"description":"JSON schema describing the report shape."},"example":[{"createdDate":"2025-06-26T12:00:00.0000000+00:00","name":"Monthly Sales Report","contentType":"application/pdf","description":"This report contains the monthly sales data for June 2025.","updatedDate":"2025-06-26T02:30:00.0000000+00:00"}]}}},"400":{"description":"Invalid Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.Documents.DocumentServicesApi.GetAllDocuments","errorType":"ArgumentException","statusCode":400,"request":"GET /api/repdef-000001/documents","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Invalid report id format: 'abc123'. Expected format: repdef-nnnnnn"}}}},"401":{"description":"Invalid API Key provided or Invalid Bearer token"},"404":{"description":"Resource Not Found"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.Documents.DocumentServicesApi.GetAllDocuments","errorType":"NullReferenceException","statusCode":500,"request":"GET /api/repdef-000001/documents","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Internal Server Error: Object reference not set to an instance of an object."}}}}}}},"/{id}/ai/analyse":{"post":{"tags":["AI Analysis"],"summary":"Analyse Report Data with AI","description":"Submit report data for AI analysis. On success, `metadata.perspioAITokens` is billed Perspio AI tokens (PATs), not the raw LLM `tokensUsed` count.","operationId":"analyseReportData","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"JSON schema describing the report shape.","example":"repdef-000013"}},{"name":"model","in":"query","description":"Optional model override. Canonical channel for overriding the model; takes precedence over the deprecated `AIAnalysisRequest.model` body field when both are supplied.","schema":{"type":"string","description":"JSON schema describing the report shape."}}],"requestBody":{"description":"AI analysis request: send `skillId` and `reportRunId`. The service loads report CSV and context from the report-run artifact store.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AIAnalysisRequest"}],"description":"JSON schema describing the report shape."},"example":{"skillId":"skill-key-insights","reportRunId":"rrun-20260212-001","correlationId":"corr-20260212-001"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AIAnalysisResponse"}],"description":"JSON schema describing the report shape."},"example":{"isSuccess":false,"aiRunId":"value","skillId":"value","content":"value","reportRunId":"value","aiResultBlobUrl":"value","title":"value","summary":"value","metadata":{"correlationId":"value","processingTimeMs":0,"perspioAITokens":0,"completedAt":"value","toolCallCount":0,"toolCallIterations":0,"toolsUsed":"value"},"error":{"errorCode":"value","message":"value","userAction":"value","details":{},"correlationId":"value","timestamp":"value"},"guardrail":{}}}}},"400":{"description":"Invalid Request","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AIErrorResponse"}],"description":"JSON schema describing the report shape."},"example":{"code":"INVALID_REQUEST","message":"Request body is required","userAction":"Correct the request and retry.","correlationId":"strm-20260630-015500-502-b7cc0","details":null}}}},"401":{"description":"Invalid API Key provided or Invalid Bearer token"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AIErrorResponse"}],"description":"JSON schema describing the report shape."},"example":{"code":"LLM_ERROR","message":"The AI provider returned an error.","userAction":"Retry later; contact support if the error persists.","correlationId":"strm-20260630-015500-502-b7cc0","details":null}}}}}}},"/{id}/ai/estimate":{"post":{"tags":["AI Analysis"],"summary":"Estimate AI usage and cost before analysis","description":"Estimate Perspio AI token burn and quota headroom for the same request shape as analyse.","operationId":"estimateReportData","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"JSON schema describing the report shape.","example":"repdef-000013"}},{"name":"model","in":"query","description":"Optional model override. Canonical channel for overriding the model; takes precedence over the deprecated `AIAnalysisRequest.model` body field when both are supplied.","schema":{"type":"string","description":"JSON schema describing the report shape."}}],"requestBody":{"description":"AI analysis request (same as analyse)","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AIAnalysisRequest"}],"description":"JSON schema describing the report shape."},"example":{"tenantId":"string","userId":"string","correlationId":"string","skillId":"string","reportDefinitionId":"string","reportRunId":"string","agentId":"string","model":"string","userQuery":"string","context":{}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AIEstimateResponse"}],"description":"JSON schema describing the report shape."},"example":{"currentUsage":0,"quota":0,"headroom":0,"estimatedPerspioAITokens":0,"willFit":false,"actualCostUsd":"value","billedCostUsd":"value","billedCostAud":"value","periodKey":"value"}}}},"400":{"description":"Invalid Request","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AIErrorResponse"}],"description":"JSON schema describing the report shape."},"example":{"code":"INVALID_REQUEST","message":"Request body is required","userAction":"Correct the request and retry.","correlationId":"strm-20260630-015500-502-b7cc0","details":null}}}},"401":{"description":"Invalid API Key provided or Invalid Bearer token"},"404":{"description":"Resource Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"code":"REPORT_NOT_FOUND","message":"Report definition not found or not accessible","userAction":"Correct the request and retry.","correlationId":"strm-20260630-015500-502-b7cc0","details":null}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AIErrorResponse"}],"description":"JSON schema describing the report shape."},"example":{"code":"LLM_ERROR","message":"The AI provider returned an error.","userAction":"Retry later; contact support if the error persists.","correlationId":"strm-20260630-015500-502-b7cc0","details":null}}}}}}},"/{id}/ai/validate":{"post":{"tags":["AI Analysis"],"summary":"Validate AI analysis request","description":"Validate skill, report payload, and limits before running analyse.","operationId":"validateReportData","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"JSON schema describing the report shape.","example":"repdef-000013"}},{"name":"model","in":"query","description":"Optional model override. Canonical channel for overriding the model; takes precedence over the deprecated `AIAnalysisRequest.model` body field when both are supplied.","schema":{"type":"string","description":"JSON schema describing the report shape."}}],"requestBody":{"description":"AI analysis request","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AIAnalysisRequest"}],"description":"JSON schema describing the report shape."},"example":{"tenantId":"string","userId":"string","correlationId":"string","skillId":"string","reportDefinitionId":"string","reportRunId":"string","agentId":"string","model":"string","userQuery":"string","context":{}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AIValidationResponse"}],"description":"JSON schema describing the report shape."},"example":{"isValid":false,"errorCode":"value","errorMessage":"value","errors":["value"],"details":{}}}}},"400":{"description":"Invalid Request","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AIErrorResponse"}],"description":"JSON schema describing the report shape."},"example":{"code":"INVALID_REQUEST","message":"Request body is required","userAction":"Correct the request and retry.","correlationId":"strm-20260630-015500-502-b7cc0","details":null}}}},"401":{"description":"Invalid API Key provided or Invalid Bearer token"},"404":{"description":"Resource Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"code":"REPORT_NOT_FOUND","message":"Report definition not found or not accessible","userAction":"Correct the request and retry.","correlationId":"strm-20260630-015500-502-b7cc0","details":null}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AIErrorResponse"}],"description":"JSON schema describing the report shape."},"example":{"code":"LLM_ERROR","message":"The AI provider returned an error.","userAction":"Retry later; contact support if the error persists.","correlationId":"strm-20260630-015500-502-b7cc0","details":null}}}}}}},"/{id}/ai/history":{"get":{"tags":["AI Analysis"],"summary":"List AI analysis runs for a report","description":"Returns a paged list of recent AI runs for the calling user and report definition, newest first. Each item matches `AIReportHistoryItem` (PATs and run metadata; no model, raw provider token count, or estimated USD). Use `page_size` and the `token` header (continuation token) for pagination. Legacy `limit` is still accepted.","operationId":"getReportAiHistory","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"JSON schema describing the report shape.","example":"repdef-000013"}},{"name":"page_size","in":"query","description":"Max runs per page (capped at 100). Defaults to 20.","schema":{"maximum":100,"minimum":1,"type":"integer","description":"JSON schema describing the report shape.","default":20}},{"name":"limit","in":"query","description":"Legacy alias for `page_size`; prefer `page_size`.","schema":{"maximum":100,"minimum":1,"type":"integer","description":"JSON schema describing the report shape.","default":20}},{"name":"successOnly","in":"query","description":"If true, only successful runs are returned. **Default: true** when the query is omitted or not parseable; set to `false` to include failed runs (e.g. for diagnostics).","schema":{"type":"boolean","description":"JSON schema describing the report shape."}},{"name":"token","in":"header","description":"Continuation token from a previous page response.","schema":{"type":"string","description":"JSON schema describing the report shape."}}],"responses":{"200":{"description":"Success","headers":{"ContinuationToken":{"description":"Token to pass back (ContinuationToken header) for the next page; absent on the last page.","schema":{"type":"string"},"example":"eyJ0b2tlbiI6IjEwMDAifQ=="},"ResultCount":{"description":"Number of items returned in this page.","schema":{"type":"integer","format":"int64"},"example":50},"TotalCount":{"description":"Total number of items matching the request across all pages.","schema":{"type":"integer","format":"int64"},"example":1372}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AIHistoryResponse"}],"description":"JSON schema describing the report shape."},"example":{"result":[{"aiRunId":"value","reportDefinitionId":"value","reportRunId":"value","skillId":"value","agentId":"value","title":"value","summary":"value","createdAt":"value","durationMs":0,"aiResultBlobUrl":"value","reportPdfBlobUrl":"value","perspioAITokens":0,"success":false}],"resultCount":0,"totalCount":0,"continuationToken":"value"}}}},"400":{"description":"Invalid Request","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AIErrorResponse"}],"description":"JSON schema describing the report shape."},"example":{"code":"INVALID_REQUEST","message":"Request body is required","userAction":"Correct the request and retry.","correlationId":"strm-20260630-015500-502-b7cc0","details":null}}}},"401":{"description":"Invalid API Key provided or Invalid Bearer token"},"404":{"description":"Resource Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"code":"REPORT_NOT_FOUND","message":"Report definition not found or not accessible","userAction":"Correct the request and retry.","correlationId":"strm-20260630-015500-502-b7cc0","details":null}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AIErrorResponse"}],"description":"JSON schema describing the report shape."},"example":{"code":"LLM_ERROR","message":"The AI provider returned an error.","userAction":"Retry later; contact support if the error persists.","correlationId":"strm-20260630-015500-502-b7cc0","details":null}}}}}}},"/{id}/ai/runs/{aiRunId}":{"get":{"tags":["AI Analysis"],"summary":"Get AI run by id","description":"Returns a single AI run as an analyse-shaped payload (AIAnalysisResponse) with inlined markdown content, so clients can reuse the analyse renderer. `metadata.perspioAITokens` is PATs (same as live analyse), not raw provider token usage.","operationId":"getReportAiRun","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"JSON schema describing the report shape.","example":"repdef-000013"}},{"name":"aiRunId","in":"path","required":true,"schema":{"type":"string","description":"JSON schema describing the report shape."}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AIAnalysisResponse"}],"description":"JSON schema describing the report shape."},"example":{"isSuccess":false,"aiRunId":"value","skillId":"value","content":"value","reportRunId":"value","aiResultBlobUrl":"value","title":"value","summary":"value","metadata":{"correlationId":"value","processingTimeMs":0,"perspioAITokens":0,"completedAt":"value","toolCallCount":0,"toolCallIterations":0,"toolsUsed":"value"},"error":{"errorCode":"value","message":"value","userAction":"value","details":{},"correlationId":"value","timestamp":"value"},"guardrail":{}}}}},"400":{"description":"Invalid Request","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AIErrorResponse"}],"description":"JSON schema describing the report shape."},"example":{"code":"INVALID_REQUEST","message":"Request body is required","userAction":"Correct the request and retry.","correlationId":"strm-20260630-015500-502-b7cc0","details":null}}}},"401":{"description":"Invalid API Key provided or Invalid Bearer token"},"404":{"description":"Resource Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"code":"REPORT_NOT_FOUND","message":"Report definition not found or not accessible","userAction":"Correct the request and retry.","correlationId":"strm-20260630-015500-502-b7cc0","details":null}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AIErrorResponse"}],"description":"JSON schema describing the report shape."},"example":{"code":"LLM_ERROR","message":"The AI provider returned an error.","userAction":"Retry later; contact support if the error persists.","correlationId":"strm-20260630-015500-502-b7cc0","details":null}}}}}}}},"components":{"schemas":{"PerspioError":{"type":"object","properties":{"functionName":{"type":"string","description":"Name of the backend function that raised the error."},"errorType":{"type":"string","description":"Exception/error type name."},"statusCode":{"type":"integer","description":"HTTP status code of the error.","format":"int32"},"request":{"type":"string","description":"Method and URL of the failing request."},"tenantId":{"type":"string","description":"Tenant the request was executed for."},"message":{"type":"string","description":"Human-readable error message."}},"description":"Standard Perspio backend error body (ErrorResultObject emitted by the error-handling middleware)."},"CreateReport-RequestObject":{"type":"object","properties":{"name":{"type":"string","description":"Display name."},"title":{"type":"string","description":"Title."},"description":{"type":"string","description":"Free-text description."},"isCustom":{"type":"boolean","description":"Is Custom."},"enabled":{"type":"boolean","description":"Whether the schedule is enabled."},"fromDateUtc":{"description":"From Date Utc."},"toDateUtc":{"description":"To Date Utc."},"interval":{"description":"Interval."},"timezone":{"description":"Timezone."},"format":{"type":"integer","description":"Output format of the report (e.g. csv, pdf, json)."},"scope":{"type":"object","properties":{"scopeType":{"type":"integer","description":"Scope Type."},"objectRefs":{"type":"array","items":{"type":"string"}}}},"objectOptions":{"type":"integer","description":"Object Options."},"queryParameters":{"type":"array","items":{"type":"string"}},"reportType":{"type":"integer","description":"Type/category of the report."},"columns":{"type":"array","items":{"required":["name","columnType","propertyName","title","value","format","dataType","display"],"type":"object","properties":{"name":{"type":"string","description":"Display name."},"columnType":{"type":"integer","description":"Column Type."},"propertyName":{"type":"string","description":"Property Name."},"title":{"type":"string","description":"Title."},"value":{"description":"Value."},"format":{"type":"string","description":"Output format of the report (e.g. csv, pdf, json)."},"dataType":{"description":"Data Type."},"display":{"description":"Display."}}}}}},"UpdateReport-RequestObject":{"type":"object","properties":{"name":{"type":"string","description":"Display name."},"title":{"type":"string","description":"Title."},"description":{"type":"string","description":"Free-text description."},"isCustom":{"type":"boolean","description":"Is Custom."},"enabled":{"type":"boolean","description":"Whether the schedule is enabled."},"fromDateUtc":{"description":"From Date Utc."},"toDateUtc":{"description":"To Date Utc."},"interval":{"description":"Interval."},"timezone":{"description":"Timezone."},"format":{"type":"integer","description":"Output format of the report (e.g. csv, pdf, json)."},"scope":{"type":"object","properties":{"scopeType":{"type":"integer","description":"Scope Type."},"objectRefs":{"type":"array","items":{"type":"string"}}}},"objectOptions":{"type":"integer","description":"Object Options."},"queryParameters":{"type":"array","items":{"type":"string"}},"reportType":{"type":"integer","description":"Type/category of the report."},"columns":{"type":"array","items":{"required":["name","columnType","propertyName","title","value","format","dataType","display"],"type":"object","properties":{"name":{"type":"string","description":"Display name."},"columnType":{"type":"integer","description":"Column Type."},"propertyName":{"type":"string","description":"Property Name."},"title":{"type":"string","description":"Title."},"value":{"description":"Value."},"format":{"type":"string","description":"Output format of the report (e.g. csv, pdf, json)."},"dataType":{"description":"Data Type."},"display":{"description":"Display."}}}}}},"ReportDocumentsResponseObject":{"type":"object","properties":{"createdDate":{"type":"string","description":"UTC timestamp when the record was created."},"name":{"type":"string","description":"Display name."},"contentType":{"type":"string","description":"Content Type."},"description":{"type":"string","description":"Free-text description."},"updatedDate":{"type":"string","description":"UTC timestamp when the record was last modified."}}},"ScheduledReportDefinition":{"required":["name","to","subject","reportQuery","schedule"],"type":"object","properties":{"id":{"type":"string","description":"Scheduled report ID"},"name":{"type":"string","description":"Name of the scheduled report"},"to":{"type":"array","items":{"type":"string","format":"email"},"description":"List of recipient email addresses"},"subject":{"type":"string","description":"Email subject line"},"reportQuery":{"type":"string","description":"Query string for report data"},"schedule":{"required":["type"],"type":"object","properties":{"type":{"type":"string","description":"Schedule type, e.g. 'cron'"},"cronExpression":{"type":"string","description":"Cron expression for schedule"},"timeZone":{"type":"string","description":"Time zone for the schedule"}},"description":"Scheduling details"},"reportId":{"type":"string","description":"ID of the associated report"},"lastRunTimeStampUtc":{"type":"string","description":"Timestamp of last run in UTC","format":"date-time"}}},"AIAnalysisRequest":{"required":["skillId","reportRunId"],"type":"object","properties":{"tenantId":{"type":"string","description":"Identifier of the owning tenant."},"userId":{"type":"string","description":"User Id."},"correlationId":{"type":"string","description":"Client-supplied correlation id, echoed back for request tracing."},"skillId":{"type":"string","description":"Skill id to execute."},"reportDefinitionId":{"type":"string","description":"Report Definition Id."},"reportRunId":{"type":"string","description":"Identifies saved report-run artifacts (CSV + metadata) loaded server-side."},"agentId":{"type":"string","description":"Agent Id.","nullable":true},"model":{"type":"string","description":"Deprecated. Prefer the `model` query parameter on analyse/estimate/validate, which takes precedence over this body field when both are supplied. Scheduled for removal after 2026-04-15.","nullable":true,"deprecated":true},"userQuery":{"type":"string","description":"User Query.","nullable":true},"context":{"type":"object","nullable":true}},"description":"Report AI request for analyse / estimate / validate. Send `skillId` and `reportRunId`; the backend loads report content from the report-run artifact store. Inline `reportData` / `reportDataCsv` are not part of the public contract."},"AIAnalysisResponse":{"type":"object","properties":{"isSuccess":{"type":"boolean","description":"Is Success."},"aiRunId":{"type":"string","description":"Ai Run Id."},"skillId":{"type":"string","description":"Skill Id.","nullable":true},"content":{"type":"string","description":"Content.","nullable":true},"reportRunId":{"type":"string","description":"Report Run Id.","nullable":true},"aiResultBlobUrl":{"type":"string","description":"Ai Result Blob Url.","nullable":true},"title":{"type":"string","description":"Title.","nullable":true},"summary":{"type":"string","description":"Summary.","nullable":true},"metadata":{"$ref":"#/components/schemas/AnalysisMetadata"},"error":{"$ref":"#/components/schemas/AIError"},"guardrail":{"type":"object","nullable":true}},"description":"Analyse/run response. See Perspio.Shared.AI.Models.AIAnalysisResponse."},"AnalysisMetadata":{"type":"object","properties":{"correlationId":{"type":"string","description":"Client-supplied correlation id, echoed back for request tracing."},"processingTimeMs":{"type":"integer","description":"Processing Time Ms.","format":"int64"},"perspioAITokens":{"type":"integer","description":"Billed Perspio AI Tokens (PATs) for this run; not the provider token count.","format":"int64"},"completedAt":{"type":"string","description":"Completed At.","format":"date-time"},"toolCallCount":{"type":"integer","description":"Tool Call Count."},"toolCallIterations":{"type":"integer","description":"Tool Call Iterations."},"toolsUsed":{"type":"string","description":"Tools Used.","nullable":true}},"description":"Analyse / GET …/ai/runs metadata. Billed units use perspioAITokens (PATs), not raw LLM totals. Omitted: model, promptTokens, completionTokens, raw totalTokens, estimatedCostUsd, cacheHit, pricingSnapshot."},"AIError":{"type":"object","properties":{"errorCode":{"type":"string","description":"Error Code."},"message":{"type":"string","description":"Message."},"userAction":{"type":"string","description":"User Action.","nullable":true},"details":{"type":"object","nullable":true},"correlationId":{"type":"string","description":"Client-supplied correlation id, echoed back for request tracing.","nullable":true},"timestamp":{"type":"string","description":"Timestamp.","format":"date-time"}}},"AIRunSummary":{"type":"object","properties":{"aiRunId":{"type":"string","description":"Ai Run Id."},"reportDefinitionId":{"type":"string","description":"Report Definition Id."},"reportRunId":{"type":"string","description":"Report run id that this AI analysis was produced against; null when the analysis is not tied to a specific run.","nullable":true},"skillId":{"type":"string","description":"Skill Id."},"agentId":{"type":"string","description":"Resolved AI agent id for this run.","nullable":true},"model":{"type":"string","description":"LLM model id for the run (Connectors / ADX full projection; not in report history list items).","nullable":true},"title":{"type":"string","description":"Title."},"summary":{"type":"string","description":"Summary."},"createdAt":{"type":"string","description":"Created At.","format":"date-time"},"durationMs":{"type":"integer","description":"End-to-end AI run duration in milliseconds.","format":"int64"},"aiResultBlobUrl":{"type":"string","description":"Ai Result Blob Url."},"reportPdfBlobUrl":{"type":"string","description":"Absolute blob URL to the source report PDF for this run (when reportRunId is present).","nullable":true},"tokensUsed":{"type":"integer","description":"Number of tokens consumed by the run."},"perspioAITokens":{"type":"integer","description":"Billed Perspio AI Tokens (PATs) for this run.","format":"int64"},"estimatedCostUsd":{"pattern":"^-?\\d+(\\.\\d{1,6})?$","type":"string","description":"Decimal currency encoded as string to preserve precision across SDKs.","nullable":true},"success":{"type":"boolean","description":"Success."}},"description":"Full run summary aligned with `Perspio.Shared.AI.Models.AiRunSummary` (e.g. **Connectors** `GET .../ai/{id}/{instanceId}/history` from ADX). Includes `model`, raw `tokensUsed`, and `estimatedCostUsd`. The **report** `GET /{id}/ai/history` list uses `AIReportHistoryItem` instead, which omits those fields."},"ActionUsageStats":{"type":"object","properties":{"runs":{"type":"integer","description":"Runs."},"tokens":{"type":"integer","description":"Tokens.","format":"int64"},"costUsd":{"pattern":"^-?\\d+(\\.\\d{1,6})?$","type":"string","description":"Decimal currency encoded as string to preserve precision across SDKs.","nullable":true}}},"AIEstimateResponse":{"type":"object","properties":{"currentUsage":{"type":"integer","description":"Current period usage (Perspio AI Tokens) for the resolved agent/instance.","format":"int64"},"quota":{"type":"integer","description":"Quota (PATs) for the period; null when unset.","format":"int64","nullable":true},"headroom":{"type":"integer","description":"Quota - currentUsage - projected burn; null when quota is unset.","format":"int64","nullable":true},"estimatedPerspioAITokens":{"type":"integer","description":"Projected Perspio AI Tokens that will be billed if this analyse call runs.","format":"int64"},"willFit":{"type":"boolean","description":"True when projected burn fits within remaining quota (or quota is unset)."},"actualCostUsd":{"pattern":"^-?\\d+(\\.\\d{1,6})?$","type":"string","description":"Decimal currency encoded as string to preserve precision across SDKs.","nullable":true},"billedCostUsd":{"pattern":"^-?\\d+(\\.\\d{1,6})?$","type":"string","description":"Decimal currency encoded as string to preserve precision across SDKs.","nullable":true},"billedCostAud":{"pattern":"^-?\\d+(\\.\\d{1,6})?$","type":"string","description":"Decimal currency encoded as string to preserve precision across SDKs.","nullable":true},"periodKey":{"type":"string","description":"Quota accounting period key (e.g. yyyy-MM)."}},"description":"Response for POST /{id}/ai/estimate. Shape matches Perspio.Shared.AI.Models.AiUsageEstimate. `additionalProperties: true` to allow additive evolution without breaking SDKs."},"AIValidationResponse":{"type":"object","properties":{"isValid":{"type":"boolean","description":"Is Valid."},"errorCode":{"type":"string","description":"Error Code.","nullable":true},"errorMessage":{"type":"string","description":"Error Message.","nullable":true},"errors":{"type":"array","items":{"type":"string"}},"details":{"type":"object","nullable":true}},"description":"Response for POST /{id}/ai/validate. Shape matches Perspio.Shared.AI.Interfaces.ValidationResult. `additionalProperties: true` to allow additive evolution without breaking SDKs."},"AIReportHistoryItem":{"type":"object","properties":{"aiRunId":{"type":"string","description":"Ai Run Id."},"reportDefinitionId":{"type":"string","description":"Report Definition Id."},"reportRunId":{"type":"string","description":"Report Run Id.","nullable":true},"skillId":{"type":"string","description":"Skill Id."},"agentId":{"type":"string","description":"Agent Id.","nullable":true},"title":{"type":"string","description":"Title."},"summary":{"type":"string","description":"Summary."},"createdAt":{"type":"string","description":"Created At.","format":"date-time"},"durationMs":{"type":"integer","description":"Duration Ms.","format":"int64"},"aiResultBlobUrl":{"type":"string","description":"Ai Result Blob Url."},"reportPdfBlobUrl":{"type":"string","description":"Report Pdf Blob Url.","nullable":true},"perspioAITokens":{"type":"integer","description":"Perspio AITokens.","format":"int64"},"success":{"type":"boolean","description":"Success."}},"description":"List row for GET /{id}/ai/history (report-scoped). Omits model, raw LLM token count, and estimated USD; Connectors agent history may still return those on AIRunSummary."},"AIHistoryResponse":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#/components/schemas/AIReportHistoryItem"},"description":"Result payload of the AI run."},"resultCount":{"type":"integer","description":"Result Count."},"totalCount":{"type":"integer","description":"Total count when known; -1 when not computed."},"continuationToken":{"type":"string","description":"Opaque continuation token; echo via `token` header to fetch the next page.","nullable":true}},"description":"Response for GET /{id}/ai/history. Paged `PagedResult<AIReportHistoryItem>`. `additionalProperties: true` to allow additive evolution without breaking SDKs."},"AIErrorResponse":{"type":"object","properties":{"code":{"type":"string","description":"Code."},"message":{"type":"string","description":"Message."},"userAction":{"type":"string","description":"User Action.","nullable":true},"correlationId":{"type":"string","description":"Client-supplied correlation id, echoed back for request tracing.","nullable":true},"details":{"type":"object","nullable":true}}}},"securitySchemes":{"oauth2":{"type":"oauth2","description":"Client credentials from your Perspio API application. See Get Access Token.","flows":{"clientCredentials":{"tokenUrl":"/auth/v3/token","scopes":{}}}},"subscriptionKey":{"type":"apiKey","name":"Ocp-Apim-Subscription-Key","in":"header","description":"Your tenant's subscription key, from your API application."},"tenantId":{"type":"apiKey","name":"tid","in":"header","description":"Your tenant ID (tid), from your API application."}}},"security":[{"oauth2":[],"subscriptionKey":[],"tenantId":[]}],"tags":[{"name":"Reports","description":"Report definitions and data."},{"name":"Scheduled Reports","description":"Scheduled report management."},{"name":"Saved Reports","description":"Saved report documents."},{"name":"Other","description":"Report dictionaries, schema and history."},{"name":"AI Analysis","description":"AI-assisted report analysis."}],"x-readme":{"oauth-options":{"useInsecureClientAuthentication":true}}}