# Campaigns

## Create Campaign

`client.printMail.campaigns.create(CampaignCreateParamsparams, RequestOptionsoptions?): Campaign`

**post** `/print-mail/v1/campaigns`

Create a new campaign.

A campaign links a mailing list with a specific mail piece configuration (letter, postcard, cheque, self-mailer, or snap pack)
to send bulk mail. Only one collateral type can be set per campaign.

Upon creation, the campaign enters the `drafting` status while assets are validated.

### Parameters

- `params: CampaignCreateParams`

  - `mailingList: string`

    Body param: The ID of the mailing list associated with this campaign.

  - `cheque?: Cheque`

    Body param: Inline cheque configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `bankAccount?: string`

      ID of the bank account to use for the cheque.

    - `currencyCode?: "CAD" | "USD"`

      Enum representing the supported currency codes.

      - `"CAD"`

      - `"USD"`

    - `description?: string`

      An optional description.

    - `envelope?: string`

      The custom envelope ID or `"standard"`.

    - `letterPDF?: string | Uploadable`

      PDF file for an optional attached letter. Cannot be used with `letterTemplate`.

      - `string`

      - `Uploadable`

    - `letterSettings?: LetterSettings`

      Settings for the attached letter (e.g., color printing).

      - `color?: boolean`

        Whether to print the attached letter in color.

    - `letterTemplate?: string`

      ID of a template for an optional attached letter. Cannot be used with `letterPDF`.

    - `logo?: string`

      A publicly accessible URL for the logo to print on the cheque.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the cheque.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `memo?: string`

      Memo line text for the cheque.

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the cheque.

    - `message?: string`

      Message included on the cheque stub.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `returnEnvelope?: string`

      ID of a return envelope to include.

    - `size?: ChequeSize`

      Enum representing the supported cheque sizes.

      - `"us_letter"`

      - `"us_legal"`

  - `defaultSenderContact?: string`

    Body param: The ID of the default sender contact to use for orders if not specified per recipient.

  - `description?: string`

    Body param: An optional string describing this resource. Will be visible in the API and the dashboard.

  - `letter?: Letter`

    Body param: Inline letter configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `addressPlacement?: AddressPlacement`

      Enum representing the placement of the address on the letter.

      - `"top_first_page"`

      - `"insert_blank_page"`

    - `attachedPDF?: AttachedPdf`

      Model representing an attached PDF.

      - `file: string | Uploadable`

        The file (multipart form upload) or URL pointing to a PDF for the attached PDF.

        - `string`

        - `Uploadable`

      - `placement: "before_template" | "after_template"`

        Enum representing the placement of the attached PDF.

        - `"before_template"`

        - `"after_template"`

    - `color?: boolean`

      Whether to print in color.

    - `description?: string`

      An optional description.

    - `doubleSided?: boolean`

      Whether to print on both sides of the paper.

    - `envelope?: string`

      The custom envelope ID or `"standard"`.

    - `envelopeType?: "standard_double_window" | "flat"`

      The type of envelope used for the letter.

      - `"standard_double_window"`

      - `"flat"`

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the letter.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the letter.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `paper?: "standard" | "premium_paper_letter_standard_white_70lb" | "premium_paper_letter_standard_white_80lb" | (string & {})`

      Premium paper selection ("standard" or a premium paper ID). If omitted, org default is used when configured; otherwise "standard".

      - `"standard" | "premium_paper_letter_standard_white_70lb" | "premium_paper_letter_standard_white_80lb"`

        - `"standard"`

        - `"premium_paper_letter_standard_white_70lb"`

        - `"premium_paper_letter_standard_white_80lb"`

      - `(string & {})`

    - `pdf?: string | Uploadable`

      A PDF file or URL for the letter content. Cannot be used with `template`.

      - `string`

      - `Uploadable`

    - `perforatedPage?: 1`

      Which page number should be perforated (if any).

      - `1`

    - `returnEnvelope?: string`

      ID of a return envelope to include.

    - `size?: LetterSize`

      Enum representing the supported letter sizes.

      - `"us_letter"`

      - `"a4"`

    - `template?: string`

      ID of a template for the letter content. Cannot be used with `pdf`.

  - `metadata?: Record<string, unknown>`

    Body param: See the section on Metadata.

  - `postcard?: Postcard`

    Body param: Inline postcard configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `backTemplate?: string`

      ID of the template for the back side. Cannot be used with `pdf`.

    - `description?: string`

      An optional description.

    - `frontTemplate?: string`

      ID of the template for the front side. Cannot be used with `pdf`.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the postcard.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the postcard.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `paper?: "standard" | "premium_paper_heavy_1_glossy" | "premium_paper_postcard_uv_glossy_ss" | 2 more | (string & {})`

      Premium paper selection ("standard" or a premium paper ID). If omitted, org default is used when configured; otherwise "standard".

      - `"standard" | "premium_paper_heavy_1_glossy" | "premium_paper_postcard_uv_glossy_ss" | 2 more`

        - `"standard"`

        - `"premium_paper_heavy_1_glossy"`

        - `"premium_paper_postcard_uv_glossy_ss"`

        - `"premium_paper_postcard_uv_glossy_ss_120lb"`

        - `"premium_paper_postcard_satin_ds"`

      - `(string & {})`

    - `pdf?: string | Uploadable`

      A 2-page PDF file for the postcard content (front and back). Cannot be used with `frontTemplate`/`backTemplate`.

      - `string`

      - `Uploadable`

    - `size?: "6x4" | "9x6" | "11x6"`

      Enum representing the supported postcard sizes.

      - `"6x4"`

      - `"9x6"`

      - `"11x6"`

  - `selfMailer?: SelfMailer`

    Body param: Inline self-mailer configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `description?: string`

      An optional description.

    - `insideTemplate?: string`

      ID of the template for the inside. Cannot be used with `pdf`.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the self-mailer.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the self-mailer.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `outsideTemplate?: string`

      ID of the template for the outside. Cannot be used with `pdf`.

    - `pdf?: string | Uploadable`

      A 2-page PDF file for the self-mailer content. Cannot be used with `insideTemplate`/`outsideTemplate`.

      - `string`

      - `Uploadable`

    - `size?: "8.5x11_bifold" | "8.5x11_trifold" | "9.5x16_trifold"`

      Enum representing the supported self-mailer sizes.

      - `"8.5x11_bifold"`

      - `"8.5x11_trifold"`

      - `"9.5x16_trifold"`

  - `sendDate?: string`

    Body param: The scheduled date and time for the campaign to be sent.

  - `snapPack?: SnapPack`

    Body param: Inline snap pack configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `description?: string`

      An optional description.

    - `insideTemplate?: string`

      ID of the template for the inside. Cannot be used with `pdf`.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the snap pack.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the snap pack.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `outsideTemplate?: string`

      ID of the template for the outside. Cannot be used with `pdf`.

    - `pdf?: string | Uploadable`

      A 2-page PDF file for the snap pack content. Cannot be used with `insideTemplate`/`outsideTemplate`.

      - `string`

      - `Uploadable`

    - `size?: "8.5x11_bifold_v"`

      Enum representing the supported snap pack sizes.

      - `"8.5x11_bifold_v"`

  - `idempotencyKey?: string`

    Header param

### Returns

