---
title: "Create a report to be processed"
method: POST
path: "/report"
tags: ["Report"]
---

# Create a report to be processed

`POST /report`

## Request

- Base URL: `https://api.zentail.com/v1`
- URL: `https://api.zentail.com/v1/report`
- Auth: API key in header `AUTHORIZATION`

You can use this endpoint to create an import or an export. The parameters used in each case are different so definitely check out the model to see what each parameter is used for. Please note the prefixes '*For exports only:*' and '*For imports only:*'.<br/>

### Import
You'll need to build a file that has a header row that describes the contents of the corresponding column. You can find a list of acceptable column headers [here](https://app.zentail.com/data/dictionary). For example, if you were importing a file to set the MSRP for a set of SKUs, the first column header would have to be 'SKU' and the second column header would be 'MSRP'.<br/>

### Export
If you don't supply any columnTypes in your request, we will include all of the possible columns that can be exported. If you'd like to restrict the number of columns you can pass the column types as an array. You can find a list of acceptable column headers [here](https://app.zentail.com/data/dictionary). For example if you were trying to export the MSRP for SKUs you would send `["SKU", "MSRP"]` in the columnType parameter.<br/>
You can also use filters to limit the results of a report. You can find find more information on how to build a filter query [here](https://help.zentail.com/import-export/how-to-write-a-filter-formula-for-import-and-exports)<br/>
An account can have at most 20 exports pending or processing at once. Past that, this endpoint returns `429 Too Many Requests` with a `Retry-After` header, in seconds.

## Request body

- ReportPost
  - `label` string, required: Assigns a label to this report.
  - `isExport` boolean: If true, this is an export. Otherwise it's an import.
  - `data` string: *For imports only:* This should be a [csv](https://en.wikipedia.org/wiki/Comma-separated_values#Basic_rules), xls, xlsx, xslsm, txt, or tsv file encoded in base 64 (e.g. base64_encode(data) in PHP).
  - `extension` 'csv' | 'xls' | 'xlsx' | 'xlsm' | 'txt' | 'tsv': *For imports only:* This tells us the type of file that was encoded in the data parameter.
  - `overwriteWithBlank` boolean: *For imports only:* If set to true, blank values supplied in the upload , data will overwrite.
  - `createNewProducts` boolean: *For imports only:* If set to true, if a SKU doesn't exist in zentail, we will create one.
  - `columnTypes` string[]: *For exports only:* Use this field to provide the columns you'd like to export. You can find the columns eligible for export at [here](https://app.zentail.com/data/dictionary). If no columns are supplied, all the possible columns will be exported (there are lot!).
  - `delimiter` string: *For exports only:* We will use this delimiter to separate the data in the export.
  - `activeOnly` boolean: *For exports only:* If set to true, export will only include active products.
  - `insertOnly` boolean: *For imports only:* If set to true, report will only fill in blank data on Zentail. Any data that already exists on Zentail will not be overwritten by data in the file.
  - `includeHeader` boolean: *For exports only:* If set to true, export will include a header
  - `exportForExcel` boolean: *For exports only:* If set to true, will export as an Excel file.
  - `filter` string: *For exports only:* Use this to pass in filters to restrict the products being exported. See how to write a filter formula [here](https://help.zentail.com/import-export/how-to-write-a-filter-formula-for-import-and-exports)., we will create one.
  - `headersOnly` boolean: *For exports only:* If true, this export will only have header rows.

## Response `200`

Success

- Report
  - `reportId` integer
  - `label` string
  - `isExport` boolean: If true, this is an export. Otherwise it's an import.
  - `requestedTs` string, date-time: Timestamp when the report was requested to be run.
  - `completedTs` string, date-time: Timestamp when the report was completed.
  - `columnTypes` string[]: Array of the column headers in this report.
  - `status` 'PENDING' | 'PROCESSING' | 'CANCELED' | 'COMPLETE'
  - `totalLines` integer: Total number of lines processed successfully.
  - `linesSuccessfullyProcessed` integer
  - `filePath` string: Path to access the stored file. Use this to download an exported file when it is "COMPLETE"
  - `errorMessage` string: Returns an error message if we ran into an error processing the report.
  - `overwriteWithBlank` boolean: *For imports only:* If set to true, blank values supplied in the upload data will overwrite. NULL is equivalent to false.
  - `createNewProducts` boolean: *For imports only:* If set to true, if a SKU doesn't exist in zentail we will create one. NULL is equivalent to false.
  - `activeOnly` boolean: *For exports only:* If set to true, export will only include active products.
  - `insertOnly` boolean: *For imports only:* If set to true, report will only fill in blank data on Zentail. Any data that already exists on Zentail will not be overwritten by data in the file.
  - `includeHeader` boolean: *For exports only:* If set to true, export will include a header
  - `exportForExcel` boolean: *For exports only:* If set to true, will export as an Excel file.
  - `filter` string: *For exports only:* Use this to pass in filters to restrict the products being exported. See how to write a filter formula [here](https://help.zentail.com/import-export/how-to-write-a-filter-formula-for-import-and-exports).
  - `delimiter` string: *For exports only:* We will use this delimiter to separate the data in the export.
  - `headersOnly` boolean: *For exports only:* If true, this export will only have header rows.
  - `uploader` string: If this is null, then the report was created by the API.

## Other responses

- `400`: Bad Request
- `403`: Permission Denied
- `404`: Not Found
- `500`: Zentail Error
- `503`: Zentail Error

---

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