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