---
title: "Create ExportDestination"
method: POST
path: "/organizations/{orgId}/dataexports/destinations"
tags: ["ExportDestination"]
---

# Create ExportDestination

`POST /organizations/{orgId}/dataexports/destinations`

Create a new Export Destination to use for your Data Export Schedules or Ad-Hoc Data Exports. 

Currently, two options for setting up Data Export Destinations are available:
* S3 buckets on your AWS account.
* Buckets in your Google Cloud Storage account.

Request and Response schema:
* Use the selector under the `destinationType` parameter to expose the relevant request and response schema for the type of Destination.

Request and Response samples:
* Use the **Example** selector to show the relevant request and response samples for the type of Destination.

## Path parameters

- `orgId` string, required

## Request body

- union
  - ExportDestinationS3Request
    - `bucketName` string, required — Name of the S3 bucket for the Export Destination.
    - `prefix` string — Location in specified S3 bucket for the Export Destination. If you omit a `prefix`, then the root of the bucket will be used.
    - `iamRoleArn` string, required — To enable m3ter to upload a Data Exports to your S3 bucket, the service has to assume an IAM role with PutObject permission for the specified `bucketName`. Create a suitable IAM role in your AWS account and enter ARN: **Formatting Constraints:** * The IAM role ARN must begin with "arn:aws:iam". * The general format required is: "arn:aws:iam::<aws account id>:role/<role name>". For example: "arn:aws:iam::922609978421:role/IAMRole636". * If the `iamRoleArn` used doesn't comply with this format, then an error message will be returned. **More Details:** For more details and examples of the Permission and Trust Policies you can use to create the required IAM Role ARN, see [Creating Data Export Destinations](https://www.m3ter.com/docs/guides/data-exports/creating-data-export-destinations) in our main User documentation.
    - `partitionOrder` 'TYPE_FIRST' | 'TIME_FIRST', nullable — Output partitioning
    - `destinationType` 'S3' — The type of destination
    - `name` string, required — The name of the Export Destination.
    - `code` string, required — The code of the Export Destination.
    - `version` integer — The version number of the entity: - **Create entity:** Not valid for initial insertion of new entity - *do not use for Create*. On initial Create, version is set at 1 and listed in the response. - **Update Entity:** On Update, version is required and must match the existing version because a check is performed to ensure sequential versioning is preserved. Version is incremented by 1 and listed in the response.
  - ExportDestinationGoogleCloudStorageRequest
    - `bucketName` string, required — The export destination bucket name.
    - `prefix` string — The export destination prefix.
    - `projectNumber` string, required — The export destination GCP projectNumber.
    - `poolId` string, required — The export destination Web Identity Federation poolId.
    - `providerId` string, required — The export destination Web Identity Federation identity providerId.
    - `serviceAccountEmail` string — The export destination service account email.
    - `partitionOrder` 'TYPE_FIRST' | 'TIME_FIRST', nullable — Output partitioning
    - `destinationType` 'GCS' — The type of destination
    - `name` string, required — The name of the Export Destination.
    - `code` string, required — The code of the Export Destination.
    - `version` integer — The version number of the entity: - **Create entity:** Not valid for initial insertion of new entity - *do not use for Create*. On initial Create, version is set at 1 and listed in the response. - **Update Entity:** On Update, version is required and must match the existing version because a check is performed to ensure sequential versioning is preserved. Version is incremented by 1 and listed in the response.

## Response `200`

Returns the created Export Destination.

- union
  - ExportDestinationS3Response
    - `bucketName` string — Name of the S3 bucket for the Export Destination.
    - `prefix` string — Location in specified S3 bucket for the Export Destination. If no `prefix` is specified, then the root of the bucket is used.
    - `iamRoleArn` string — The specified IAM role ARN with PutObject permission for the specified `bucketName`, which allows the service to upload Data Exports to your S3 bucket.
    - `partitionOrder` 'TYPE_FIRST' | 'TIME_FIRST' — Output partitioning
    - `name` string — The name of the data Export Destination.
    - `code` string — The code of the data Export Destination.
    - `destinationType` 'S3' | 'GCS' — The type of destination
    - `dtCreated` string, date-time — The DateTime when the Export Destination was created.
    - `dtLastModified` string, date-time — The DateTime when the Export Destination was last modified.
    - `createdBy` string — The id of the user who created the Export Destination.
    - `lastModifiedBy` string — The id of the user who last modified the Export Destination.
    - `id` string, required — The UUID of the entity.
    - `version` integer — The version number: - **Create:** On initial Create to insert a new entity, the version is set at 1 in the response. - **Update:** On successful Update, the version is incremented by 1 in the response.
  - ExportDestinationGoogleCloudStorageResponse
    - `bucketName` string — The bucket name.
    - `prefix` string — The prefix.
    - `projectNumber` string — The export destination GCP projectNumber.
    - `poolId` string — The export destination Web Identity Federation poolId.
    - `providerId` string — The export destination Web Identity Federation identity providerId.
    - `serviceAccountEmail` string — The export destination service account email.
    - `partitionOrder` 'TYPE_FIRST' | 'TIME_FIRST' — Output partitioning
    - `name` string — The name of the data Export Destination.
    - `code` string — The code of the data Export Destination.
    - `destinationType` 'S3' | 'GCS' — The type of destination
    - `dtCreated` string, date-time — The DateTime when the Export Destination was created.
    - `dtLastModified` string, date-time — The DateTime when the Export Destination was last modified.
    - `createdBy` string — The id of the user who created the Export Destination.
    - `lastModifiedBy` string — The id of the user who last modified the Export Destination.
    - `id` string, required — The UUID of the entity.
    - `version` integer — The version number: - **Create:** On initial Create to insert a new entity, the version is set at 1 in the response. - **Update:** On successful Update, the version is incremented by 1 in the response.

## Other responses

- `4XX` — Error message
- `5XX` — Error message

---

[API](https://skmtc.net/m3ter-com/apis/m3ter-api.md) · [All operations](https://skmtc.net/m3ter-com/apis/m3ter-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/m3ter-com/m3ter-api/revisions/ac93d1a9e6d9/schema)
