StartMailboxExportJobCommand

Starts a mailbox export job to export MIME-format email messages and calendar items from the specified mailbox to the specified Amazon Simple Storage Service (Amazon S3) bucket. For more information, see Exporting mailbox content  in the WorkMail Administrator Guide.

Example Syntax

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

import { WorkMailClient, StartMailboxExportJobCommand } from "@aws-sdk/client-workmail"; // ES Modules import
// const { WorkMailClient, StartMailboxExportJobCommand } = require("@aws-sdk/client-workmail"); // CommonJS import
const client = new WorkMailClient(config);
const input = { // StartMailboxExportJobRequest
  ClientToken: "STRING_VALUE", // required
  OrganizationId: "STRING_VALUE", // required
  EntityId: "STRING_VALUE", // required
  Description: "STRING_VALUE",
  RoleArn: "STRING_VALUE", // required
  KmsKeyArn: "STRING_VALUE", // required
  S3BucketName: "STRING_VALUE", // required
  S3Prefix: "STRING_VALUE", // required
};
const command = new StartMailboxExportJobCommand(input);
const response = await client.send(command);
// { // StartMailboxExportJobResponse
//   JobId: "STRING_VALUE",
// };

StartMailboxExportJobCommand Input

Parameter
Type
Description
EntityId
Required
string | undefined

The identifier of the user or resource associated with the mailbox.

The identifier can accept UserId or ResourceId, Username or Resourcename, or email. The following identity formats are available:

  • Entity ID: 12345678-1234-1234-1234-123456789012, r-0123456789a0123456789b0123456789 , or S-1-1-12-1234567890-123456789-123456789-1234

  • Email address: entitydomain.tld

  • Entity name: entity

KmsKeyArn
Required
string | undefined

The Amazon Resource Name (ARN) of the symmetric AWS Key Management Service (AWS KMS) key that encrypts the exported mailbox content.

OrganizationId
Required
string | undefined

The identifier associated with the organization.

RoleArn
Required
string | undefined

The ARN of the AWS Identity and Access Management (IAM) role that grants write permission to the S3 bucket.

S3BucketName
Required
string | undefined

The name of the S3 bucket.

S3Prefix
Required
string | undefined

The S3 bucket prefix.

ClientToken
string | undefined

The idempotency token for the client request.

Description
string | undefined

The mailbox export job description.

StartMailboxExportJobCommand Output

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

The job ID.

Throws

Name
Fault
Details
EntityNotFoundException
client

The identifier supplied for the user, group, or resource does not exist in your organization.

InvalidParameterException
client

One or more of the input parameters don't match the service's restrictions.

LimitExceededException
client

The request exceeds the limit of the resource.

OrganizationNotFoundException
client

An operation received a valid organization identifier that either doesn't belong or exist in the system.

OrganizationStateException
client

The organization must have a valid state to perform certain operations on the organization or its members.

WorkMailServiceException
Base exception class for all service exceptions from WorkMail service.