The below sets out a list of endpoints for using to task server to download large, long running MI reports. any {{ }} items denote variables and should be replaced by your values
(POST) /api/tenant/mergedreport/queuefordownload
This is a post request to queue a merged report for download. It requires a json body in this format:
{
"reportId": "{{merged_report_id}}",
"reportType": 1
}
"reportType" is always 1
At the moment, this is the only end point we have for queuing merged reports. It is quite old so unfortunately you will need to add a custom header to the request. The custom header name is TorusTenantId and the value should be the tenantId
Another thing to consider is that you probably won't have the merged_report_id. You will need to run a separate request to get this. (see next endpoint)
(we could look at modifying this endpoint to work in the same way the execute report endpoint dows but this would require development time).
(GET) /api/tenant/mergedreport/list/get/{{tenant_id}}?$filter=tolower('{{report_name}}') eq tolower(Name)
This endpoint returns a list of merged reports for a tenant. You can use oData to filter out the list of merged reports. The odata data used in this example returns a json array of merged reports with a name equal to a given report name (the tolower is used to get round case sensitivity. Also note the single quotation marks. Very important)
The request will return the following:
[
{
"id": 1087,
"name": "MI_Report",
"description": "MI_Report",
"tenantId": 69,
"limitTenantAccess": false,
"limitRoleAccess": false,
"limitUserAccess": false,
"isScheduled": true,
"scheduleSource": 1,
"reportSources": null,
"reportConditions": null,
"reportColumns": null,
"reportAccess": null,
"adminUserDetails": null,
"isDeleted": false
}
]
You will need the id value to send to the queuefordownload endpoint
Once you have queued the merged report, you can run the following
(GET) /api/tenant/report/queue/list/get?$filter=DateQueued gt datetime'2025-09-12T00:00'
This will be the endpoint you will use for polling. By default the endpoint returns the last 7 days worth of downloads requested by the signed in user. You can use oData to filter the returned list. In the example above, the endpoint will return downloads queued after 12 Sep (please note the date format). The end point returns a json array of downloads that have been scheduled by the signed in user.
[
{
"tenantId": 69,
"tenantSubDomainName": "benefitsforme",
"scheduledTaskRunNowId": 59398,
"name": "MI_Report",
"queuedBy": "Useraccount for API client",
"status": "Finished",
"progress": "100%",
"message": "Report task successfully ran",
"dateQueued": "2025-09-12T08:33:42.97",
"dateStarted": "2025-09-12T08:33:46.413",
"dateFinished": "2025-09-12T08:42:58.76",
"fileGuid": "ae20260a-752a-4f0c-b6da-7ba40c355ae9",
"isViewed": true,
"viewType": null
}
]
The status property will indicate one of the following: 'Pending', 'Running', 'Finished', 'Cancelled' or 'Error'. The message property will give you more detail of the current state of the download. Once a download is successfully completed, the status value will be 'Finished' and there will be a value in the fileGuid property. You will need this fileGuid to be able to download the excel file.
When you have a file guid, use the following endpoint to obtain the file
(GET) /api/file/download/report/{{file_guid}}
This will return the file in excel format.
Standard HTTP Error codes apply:
| 200 | ok |
| 400 | Bad Request |
| 401 | Unauthorised |
| 403 | Forbidden |
| 404 | Page not found |
| 429 | Too Many Requests |
| 500 | Error |