Lob.com Uploads API

The uploads endpoint allows you to upload audience files that are then associated with a given campaign. At this time, only CSV files are allowed. The API provides endpoints for creating uploads, uploading audience files, and marking uploaded files as ready for processing. The API also provides endpoints for downloading files that describe the results, both successful and not, of the processing.

OpenAPI Specification

lobcom-uploads-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Lob Accounts Uploads API
  version: 1.22.0
  description: 'The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors. <p>

    '
  license:
    name: MIT
    url: https://mit-license.org/
  contact:
    name: Lob Developer Experience
    url: https://support.lob.com/
    email: lob-openapi@lob.com
  termsOfService: https://www.lob.com/legal
servers:
- url: https://api.lob.com/v1
  description: production
security:
- basicAuth: []
tags:
- name: Uploads
  description: 'The uploads endpoint allows you to upload audience files that are then associated with a given campaign.

    At this time, only CSV files are allowed. The API provides endpoints for creating uploads, uploading audience files,

    and marking uploaded files as ready for processing. The API also provides endpoints for downloading files that

    describe the results, both successful and not, of the processing.

    '
paths:
  /uploads:
    get:
      operationId: uploads_list
      summary: List
      description: Returns a list of your uploads. Optionally, filter uploads by campaign.
      tags:
      - Uploads
      parameters:
      - required: false
        schema:
          $ref: '#/components/schemas/cmp_id'
        name: campaignId
        description: id of the campaign
        in: query
      responses:
        '200':
          $ref: '#/components/responses/all_uploads'
      x-codeSamples:
      - lang: Shell
        source: "curl https://api.lob.com/v1/uploads \\\n  -u <YOUR API KEY>:\n"
        label: CURL
      - lang: Ruby
        source: "uploadsApi = UploadsApi.new(config)\n\nbegin\n  uploads = uploadsApi.list_upload({ campaign_id: \"cmp_e05ee61ff80764b\" })\nrescue => err\n  p err.message\nend\n"
        label: RUBY
    post:
      operationId: upload_create
      summary: Create
      description: Creates a new upload with the provided properties.
      tags:
      - Uploads
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/upload_writable'
      responses:
        '201':
          description: Upload created successfully
          content:
            $ref: '#/components/mediaTypes/upload'
        '422':
          $ref: '#/components/responses/upload_validation_error'
      x-codeSamples:
      - lang: Shell
        source: "curl --location --request POST 'https://api.lob.com/v1/uploads' \\\n--header 'Content-Type: application/json' \\\n-u YOUR_KEY_HERE: \\\n--data-raw '{\n    \"campaignId\": \"cmp_f33809b18b6f3ea8\"\n}'\n"
        label: CURL
      - lang: Ruby
        source: "uploadCreate = UploadWritable.new({\n  campaign_id: \"cmp_e05ee61ff80764b\",\n});\n\nuploadApi = UploadsApi.new(config)\n\nbegin\n  createdUpload = uploadApi.create_upload(uploadCreate)\nrescue => err\n  p err.message\nend\n"
        label: RUBY
  /uploads/{upl_id}:
    parameters:
    - in: path
      name: upl_id
      description: id of the upload
      required: true
      schema:
        $ref: '#/components/schemas/upl_id'
    get:
      operationId: upload_retrieve
      summary: Retrieve
      description: Retrieves the details of an existing upload. You need only supply the unique upload identifier that was returned upon upload creation.
      tags:
      - Uploads
      responses:
        '200':
          description: Returns an upload object
          content:
            $ref: '#/components/mediaTypes/upload'
        '404':
          $ref: '#/components/responses/upload_not_found'
        '422':
          $ref: '#/components/responses/upload_validation_error'
      x-codeSamples:
      - lang: Shell
        source: "curl https://api.lob.com/v1/uploads/upl_71be866e430b11e9 \\\n  -u <YOUR API KEY>: \\\n"
        label: CURL
      - lang: Ruby
        source: "uploadApi = UploadsApi.new(config)\n\nbegin\n  retrievedUpload = uploadApi.get_upload(\"upl_71be866e430b11e9\")\nrescue => err\n  p err.message\nend\n"
        label: RUBY
    patch:
      operationId: upload_update
      summary: Update
      description: Update the details of an existing upload. You need only supply the unique identifier that was returned upon upload creation.
      tags:
      - Uploads
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/upload_updatable'
      responses:
        '200':
          description: Returns an upload object
          content:
            $ref: '#/components/mediaTypes/upload'
        '404':
          $ref: '#/components/responses/upload_not_found'
        '422':
          $ref: '#/components/responses/upload_validation_error'
      x-codeSamples:
      - lang: Shell
        source: "curl -X PATCH https://api.lob.com/v1/uploads/upl_71be866e430b11e9 \\\n  -u <YOUR API KEY>: \\\n  -d \"state=Ready for Validation\"\n"
        label: CURL
      - lang: Python
        source: "upload_updatable = UploadUpdatable(\n  state = UploadState(\"Ready for Validation\"),\n)\n\nwith ApiClient(configuration) as api_client:\n  api = UploadsApi(api_client)\n\ntry:\n  updated_upload = api.update_upload(\"upl_71be866e430b11e9\", upload_updatable)\nexcept ApiException as e:\n  print(e)\n"
        label: PYTHON
      - lang: Ruby
        source: "uploadUpdatable = UploadUpdatable.new({\n  required_address_column_mapping: RequiredAddressColumnMapping.new({\n    name: \"recipient\",\n    address_line1: \"primary line\",\n    address_city: \"city\",\n    address_state: \"state\",\n    address_zip: \"zip_code\",\n  }),\n})\n\nuploadApi = UploadsApi.new(config)\n\nbegin\n  updatedUpload = uploadApi.update_upload(\"upl_71be866e430b11e9\", uploadUpdatable)\nrescue => err\n  p err.message\nend\n"
        label: RUBY
    delete:
      operationId: upload_delete
      summary: Delete
      description: Delete an existing upload. You need only supply the unique identifier that was returned upon upload creation.
      tags:
      - Uploads
      responses:
        '204':
          description: Successful Response
      x-codeSamples:
      - lang: Shell
        source: "curl -X DELETE https://api.lob.com/v1/uploads/upl_71be866e430b11e9 \\\n  -u <YOUR API KEY>:\n"
        label: CURL
      - lang: Ruby
        source: "uploadApi = UploadsApi.new(config)\n\nbegin\n  deletedUpload = uploadApi.delete_upload(\"upl_71be866e430b11e9\")\nrescue => err\n  p err.message\nend\n"
        label: RUBY
  /uploads/{upl_id}/file:
    parameters:
    - in: path
      name: upl_id
      description: ID of the upload
      required: true
      schema:
        $ref: '#/components/schemas/upl_id'
    post:
      operationId: upload_file
      summary: Upload file
      description: Upload an [audience file](https://help.lob.com/print-and-mail/building-a-mail-strategy/campaign-or-triggered-sends/campaign-audience-guide) and associate it with an upload.
      tags:
      - Uploads
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/upload_file'
        '422':
          $ref: '#/components/responses/upload_validation_error'
      x-codeSamples:
      - lang: Shell
        source: "curl -X POST https://api.lob.com/v1/uploads/upl_71be866e430b11e9/file \\\n  -u <YOUR API KEY>: \\\n  -F file=@<YOUR FILE NAME HERE>\n"
        label: CURL
      - lang: Python
        source: "with ApiClient(configuration) as api_client:\n  api = UploadsApi(api_client)\n\ntry:\n  res = api.upload_file(\"upl_71be866e430b11e9\", open(\"<PATH_TO_CSV>\", \"rb\"))\nexcept ApiException as e:\n  print(e)\n"
        label: PYTHON
  /uploads/{upl_id}/exports:
    parameters:
    - in: path
      name: upl_id
      description: ID of the upload
      required: true
      schema:
        $ref: '#/components/schemas/upl_id'
    post:
      operationId: upload_export_create
      summary: Create Export
      description: 'Campaign Exports can help you understand exactly which records in a campaign could not be created. By initiating and retrieving an export, you will get row-by-row errors for your campaign. For a step-by-step walkthrough of creating a campaign and exporting failures, see our [Campaigns Guide](https://help.lob.com/print-and-mail/building-a-mail-strategy/campaign-or-triggered-sends/launch-your-first-campaign).


        Create an export file associated with an upload.'
      tags:
      - Uploads
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  enum:
                  - all
                  - failures
                  - successes
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/upload_create_export'
        4XX:
          $ref: '#/components/responses/upload_export_error'
      x-codeSamples:
      - lang: Shell
        source: "curl https://api.lob.com/v1/uploads/upl_71be866e430b11e9/exports \\\n  -u <YOUR API KEY>: \\\n  -d \"type=failures\" \\\n"
        label: CURL
      - lang: Python
        source: "with ApiClient(configuration) as api_client:\n  api = UploadsApi(api_client)\n\nexport_model = ExportModel(\n  type = \"all\"\n)\n\ntry:\n  created_export = api.create_export(\"upl_71be866e430b11e9\", export_model)\nexcept ApiException as e:\n  print(e)\n"
        label: PYTHON
      - lang: Ruby
        source: "exportModel = ExportModel.new({\n  type: \"all\"\n})\n\nuploadsApi = UploadsApi.new(config)\n\nbegin\n  createdExport = uploadsApi.create_export(\"upl_71be866e430b11e9\", exportModel)\nrescue => err\n  p err.message\nend\n"
        label: RUBY
  /uploads/{upl_id}/report:
    parameters:
    - in: path
      name: upl_id
      description: ID of the upload
      required: true
      schema:
        $ref: '#/components/schemas/upl_id'
    - in: query
      required: false
      name: status
      description: The status of line items to filter and retrieve. By default all line items are returned.
      schema:
        enum:
        - Validated
        - Failed
        - Processing
        type: string
    - in: query
      required: false
      name: limit
      description: How many results to return.
      schema:
        type: integer
        minimum: 1
        default: 100
        maximum: 100
        example: 10
    - $ref: '#/components/parameters/offset'
    get:
      operationId: report_retrieve
      summary: Retrieve Line Item Report
      description: 'Retrieves the line item data for each row from the csv file associated with the upload id record. NOTE: This endpoint is currently feature flagged. Please reach out to Lob''s support team if you  would like access to this API endpoint.'
      tags:
      - Uploads
      responses:
        '200':
          description: Returns an report object
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                - count
                - offset
                - total_count
                properties:
                  data:
                    type: array
                    items:
                      properties:
                        rowNumber:
                          title: Row Number
                          type: number
                          description: The row number of the csv file containing this data.
                        status:
                          type: string
                          description: The processing status of line item.
                          enum:
                          - Validated
                          - Failed
                          - Processing
                        errorMessage:
                          type: string
                          nullable: true
                          description: The error message detailing the reason why processing the line item failed.
                        mailpieceId:
                          type: string
                          nullable: true
                          description: The mailpiece id created from the line item when it was validated.
                        originalData:
                          type: object
                          description: Key-value pairs where each key is the column header and each value is the value of the column for the row.
                  next_url:
                    type: string
                    description: Url of next page of items in list.
                    nullable: true
                  prev_url:
                    type: string
                    description: Url of previous page of items in list.
                    nullable: true
                  count:
                    $ref: '#/components/schemas/count'
                  total_count:
                    type: integer
                    description: Indicates the total number of records. Provided when the request specifies an "include" query parameter
              example:
                id: ex_6a94fe68fd151e0f8
                dateCreated: '2021-07-06T22:51:42.838Z'
                dateModified: '2022-07-06T22:51:42.838Z'
                deleted: false
                s3Url: null
                state: in_progress
                type: failures
                uploadId: upl_71be866e430b11e9
        '404':
          $ref: '#/components/responses/upload_not_found'
      x-codeSamples:
      - lang: Shell
        source: "curl https://api.lob.com/v1/uploads/upl_71be866e430b11e9/report \\\n  -u <YOUR API KEY>:\n"
        label: CURL
      - lang: Python
        source: "with ApiClient(configuration) as api_client:\n  api = UploadsApi(api_client)\n\ntry:\n  retrieved_report = api.get_report(\"upl_71be866e430b11e9\")\nexcept ApiException as e:\n  print(e)\n"
        label: PYTHON
      - lang: Ruby
        source: "uploadsApi = UploadsApi.new(config)\n\nbegin\n  retrievedreport = uploadsApi.get_report(\"upl_71be866e430b11e9\")\nrescue => err\n  p err.message\nend\n"
        label: RUBY
  /uploads/{upl_id}/exports/{ex_id}:
    parameters:
    - in: path
      name: upl_id
      description: ID of the upload
      required: true
      schema:
        $ref: '#/components/schemas/upl_id'
    - in: path
      name: ex_id
      description: ID of the export
      required: true
      schema:
        $ref: '#/components/schemas/ex_id'
    get:
      operationId: export_retrieve
      summary: Retrieve Export
      description: Retrieves the details of an existing export. You need only supply the unique export identifier that was returned upon export creation. If you try retrieving an export immediately after creating one (i.e., before we're done processing the export), you will get back an export object with `state = in_progress`.
      tags:
      - Uploads
      responses:
        '200':
          description: Returns an export object
          content:
            application/json:
              schema:
                type: object
                required:
                - id
                - dateCreated
                - dateModified
                - deleted
                - s3Url
                - state
                - type
                - uploadId
                properties:
                  id:
                    $ref: '#/components/schemas/ex_id'
                  dateCreated:
                    type: string
                    format: date-time
                    description: A timestamp in ISO 8601 format of the date the export was created
                  dateModified:
                    type: string
                    format: date-time
                    description: A timestamp in ISO 8601 format of the date the export was last modified
                  deleted:
                    type: boolean
                    description: Returns as `true` if the resource has been successfully deleted.
                  s3Url:
                    type: string
                    description: The URL for the generated export file.
                  state:
                    type: string
                    enum:
                    - in_progress
                    - failed
                    - succeeded
                    description: The state of the export file, which can be `in_progress`, `failed` or `succeeded`.
                  type:
                    type: string
                    enum:
                    - all
                    - failures
                    - successes
                    description: The export file type, which can be `all`, `failures` or `successes`.
                  uploadId:
                    $ref: '#/components/schemas/upl_id'
              example:
                id: ex_6a94fe68fd151e0f8
                dateCreated: '2021-07-06T22:51:42.838Z'
                dateModified: '2022-07-06T22:51:42.838Z'
                deleted: false
                s3Url: null
                state: in_progress
                type: failures
                uploadId: upl_71be866e430b11e9
      x-codeSamples:
      - lang: Shell
        source: "curl https://api.lob.com/v1/uploads/upl_71be866e430b11e9/exports/ex_6a94fe68fd151e0f8 \\\n  -u <YOUR API KEY>:\n"
        label: CURL
      - lang: Python
        source: "with ApiClient(configuration) as api_client:\n  api = UploadsApi(api_client)\n\ntry:\n  retrieved_export = api.get_export(\"upl_71be866e430b11e9\", \"ex_6a94fe68fd151e0f8\")\nexcept ApiException as e:\n  print(e)\n"
        label: PYTHON
      - lang: Ruby
        source: "uploadsApi = UploadsApi.new(config)\n\nbegin\n  retrievedExport = uploadsApi.get_export(\"upl_71be866e430b11e9\", \"ex_6a94fe68fd151e0f8\")\nrescue => err\n  p err.message\nend\n"
        label: RUBY
components:
  responses:
    all_uploads:
      description: An array of matching uploads. Each entry in the array is a separate upload.
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/upload'
          example:
          - id: upl_71be866e430b11e9
            accountId: fa9ea650fc7b31a89f92
            campaignId: cmp_1933ad629bae1408
            mode: test
            failuresUrl: https://www.example.com
            originalFilename: my_audience.csv
            state: Draft
            totalMailpieces: 100
            failedMailpieces: 5
            validatedMailpieces: 95
            bytesProcessed: 17268
            dateCreated: '2017-09-05T17:47:53.767Z'
            dateModified: '2017-09-05T17:47:53.767Z'
            requiredAddressColumnMapping:
              name: recipient_name
              address_line1: primary_line
              address_city: city
              address_state: state
              address_zip: zip_code
            optionalAddressColumnMapping:
              address_line2: secondary_line
              company: company
              address_country: country
            mergeVariableColumnMapping:
              gift_code: code
            metadata:
              columns:
              - recipient_name
              - zip_code
    upload_validation_error:
      description: Validation Error
      content:
        application/json:
          schema:
            title: HTTPValidationError
            type: object
            properties:
              detail:
                title: Detail
                type: array
                items:
                  title: ValidationError
                  required:
                  - loc
                  - msg
                  - type
                  type: object
                  properties:
                    loc:
                      title: Location
                      type: array
                      items:
                        anyOf:
                        - type: string
                        - type: integer
                    msg:
                      title: Message
                      type: string
                    type:
                      title: Error Type
                      type: string
    upload_not_found:
      description: Not Found Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            error:
              code: not_found
              message: upload not found
              status_code: 404
    upload_export_error:
      description: Create Export Error
      content:
        application/json:
          schema:
            type: object
            required:
            - code
            - message
            - errors
            properties:
              code:
                description: A conventional HTTP status code
                type: number
                enum:
                - 400
                - 404
              message:
                description: A human-readable message with more details about the error
                type: string
              errors:
                description: An array of pre-defined strings that identify an error
                type: array
                items:
                  type: string
            example:
              code: 400
              message: Invalid body, check 'errors' property for more info.
              errors:
              - type must be a string
  schemas:
    upload_state:
      title: Upload State
      enum:
      - Preprocessing
      - Draft
      - Ready for Validation
      - Validating
      - Scheduled
      - Cancelled
      - Errored
      default: Draft
      type: string
      description: The `state` property on the `upload` object. As the file is processed, the `state` will change from `Ready for Validation` to `Validating` and then will be either `Scheduled` (successfully processed) or `Errored` (Unsuccessfully processed).
    optional_address_column_mapping:
      title: Optional Address Columns
      type: object
      required:
      - address_line2
      - company
      - address_country
      properties:
        address_line2:
          type: string
          nullable: true
          default: null
          description: The column header from the csv file that should be mapped to the optional field "address_line2"
        company:
          type: string
          nullable: true
          default: null
          description: The column header from the csv file that should be mapped to the optional field "company"
        address_country:
          type: string
          nullable: true
          default: null
          description: The column header from the csv file that should be mapped to the optional field "address_country"
      example:
        address_line2: secondary_line
        company: company
        address_country: country,
      description: The mapping of column headers in your file to Lob-optional fields for the resource created. See our <a href="https://help.lob.com/print-and-mail/building-a-mail-strategy/campaign-or-triggered-sends/campaign-audience-guide#optional-columns-3" target="_blank">Campaign Audience Guide</a> for additional details.
    upload_updatable:
      type: object
      properties:
        originalFilename:
          title: Original Filename
          type: string
          description: Original filename provided when the upload is created.
        requiredAddressColumnMapping:
          $ref: '#/components/schemas/required_address_column_mapping'
        optionalAddressColumnMapping:
          $ref: '#/components/schemas/optional_address_column_mapping'
        metadata:
          $ref: '#/components/schemas/uploads_metadata'
        mergeVariableColumnMapping:
          $ref: '#/components/schemas/merge_variable_column_mapping'
    upload_file:
      type: object
      required:
      - message
      - filename
      properties:
        message:
          title: Message
          enum:
          - File uploaded successfully
          type: string
          default: File uploaded successfully
        filename:
          title: Filename
          type: string
    upload_create_export:
      type: object
      required:
      - message
      - exportId
      properties:
        message:
          title: Message
          enum:
          - Export is processing
          type: string
          default: Export is processing
        exportId:
          title: Export ID
          type: string
          example: ex_2dafd758ed3da9c43
    upload:
      allOf:
      - $ref: '#/components/schemas/upload_writable'
      - type: object
        required:
        - id
        - accountId
        - campaignId
        - requiredAddressColumnMapping
        - optionalAddressColumnMapping
        - metadata
        - mergeVariableColumnMapping
        - mode
        - state
        - totalMailpieces
        - failedMailpieces
        - validatedMailpieces
        - bytesProcessed
        - dateCreated
        - dateModified
        properties:
          id:
            $ref: '#/components/schemas/upl_id'
          accountId:
            title: Account ID
            type: string
            description: Account ID that made the request
            example: fa9ea650fc7b31a89f92
          mode:
            enum:
            - test
            - live
            type: string
            description: The environment in which the mailpieces were created. Today, will only be `live`.
          failuresUrl:
            title: Failures URL
            type: string
            example: https://www.example.com
            description: Url where your campaign mailpiece failures can be retrieved
          originalFilename:
            title: Original Filename
            type: string
            example: my_audience.csv
            description: Filename of the upload
          state:
            $ref: '#/components/schemas/upload_state'
          totalMailpieces:
            title: Total Mailpieces
            type: integer
            example: 100
            description: Total number of recipients for the campaign
          failedMailpieces:
            title: Failed Mailpieces
            type: integer
            example: 5
            description: Number of mailpieces that failed to create
          validatedMailpieces:
            title: Validated Mailpieces
            type: integer
            example: 95
            description: Number of mailpieces that were successfully created
          bytesProcessed:
            title: Bytes Processed
            type: integer
            example: 17268
            description: Number of bytes processed in your CSV
          dateCreated:
            title: Date Created
            type: string
            format: date-time
            description: A timestamp in ISO 8601 format of the date the upload was created
          dateModified:
            title: Date Modified
            type: string
            format: date-time
            description: A timestamp in ISO 8601 format of the date the upload was last modified
    cmp_id:
      type: string
      title: Campaign id
      description: Unique identifier prefixed with `cmp_`.
      pattern: ^cmp_[a-zA-Z0-9]+$
    upload_writable:
      type: object
      required:
      - campaignId
      properties:
        campaignId:
          allOf:
          - $ref: '#/components/schemas/cmp_id'
          - description: Associated Campaign ID
            type: string
            example: cmp_1933ad629bae1408
        requiredAddressColumnMapping:
          $ref: '#/components/schemas/required_address_column_mapping'
        optionalAddressColumnMapping:
          $ref: '#/components/schemas/optional_address_column_mapping'
        metadata:
          $ref: '#/components/schemas/uploads_metadata'
        mergeVariableColumnMapping:
          $ref: '#/components/schemas/merge_variable_column_mapping'
          description: test
    uploads_metadata:
      title: Metadata
      type: object
      required:
      - columns
      properties:
        columns:
          type: array
          description: The list of column names from the csv file which you want associated with each of your mailpieces
          default: []
          items:
            type: string
      default:
        columns: []
      example:
        columns:
        - recipient_name
      description: The list of column headers in your file as an array that you want as metadata associated with each mailpiece. See our <a href="https://help.lob.com/print-and-mail/building-a-mail-strategy/campaign-or-triggered-sends/campaign-audience-guide#required-columns-2" target="_blank">Campaign Audience Guide</a> for additional details.
    upl_id:
      type: string
      description: Unique identifier prefixed with `upl_`.
      pattern: ^upl_[a-zA-Z0-9]+$
    required_address_column_mapping:
      title: Required Address Columns
      type: object
      required:
      - name
      - address_line1
      - address_city
      - address_state
      - address_zip
      properties:
        name:
          type: string
          nullable: true
          default: null
          description: The column header from the csv file that should be mapped to the required field `name`
        address_line1:
          type: string
          nullable: true
          default: null
          description: The column header from the csv file that should be mapped to the required field `address_line1`
        address_city:
          type: string
          nullable: true
          default: null
          description: The column header from the csv file that should be mapped to the required field `address_city`
        address_state:
          type: string
          nullable: true
          default: null
          description: The column header from the csv file that should be mapped to the required field `address_state`
        address_zip:
          type: string
          nullable: true
          default: null
          description: The column header from the csv file that should be mapped to the required field `address_zip`
      example:
        name: recipient_name
        address_line1: primary_line
        address_city: city
        address_state: state
        address_zip: zip_code
      description: The mapping of column headers in your file to Lob-required fields for the resource created. See our <a href="https://help.lob.com/print-and-mail/building-a-mail-strategy/campaign-or-triggered-sends/campaign-audience-guide#required-columns-2" target="_blank">Campaign Audience Guide</a> for additional details.
    ex_id:
      type: string
      description: Unique identifier prefixed with `ex_`.
      pattern: ^ex_[a-zA-Z0-9]+$
    merge_variable_column_mapping:
      title: Merge Variable Mapping
      type: object
      nullable: true
      default: null
      example:
        name: recipient_name
        gift_code: code
        qr_code_redirect_url: redirect_url
      description: The mapping of column headers in your file to the merge variables present in your creative. See our <a href="https://help.lob.com/print-and-mail/building-a-mail-strategy/campaign-or-triggered-sends/campaign-audience-guide#step-3-map-merge-variable-data-if-applicable-7" target="_blank">Campaign Audience Guide</a> for additional details. <br />If a merge variable has the same "name" as a "key" in the `requiredAddressColumnMapping` or `optionalAddressColumnMapping` objects, then they **CANNOT** have a different value in this object. If a different value is provided, then when the campaign is processing it will get overwritten with the mapped value present in the `requiredAddressColumnMapping` or `optionalAddressColumnMapping` objects. The redirect URLs for QR codes can also be customized using this mapping. If the URL has a variable and the variable mapping existsing here, then data from the respective column in the audience file will be merged into the URL template.
    count:
      type: integer
      description: number of resources in a set
    error:
      type: object
      description: Lob uses RESTful HTTP response codes to indicate success or failure of an API request. In general, 2xx indicates success, 4xx indicate an input error, and 5xx indicates an error

# --- truncated at 32 KB (43 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/lobcom/refs/heads/main/openapi/lobcom-uploads-api-openapi.yml