CreateExportJobCommand

Creates an export job for a data source and destination.

You can execute this operation no more than once per second.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { SESv2Client, CreateExportJobCommand } from "@aws-sdk/client-sesv2"; // ES Modules import
// const { SESv2Client, CreateExportJobCommand } = require("@aws-sdk/client-sesv2"); // CommonJS import
const client = new SESv2Client(config);
const input = { // CreateExportJobRequest
  ExportDataSource: { // ExportDataSource
    MetricsDataSource: { // MetricsDataSource
      Dimensions: { // ExportDimensions // required
        "<keys>": [ // ExportDimensionValue
          "STRING_VALUE",
        ],
      },
      Namespace: "VDM", // required
      Metrics: [ // ExportMetrics // required
        { // ExportMetric
          Name: "SEND" || "COMPLAINT" || "PERMANENT_BOUNCE" || "TRANSIENT_BOUNCE" || "OPEN" || "CLICK" || "DELIVERY" || "DELIVERY_OPEN" || "DELIVERY_CLICK" || "DELIVERY_COMPLAINT",
          Aggregation: "RATE" || "VOLUME",
        },
      ],
      StartDate: new Date("TIMESTAMP"), // required
      EndDate: new Date("TIMESTAMP"), // required
    },
    MessageInsightsDataSource: { // MessageInsightsDataSource
      StartDate: new Date("TIMESTAMP"), // required
      EndDate: new Date("TIMESTAMP"), // required
      Include: { // MessageInsightsFilters
        FromEmailAddress: [ // EmailAddressFilterList
          "STRING_VALUE",
        ],
        Destination: [
          "STRING_VALUE",
        ],
        Subject: [ // EmailSubjectFilterList
          "STRING_VALUE",
        ],
        Isp: [ // IspFilterList
          "STRING_VALUE",
        ],
        LastDeliveryEvent: [ // LastDeliveryEventList
          "SEND" || "DELIVERY" || "TRANSIENT_BOUNCE" || "PERMANENT_BOUNCE" || "UNDETERMINED_BOUNCE" || "COMPLAINT",
        ],
        LastEngagementEvent: [ // LastEngagementEventList
          "OPEN" || "CLICK",
        ],
      },
      Exclude: {
        FromEmailAddress: [
          "STRING_VALUE",
        ],
        Destination: [
          "STRING_VALUE",
        ],
        Subject: [
          "STRING_VALUE",
        ],
        Isp: [
          "STRING_VALUE",
        ],
        LastDeliveryEvent: [
          "SEND" || "DELIVERY" || "TRANSIENT_BOUNCE" || "PERMANENT_BOUNCE" || "UNDETERMINED_BOUNCE" || "COMPLAINT",
        ],
        LastEngagementEvent: [
          "OPEN" || "CLICK",
        ],
      },
      MaxResults: Number("int"),
    },
  },
  ExportDestination: { // ExportDestination
    DataFormat: "CSV" || "JSON", // required
    S3Url: "STRING_VALUE",
  },
};
const command = new CreateExportJobCommand(input);
const response = await client.send(command);
// { // CreateExportJobResponse
//   JobId: "STRING_VALUE",
// };

Example Usage

 There was an error loading the code editor. Retry

CreateExportJobCommand Input

See CreateExportJobCommandInput for more details

Parameter
Type
Description
ExportDataSource
Required
ExportDataSource | undefined

The data source for the export job.

ExportDestination
Required
ExportDestination | undefined

The destination for the export job.

CreateExportJobCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
JobId
string | undefined

A string that represents the export job ID.

Throws

Name
Fault
Details
BadRequestException
client

The input you provided is invalid.

LimitExceededException
client

There are too many instances of the specified resource type.

NotFoundException
client

The resource you attempted to access doesn't exist.

TooManyRequestsException
client

Too many requests have been made to the operation.

SESv2ServiceException
Base exception class for all service exceptions from SESv2 service.