---
schema_version: "1"
id: 0a637da322b44486fad18adf80f2b516c15a6c8b14361e5816b9177e26f3ece7
title: Download Formatted Excel Reports Using the Reports REST API
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/analytics/api_analytics/guides/examples/reports/sforce-analytics-rest-api-download-excel.md
canonical_url: https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-download-excel.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: d9fba7c9f45f68db5166f040b33487780fb8ea1ccdd8d6c6493b35cdc84fcba5
products:
  - Salesforce Reports and Dashboards REST API Developer Guide
  - analytics
---

# 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:

```nolang
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](https://developer.salesforce.com/docs/atlas.en-us.api_analytics.meta/api_analytics/sforce_analytics_rest_api_limits_limitations.htm).

To execute a report and download it in a single request, send a POST:

```nolang
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:

```nolang
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.

```nolang
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

```

