Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

Download Formatted Excel Reports Using the Reports REST API

Use the Reports REST API to download report results as JSON or Excel.

Request JSON Output

Send a POST request with the Accept header set to application/json:

1curl -X POST "https://YOUR_INSTANCE.my.salesforce.com/services/data/v62.0/analytics/reports/YOUR_REPORT_ID" \
2     -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
3     -H "Content-Type: application/json" \
4     -H "Accept: application/json"

Request Excel Output

The Accept header controls the output format. Set it to application/vnd.openxmlformats-officedocument.spreadsheetml.sheet to receive Excel. Always keep Content-Type as application/json. If you must separate execution from download, first execute via POST with Accept: application/json, then retrieve the Excel file via GET.

This endpoint isn't designed for concurrent export of large formatted reports. To avoid impact on overall system load, don't run more than one large report export at a time. For report size, row, and other API limits, see Requirements and Limitations.

Note

To execute a report and download it in a single request, send a POST:

1curl -X POST "https://YOUR_INSTANCE.my.salesforce.com/services/data/v62.0/analytics/reports/YOUR_REPORT_ID" \
2     -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
3     -H "Content-Type: application/json" \
4     -H "Accept: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" \
5     --output "report.xlsx"

To download a previously executed report, send a GET:

1curl -X GET "https://YOUR_INSTANCE.my.salesforce.com/services/data/v62.0/analytics/reports/YOUR_REPORT_ID" \
2     -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
3     -H "Accept: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" \
4     --output "report.xlsx"

The response includes the filename in the Content-Disposition header. Read it from the response stream to save the file.

1HTTP/1.1 200 OK
2Date: Thu, 09 Jul 2026 09:55:53 GMT
3Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
4Transfer-Encoding: chunked
5Connection: close
6Vary: Accept-Encoding
7X-Content-Type-Options: nosniff
8Content-Disposition: attachment; filename="New Opportunities Report-2026-07-09-15-25-49.xlsx"
9Strict-Transport-Security: max-age=63072000; includeSubDomains
10Sforce-Limit-Info: api-usage=2/15000
11Cache-Control: no-cache,must-revalidate,max-age=0,no-store,private
12X-Robots-Tag: none
13Set-Cookie: CookieConsentPolicy=0:1; path=/; expires=Fri, 09-Jul-2027 09:55:49 GMT; Max-Age=31536000; secure
14Server: sfdcedge
15X-SFDC-Request-Id: 3aecd0ec3baade21751f95eb0f30ce00
16X-Request-Id: 3aecd0ec3baade21751f95eb0f30ce00
17X-SFDC-Edge-Cache: none