- `Campaign`

  Represents a bulk mail campaign.

  - `id: string`

    A unique ID prefixed with campaign_

  - `createdAt: string`

    The UTC time at which this resource was created.

  - `createdCount: number`

    The number of orders successfully created for this campaign.

  - `live: boolean`

    `true` if this is a live mode resource else `false`.

  - `mailingList: string`

    The ID of the mailing list associated with this campaign.

  - `status: "drafting" | "changes_required" | "creating_orders" | 4 more`

    Status of the campaign lifecycle.

    - `"drafting"`

    - `"changes_required"`

    - `"creating_orders"`

    - `"draft"`

    - `"ready"`

    - `"printing"`

    - `"processed_for_delivery"`

  - `updatedAt: string`

    The UTC time at which this resource was last updated.

  - `cheque?: Cheque`

    Inline cheque configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `bankAccount?: string`

      ID of the bank account to use for the cheque.

    - `currencyCode?: "CAD" | "USD"`

      Enum representing the supported currency codes.

      - `"CAD"`

      - `"USD"`

    - `description?: string`

      An optional description.

    - `envelope?: string`

      The custom envelope ID or `"standard"`.

    - `letterSettings?: LetterSettings`

      Settings for the attached letter (e.g., color printing).

      - `color?: boolean`

        Whether to print the attached letter in color.

    - `letterTemplate?: string`

      ID of a template for an optional attached letter. Cannot be used with `letterPDF`.

    - `letterUploadedPDF?: string`

      A signed URL to the attached letter PDF, if any.

    - `logo?: string`

      A publicly accessible URL for the logo to print on the cheque.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the cheque.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `memo?: string`

      Memo line text for the cheque.

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the cheque.

    - `message?: string`

      Message included on the cheque stub.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `returnEnvelope?: string`

      ID of a return envelope to include.

    - `size?: ChequeSize`

      Enum representing the supported cheque sizes.

      - `"us_letter"`

      - `"us_legal"`

  - `defaultSenderContact?: string`

    The ID of the default sender contact to use for orders if not specified per recipient.

  - `description?: string`

    An optional string describing this resource. Will be visible in the API and the dashboard.

  - `errors?: Array<Error>`

    A list of processing errors encountered, if any. Present when status is 'changes_required'.

    - `message: string`

      A human-readable message describing the error.

    - `type: "processing_error" | "internal_error"`

      Type of error encountered during campaign processing.

      - `"processing_error"`

      - `"internal_error"`

  - `letter?: Letter`

    Inline letter configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `addressPlacement?: AddressPlacement`

      Enum representing the placement of the address on the letter.

      - `"top_first_page"`

      - `"insert_blank_page"`

    - `attachedPDF?: AttachedPdf`

      Model representing an attached PDF.

      - `file: string | Uploadable`

        The file (multipart form upload) or URL pointing to a PDF for the attached PDF.

        - `string`

        - `Uploadable`

      - `placement: "before_template" | "after_template"`

        Enum representing the placement of the attached PDF.

        - `"before_template"`

        - `"after_template"`

    - `color?: boolean`

      Whether to print in color.

    - `description?: string`

      An optional description.

    - `doubleSided?: boolean`

      Whether to print on both sides of the paper.

    - `envelope?: string`

      The custom envelope ID or `"standard"`.

    - `envelopeType?: "standard_double_window" | "flat"`

      The type of envelope used for the letter.

      - `"standard_double_window"`

      - `"flat"`

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the letter.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the letter.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `paper?: "standard" | "premium_paper_letter_standard_white_70lb" | "premium_paper_letter_standard_white_80lb" | (string & {})`

      Premium paper selection ("standard" or a premium paper ID). If omitted, org default is used when configured; otherwise "standard".

      - `"standard" | "premium_paper_letter_standard_white_70lb" | "premium_paper_letter_standard_white_80lb"`

        - `"standard"`

        - `"premium_paper_letter_standard_white_70lb"`

        - `"premium_paper_letter_standard_white_80lb"`

      - `(string & {})`

    - `perforatedPage?: 1`

      Which page number should be perforated (if any).

      - `1`

    - `returnEnvelope?: string`

      ID of a return envelope to include.

    - `size?: LetterSize`

      Enum representing the supported letter sizes.

      - `"us_letter"`

      - `"a4"`

    - `template?: string`

      ID of a template for the letter content. Cannot be used with `pdf`.

    - `uploadedPDF?: string`

      A signed URL to the uploaded PDF, if any.

  - `metadata?: Record<string, unknown>`

    See the section on Metadata.

  - `orderPreviewURL?: string`

    A temporary URL to preview the first rendered order, available once the campaign status is 'draft' or later.

  - `postcard?: Postcard`

    Inline postcard configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `backTemplate?: string`

      ID of the template for the back side. Cannot be used with `pdf`.

    - `description?: string`

      An optional description.

    - `frontTemplate?: string`

      ID of the template for the front side. Cannot be used with `pdf`.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the postcard.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the postcard.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `paper?: "standard" | "premium_paper_heavy_1_glossy" | "premium_paper_postcard_uv_glossy_ss" | 2 more | (string & {})`

      Premium paper selection ("standard" or a premium paper ID). If omitted, org default is used when configured; otherwise "standard".

      - `"standard" | "premium_paper_heavy_1_glossy" | "premium_paper_postcard_uv_glossy_ss" | 2 more`

        - `"standard"`

        - `"premium_paper_heavy_1_glossy"`

        - `"premium_paper_postcard_uv_glossy_ss"`

        - `"premium_paper_postcard_uv_glossy_ss_120lb"`

        - `"premium_paper_postcard_satin_ds"`

      - `(string & {})`

    - `size?: "6x4" | "9x6" | "11x6"`

      Enum representing the supported postcard sizes.

      - `"6x4"`

      - `"9x6"`

      - `"11x6"`

    - `uploadedPDF?: string`

      A signed URL to the uploaded PDF, if any.

  - `reportURL?: string`

    A temporary URL to download the processing report, available once the campaign is in the `ready` status.

  - `selfMailer?: SelfMailer`

    Inline self-mailer configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `description?: string`

      An optional description.

    - `insideTemplate?: string`

      ID of the template for the inside. Cannot be used with `pdf`.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the self-mailer.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the self-mailer.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `outsideTemplate?: string`

      ID of the template for the outside. Cannot be used with `pdf`.

    - `size?: "8.5x11_bifold" | "8.5x11_trifold" | "9.5x16_trifold"`

      Enum representing the supported self-mailer sizes.

      - `"8.5x11_bifold"`

      - `"8.5x11_trifold"`

      - `"9.5x16_trifold"`

    - `uploadedPDF?: string`

      A signed URL to the uploaded PDF, if any.

  - `sendDate?: string`

    The scheduled date and time for the campaign to be sent.

  - `snapPack?: SnapPack`

    Inline snap pack configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `description?: string`

      An optional description.

    - `insideTemplate?: string`

      ID of the template for the inside. Cannot be used with `pdf`.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the snap pack.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the snap pack.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `outsideTemplate?: string`

      ID of the template for the outside. Cannot be used with `pdf`.

    - `size?: "8.5x11_bifold_v"`

      Enum representing the supported snap pack sizes.

      - `"8.5x11_bifold_v"`

    - `uploadedPDF?: string`

      A signed URL to the uploaded PDF, if any.

### Example

```typescript
import PostGrid from 'postgrid-node';

const client = new PostGrid({
  printMailAPIKey: process.env['POSTGRID_PRINT_MAIL_API_KEY'], // This is the default and can be omitted
});

const campaign = await client.printMail.campaigns.create({ mailingList: 'mailingList' });

console.log(campaign.id);
```

#### Response

```json
{
  "id": "campaign_sqF12lZ1VlBb",
  "createdAt": "2019-12-27T18:11:19.117Z",
  "createdCount": 0,
  "live": true,
  "mailingList": "mailingList",
  "status": "drafting",
  "updatedAt": "2019-12-27T18:11:19.117Z",
  "cheque": {
    "bankAccount": "bankAccount",
    "currencyCode": "CAD",
    "description": "description",
    "envelope": "envelope",
    "letterSettings": {
      "color": true
    },
    "letterTemplate": "letterTemplate",
    "letterUploadedPDF": "https://example.com",
    "logo": "https://example.com",
    "mailingClass": "first_class",
    "memo": "memo",
    "mergeVariables": {
      "foo": "bar"
    },
    "message": "message",
    "metadata": {
      "foo": "string"
    },
    "returnEnvelope": "returnEnvelope",
    "size": "us_letter"
  },
  "defaultSenderContact": "defaultSenderContact",
  "description": "description",
  "errors": [
    {
      "message": "message",
      "type": "processing_error"
    }
  ],
  "letter": {
    "addressPlacement": "top_first_page",
    "attachedPDF": {
      "file": "https://example.com",
      "placement": "before_template"
    },
    "color": true,
    "description": "description",
    "doubleSided": true,
    "envelope": "envelope",
    "envelopeType": "standard_double_window",
    "mailingClass": "first_class",
    "mergeVariables": {
      "foo": "bar"
    },
    "metadata": {
      "foo": "string"
    },
    "paper": "standard",
    "perforatedPage": 1,
    "returnEnvelope": "returnEnvelope",
    "size": "us_letter",
    "template": "template",
    "uploadedPDF": "https://example.com"
  },
  "metadata": {
    "foo": "bar"
  },
  "orderPreviewURL": "https://example.com",
  "postcard": {
    "backTemplate": "backTemplate",
    "description": "description",
    "frontTemplate": "frontTemplate",
    "mailingClass": "first_class",
    "mergeVariables": {
      "foo": "bar"
    },
    "metadata": {
      "foo": "string"
    },
    "paper": "standard",
    "size": "6x4",
    "uploadedPDF": "https://example.com"
  },
  "reportURL": "https://example.com",
  "selfMailer": {
    "description": "description",
    "insideTemplate": "insideTemplate",
    "mailingClass": "first_class",
    "mergeVariables": {
      "foo": "bar"
    },
    "metadata": {
      "foo": "string"
    },
    "outsideTemplate": "outsideTemplate",
    "size": "8.5x11_bifold",
    "uploadedPDF": "https://example.com"
  },
  "sendDate": "2019-12-27T18:11:19.117Z",
  "snapPack": {
    "description": "description",
    "insideTemplate": "insideTemplate",
    "mailingClass": "first_class",
    "mergeVariables": {
      "foo": "bar"
    },
    "metadata": {
      "foo": "string"
    },
    "outsideTemplate": "outsideTemplate",
    "size": "8.5x11_bifold_v",
    "uploadedPDF": "https://example.com"
  }
}
```

## List Campaigns

`client.printMail.campaigns.list(CampaignListParamsquery?, RequestOptionsoptions?): SkipLimit<Campaign>`

**get** `/print-mail/v1/campaigns`

Retrieve a list of campaigns.

Returns a paginated list of campaigns associated with the authenticated organization,
filterable by various parameters.

### Parameters

- `query: CampaignListParams`

  - `limit?: number`

  - `search?: string`

    You can supply any string to help narrow down the list of resources. For example, if you pass `"New York"` (quoted), it will return resources that have that string present somewhere in their response. Alternatively, you can supply a structured search query. See the documentation on `StructuredSearchQuery` for more details.

  - `skip?: number`

### Returns

