> ## Documentation Index
> Fetch the complete documentation index at: https://docs.posta.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Create letter

> Create a new letter.



## OpenAPI

````yaml POST /letters
openapi: 3.0.0
info:
  title: Posta API
  description: Posta API
  version: '2024-07-30'
servers:
  - url: https://api.posta.co
    description: Posta API endpoint
    variables: {}
security: []
tags:
  - name: Letters
  - name: Assets
  - name: Asset Versions
paths:
  /letters:
    post:
      tags:
        - Letters
      summary: Create letter
      description: Create a new letter.
      operationId: createLetter
      parameters:
        - $ref: '#/components/parameters/IdempotencySupport'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LetterCreate'
      responses:
        '201':
          description: >-
            The request has succeeded and a new resource has been created as a
            result
          headers:
            location:
              required: true
              description: >-
                The Location header contains the URL where the status of the
                long running operation can be checked.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Letter'
        '400':
          description: The server could not understand the request due to invalid syntax.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '401':
          description: Access is unauthorized.
        '403':
          description: Access is forbidden.
        '429':
          description: Client error
          headers:
            P-RateLimit-Limit:
              required: false
              schema:
                type: integer
            P-RateLimit-Remaining:
              required: false
              schema:
                type: integer
            P-RateLimit-Reset:
              required: false
              schema:
                type: string
                format: date-time
        '500':
          description: Server error
      security:
        - ApiKeyAuth: []
