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:
curl -X POST "https://YOUR_INSTANCE.my.salesforce.com/services/data/v62.0/analytics/reports/YOUR_REPORT_ID" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-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.
note: 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:
curl -X POST "https://YOUR_INSTANCE.my.salesforce.com/services/data/v62.0/analytics/reports/YOUR_REPORT_ID" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" \
--output "report.xlsx"
To download a previously executed report, send a GET:
curl -X GET "https://YOUR_INSTANCE.my.salesforce.com/services/data/v62.0/analytics/reports/YOUR_REPORT_ID" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Accept: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" \
--output "report.xlsx"
The response includes the filename in the Content-Disposition header. Read it from the response stream to save the file.
HTTP/1.1 200 OK
Date: Thu, 09 Jul 2026 09:55:53 GMT
Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Transfer-Encoding: chunked
Connection: close
Vary: Accept-Encoding
X-Content-Type-Options: nosniff
Content-Disposition: attachment; filename="New Opportunities Report-2026-07-09-15-25-49.xlsx"
Strict-Transport-Security: max-age=63072000; includeSubDomains
Sforce-Limit-Info: api-usage=2/15000
Cache-Control: no-cache,must-revalidate,max-age=0,no-store,private
X-Robots-Tag: none
Set-Cookie: CookieConsentPolicy=0:1; path=/; expires=Fri, 09-Jul-2027 09:55:49 GMT; Max-Age=31536000; secure
Server: sfdcedge
X-SFDC-Request-Id: 3aecd0ec3baade21751f95eb0f30ce00
X-Request-Id: 3aecd0ec3baade21751f95eb0f30ce00
X-SFDC-Edge-Cache: none