- `Campaign`

  Represents a bulk mail campaign.

  - `id: string`

    A unique ID prefixed with campaign_

  - `createdAt: string`

    The UTC time at which this resource was created.

  - `createdCount: number`

    The number of orders successfully created for this campaign.

  - `live: boolean`

    `true` if this is a live mode resource else `false`.

  - `mailingList: string`

    The ID of the mailing list associated with this campaign.

  - `status: "drafting" | "changes_required" | "creating_orders" | 4 more`

    Status of the campaign lifecycle.

    - `"drafting"`

    - `"changes_required"`

    - `"creating_orders"`

    - `"draft"`

    - `"ready"`

    - `"printing"`

    - `"processed_for_delivery"`

  - `updatedAt: string`

    The UTC time at which this resource was last updated.

  - `cheque?: Cheque`

    Inline cheque configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `bankAccount?: string`

      ID of the bank account to use for the cheque.

    - `currencyCode?: "CAD" | "USD"`

      Enum representing the supported currency codes.

      - `"CAD"`

      - `"USD"`

    - `description?: string`

      An optional description.

    - `envelope?: string`

      The custom envelope ID or `"standard"`.

    - `letterSettings?: LetterSettings`

      Settings for the attached letter (e.g., color printing).

      - `color?: boolean`

        Whether to print the attached letter in color.

    - `letterTemplate?: string`

      ID of a template for an optional attached letter. Cannot be used with `letterPDF`.

    - `letterUploadedPDF?: string`

      A signed URL to the attached letter PDF, if any.

    - `logo?: string`

      A publicly accessible URL for the logo to print on the cheque.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the cheque.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `memo?: string`

      Memo line text for the cheque.

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the cheque.

    - `message?: string`

      Message included on the cheque stub.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `returnEnvelope?: string`

      ID of a return envelope to include.

    - `size?: ChequeSize`

      Enum representing the supported cheque sizes.

      - `"us_letter"`

      - `"us_legal"`

  - `defaultSenderContact?: string`

    The ID of the default sender contact to use for orders if not specified per recipient.

  - `description?: string`

    An optional string describing this resource. Will be visible in the API and the dashboard.

  - `errors?: Array<Error>`

    A list of processing errors encountered, if any. Present when status is 'changes_required'.

    - `message: string`

      A human-readable message describing the error.

    - `type: "processing_error" | "internal_error"`

      Type of error encountered during campaign processing.

      - `"processing_error"`

      - `"internal_error"`

  - `letter?: Letter`

    Inline letter configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `addressPlacement?: AddressPlacement`

      Enum representing the placement of the address on the letter.

      - `"top_first_page"`

      - `"insert_blank_page"`

    - `attachedPDF?: AttachedPdf`

      Model representing an attached PDF.

      - `file: string | Uploadable`

        The file (multipart form upload) or URL pointing to a PDF for the attached PDF.

        - `string`

        - `Uploadable`

      - `placement: "before_template" | "after_template"`

        Enum representing the placement of the attached PDF.

        - `"before_template"`

        - `"after_template"`

    - `color?: boolean`

      Whether to print in color.

    - `description?: string`

      An optional description.

    - `doubleSided?: boolean`

      Whether to print on both sides of the paper.

    - `envelope?: string`

      The custom envelope ID or `"standard"`.

    - `envelopeType?: "standard_double_window" | "flat"`

      The type of envelope used for the letter.

      - `"standard_double_window"`

      - `"flat"`

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the letter.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the letter.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `paper?: "standard" | "premium_paper_letter_standard_white_70lb" | "premium_paper_letter_standard_white_80lb" | (string & {})`

      Premium paper selection ("standard" or a premium paper ID). If omitted, org default is used when configured; otherwise "standard".

      - `"standard" | "premium_paper_letter_standard_white_70lb" | "premium_paper_letter_standard_white_80lb"`

        - `"standard"`

        - `"premium_paper_letter_standard_white_70lb"`

        - `"premium_paper_letter_standard_white_80lb"`

      - `(string & {})`

    - `perforatedPage?: 1`

      Which page number should be perforated (if any).

      - `1`

    - `returnEnvelope?: string`

      ID of a return envelope to include.

    - `size?: LetterSize`

      Enum representing the supported letter sizes.

      - `"us_letter"`

      - `"a4"`

    - `template?: string`

      ID of a template for the letter content. Cannot be used with `pdf`.

    - `uploadedPDF?: string`

      A signed URL to the uploaded PDF, if any.

  - `metadata?: Record<string, unknown>`

    See the section on Metadata.

  - `orderPreviewURL?: string`

    A temporary URL to preview the first rendered order, available once the campaign status is 'draft' or later.

  - `postcard?: Postcard`

    Inline postcard configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `backTemplate?: string`

      ID of the template for the back side. Cannot be used with `pdf`.

    - `description?: string`

      An optional description.

    - `frontTemplate?: string`

      ID of the template for the front side. Cannot be used with `pdf`.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the postcard.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the postcard.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `paper?: "standard" | "premium_paper_heavy_1_glossy" | "premium_paper_postcard_uv_glossy_ss" | 2 more | (string & {})`

      Premium paper selection ("standard" or a premium paper ID). If omitted, org default is used when configured; otherwise "standard".

      - `"standard" | "premium_paper_heavy_1_glossy" | "premium_paper_postcard_uv_glossy_ss" | 2 more`

        - `"standard"`

        - `"premium_paper_heavy_1_glossy"`

        - `"premium_paper_postcard_uv_glossy_ss"`

        - `"premium_paper_postcard_uv_glossy_ss_120lb"`

        - `"premium_paper_postcard_satin_ds"`

      - `(string & {})`

    - `size?: "6x4" | "9x6" | "11x6"`

      Enum representing the supported postcard sizes.

      - `"6x4"`

      - `"9x6"`

      - `"11x6"`

    - `uploadedPDF?: string`

      A signed URL to the uploaded PDF, if any.

  - `reportURL?: string`

    A temporary URL to download the processing report, available once the campaign is in the `ready` status.

  - `selfMailer?: SelfMailer`

    Inline self-mailer configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `description?: string`

      An optional description.

    - `insideTemplate?: string`

      ID of the template for the inside. Cannot be used with `pdf`.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the self-mailer.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the self-mailer.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `outsideTemplate?: string`

      ID of the template for the outside. Cannot be used with `pdf`.

    - `size?: "8.5x11_bifold" | "8.5x11_trifold" | "9.5x16_trifold"`

      Enum representing the supported self-mailer sizes.

      - `"8.5x11_bifold"`

      - `"8.5x11_trifold"`

      - `"9.5x16_trifold"`

    - `uploadedPDF?: string`

      A signed URL to the uploaded PDF, if any.

  - `sendDate?: string`

    The scheduled date and time for the campaign to be sent.

  - `snapPack?: SnapPack`

    Inline snap pack configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `description?: string`

      An optional description.

    - `insideTemplate?: string`

      ID of the template for the inside. Cannot be used with `pdf`.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the snap pack.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the snap pack.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `outsideTemplate?: string`

      ID of the template for the outside. Cannot be used with `pdf`.

    - `size?: "8.5x11_bifold_v"`

      Enum representing the supported snap pack sizes.

      - `"8.5x11_bifold_v"`

    - `uploadedPDF?: string`

      A signed URL to the uploaded PDF, if any.

### Example

```typescript
import PostGrid from 'postgrid-node';

const client = new PostGrid({
  printMailAPIKey: process.env['POSTGRID_PRINT_MAIL_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const campaign of client.printMail.campaigns.list()) {
  console.log(campaign.id);
}
```

#### Response

```json
{
  "data": [
    {
      "id": "campaign_sqF12lZ1VlBb",
      "createdAt": "2019-12-27T18:11:19.117Z",
      "createdCount": 0,
      "live": true,
      "mailingList": "mailingList",
      "status": "drafting",
      "updatedAt": "2019-12-27T18:11:19.117Z",
      "cheque": {
        "bankAccount": "bankAccount",
        "currencyCode": "CAD",
        "description": "description",
        "envelope": "envelope",
        "letterSettings": {
          "color": true
        },
        "letterTemplate": "letterTemplate",
        "letterUploadedPDF": "https://example.com",
        "logo": "https://example.com",
        "mailingClass": "first_class",
        "memo": "memo",
        "mergeVariables": {
          "foo": "bar"
        },
        "message": "message",
        "metadata": {
          "foo": "string"
        },
        "returnEnvelope": "returnEnvelope",
        "size": "us_letter"
      },
      "defaultSenderContact": "defaultSenderContact",
      "description": "description",
      "errors": [
        {
          "message": "message",
          "type": "processing_error"
        }
      ],
      "letter": {
        "addressPlacement": "top_first_page",
        "attachedPDF": {
          "file": "https://example.com",
          "placement": "before_template"
        },
        "color": true,
        "description": "description",
        "doubleSided": true,
        "envelope": "envelope",
        "envelopeType": "standard_double_window",
        "mailingClass": "first_class",
        "mergeVariables": {
          "foo": "bar"
        },
        "metadata": {
          "foo": "string"
        },
        "paper": "standard",
        "perforatedPage": 1,
        "returnEnvelope": "returnEnvelope",
        "size": "us_letter",
        "template": "template",
        "uploadedPDF": "https://example.com"
      },
      "metadata": {
        "foo": "bar"
      },
      "orderPreviewURL": "https://example.com",
      "postcard": {
        "backTemplate": "backTemplate",
        "description": "description",
        "frontTemplate": "frontTemplate",
        "mailingClass": "first_class",
        "mergeVariables": {
          "foo": "bar"
        },
        "metadata": {
          "foo": "string"
        },
        "paper": "standard",
        "size": "6x4",
        "uploadedPDF": "https://example.com"
      },
      "reportURL": "https://example.com",
      "selfMailer": {
        "description": "description",
        "insideTemplate": "insideTemplate",
        "mailingClass": "first_class",
        "mergeVariables": {
          "foo": "bar"
        },
        "metadata": {
          "foo": "string"
        },
        "outsideTemplate": "outsideTemplate",
        "size": "8.5x11_bifold",
        "uploadedPDF": "https://example.com"
      },
      "sendDate": "2019-12-27T18:11:19.117Z",
      "snapPack": {
        "description": "description",
        "insideTemplate": "insideTemplate",
        "mailingClass": "first_class",
        "mergeVariables": {
          "foo": "bar"
        },
        "metadata": {
          "foo": "string"
        },
        "outsideTemplate": "outsideTemplate",
        "size": "8.5x11_bifold_v",
        "uploadedPDF": "https://example.com"
      }
    }
  ],
  "limit": 0,
  "object": "list",
  "skip": 0,
  "totalCount": 0
}
```

## Get Campaign

`client.printMail.campaigns.retrieve(stringid, RequestOptionsoptions?): Campaign`

**get** `/print-mail/v1/campaigns/{id}`

Retrieve a specific campaign by its ID.

### Parameters

- `id: string`

### Returns

