---
title: "Export an insight"
method: POST
path: "/gdc/internal/projects/{project_id}/exportResult"
tags: ["export-reports"]
---

# Export an insight

`POST /gdc/internal/projects/{project_id}/exportResult`

## Request

- Base URL: `https://secure.gooddata.com`
- URL: `https://secure.gooddata.com/gdc/internal/projects/{project_id}/exportResult`
- Auth: none declared

Export data used by an insight into CSV, XLSX. When you export to CSV, formulas in attribute and attribute header cells are automatically escaped using quotation marks. This does not apply to raw CSV exports. To turn this feature off, contact GoodData Support.
For more information, see [Export an insight use case](#section/Use-Cases/Export-an-insight).**Request body parameters**

* `executionResult`  (string, required) - Specifies which insight should be exported.
Using the Network tab of DevTools, you can get executionResult from the response of `gdc/app/projects/{project-id}/executeAfm` request.
Including execution_result_id, report_view and report_view_checksum.

* `format`  (string, optional) - Specifies title of the exported file.
Available options are: `csv` and `xlsx`.
If not set, defaults to `csv`.

* `title`  (string, optional) - Specifies format of the exported file.
If not set, defaults to `Untitled`.

**NOTE:** **executionResult** must contain **q** (report view) and **c** (report view checksum).

## Path parameters

- `project_id` string, required

## Request body

- ExportResult
  - `resultExport` object, required
    - `executionResult` string, required: response URI returned from AFM/Visualization execution; must contain 'q' (compressed ReportView) and 'c' (checksum) parameters
    - `exportConfig` ExportConfig
      - `format` 'csv' | 'xlsx': output format
      - `title` string: report title, when not specified, default value is used
      - `mergeHeaders` union
        - '0' | '1': merge headers property for XLSX format (default 'true')
        - 0 | 1: merge headers property for XLSX format (default 'true')
        - boolean: merge headers property for XLSX format (default 'true')
      - `showFilters` union
        - '0' | '1': render filters with their expressions to the first lines of XLSX table (afm must be defined)
        - 0 | 1: render filters with their expressions to the first lines of XLSX table (afm must be defined)
        - boolean: render filters with their expressions to the first lines of XLSX table (afm must be defined)
      - `afm` object: afm used to obtain information about exported filters and all the other properties necessary for the filter MAQL conversion
        - `attributes` AttributeItem[]
          - `localIdentifier` string, required: your internal attribute identifier
          - `displayForm` union, required
            - Uri: URI containing mandatory root key
              - …
            - IdentifierObjQualifier: qualifies md object using identifier
              - …
          - `alias` string
        - `measures` MeasureItem[]
          - `localIdentifier` string, required: Global identifier of a metadata object
          - `definition` union, required
            - SimpleMeasureDefinition
              - …
            - PopMeasureDefinition
              - …
            - AfmOverPeriodMeasureDefinition
              - …
            - AfmPreviousPeriodMeasureDefinition
              - …
            - ArithmeticMeasureDefinition
              - …
          - `alias` string: alternative title of the measure used in the execution result instead of the metric title
          - `format` string: number format of the measure values in the execution result, overrides the metric format
        - `filters` CompatibilityFilter[]
          - union
            - ExpressionFilter
              - …
            - union
              - …
        - `nativeTotals` NativeTotalItem[]
          - `measureIdentifier` string, required: Global identifier of a metadata object
          - `attributeIdentifiers` Identifier[], required

## Response `201`

`201` returns the URI to poll on.
Polling returns various HTTP codes depending on whether the export is still running (`202`) or not.
When the export is finished, the response returns `200` and the exported file.

- Uri: URI containing mandatory root key
  - `uri` string, uri, required

---

[API](https://skmtc.dev/gooddata/apis/gooddata-api-documentation.md) - [All operations](https://skmtc.dev/gooddata/apis/gooddata-api-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/gooddata/apis/gooddata-api-documentation/revisions/e5dc0ee6ab00?raw)