components:
  parameters:
    IdempotencySupport:
      name: Idempotency-Key
      in: header
      required: false
      description: Unique idempotency key for each request (e.g., V4 UUID).
      schema:
        type: string
  schemas:
    LetterCreate:
      type: object
      required:
        - sender
        - recipient
        - content
        - useType
      properties:
        externalId:
          type: string
          example: 0013i00002YyVvSAAV
          minLength: 0
          maxLength: 99999
          description: >-
            Optional client-defined identifier for referencing this letter in
            external systems. Not used by Posta for processing.
        sendDate:
          type: string
          format: date
          description: >-
            Specifies the Send Date in ISO 8601 format (YYYY-MM-DD). Time
            portion, if provided, is ignored.


            **If omitted:**
              - SLA begins after the daily cutoff and we auto-assign a date based on our SLA:
              - ***Before cutoff***: Earliest production date (e.g., same day if sent 9 am Tuesday).
              - ***After cutoff***: Next production date (e.g., next day if sent 11 am Tuesday).
              - ***Non-production day***: Next production date.

              **If specified:**
              - Must be between current date and 180 days in future.
              - If specified date is a production day, value remains as-is.
              - If not a production day, next production day is assigned.

            Daily cutoff: 10 am ET on production days (Monday - Friday, exluding
            national holidays)


            Note: All letters are cancelable on or before the Send Date's daily
            cutoff.


            Example: `2023-08-15`
        description:
          type: string
          example: Compliance notice
          minLength: 0
          maxLength: 99999
          description: >-
            Optional description for internal reference. Does not affect
            processing or delievery.
        sender:
          $ref: '#/components/schemas/SenderCreate'
        recipient:
          $ref: '#/components/schemas/RecipientCreate'
        content:
          allOf:
            - $ref: '#/components/schemas/LetterContent'
          description: Content of the letter.
        variables:
          type: array
          items:
            $ref: '#/components/schemas/VariableEntry'
          maxItems: 128
          description: >-
            Key-value pairs for personalizing letter content when using
            handlebars in HTML content.
        options:
          allOf:
            - $ref: '#/components/schemas/LetterOptions'
          description: >-
            Customization options for letter production and delivery, including:

            1. Printing preferences (e.g., color, simplex/duplex)

            2. Mailing preferences (e.g., mail class, extra services)

            3. Data processing preferences (e.g., CASS, NCOA)

            4. Other preferences


            Defaults apply if not specified. See `Option` documentation for
            details.

            Note: Some options may affect pricing or production time.
        useType:
          allOf:
            - $ref: '#/components/schemas/UseType'
          example: marketing
          description: >-
            Indicates the letter's purpose: 'marketing' or 'transactional'.
            Affects eligibility for USPS promotions and sales tax compliance.
        metadata:
          type: array
          items:
            $ref: '#/components/schemas/MetadataEntry'
          nullable: true
          description: |-
            A key-value store for custom metadata.

            Limitations:
            1. Up to 20 metadata key-value pairs
            1. Key must be no more than 64 characters
            2. Value must be no more than 512 characters
      description: A letter.
    Letter:
      type: object
      required:
        - id
        - status
        - sender
        - recipient
        - content
        - useType
        - events
        - createdAt
        - modifiedAt
      properties:
        id:
          type: string
          example: ltr_9a32a8b5a96c880c
          minLength: 1
          maxLength: 99999
          description: >-
            A unique identifier for the letter, prefixed with ltr_. Use this ID
            to retrieve, update, or delete the letter.
          readOnly: true
        status:
          allOf:
            - $ref: '#/components/schemas/LetterStatus'
          example: queued
          description: |-
            Represents the current status of a letter in the mailing process:
            - `queued`: Awaiting processing
            - `ready`: Processed and ready for printing
            - `inProduction`: Being printed and prepared for mailing
            - `mailed`: Handed off to postal service for delivery
            - `issue`: Problem that needs addressing
            - `canceled`: Letter will not be mailed
          readOnly: true
        externalId:
          type: string
          example: 0013i00002YyVvSAAV
          minLength: 0
          maxLength: 99999
          description: >-
            Optional client-defined identifier for referencing this letter in
            external systems. Not used by Posta for processing.
        sendDate:
          type: string
          format: date
          description: >-
            Specifies the Send Date in ISO 8601 format (YYYY-MM-DD). Time
            portion, if provided, is ignored.


            **If omitted:**
              - SLA begins after the daily cutoff and we auto-assign a date based on our SLA:
              - ***Before cutoff***: Earliest production date (e.g., same day if sent 9 am Tuesday).
              - ***After cutoff***: Next production date (e.g., next day if sent 11 am Tuesday).
              - ***Non-production day***: Next production date.

              **If specified:**
              - Must be between current date and 180 days in future.
              - If specified date is a production day, value remains as-is.
              - If not a production day, next production day is assigned.

            Daily cutoff: 10 am ET on production days (Monday - Friday, exluding
            national holidays)


            Note: All letters are cancelable on or before the Send Date's daily
            cutoff.


            Example: `2023-08-15`
        description:
          type: string
          example: Compliance notice
          minLength: 0
          maxLength: 99999
          description: >-
            Optional description for internal reference. Does not affect
            processing or delievery.
        sender:
          $ref: '#/components/schemas/Sender'
        recipient:
          $ref: '#/components/schemas/Recipient'
        content:
          allOf:
            - $ref: '#/components/schemas/LetterContent'
          description: Content of the letter.
        url:
          type: string
          example: https://api.posta.co/letters/ltr_9a32a8b5a96c880c/download
          minLength: 0
          maxLength: 99999
          description: >-
            Temporary URL to download the rendered letter PDF. Expires after a
            set period.
          readOnly: true
        variables:
          type: array
          items:
            $ref: '#/components/schemas/VariableEntry'
          maxItems: 128
          description: >-
            Key-value pairs for personalizing letter content when using
            handlebars in HTML content.
        options:
          allOf:
            - $ref: '#/components/schemas/LetterOptions'
          description: >-
            Customization options for letter production and delivery, including:

            1. Printing preferences (e.g., color, simplex/duplex)

            2. Mailing preferences (e.g., mail class, extra services)

            3. Data processing preferences (e.g., CASS, NCOA)

            4. Other preferences


            Defaults apply if not specified. See `Option` documentation for
            details.

            Note: Some options may affect pricing or production time.
        useType:
          allOf:
            - $ref: '#/components/schemas/UseType'
          example: marketing
          description: >-
            Indicates the letter's purpose: 'marketing' or 'transactional'.
            Affects eligibility for USPS promotions and sales tax compliance.
        events:
          type: array
          items:
            $ref: '#/components/schemas/LetterEvent'
          maxItems: 999
          description: Array of events in the letter's lifecycle.
          readOnly: true
        issueMessage:
          type: string
          example: Recipient address could not be validated
          minLength: 0
          maxLength: 99999
          description: >-
            Human-readable description of any issues encountered with the
            letter.
          readOnly: true
        metadata:
          type: array
          items:
            $ref: '#/components/schemas/MetadataEntry'
          nullable: true
          description: |-
            A key-value store for custom metadata.

            Limitations:
            1. Up to 20 metadata key-value pairs
            1. Key must be no more than 64 characters
            2. Value must be no more than 512 characters
        createdAt:
          type: string
          format: date-time
          description: The timestamp the resource was created at (UTC).
          readOnly: true
        modifiedAt:
          type: string
          format: date-time
          description: The timestamp the resource was last modified at (UTC).
          readOnly: true
      description: A letter.
    ValidationError:
      type: object
      properties:
        errors:
          type: object
          description: Errors object is representing the request field validation errors
      allOf:
        - type: object
          required:
            - type
            - title
            - detail
            - status
          properties:
            type:
              type: string
              description: The type of the error
            title:
              type: string
              description: A brief summary of the error
            detail:
              type: string
              description: A detailed description of the error
            status:
              type: number
              enum:
                - 400
              description: The HTTP status code
          description: RFC 7807 problem details object
      description: Request validation error response
    SenderCreate:
      type: object
      required:
        - address
      properties:
        individual:
          allOf:
            - $ref: '#/components/schemas/Individual'
          description: >-
            Name of the individual, if applicable. Must be 40 characters or
            less.
        organization:
          type: string
          example: Veezla, Inc.
          minLength: 0
          maxLength: 99999
          description: >-
            Name of the organization, if applicable. Must be 40 characters or
            less.
        address:
          $ref: '#/components/schemas/AddressCreate'
      description: >-
        An object containing the sender's information for the letter. It must
        include:


        Either an `individual` object, an `organization` string, or both.

        - If `individual` is provided, it can contain either a `fullName` string
        or name components (at minimum `firstName` and `lastName`).

        - If only name components are provided, they will be used in the order
        specified in our API for addressing.

        - If both `fullName` and name components are provided, `fullName` will
        be used for addressing.


        An `address` object with the sender's complete address details.


        This information is used to populate the return address on the letter.
        Ensure all provided details are accurate to facilitate any potential
        return mail handling.
    RecipientCreate:
      type: object
      required:
        - address
      properties:
        nonAddressData:
          type: string
          minLength: 0
          maxLength: 99999
          description: >-
            Additional non-address data for the recipient. It will be printed as
            the first line of the recipient information. Must be 40 characters
            or less.s Eg. `Private & Confidential`.
        individual:
          allOf:
            - $ref: '#/components/schemas/Individual'
          description: >-
            Name of the individual, if applicable. Must be 40 characters or
            less.
        organization:
          type: string
          example: Posta Customer, Inc.
          minLength: 0
          maxLength: 99999
          description: >-
            Name of the organization, if applicable. Must be 40 characters or
            less.
        address:
          $ref: '#/components/schemas/AddressCreate'
      description: >-
        Recipient information for the letter. Either individual or organization
        is required; both can be provided.

        For accurate NCOA processing, provide name components when available.
    LetterContent:
      type: object
      allOf:
        - $ref: '#/components/schemas/AssetReference'
      description: Content of the letter.
    VariableEntry:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          example: customerName
          maxLength: 64
          description: The name of the variable.
        value:
          type: string
          example: John Doe
          maxLength: 512
          description: The value of the variable, if available.
      description: >-
        Represents a variable with a name and optional value for dynamic
        personalization.
    LetterOptions:
      type: object
      properties:
        print:
          $ref: '#/components/schemas/LetterPrintOptions'
        mail:
          $ref: '#/components/schemas/MailOptions'
        variableHandling:
          $ref: '#/components/schemas/VariableHandlingOptions'
        addressProcessing:
          $ref: '#/components/schemas/AddressProcessingOptions'
        deliverabilityThreshold:
          allOf:
            - $ref: '#/components/schemas/DeliverabilityThreshold'
          example: normal
          description: Deliverability threshold for the letter.
          default: normal
        deliverabilityValues:
          type: array
          items:
            $ref: '#/components/schemas/DeliverabilityStatus'
          maxItems: 99999
          description: >-
            You can speficy explicit deliverability values as a threashold
            insteead of our presets. The letter will only be send when the
            recipient's address' deliverability is among the specified values.
      description: Options for customizing the letter's printing, mailing, and processing.
    UseType:
      type: string
      enum:
        - marketing
        - transactional
    MetadataEntry:
      type: object
      required:
        - key
      properties:
        key:
          type: string
          example: salesforceId
          description: Must be no more than 64 characters.
        value:
          type: string
          nullable: true
          example: 0013i00002YyVvSAAV
          description: Must be no more than 512 characters.
    LetterStatus:
      type: string
      enum:
        - queued
        - ready
        - inProduction
        - mailed
        - issue
        - canceled
    Sender:
      type: object
      required:
        - address
      properties:
        individual:
          allOf:
            - $ref: '#/components/schemas/Individual'
          description: >-
            Name of the individual, if applicable. Must be 40 characters or
            less.
        organization:
          type: string
          example: Veezla, Inc.
          minLength: 0
          maxLength: 99999
          description: >-
            Name of the organization, if applicable. Must be 40 characters or
            less.
        address:
          $ref: '#/components/schemas/Address'
        addressComponents:
          allOf:
            - $ref: '#/components/schemas/AddressComponents'
          description: Parsed components of the sender's address.
          readOnly: true
        addressAnalysis:
          allOf:
            - $ref: '#/components/schemas/AddressAnalysis'
          description: Analysis of the sender's address.
          readOnly: true
        addressCorrections:
          type: array
          items:
            $ref: '#/components/schemas/AddressCorrection'
          maxItems: 999
          description: Corrections made to the sender's address.
          readOnly: true
        addressMetadata:
          allOf:
            - $ref: '#/components/schemas/AddressMetadata'
          description: Metadata about the sender's address.
          readOnly: true
      description: >-
        An object containing the sender's information for the letter. It must
        include:


        Either an `individual` object, an `organization` string, or both.

        - If `individual` is provided, it can contain either a `fullName` string
        or name components (at minimum `firstName` and `lastName`).

        - If only name components are provided, they will be used in the order
        specified in our API for addressing.

        - If both `fullName` and name components are provided, `fullName` will
        be used for addressing.


        An `address` object with the sender's complete address details.


        This information is used to populate the return address on the letter.
        Ensure all provided details are accurate to facilitate any potential
        return mail handling.
    Recipient:
      type: object
      required:
        - address
      properties:
        nonAddressData:
          type: string
          minLength: 0
          maxLength: 99999
          description: >-
            Additional non-address data for the recipient. It will be printed as
            the first line of the recipient information. Must be 40 characters
            or less.s Eg. `Private & Confidential`.
        individual:
          allOf:
            - $ref: '#/components/schemas/Individual'
          description: >-
            Name of the individual, if applicable. Must be 40 characters or
            less.
        organization:
          type: string
          example: Posta Customer, Inc.
          minLength: 0
          maxLength: 99999
          description: >-
            Name of the organization, if applicable. Must be 40 characters or
            less.
        address:
          $ref: '#/components/schemas/Address'
        addressComponents:
          allOf:
            - $ref: '#/components/schemas/AddressComponents'
          description: Parsed components of the recipient's address.
          readOnly: true
        addressAnalysis:
          allOf:
            - $ref: '#/components/schemas/AddressAnalysis'
          description: Analysis of the recipient's address.
          readOnly: true
        addressCorrections:
          type: array
          items:
            $ref: '#/components/schemas/AddressCorrection'
          maxItems: 999
          description: Corrections made to the recipient's address.
          readOnly: true
        addressMetadata:
          allOf:
            - $ref: '#/components/schemas/AddressMetadata'
          description: Metadata about the recipient's address.
          readOnly: true
      description: >-
        Recipient information for the letter. Either individual or organization
        is required; both can be provided.

        For accurate NCOA processing, provide name components when available.
    LetterEvent:
      oneOf:
        - $ref: '#/components/schemas/TrackingEvent'
        - $ref: '#/components/schemas/RenderingEvent'
      discriminator:
        propertyName: type
        mapping:
          tracking:
            $ref: '#/components/schemas/TrackingEvent'
          rendering:
            $ref: '#/components/schemas/RenderingEvent'
      description: Represents a lifecycle event for a letter.
    Individual:
      type: object
      properties:
        fullName:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: The full name of the individual.
        prefix:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: The name prefix (e.g., Mr., Mrs., Dr.).
        firstName:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: The first name (given name) of the individual.
        middleName:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: The middle name of the individual.
        lastName:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: The last name (family name) of the individual.
        postfix:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: The name suffix (e.g., Jr., Sr., III).
        title:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: The professional or honorary title of the individual.
      description: An individual's name components.
    AddressCreate:
      type: object
      required:
        - addressLine1
      properties:
        urbanization:
          type: string
          minLength: 0
          maxLength: 99999
          description: Urbanization for addresses in Puerto Rico, if applicable.
        addressLine1:
          type: string
          example: 1900 Reston Metro Plz
          minLength: 1
          maxLength: 99999
          description: First line of the address.
        addressLine2:
          type: string
          example: Ste 600
          minLength: 0
          maxLength: 99999
          description: Second line of the address, if applicable.
        city:
          type: string
          example: Reston
          minLength: 0
          maxLength: 99999
          description: City name.
        state:
          type: string
          example: VA
          minLength: 0
          maxLength: 99999
          description: State or province code.
        zipCode:
          type: string
          example: '20190'
          minLength: 0
          maxLength: 99999
          description: ZIP Code.
        plus4Code:
          type: string
          example: '5952'
          minLength: 0
          maxLength: 99999
          description: ZIP+4 code, if applicable.
      description: Address information for sender or recipient.
    AssetReference:
      type: object
      required:
        - type
        - assetId
        - assetVersionId
      properties:
        type:
          type: string
          enum:
            - asset
        assetId:
          type: string
          example: ast_1234567890abcdef
          description: Identifier of the asset used for the letter's content.
        assetVersionId:
          type: string
          example: astv_1234567890abcdef
          description: Identifier of the asset version used for the letter's content.
          readOnly: true
      description: Content referencing an existing asset for the letter.
    LetterPrintOptions:
      type: object
      properties:
        color:
          type: boolean
          example: true
          description: Whether to print the letter in color or black and white.
          default: true
      description: Print options for the letter.
    MailOptions:
      type: object
      properties:
        service:
          allOf:
            - $ref: '#/components/schemas/MailServices'
          example: firstClass
          description: >-
            Mailing service to use for the letter. We currently support
            `firstClass` only.
          default: firstClass
        extraServices:
          type: array
          items:
            $ref: '#/components/schemas/ExtraServices'
          example:
            - acs
          maxItems: 99999
          description: >-
            Additional services for `firstClass` mail. We will offer support for
            ACS and Secure Destruction soon, currently no extra services
            available.
      description: Mail options for the letter.
    VariableHandlingOptions:
      type: object
      properties:
        validationScope:
          allOf:
            - $ref: '#/components/schemas/ValidationScope'
          example: asset
          default: none
      description: Variable handling options for the letter.
    AddressProcessingOptions:
      type: object
      properties:
        cassSender:
          $ref: '#/components/schemas/CassOptions'
        cassRecipient:
          type: object
          properties:
            type:
              allOf:
                - $ref: '#/components/schemas/CassType'
              example: basic
              description: >-
                Indicates the type of CASS processing to be applied to the
                recipient's address. Values can be: `none`, `basic`, `full`.
              default: basic
            casing:
              allOf:
                - $ref: '#/components/schemas/CassCasing'
              example: proper
              description: >-
                Specifies the casing style to be used for the address after CASS
                processing.
              default: proper
        ncoaRecipient:
          allOf:
            - $ref: '#/components/schemas/NcoaHandling'
          example: newAddress
          description: NCOA handling preferences for the recipient's address.
          default: newAddress
      description: Address processing options for the letter.
    DeliverabilityThreshold:
      type: string
      enum:
        - none
        - normal
        - strict
      description: Thresholds for determining whether to deliver based on address quality.
    DeliverabilityStatus:
      type: string
      enum:
        - deliverable
        - deliverableUnnecessaryUnit
        - deliverableIncorrectUnit
        - deliverableMissingUnit
        - undeliverable
      description: The deliverability status of an address
    Address:
      type: object
      required:
        - addressLine1
      properties:
        addressLine1:
          type: string
          example: 1900 Reston Metro Plz
          minLength: 1
          maxLength: 99999
          description: First line of the address.
        addressLine2:
          type: string
          example: Ste 600
          minLength: 0
          maxLength: 99999
          description: Second line of the address, if applicable.
        lastLine:
          type: string
          example: Reston, VA 20194-5952
          minLength: 0
          maxLength: 99999
          description: >-
            Generated by us, used as the last line for postal addressing.
            Typically city, state, and ZIP code combined.
          readOnly: true
      description: Address information for sender or recipient.
    AddressComponents:
      oneOf:
        - $ref: '#/components/schemas/CassNoneComponents'
        - $ref: '#/components/schemas/BasicComponents'
        - $ref: '#/components/schemas/FullAddressComponents'
      discriminator:
        propertyName: cassType
        mapping:
          none:
            $ref: '#/components/schemas/CassNoneComponents'
          basic:
            $ref: '#/components/schemas/BasicComponents'
          full:
            $ref: '#/components/schemas/FullAddressComponents'
      description: Represents an address components
    AddressAnalysis:
      type: object
      properties:
        dpvMatchCode:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: DPV (Delivery Point Validation) match code
        dpvFootnotes:
          type: array
          items:
            type: string
          example:
            - TODO
          maxItems: 999
          description: DPV footnotes
        dpvCmra:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: DPV CMRA indicator
        dpvVacant:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: DPV vacant indicator
        dpvNoStat:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: DPV no-stat indicator
        dpvActive:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: DPV active indicator
        dpvInactiveReason:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: DPV inactive reason
        dpvThrowback:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: DPV throwback indicator
        dpvNonDeliveryDayIndicator:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: DPV non-delivery day indicator
        dpvNonDeliveryDayValues:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: DPV non-delivery day values
        dpvNoSecureLocation:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: DPV no secure location indicator
        dpvDoorNotAccessible:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: DPV door not accessible indicator
        lacslinkCode:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: LACSLink code
        lacslinkIndicator:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: LACSLink indicator
        suitelinkIndicator:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: SuiteLink indicator
        ewsIndicator:
          type: boolean
          description: Early Warning System indicator
      description: Analysis of the address
    AddressCorrection:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          example: TODO
          minLength: 1
          maxLength: 99999
          description: Name of the corrected address field
        input:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: Input value before correction
        corrected:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: Corrected value
      description: Represents a correction made to an address component
    AddressMetadata:
      type: object
      properties:
        recordType:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: Type of record
        addressType:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: Type of address
        zipCodeType:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: Type of ZIP code
        county:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: County name
        countyFips:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: County FIPS code
        carrierRoute:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: Carrier route
        carrierRouteType:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: Type of carrier route
        congressionalDistrict:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: Congressional district
        defaultBuildingAddress:
          type: boolean
          description: Indicates if this is the default building address
        elotSequence:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: eLOT sequence number
        elotSort:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: eLOT sort
        latitude:
          type: number
          format: float
          example: 0
          minimum: -90
          maximum: 90
          description: Latitude coordinate
        longitude:
          type: number
          format: float
          example: 0
          minimum: -180
          maximum: 180
          description: Longitude coordinate
        precision:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: Precision of the geocode
        uspsFinanceNumber:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: USPS finance number
        timeZone:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: Time zone of the address
      description: Metadata related to the address
    TrackingEvent:
      type: object
      required:
        - type
        - status
        - trackingEventDetails
      properties:
        type:
          type: string
          enum:
            - tracking
        status:
          allOf:
            - $ref: '#/components/schemas/TrackingEventStatus'
          description: The status of the tracking event.
        description:
          type: string
          example: TODO
          description: Description of the tracking event.
        operationCode:
          type: string
          example: TODO
          description: Operation code associated with the tracking event.
        actionRequired:
          type: boolean
          description: Indicates if any action is required based on this event.
        trackingEventDetails:
          allOf:
            - $ref: '#/components/schemas/TrackingEventDetails'
          description: Detailed information about the tracking event.
        location:
          type: string
          example: TODO
          description: The location where the event occurred, if applicable.
      allOf:
        - $ref: '#/components/schemas/LetterEventBase'
      description: Represents a tracking event in the letter's lifecycle.
    RenderingEvent:
      type: object
      required:
        - type
        - name
      properties:
        type:
          type: string
          enum:
            - rendering
        name:
          type: string
          enum:
            - rendered
            - failedToRender
          example: rendered
          description: The specific rendering event that occurred.
      allOf:
        - $ref: '#/components/schemas/LetterEventBase'
      description: Represents a rendering event in the letter's lifecycle.
    MailServices:
      type: string
      enum:
        - firstClass
      description: Available mail classes for letters.
    ExtraServices:
      type: string
      enum:
        - acs
        - secureDestruction
      description: Additional mailing services that can be applied to letters.
    ValidationScope:
      type: string
      enum:
        - none
        - asset
      description: >-
        Defines the scope to validate the requested variables against.

        - `none`: The requested variable will not be evaluated.

        - `asset`: The requested variable will be evaluated against the Variable
        Definitions of the published version of the Asset. If the requested
        variables are missing a defined variable on the Asset or if they contain
        an extra variable not defined on the Asset, the rendering will fail.
        Furthermore, all parameters of the Variable Definition will be
        evaluated.


        For detailed examples and edge cases on how `behavior`, `allowEmpty`,
        and `presetValue`

        interact, see the Assets Overview in our API reference.
    CassOptions:
      type: object
      properties:
        type:
          allOf:
            - $ref: '#/components/schemas/CassType'
          example: basic
          description: Indicates the level of CASS processing to be applied to the address.
          default: none
        casing:
          allOf:
            - $ref: '#/components/schemas/CassCasing'
          example: proper
          description: >-
            Specifies the casing style to be used for the address after CASS
            processing.
          default: proper
      description: CASS options for address processing.
    CassType:
      type: string
      enum:
        - none
        - basic
        - full
      description: Types of CASS processing.
    CassCasing:
      type: string
      enum:
        - proper
        - upper
        - original
      description: CASS casing options for processed addresses.
    NcoaHandling:
      type: string
      enum:
        - newAddress
        - oldAddress
        - doNotSend
      description: >-
        NCOA (National Change of Address) handling options for recipient
        addresses.
    CassNoneComponents:
      type: object
      required:
        - cassType
      properties:
        cassType:
          type: string
          enum:
            - none
        urbanization:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: Urbanization name
        city:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: City name
        state:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: State abbreviation
        zipCode:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: 5-digit ZIP code
        plus4Code:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: ZIP+4 code
      description: Components of the address, with no CASS data
    BasicComponents:
      type: object
      required:
        - cassType
      properties:
        cassType:
          type: string
          enum:
            - basic
        urbanization:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: Urbanization name
        city:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: City name
        primaryCity:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: Primary city name
        state:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: State abbreviation
        zipCode:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: 5-digit ZIP code
        plus4Code:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: ZIP+4 code
        deliverability:
          allOf:
            - $ref: '#/components/schemas/DeliverabilityStatus'
          description: Deliverability status
        validAddress:
          type: boolean
          description: Indicates if the address is valid
      description: Basic components of the address
    FullAddressComponents:
      type: object
      required:
        - cassType
      properties:
        cassType:
          type: string
          enum:
            - full
        urbanization:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: Urbanization name
        primaryNumber:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: Primary street number
        streetName:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: Street name
        streetPredirection:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: Street pre-direction
        streetPostdirection:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: Street post-direction
        streetSuffix:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: Street suffix
        secondaryNumber:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: Secondary number (e.g., apartment or suite number)
        secondaryDesignator:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: Secondary designator (e.g., Apt, Ste)
        extraSecondaryNumber:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: Extra secondary number
        extraSecondaryDesignator:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: Extra secondary designator
        pmbDesignator:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: Private mailbox designator
        pmbNumber:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: Private mailbox number
        city:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: City name
        primaryCity:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: Primary city name
        state:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: State abbreviation
        zipCode:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: 5-digit ZIP code
        plus4Code:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: ZIP+4 code
        deliveryPointBarcode:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: Delivery point barcode
        deliveryPoint:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: Delivery point
        deliveryPointCheckDigit:
          type: string
          example: TODO
          minLength: 0
          maxLength: 99999
          description: Delivery point check digit
        deliverability:
          allOf:
            - $ref: '#/components/schemas/DeliverabilityStatus'
          description: Deliverability status
        validAddress:
          type: boolean
          description: Indicates if the address is valid
      description: All Components of the address
    TrackingEventStatus:
      type: string
      enum:
        - inTransit
        - delivered
        - exception
        - outForDelivery
        - returnedToSender
      description: Status options for tracking events.
    TrackingEventDetails:
      type: object
      properties:
        notes:
          type: string
          example: TODO
          description: Additional notes about the tracking event.
        facility:
          type: string
          example: TODO
          description: The postal facility where the event occurred.
        facilityType:
          type: string
          example: TODO
          description: The type of postal facility.
        facilityZip:
          type: string
          example: TODO
          description: The ZIP code of the facility.
        additionalData:
          type: object
          additionalProperties:
            type: string
          description: Any additional data related to the tracking event.
      description: Detailed information about a tracking event.
    LetterEventBase:
      type: object
      required:
        - id
        - createdAt
        - modifiedAt
      properties:
        id:
          type: string
          example: evt_1234567890abcdef
          description: Unique identifier for the event.
        timestamp:
          type: string
          format: date-time
          description: The timestamp when the event occurred.
        createdAt:
          type: string
          format: date-time
          description: The timestamp the resource was created at (UTC).
          readOnly: true
        modifiedAt:
          type: string
          format: date-time
          description: The timestamp the resource was last modified at (UTC).
          readOnly: true
      description: Base model for letter events.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key

````