- `Campaign`

  Represents a bulk mail campaign.

  - `id: string`

    A unique ID prefixed with campaign_

  - `createdAt: string`

    The UTC time at which this resource was created.

  - `createdCount: number`

    The number of orders successfully created for this campaign.

  - `live: boolean`

    `true` if this is a live mode resource else `false`.

  - `mailingList: string`

    The ID of the mailing list associated with this campaign.

  - `status: "drafting" | "changes_required" | "creating_orders" | 4 more`

    Status of the campaign lifecycle.

    - `"drafting"`

    - `"changes_required"`

    - `"creating_orders"`

    - `"draft"`

    - `"ready"`

    - `"printing"`

    - `"processed_for_delivery"`

  - `updatedAt: string`

    The UTC time at which this resource was last updated.

  - `cheque?: Cheque`

    Inline cheque configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `bankAccount?: string`

      ID of the bank account to use for the cheque.

    - `currencyCode?: "CAD" | "USD"`

      Enum representing the supported currency codes.

      - `"CAD"`

      - `"USD"`

    - `description?: string`

      An optional description.

    - `envelope?: string`

      The custom envelope ID or `"standard"`.

    - `letterSettings?: LetterSettings`

      Settings for the attached letter (e.g., color printing).

      - `color?: boolean`

        Whether to print the attached letter in color.

    - `letterTemplate?: string`

      ID of a template for an optional attached letter. Cannot be used with `letterPDF`.

    - `letterUploadedPDF?: string`

      A signed URL to the attached letter PDF, if any.

    - `logo?: string`

      A publicly accessible URL for the logo to print on the cheque.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the cheque.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `memo?: string`

      Memo line text for the cheque.

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the cheque.

    - `message?: string`

      Message included on the cheque stub.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `returnEnvelope?: string`

      ID of a return envelope to include.

    - `size?: ChequeSize`

      Enum representing the supported cheque sizes.

      - `"us_letter"`

      - `"us_legal"`

  - `defaultSenderContact?: string`

    The ID of the default sender contact to use for orders if not specified per recipient.

  - `description?: string`

    An optional string describing this resource. Will be visible in the API and the dashboard.

  - `errors?: Array<Error>`

    A list of processing errors encountered, if any. Present when status is 'changes_required'.

    - `message: string`

      A human-readable message describing the error.

    - `type: "processing_error" | "internal_error"`

      Type of error encountered during campaign processing.

      - `"processing_error"`

      - `"internal_error"`

  - `letter?: Letter`

    Inline letter configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `addressPlacement?: AddressPlacement`

      Enum representing the placement of the address on the letter.

      - `"top_first_page"`

      - `"insert_blank_page"`

    - `attachedPDF?: AttachedPdf`

      Model representing an attached PDF.

      - `file: string | Uploadable`

        The file (multipart form upload) or URL pointing to a PDF for the attached PDF.

        - `string`

        - `Uploadable`

      - `placement: "before_template" | "after_template"`

        Enum representing the placement of the attached PDF.

        - `"before_template"`

        - `"after_template"`

    - `color?: boolean`

      Whether to print in color.

    - `description?: string`

      An optional description.

    - `doubleSided?: boolean`

      Whether to print on both sides of the paper.

    - `envelope?: string`

      The custom envelope ID or `"standard"`.

    - `envelopeType?: "standard_double_window" | "flat"`

      The type of envelope used for the letter.

      - `"standard_double_window"`

      - `"flat"`

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the letter.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the letter.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `paper?: "standard" | "premium_paper_letter_standard_white_70lb" | "premium_paper_letter_standard_white_80lb" | (string & {})`

      Premium paper selection ("standard" or a premium paper ID). If omitted, org default is used when configured; otherwise "standard".

      - `"standard" | "premium_paper_letter_standard_white_70lb" | "premium_paper_letter_standard_white_80lb"`

        - `"standard"`

        - `"premium_paper_letter_standard_white_70lb"`

        - `"premium_paper_letter_standard_white_80lb"`

      - `(string & {})`

    - `perforatedPage?: 1`

      Which page number should be perforated (if any).

      - `1`

    - `returnEnvelope?: string`

      ID of a return envelope to include.

    - `size?: LetterSize`

      Enum representing the supported letter sizes.

      - `"us_letter"`

      - `"a4"`

    - `template?: string`

      ID of a template for the letter content. Cannot be used with `pdf`.

    - `uploadedPDF?: string`

      A signed URL to the uploaded PDF, if any.

  - `metadata?: Record<string, unknown>`

    See the section on Metadata.

  - `orderPreviewURL?: string`

    A temporary URL to preview the first rendered order, available once the campaign status is 'draft' or later.

  - `postcard?: Postcard`

    Inline postcard configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `backTemplate?: string`

      ID of the template for the back side. Cannot be used with `pdf`.

    - `description?: string`

      An optional description.

    - `frontTemplate?: string`

      ID of the template for the front side. Cannot be used with `pdf`.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the postcard.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the postcard.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `paper?: "standard" | "premium_paper_heavy_1_glossy" | "premium_paper_postcard_uv_glossy_ss" | 2 more | (string & {})`

      Premium paper selection ("standard" or a premium paper ID). If omitted, org default is used when configured; otherwise "standard".

      - `"standard" | "premium_paper_heavy_1_glossy" | "premium_paper_postcard_uv_glossy_ss" | 2 more`

        - `"standard"`

        - `"premium_paper_heavy_1_glossy"`

        - `"premium_paper_postcard_uv_glossy_ss"`

        - `"premium_paper_postcard_uv_glossy_ss_120lb"`

        - `"premium_paper_postcard_satin_ds"`

      - `(string & {})`

    - `size?: "6x4" | "9x6" | "11x6"`

      Enum representing the supported postcard sizes.

      - `"6x4"`

      - `"9x6"`

      - `"11x6"`

    - `uploadedPDF?: string`

      A signed URL to the uploaded PDF, if any.

  - `reportURL?: string`

    A temporary URL to download the processing report, available once the campaign is in the `ready` status.

  - `selfMailer?: SelfMailer`

    Inline self-mailer configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `description?: string`

      An optional description.

    - `insideTemplate?: string`

      ID of the template for the inside. Cannot be used with `pdf`.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the self-mailer.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the self-mailer.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `outsideTemplate?: string`

      ID of the template for the outside. Cannot be used with `pdf`.

    - `size?: "8.5x11_bifold" | "8.5x11_trifold" | "9.5x16_trifold"`

      Enum representing the supported self-mailer sizes.

      - `"8.5x11_bifold"`

      - `"8.5x11_trifold"`

      - `"9.5x16_trifold"`

    - `uploadedPDF?: string`

      A signed URL to the uploaded PDF, if any.

  - `sendDate?: string`

    The scheduled date and time for the campaign to be sent.

  - `snapPack?: SnapPack`

    Inline snap pack configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `description?: string`

      An optional description.

    - `insideTemplate?: string`

      ID of the template for the inside. Cannot be used with `pdf`.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the snap pack.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the snap pack.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `outsideTemplate?: string`

      ID of the template for the outside. Cannot be used with `pdf`.

    - `size?: "8.5x11_bifold_v"`

      Enum representing the supported snap pack sizes.

      - `"8.5x11_bifold_v"`

    - `uploadedPDF?: string`

      A signed URL to the uploaded PDF, if any.

### Example

```typescript
import PostGrid from 'postgrid-node';

const client = new PostGrid({
  printMailAPIKey: process.env['POSTGRID_PRINT_MAIL_API_KEY'], // This is the default and can be omitted
});

const campaign = await client.printMail.campaigns.retrieve('id');

console.log(campaign.id);
```

#### Response

```json
{
  "id": "campaign_sqF12lZ1VlBb",
  "createdAt": "2019-12-27T18:11:19.117Z",
  "createdCount": 0,
  "live": true,
  "mailingList": "mailingList",
  "status": "drafting",
  "updatedAt": "2019-12-27T18:11:19.117Z",
  "cheque": {
    "bankAccount": "bankAccount",
    "currencyCode": "CAD",
    "description": "description",
    "envelope": "envelope",
    "letterSettings": {
      "color": true
    },
    "letterTemplate": "letterTemplate",
    "letterUploadedPDF": "https://example.com",
    "logo": "https://example.com",
    "mailingClass": "first_class",
    "memo": "memo",
    "mergeVariables": {
      "foo": "bar"
    },
    "message": "message",
    "metadata": {
      "foo": "string"
    },
    "returnEnvelope": "returnEnvelope",
    "size": "us_letter"
  },
  "defaultSenderContact": "defaultSenderContact",
  "description": "description",
  "errors": [
    {
      "message": "message",
      "type": "processing_error"
    }
  ],
  "letter": {
    "addressPlacement": "top_first_page",
    "attachedPDF": {
      "file": "https://example.com",
      "placement": "before_template"
    },
    "color": true,
    "description": "description",
    "doubleSided": true,
    "envelope": "envelope",
    "envelopeType": "standard_double_window",
    "mailingClass": "first_class",
    "mergeVariables": {
      "foo": "bar"
    },
    "metadata": {
      "foo": "string"
    },
    "paper": "standard",
    "perforatedPage": 1,
    "returnEnvelope": "returnEnvelope",
    "size": "us_letter",
    "template": "template",
    "uploadedPDF": "https://example.com"
  },
  "metadata": {
    "foo": "bar"
  },
  "orderPreviewURL": "https://example.com",
  "postcard": {
    "backTemplate": "backTemplate",
    "description": "description",
    "frontTemplate": "frontTemplate",
    "mailingClass": "first_class",
    "mergeVariables": {
      "foo": "bar"
    },
    "metadata": {
      "foo": "string"
    },
    "paper": "standard",
    "size": "6x4",
    "uploadedPDF": "https://example.com"
  },
  "reportURL": "https://example.com",
  "selfMailer": {
    "description": "description",
    "insideTemplate": "insideTemplate",
    "mailingClass": "first_class",
    "mergeVariables": {
      "foo": "bar"
    },
    "metadata": {
      "foo": "string"
    },
    "outsideTemplate": "outsideTemplate",
    "size": "8.5x11_bifold",
    "uploadedPDF": "https://example.com"
  },
  "sendDate": "2019-12-27T18:11:19.117Z",
  "snapPack": {
    "description": "description",
    "insideTemplate": "insideTemplate",
    "mailingClass": "first_class",
    "mergeVariables": {
      "foo": "bar"
    },
    "metadata": {
      "foo": "string"
    },
    "outsideTemplate": "outsideTemplate",
    "size": "8.5x11_bifold_v",
    "uploadedPDF": "https://example.com"
  }
}
```

