---
title: "POST /#X-Amz-Target=AmazonForecast.CreateWhatIfForecastExport"
method: POST
path: "/#X-Amz-Target=AmazonForecast.CreateWhatIfForecastExport"
---

# POST /#X-Amz-Target=AmazonForecast.CreateWhatIfForecastExport

`POST /#X-Amz-Target=AmazonForecast.CreateWhatIfForecastExport`

Exports a forecast created by the CreateWhatIfForecast operation to your Amazon Simple Storage Service (Amazon S3) bucket. The forecast file name will match the following conventions:

`≈<ForecastExportJobName>_<ExportTimestamp>_<PartNumber>`

The <ExportTimestamp> component is in Java SimpleDateFormat (yyyy-MM-ddTHH-mm-ssZ).

You must specify a DataDestination object that includes an Identity and Access Management (IAM) role that Amazon Forecast can assume to access the Amazon S3 bucket. For more information, see aws-forecast-iam-roles.

For more information, see howitworks-forecast.

To get a list of all your what-if forecast export jobs, use the ListWhatIfForecastExports operation.

The `Status` of the forecast export job must be `ACTIVE` before you can access the forecast in your Amazon S3 bucket. To get the status, use the DescribeWhatIfForecastExport operation.

## Headers

- `X-Amz-Target` 'AmazonForecast.CreateWhatIfForecastExport', required

## Request body

- CreateWhatIfForecastExportRequest
  - `WhatIfForecastExportName` string, required — The name of the what-if forecast to export.
  - `WhatIfForecastArns` LongArn[], required — The list of what-if forecast Amazon Resource Names (ARNs) to export.
  - `Destination` object, required — <p>The location where you want to save the forecast and an Identity and Access Management (IAM) role that Amazon Forecast can assume to access the location. The forecast must be exported to an Amazon S3 bucket.</p> <p>If encryption is used, <code>Destination</code> must include an Key Management Service (KMS) key. The IAM role must allow Amazon Forecast permission to access the key.</p>
    - `S3Config` object, required — The path to an Amazon Simple Storage Service (Amazon S3) bucket along with the credentials to access the bucket.
      - `Path` string, required — The path to an Amazon Simple Storage Service (Amazon S3) bucket or file(s) in an Amazon S3 bucket.
      - `RoleArn` string, required — <p>The ARN of the Identity and Access Management (IAM) role that Amazon Forecast can assume to access the Amazon S3 bucket or files. If you provide a value for the <code>KMSKeyArn</code> key, the role must allow access to the key.</p> <p>Passing a role across Amazon Web Services accounts is not allowed. If you pass a role that isn't in your account, you get an <code>InvalidInputException</code> error.</p>
      - `KMSKeyArn` string — The Amazon Resource Name (ARN) of an Key Management Service (KMS) key.
  - `Tags` Tag[] — A list of <a href="https://docs.aws.amazon.com/forecast/latest/dg/tagging-forecast-resources.html">tags</a> to apply to the what if forecast.
    - `Key` string, password, required — One part of a key-value pair that makes up a tag. A <code>key</code> is a general label that acts like a category for more specific tag values.
    - `Value` string, password, required — The optional part of a key-value pair that makes up a tag. A <code>value</code> acts as a descriptor within a tag category (key).
  - `Format` string — The format of the exported data, CSV or PARQUET.

## Response `200`

Success

- CreateWhatIfForecastExportResponse
  - `WhatIfForecastExportArn` string — The Amazon Resource Name (ARN) of the what-if forecast.

## Other responses

- `480` — InvalidInputException
- `481` — ResourceAlreadyExistsException
- `482` — ResourceNotFoundException
- `483` — ResourceInUseException
- `484` — LimitExceededException

---

[API](https://skmtc.net/aws/apis/forecast.md) · [All operations](https://skmtc.net/aws/apis/forecast/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/forecast/revisions/3d1c872d2ac9/schema)