## Update Campaign

`client.printMail.campaigns.update(stringid, CampaignUpdateParamsbody, RequestOptionsoptions?): Campaign`

**post** `/print-mail/v1/campaigns/{id}`

Update an existing campaign.

Campaigns can only be updated if they are in the `draft` or `changes_required` status.
Updating a campaign will trigger reprocessing and set its status back to `drafting`.

### Parameters

- `id: string`

- `body: CampaignUpdateParams`

  - `cheque?: Cheque | null`

    Inline cheque configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `bankAccount?: string`

      ID of the bank account to use for the cheque.

    - `currencyCode?: "CAD" | "USD"`

      Enum representing the supported currency codes.

      - `"CAD"`

      - `"USD"`

    - `description?: string`

      An optional description.

    - `envelope?: string`

      The custom envelope ID or `"standard"`.

    - `letterPDF?: string | Uploadable`

      PDF file for an optional attached letter. Cannot be used with `letterTemplate`.

      - `string`

      - `Uploadable`

    - `letterSettings?: LetterSettings`

      Settings for the attached letter (e.g., color printing).

      - `color?: boolean`

        Whether to print the attached letter in color.

    - `letterTemplate?: string`

      ID of a template for an optional attached letter. Cannot be used with `letterPDF`.

    - `logo?: string`

      A publicly accessible URL for the logo to print on the cheque.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the cheque.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `memo?: string`

      Memo line text for the cheque.

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the cheque.

    - `message?: string`

      Message included on the cheque stub.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `returnEnvelope?: string`

      ID of a return envelope to include.

    - `size?: ChequeSize`

      Enum representing the supported cheque sizes.

      - `"us_letter"`

      - `"us_legal"`

  - `defaultSenderContact?: string | null`

    The ID of the default sender contact. Set to `null` to remove.

  - `description?: string | null`

    An optional description for the campaign. Set to `null` to remove the existing description.

  - `letter?: Letter | null`

    Inline letter configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `addressPlacement?: AddressPlacement`

      Enum representing the placement of the address on the letter.

      - `"top_first_page"`

      - `"insert_blank_page"`

    - `attachedPDF?: AttachedPdf`

      Model representing an attached PDF.

      - `file: string | Uploadable`

        The file (multipart form upload) or URL pointing to a PDF for the attached PDF.

        - `string`

        - `Uploadable`

      - `placement: "before_template" | "after_template"`

        Enum representing the placement of the attached PDF.

        - `"before_template"`

        - `"after_template"`

    - `color?: boolean`

      Whether to print in color.

    - `description?: string`

      An optional description.

    - `doubleSided?: boolean`

      Whether to print on both sides of the paper.

    - `envelope?: string`

      The custom envelope ID or `"standard"`.

    - `envelopeType?: "standard_double_window" | "flat"`

      The type of envelope used for the letter.

      - `"standard_double_window"`

      - `"flat"`

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the letter.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the letter.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `paper?: "standard" | "premium_paper_letter_standard_white_70lb" | "premium_paper_letter_standard_white_80lb" | (string & {})`

      Premium paper selection ("standard" or a premium paper ID). If omitted, org default is used when configured; otherwise "standard".

      - `"standard" | "premium_paper_letter_standard_white_70lb" | "premium_paper_letter_standard_white_80lb"`

        - `"standard"`

        - `"premium_paper_letter_standard_white_70lb"`

        - `"premium_paper_letter_standard_white_80lb"`

      - `(string & {})`

    - `pdf?: string | Uploadable`

      A PDF file or URL for the letter content. Cannot be used with `template`.

      - `string`

      - `Uploadable`

    - `perforatedPage?: 1`

      Which page number should be perforated (if any).

      - `1`

    - `returnEnvelope?: string`

      ID of a return envelope to include.

    - `size?: LetterSize`

      Enum representing the supported letter sizes.

      - `"us_letter"`

      - `"a4"`

    - `template?: string`

      ID of a template for the letter content. Cannot be used with `pdf`.

  - `mailingList?: string`

    The ID of the mailing list to associate with this campaign.

  - `metadata?: Record<string, string> | null`

    Optional key-value data associated with the campaign. Set to `null` to remove existing metadata.

  - `postcard?: Postcard | null`

    Inline postcard configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `backTemplate?: string`

      ID of the template for the back side. Cannot be used with `pdf`.

    - `description?: string`

      An optional description.

    - `frontTemplate?: string`

      ID of the template for the front side. Cannot be used with `pdf`.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the postcard.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the postcard.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `paper?: "standard" | "premium_paper_heavy_1_glossy" | "premium_paper_postcard_uv_glossy_ss" | 2 more | (string & {})`

      Premium paper selection ("standard" or a premium paper ID). If omitted, org default is used when configured; otherwise "standard".

      - `"standard" | "premium_paper_heavy_1_glossy" | "premium_paper_postcard_uv_glossy_ss" | 2 more`

        - `"standard"`

        - `"premium_paper_heavy_1_glossy"`

        - `"premium_paper_postcard_uv_glossy_ss"`

        - `"premium_paper_postcard_uv_glossy_ss_120lb"`

        - `"premium_paper_postcard_satin_ds"`

      - `(string & {})`

    - `pdf?: string | Uploadable`

      A 2-page PDF file for the postcard content (front and back). Cannot be used with `frontTemplate`/`backTemplate`.

      - `string`

      - `Uploadable`

    - `size?: "6x4" | "9x6" | "11x6"`

      Enum representing the supported postcard sizes.

      - `"6x4"`

      - `"9x6"`

      - `"11x6"`

  - `selfMailer?: SelfMailer | null`

    Inline self-mailer configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `description?: string`

      An optional description.

    - `insideTemplate?: string`

      ID of the template for the inside. Cannot be used with `pdf`.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the self-mailer.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the self-mailer.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `outsideTemplate?: string`

      ID of the template for the outside. Cannot be used with `pdf`.

    - `pdf?: string | Uploadable`

      A 2-page PDF file for the self-mailer content. Cannot be used with `insideTemplate`/`outsideTemplate`.

      - `string`

      - `Uploadable`

    - `size?: "8.5x11_bifold" | "8.5x11_trifold" | "9.5x16_trifold"`

      Enum representing the supported self-mailer sizes.

      - `"8.5x11_bifold"`

      - `"8.5x11_trifold"`

      - `"9.5x16_trifold"`

  - `snapPack?: SnapPack | null`

    Inline snap pack configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `description?: string`

      An optional description.

    - `insideTemplate?: string`

      ID of the template for the inside. Cannot be used with `pdf`.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the snap pack.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the snap pack.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `outsideTemplate?: string`

      ID of the template for the outside. Cannot be used with `pdf`.

    - `pdf?: string | Uploadable`

      A 2-page PDF file for the snap pack content. Cannot be used with `insideTemplate`/`outsideTemplate`.

      - `string`

      - `Uploadable`

    - `size?: "8.5x11_bifold_v"`

      Enum representing the supported snap pack sizes.

      - `"8.5x11_bifold_v"`

### Returns

- `Campaign`

  Represents a bulk mail campaign.

  - `id: string`

    A unique ID prefixed with campaign_

  - `createdAt: string`

    The UTC time at which this resource was created.

  - `createdCount: number`

    The number of orders successfully created for this campaign.

  - `live: boolean`

    `true` if this is a live mode resource else `false`.

  - `mailingList: string`

    The ID of the mailing list associated with this campaign.

  - `status: "drafting" | "changes_required" | "creating_orders" | 4 more`

    Status of the campaign lifecycle.

    - `"drafting"`

    - `"changes_required"`

    - `"creating_orders"`

    - `"draft"`

    - `"ready"`

    - `"printing"`

    - `"processed_for_delivery"`

  - `updatedAt: string`

    The UTC time at which this resource was last updated.

  - `cheque?: Cheque`

    Inline cheque configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `bankAccount?: string`

      ID of the bank account to use for the cheque.

    - `currencyCode?: "CAD" | "USD"`

      Enum representing the supported currency codes.

      - `"CAD"`

      - `"USD"`

    - `description?: string`

      An optional description.

    - `envelope?: string`

      The custom envelope ID or `"standard"`.

    - `letterSettings?: LetterSettings`

      Settings for the attached letter (e.g., color printing).

      - `color?: boolean`

        Whether to print the attached letter in color.

    - `letterTemplate?: string`

      ID of a template for an optional attached letter. Cannot be used with `letterPDF`.

    - `letterUploadedPDF?: string`

      A signed URL to the attached letter PDF, if any.

    - `logo?: string`

      A publicly accessible URL for the logo to print on the cheque.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the cheque.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `memo?: string`

      Memo line text for the cheque.

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the cheque.

    - `message?: string`

      Message included on the cheque stub.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `returnEnvelope?: string`

      ID of a return envelope to include.

    - `size?: ChequeSize`

      Enum representing the supported cheque sizes.

      - `"us_letter"`

      - `"us_legal"`

  - `defaultSenderContact?: string`

    The ID of the default sender contact to use for orders if not specified per recipient.

  - `description?: string`

    An optional string describing this resource. Will be visible in the API and the dashboard.

  - `errors?: Array<Error>`

    A list of processing errors encountered, if any. Present when status is 'changes_required'.

    - `message: string`

      A human-readable message describing the error.

    - `type: "processing_error" | "internal_error"`

      Type of error encountered during campaign processing.

      - `"processing_error"`

      - `"internal_error"`

  - `letter?: Letter`

    Inline letter configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `addressPlacement?: AddressPlacement`

      Enum representing the placement of the address on the letter.

      - `"top_first_page"`

      - `"insert_blank_page"`

    - `attachedPDF?: AttachedPdf`

      Model representing an attached PDF.

      - `file: string | Uploadable`

        The file (multipart form upload) or URL pointing to a PDF for the attached PDF.

        - `string`

        - `Uploadable`

      - `placement: "before_template" | "after_template"`

        Enum representing the placement of the attached PDF.

        - `"before_template"`

        - `"after_template"`

    - `color?: boolean`

      Whether to print in color.

    - `description?: string`

      An optional description.

    - `doubleSided?: boolean`

      Whether to print on both sides of the paper.

    - `envelope?: string`

      The custom envelope ID or `"standard"`.

    - `envelopeType?: "standard_double_window" | "flat"`

      The type of envelope used for the letter.

      - `"standard_double_window"`

      - `"flat"`

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the letter.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the letter.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `paper?: "standard" | "premium_paper_letter_standard_white_70lb" | "premium_paper_letter_standard_white_80lb" | (string & {})`

      Premium paper selection ("standard" or a premium paper ID). If omitted, org default is used when configured; otherwise "standard".

      - `"standard" | "premium_paper_letter_standard_white_70lb" | "premium_paper_letter_standard_white_80lb"`

        - `"standard"`

        - `"premium_paper_letter_standard_white_70lb"`

        - `"premium_paper_letter_standard_white_80lb"`

      - `(string & {})`

    - `perforatedPage?: 1`

      Which page number should be perforated (if any).

      - `1`

    - `returnEnvelope?: string`

      ID of a return envelope to include.

    - `size?: LetterSize`

      Enum representing the supported letter sizes.

      - `"us_letter"`

      - `"a4"`

    - `template?: string`

      ID of a template for the letter content. Cannot be used with `pdf`.

    - `uploadedPDF?: string`

      A signed URL to the uploaded PDF, if any.

  - `metadata?: Record<string, unknown>`

    See the section on Metadata.

  - `orderPreviewURL?: string`

    A temporary URL to preview the first rendered order, available once the campaign status is 'draft' or later.

  - `postcard?: Postcard`

    Inline postcard configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `backTemplate?: string`

      ID of the template for the back side. Cannot be used with `pdf`.

    - `description?: string`

      An optional description.

    - `frontTemplate?: string`

      ID of the template for the front side. Cannot be used with `pdf`.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the postcard.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the postcard.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `paper?: "standard" | "premium_paper_heavy_1_glossy" | "premium_paper_postcard_uv_glossy_ss" | 2 more | (string & {})`

      Premium paper selection ("standard" or a premium paper ID). If omitted, org default is used when configured; otherwise "standard".

      - `"standard" | "premium_paper_heavy_1_glossy" | "premium_paper_postcard_uv_glossy_ss" | 2 more`

        - `"standard"`

        - `"premium_paper_heavy_1_glossy"`

        - `"premium_paper_postcard_uv_glossy_ss"`

        - `"premium_paper_postcard_uv_glossy_ss_120lb"`

        - `"premium_paper_postcard_satin_ds"`

      - `(string & {})`

    - `size?: "6x4" | "9x6" | "11x6"`

      Enum representing the supported postcard sizes.

      - `"6x4"`

      - `"9x6"`

      - `"11x6"`

    - `uploadedPDF?: string`

      A signed URL to the uploaded PDF, if any.

  - `reportURL?: string`

    A temporary URL to download the processing report, available once the campaign is in the `ready` status.

  - `selfMailer?: SelfMailer`

    Inline self-mailer configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `description?: string`

      An optional description.

    - `insideTemplate?: string`

      ID of the template for the inside. Cannot be used with `pdf`.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the self-mailer.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the self-mailer.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `outsideTemplate?: string`

      ID of the template for the outside. Cannot be used with `pdf`.

    - `size?: "8.5x11_bifold" | "8.5x11_trifold" | "9.5x16_trifold"`

      Enum representing the supported self-mailer sizes.

      - `"8.5x11_bifold"`

      - `"8.5x11_trifold"`

      - `"9.5x16_trifold"`

    - `uploadedPDF?: string`

      A signed URL to the uploaded PDF, if any.

  - `sendDate?: string`

    The scheduled date and time for the campaign to be sent.

  - `snapPack?: SnapPack`

    Inline snap pack configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `description?: string`

      An optional description.

    - `insideTemplate?: string`

      ID of the template for the inside. Cannot be used with `pdf`.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the snap pack.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the snap pack.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `outsideTemplate?: string`

      ID of the template for the outside. Cannot be used with `pdf`.

    - `size?: "8.5x11_bifold_v"`

      Enum representing the supported snap pack sizes.

      - `"8.5x11_bifold_v"`

    - `uploadedPDF?: string`

      A signed URL to the uploaded PDF, if any.

### Example

```typescript
import PostGrid from 'postgrid-node';

const client = new PostGrid({
  printMailAPIKey: process.env['POSTGRID_PRINT_MAIL_API_KEY'], // This is the default and can be omitted
});

const campaign = await client.printMail.campaigns.update('id');

console.log(campaign.id);
```

#### Response

```json
{
  "id": "campaign_sqF12lZ1VlBb",
  "createdAt": "2019-12-27T18:11:19.117Z",
  "createdCount": 0,
  "live": true,
  "mailingList": "mailingList",
  "status": "drafting",
  "updatedAt": "2019-12-27T18:11:19.117Z",
  "cheque": {
    "bankAccount": "bankAccount",
    "currencyCode": "CAD",
    "description": "description",
    "envelope": "envelope",
    "letterSettings": {
      "color": true
    },
    "letterTemplate": "letterTemplate",
    "letterUploadedPDF": "https://example.com",
    "logo": "https://example.com",
    "mailingClass": "first_class",
    "memo": "memo",
    "mergeVariables": {
      "foo": "bar"
    },
    "message": "message",
    "metadata": {
      "foo": "string"
    },
    "returnEnvelope": "returnEnvelope",
    "size": "us_letter"
  },
  "defaultSenderContact": "defaultSenderContact",
  "description": "description",
  "errors": [
    {
      "message": "message",
      "type": "processing_error"
    }
  ],
  "letter": {
    "addressPlacement": "top_first_page",
    "attachedPDF": {
      "file": "https://example.com",
      "placement": "before_template"
    },
    "color": true,
    "description": "description",
    "doubleSided": true,
    "envelope": "envelope",
    "envelopeType": "standard_double_window",
    "mailingClass": "first_class",
    "mergeVariables": {
      "foo": "bar"
    },
    "metadata": {
      "foo": "string"
    },
    "paper": "standard",
    "perforatedPage": 1,
    "returnEnvelope": "returnEnvelope",
    "size": "us_letter",
    "template": "template",
    "uploadedPDF": "https://example.com"
  },
  "metadata": {
    "foo": "bar"
  },
  "orderPreviewURL": "https://example.com",
  "postcard": {
    "backTemplate": "backTemplate",
    "description": "description",
    "frontTemplate": "frontTemplate",
    "mailingClass": "first_class",
    "mergeVariables": {
      "foo": "bar"
    },
    "metadata": {
      "foo": "string"
    },
    "paper": "standard",
    "size": "6x4",
    "uploadedPDF": "https://example.com"
  },
  "reportURL": "https://example.com",
  "selfMailer": {
    "description": "description",
    "insideTemplate": "insideTemplate",
    "mailingClass": "first_class",
    "mergeVariables": {
      "foo": "bar"
    },
    "metadata": {
      "foo": "string"
    },
    "outsideTemplate": "outsideTemplate",
    "size": "8.5x11_bifold",
    "uploadedPDF": "https://example.com"
  },
  "sendDate": "2019-12-27T18:11:19.117Z",
  "snapPack": {
    "description": "description",
    "insideTemplate": "insideTemplate",
    "mailingClass": "first_class",
    "mergeVariables": {
      "foo": "bar"
    },
    "metadata": {
      "foo": "string"
    },
    "outsideTemplate": "outsideTemplate",
    "size": "8.5x11_bifold_v",
    "uploadedPDF": "https://example.com"
  }
}
```

## Delete Campaign

`client.printMail.campaigns.delete(stringid, RequestOptionsoptions?): CampaignDeleteResponse`

**delete** `/print-mail/v1/campaigns/{id}`

Delete a campaign.

Campaigns can only be deleted if they are in `draft`, `changes_required`, or `ready` status.
This also permanently deletes associated resources. This operation cannot be undone.

### Parameters

- `id: string`

### Returns

- `CampaignDeleteResponse`

  - `id: string`

    A unique ID prefixed with campaign_

  - `deleted: true`

    - `true`

### Example

```typescript
import PostGrid from 'postgrid-node';

const client = new PostGrid({
  printMailAPIKey: process.env['POSTGRID_PRINT_MAIL_API_KEY'], // This is the default and can be omitted
});

const campaign = await client.printMail.campaigns.delete('id');

console.log(campaign.id);
```

#### Response

```json
{
  "id": "campaign_sqF12lZ1VlBb",
  "deleted": true
}
```

## Send Campaign

`client.printMail.campaigns.send(stringid, CampaignSendParamsbody, RequestOptionsoptions?): Campaign`

**post** `/print-mail/v1/campaigns/{id}/send`

Send a campaign for processing.

This action transitions a campaign from the `draft` status to `creating_orders`.
You can optionally specify a future `sendDate`. Once sent, the campaign cannot be updated.

### Parameters

- `id: string`

- `body: CampaignSendParams`

  - `sendDate?: (string & {}) | string`

    The date and time the campaign should be sent. Must be in the future. If omitted, defaults to the earliest possible processing date.

    - `(string & {})`

    - `string`

### Returns

- `Campaign`

  Represents a bulk mail campaign.

  - `id: string`

    A unique ID prefixed with campaign_

  - `createdAt: string`

    The UTC time at which this resource was created.

  - `createdCount: number`

    The number of orders successfully created for this campaign.

  - `live: boolean`

    `true` if this is a live mode resource else `false`.

  - `mailingList: string`

    The ID of the mailing list associated with this campaign.

  - `status: "drafting" | "changes_required" | "creating_orders" | 4 more`

    Status of the campaign lifecycle.

    - `"drafting"`

    - `"changes_required"`

    - `"creating_orders"`

    - `"draft"`

    - `"ready"`

    - `"printing"`

    - `"processed_for_delivery"`

  - `updatedAt: string`

    The UTC time at which this resource was last updated.

  - `cheque?: Cheque`

    Inline cheque configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `bankAccount?: string`

      ID of the bank account to use for the cheque.

    - `currencyCode?: "CAD" | "USD"`

      Enum representing the supported currency codes.

      - `"CAD"`

      - `"USD"`

    - `description?: string`

      An optional description.

    - `envelope?: string`

      The custom envelope ID or `"standard"`.

    - `letterSettings?: LetterSettings`

      Settings for the attached letter (e.g., color printing).

      - `color?: boolean`

        Whether to print the attached letter in color.

    - `letterTemplate?: string`

      ID of a template for an optional attached letter. Cannot be used with `letterPDF`.

    - `letterUploadedPDF?: string`

      A signed URL to the attached letter PDF, if any.

    - `logo?: string`

      A publicly accessible URL for the logo to print on the cheque.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the cheque.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `memo?: string`

      Memo line text for the cheque.

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the cheque.

    - `message?: string`

      Message included on the cheque stub.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `returnEnvelope?: string`

      ID of a return envelope to include.

    - `size?: ChequeSize`

      Enum representing the supported cheque sizes.

      - `"us_letter"`

      - `"us_legal"`

  - `defaultSenderContact?: string`

    The ID of the default sender contact to use for orders if not specified per recipient.

  - `description?: string`

    An optional string describing this resource. Will be visible in the API and the dashboard.

  - `errors?: Array<Error>`

    A list of processing errors encountered, if any. Present when status is 'changes_required'.

    - `message: string`

      A human-readable message describing the error.

    - `type: "processing_error" | "internal_error"`

      Type of error encountered during campaign processing.

      - `"processing_error"`

      - `"internal_error"`

  - `letter?: Letter`

    Inline letter configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `addressPlacement?: AddressPlacement`

      Enum representing the placement of the address on the letter.

      - `"top_first_page"`

      - `"insert_blank_page"`

    - `attachedPDF?: AttachedPdf`

      Model representing an attached PDF.

      - `file: string | Uploadable`

        The file (multipart form upload) or URL pointing to a PDF for the attached PDF.

        - `string`

        - `Uploadable`

      - `placement: "before_template" | "after_template"`

        Enum representing the placement of the attached PDF.

        - `"before_template"`

        - `"after_template"`

    - `color?: boolean`

      Whether to print in color.

    - `description?: string`

      An optional description.

    - `doubleSided?: boolean`

      Whether to print on both sides of the paper.

    - `envelope?: string`

      The custom envelope ID or `"standard"`.

    - `envelopeType?: "standard_double_window" | "flat"`

      The type of envelope used for the letter.

      - `"standard_double_window"`

      - `"flat"`

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the letter.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the letter.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `paper?: "standard" | "premium_paper_letter_standard_white_70lb" | "premium_paper_letter_standard_white_80lb" | (string & {})`

      Premium paper selection ("standard" or a premium paper ID). If omitted, org default is used when configured; otherwise "standard".

      - `"standard" | "premium_paper_letter_standard_white_70lb" | "premium_paper_letter_standard_white_80lb"`

        - `"standard"`

        - `"premium_paper_letter_standard_white_70lb"`

        - `"premium_paper_letter_standard_white_80lb"`

      - `(string & {})`

    - `perforatedPage?: 1`

      Which page number should be perforated (if any).

      - `1`

    - `returnEnvelope?: string`

      ID of a return envelope to include.

    - `size?: LetterSize`

      Enum representing the supported letter sizes.

      - `"us_letter"`

      - `"a4"`

    - `template?: string`

      ID of a template for the letter content. Cannot be used with `pdf`.

    - `uploadedPDF?: string`

      A signed URL to the uploaded PDF, if any.

  - `metadata?: Record<string, unknown>`

    See the section on Metadata.

  - `orderPreviewURL?: string`

    A temporary URL to preview the first rendered order, available once the campaign status is 'draft' or later.

  - `postcard?: Postcard`

    Inline postcard configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `backTemplate?: string`

      ID of the template for the back side. Cannot be used with `pdf`.

    - `description?: string`

      An optional description.

    - `frontTemplate?: string`

      ID of the template for the front side. Cannot be used with `pdf`.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the postcard.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the postcard.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `paper?: "standard" | "premium_paper_heavy_1_glossy" | "premium_paper_postcard_uv_glossy_ss" | 2 more | (string & {})`

      Premium paper selection ("standard" or a premium paper ID). If omitted, org default is used when configured; otherwise "standard".

      - `"standard" | "premium_paper_heavy_1_glossy" | "premium_paper_postcard_uv_glossy_ss" | 2 more`

        - `"standard"`

        - `"premium_paper_heavy_1_glossy"`

        - `"premium_paper_postcard_uv_glossy_ss"`

        - `"premium_paper_postcard_uv_glossy_ss_120lb"`

        - `"premium_paper_postcard_satin_ds"`

      - `(string & {})`

    - `size?: "6x4" | "9x6" | "11x6"`

      Enum representing the supported postcard sizes.

      - `"6x4"`

      - `"9x6"`

      - `"11x6"`

    - `uploadedPDF?: string`

      A signed URL to the uploaded PDF, if any.

  - `reportURL?: string`

    A temporary URL to download the processing report, available once the campaign is in the `ready` status.

  - `selfMailer?: SelfMailer`

    Inline self-mailer configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `description?: string`

      An optional description.

    - `insideTemplate?: string`

      ID of the template for the inside. Cannot be used with `pdf`.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the self-mailer.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the self-mailer.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `outsideTemplate?: string`

      ID of the template for the outside. Cannot be used with `pdf`.

    - `size?: "8.5x11_bifold" | "8.5x11_trifold" | "9.5x16_trifold"`

      Enum representing the supported self-mailer sizes.

      - `"8.5x11_bifold"`

      - `"8.5x11_trifold"`

      - `"9.5x16_trifold"`

    - `uploadedPDF?: string`

      A signed URL to the uploaded PDF, if any.

  - `sendDate?: string`

    The scheduled date and time for the campaign to be sent.

  - `snapPack?: SnapPack`

    Inline snap pack configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `description?: string`

      An optional description.

    - `insideTemplate?: string`

      ID of the template for the inside. Cannot be used with `pdf`.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the snap pack.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the snap pack.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `outsideTemplate?: string`

      ID of the template for the outside. Cannot be used with `pdf`.

    - `size?: "8.5x11_bifold_v"`

      Enum representing the supported snap pack sizes.

      - `"8.5x11_bifold_v"`

    - `uploadedPDF?: string`

      A signed URL to the uploaded PDF, if any.

### Example

```typescript
import PostGrid from 'postgrid-node';

const client = new PostGrid({
  printMailAPIKey: process.env['POSTGRID_PRINT_MAIL_API_KEY'], // This is the default and can be omitted
});

const campaign = await client.printMail.campaigns.send('id');

console.log(campaign.id);
```

#### Response

```json
{
  "id": "campaign_sqF12lZ1VlBb",
  "createdAt": "2019-12-27T18:11:19.117Z",
  "createdCount": 0,
  "live": true,
  "mailingList": "mailingList",
  "status": "drafting",
  "updatedAt": "2019-12-27T18:11:19.117Z",
  "cheque": {
    "bankAccount": "bankAccount",
    "currencyCode": "CAD",
    "description": "description",
    "envelope": "envelope",
    "letterSettings": {
      "color": true
    },
    "letterTemplate": "letterTemplate",
    "letterUploadedPDF": "https://example.com",
    "logo": "https://example.com",
    "mailingClass": "first_class",
    "memo": "memo",
    "mergeVariables": {
      "foo": "bar"
    },
    "message": "message",
    "metadata": {
      "foo": "string"
    },
    "returnEnvelope": "returnEnvelope",
    "size": "us_letter"
  },
  "defaultSenderContact": "defaultSenderContact",
  "description": "description",
  "errors": [
    {
      "message": "message",
      "type": "processing_error"
    }
  ],
  "letter": {
    "addressPlacement": "top_first_page",
    "attachedPDF": {
      "file": "https://example.com",
      "placement": "before_template"
    },
    "color": true,
    "description": "description",
    "doubleSided": true,
    "envelope": "envelope",
    "envelopeType": "standard_double_window",
    "mailingClass": "first_class",
    "mergeVariables": {
      "foo": "bar"
    },
    "metadata": {
      "foo": "string"
    },
    "paper": "standard",
    "perforatedPage": 1,
    "returnEnvelope": "returnEnvelope",
    "size": "us_letter",
    "template": "template",
    "uploadedPDF": "https://example.com"
  },
  "metadata": {
    "foo": "bar"
  },
  "orderPreviewURL": "https://example.com",
  "postcard": {
    "backTemplate": "backTemplate",
    "description": "description",
    "frontTemplate": "frontTemplate",
    "mailingClass": "first_class",
    "mergeVariables": {
      "foo": "bar"
    },
    "metadata": {
      "foo": "string"
    },
    "paper": "standard",
    "size": "6x4",
    "uploadedPDF": "https://example.com"
  },
  "reportURL": "https://example.com",
  "selfMailer": {
    "description": "description",
    "insideTemplate": "insideTemplate",
    "mailingClass": "first_class",
    "mergeVariables": {
      "foo": "bar"
    },
    "metadata": {
      "foo": "string"
    },
    "outsideTemplate": "outsideTemplate",
    "size": "8.5x11_bifold",
    "uploadedPDF": "https://example.com"
  },
  "sendDate": "2019-12-27T18:11:19.117Z",
  "snapPack": {
    "description": "description",
    "insideTemplate": "insideTemplate",
    "mailingClass": "first_class",
    "mergeVariables": {
      "foo": "bar"
    },
    "metadata": {
      "foo": "string"
    },
    "outsideTemplate": "outsideTemplate",
    "size": "8.5x11_bifold_v",
    "uploadedPDF": "https://example.com"
  }
}
```

## Domain Types

### Campaign

- `Campaign`

  Represents a bulk mail campaign.

  - `id: string`

    A unique ID prefixed with campaign_

  - `createdAt: string`

    The UTC time at which this resource was created.

  - `createdCount: number`

    The number of orders successfully created for this campaign.

  - `live: boolean`

    `true` if this is a live mode resource else `false`.

  - `mailingList: string`

    The ID of the mailing list associated with this campaign.

  - `status: "drafting" | "changes_required" | "creating_orders" | 4 more`

    Status of the campaign lifecycle.

    - `"drafting"`

    - `"changes_required"`

    - `"creating_orders"`

    - `"draft"`

    - `"ready"`

    - `"printing"`

    - `"processed_for_delivery"`

  - `updatedAt: string`

    The UTC time at which this resource was last updated.

  - `cheque?: Cheque`

    Inline cheque configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `bankAccount?: string`

      ID of the bank account to use for the cheque.

    - `currencyCode?: "CAD" | "USD"`

      Enum representing the supported currency codes.

      - `"CAD"`

      - `"USD"`

    - `description?: string`

      An optional description.

    - `envelope?: string`

      The custom envelope ID or `"standard"`.

    - `letterSettings?: LetterSettings`

      Settings for the attached letter (e.g., color printing).

      - `color?: boolean`

        Whether to print the attached letter in color.

    - `letterTemplate?: string`

      ID of a template for an optional attached letter. Cannot be used with `letterPDF`.

    - `letterUploadedPDF?: string`

      A signed URL to the attached letter PDF, if any.

    - `logo?: string`

      A publicly accessible URL for the logo to print on the cheque.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the cheque.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `memo?: string`

      Memo line text for the cheque.

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the cheque.

    - `message?: string`

      Message included on the cheque stub.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `returnEnvelope?: string`

      ID of a return envelope to include.

    - `size?: ChequeSize`

      Enum representing the supported cheque sizes.

      - `"us_letter"`

      - `"us_legal"`

  - `defaultSenderContact?: string`

    The ID of the default sender contact to use for orders if not specified per recipient.

  - `description?: string`

    An optional string describing this resource. Will be visible in the API and the dashboard.

  - `errors?: Array<Error>`

    A list of processing errors encountered, if any. Present when status is 'changes_required'.

    - `message: string`

      A human-readable message describing the error.

    - `type: "processing_error" | "internal_error"`

      Type of error encountered during campaign processing.

      - `"processing_error"`

      - `"internal_error"`

  - `letter?: Letter`

    Inline letter configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `addressPlacement?: AddressPlacement`

      Enum representing the placement of the address on the letter.

      - `"top_first_page"`

      - `"insert_blank_page"`

    - `attachedPDF?: AttachedPdf`

      Model representing an attached PDF.

      - `file: string | Uploadable`

        The file (multipart form upload) or URL pointing to a PDF for the attached PDF.

        - `string`

        - `Uploadable`

      - `placement: "before_template" | "after_template"`

        Enum representing the placement of the attached PDF.

        - `"before_template"`

        - `"after_template"`

    - `color?: boolean`

      Whether to print in color.

    - `description?: string`

      An optional description.

    - `doubleSided?: boolean`

      Whether to print on both sides of the paper.

    - `envelope?: string`

      The custom envelope ID or `"standard"`.

    - `envelopeType?: "standard_double_window" | "flat"`

      The type of envelope used for the letter.

      - `"standard_double_window"`

      - `"flat"`

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the letter.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the letter.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `paper?: "standard" | "premium_paper_letter_standard_white_70lb" | "premium_paper_letter_standard_white_80lb" | (string & {})`

      Premium paper selection ("standard" or a premium paper ID). If omitted, org default is used when configured; otherwise "standard".

      - `"standard" | "premium_paper_letter_standard_white_70lb" | "premium_paper_letter_standard_white_80lb"`

        - `"standard"`

        - `"premium_paper_letter_standard_white_70lb"`

        - `"premium_paper_letter_standard_white_80lb"`

      - `(string & {})`

    - `perforatedPage?: 1`

      Which page number should be perforated (if any).

      - `1`

    - `returnEnvelope?: string`

      ID of a return envelope to include.

    - `size?: LetterSize`

      Enum representing the supported letter sizes.

      - `"us_letter"`

      - `"a4"`

    - `template?: string`

      ID of a template for the letter content. Cannot be used with `pdf`.

    - `uploadedPDF?: string`

      A signed URL to the uploaded PDF, if any.

  - `metadata?: Record<string, unknown>`

    See the section on Metadata.

  - `orderPreviewURL?: string`

    A temporary URL to preview the first rendered order, available once the campaign status is 'draft' or later.

  - `postcard?: Postcard`

    Inline postcard configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `backTemplate?: string`

      ID of the template for the back side. Cannot be used with `pdf`.

    - `description?: string`

      An optional description.

    - `frontTemplate?: string`

      ID of the template for the front side. Cannot be used with `pdf`.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the postcard.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the postcard.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `paper?: "standard" | "premium_paper_heavy_1_glossy" | "premium_paper_postcard_uv_glossy_ss" | 2 more | (string & {})`

      Premium paper selection ("standard" or a premium paper ID). If omitted, org default is used when configured; otherwise "standard".

      - `"standard" | "premium_paper_heavy_1_glossy" | "premium_paper_postcard_uv_glossy_ss" | 2 more`

        - `"standard"`

        - `"premium_paper_heavy_1_glossy"`

        - `"premium_paper_postcard_uv_glossy_ss"`

        - `"premium_paper_postcard_uv_glossy_ss_120lb"`

        - `"premium_paper_postcard_satin_ds"`

      - `(string & {})`

    - `size?: "6x4" | "9x6" | "11x6"`

      Enum representing the supported postcard sizes.

      - `"6x4"`

      - `"9x6"`

      - `"11x6"`

    - `uploadedPDF?: string`

      A signed URL to the uploaded PDF, if any.

  - `reportURL?: string`

    A temporary URL to download the processing report, available once the campaign is in the `ready` status.

  - `selfMailer?: SelfMailer`

    Inline self-mailer configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `description?: string`

      An optional description.

    - `insideTemplate?: string`

      ID of the template for the inside. Cannot be used with `pdf`.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the self-mailer.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the self-mailer.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `outsideTemplate?: string`

      ID of the template for the outside. Cannot be used with `pdf`.

    - `size?: "8.5x11_bifold" | "8.5x11_trifold" | "9.5x16_trifold"`

      Enum representing the supported self-mailer sizes.

      - `"8.5x11_bifold"`

      - `"8.5x11_trifold"`

      - `"9.5x16_trifold"`

    - `uploadedPDF?: string`

      A signed URL to the uploaded PDF, if any.

  - `sendDate?: string`

    The scheduled date and time for the campaign to be sent.

  - `snapPack?: SnapPack`

    Inline snap pack configuration for a campaign. All fields are optional since campaigns may be in a partial state during drafting.

    - `description?: string`

      An optional description.

    - `insideTemplate?: string`

      ID of the template for the inside. Cannot be used with `pdf`.

    - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

      Mailing class for the snap pack.

      - `"first_class"`

      - `"standard_class"`

      - `"express"`

      - `"certified"`

      - `"certified_return_receipt"`

      - `"registered"`

      - `"usps_first_class"`

      - `"usps_standard_class"`

      - `"usps_eddm"`

      - `"usps_express_2_day"`

      - `"usps_express_3_day"`

      - `"usps_first_class_certified"`

      - `"usps_first_class_certified_return_receipt"`

      - `"usps_first_class_registered"`

      - `"usps_express_3_day_signature_confirmation"`

      - `"usps_express_3_day_certified"`

      - `"usps_express_3_day_certified_return_receipt"`

      - `"ca_post_lettermail"`

      - `"ca_post_personalized"`

      - `"ca_post_neighbourhood_mail"`

      - `"ups_express_overnight"`

      - `"ups_express_2_day"`

      - `"ups_express_3_day"`

      - `"royal_mail_first_class"`

      - `"royal_mail_second_class"`

      - `"au_post_second_class"`

    - `mergeVariables?: Record<string, unknown>`

      Default merge variables for the snap pack.

    - `metadata?: Record<string, string>`

      Optional key-value metadata.

    - `outsideTemplate?: string`

      ID of the template for the outside. Cannot be used with `pdf`.

    - `size?: "8.5x11_bifold_v"`

      Enum representing the supported snap pack sizes.

      - `"8.5x11_bifold_v"`

    - `uploadedPDF?: string`

      A signed URL to the uploaded PDF, if any.

### Campaign Delete Response

- `CampaignDeleteResponse`

  - `id: string`

    A unique ID prefixed with campaign_

  - `deleted: true`

    - `true`
