Lob

Lob Self Mailers API

The Self Mailers API from Lob — 1 operation(s) for self mailers.

OpenAPI Specification

lob-self-mailers-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Lob Self  Mailers API
  version: 1.20.2
  description: "Experience direct mail like never before, with unmatched personalization and scalability \x14 all in one intuitive platform."
  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: Self  Mailers
paths:
  /self_mailers:
    get:
      operationId: self_mailers_list
      summary: List
      description: Returns a list of your self_mailers. The self_mailers are returned sorted by creation date, with the most recently created self_mailers appearing first.
      tags:
      - Self  Mailers
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/before_after'
      - $ref: '#/components/parameters/include'
      - $ref: '#/components/parameters/date_created'
      - $ref: '#/components/parameters/metadata'
      - in: query
        name: size
        description: The self mailer sizes to be returned.
        schema:
          type: array
          items:
            $ref: '#/components/schemas/self_mailer_size'
      - $ref: '#/components/parameters/scheduled'
      - $ref: '#/components/parameters/send_date'
      - $ref: '#/components/parameters/mail_type'
      - $ref: '#/components/parameters/sort_by'
      - $ref: '#/components/parameters/campaign_id'
      - $ref: '#/components/parameters/status'
      responses:
        '200':
          $ref: '#/components/responses/all_self_mailers'
        default:
          $ref: '#/components/responses/mailpiece_error'
      x-codeSamples:
      - lang: Shell
        source: "curl -X GET \"https://api.lob.com/v1/self_mailers?limit=2\" \\\n  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:\n"
        label: CURL
      - lang: typescript
        source: "try {\n  const selfMailers = await new selfMailersApi(config).list(2);\n} catch (err: any) {\n  console.error(err);\n}\n"
        label: TYPESCRIPT
      - lang: Javascript
        source: "Lob.selfMailers.list({limit: 2}, function (err, res) {\n  console.log(err, res);\n});\n"
        label: NODE
      - lang: Ruby
        source: "selfMailersApi = SelfMailersApi.new(config)\n\nbegin\n  selfMailers = selfMailersApi.list({ limit: 2 })\nrescue => err\n  p err.message\nend\n"
        label: RUBY
      - lang: Python
        source: "with ApiClient(configuration) as api_client:\n  api = SelfMailersApi(api_client)\n\ntry:\n  self_mailers = api.list(limit=2)\nexcept ApiException as e:\n  print(e)\n"
        label: PYTHON
      - lang: PHP
        source: "$apiInstance = new OpenAPI\\Client\\Api\\SelfMailersApi($config, new GuzzleHttp\\Client());\n\ntry {\n    $result = $apiInstance->list(\n      2, // limit\n    );\n} catch (Exception $e) {\n    echo $e->getMessage(), PHP_EOL;\n}\n"
      - lang: Java
        source: "SelfMailersApi apiInstance = new SelfMailersApi(config);\n\ntry {\n  SelfMailerList response = apiInstance.list(\n    2, // limit\n    null, // before\n    null, // after\n    null, // include\n    null, // dateCreated\n    null, // metadata\n    null, // size\n    null, // scheduled\n    null, // sendDate\n    null, // mailType\n    null // sortBy\n  );\n} catch (ApiException e) {\n  e.printStackTrace();\n}\n"
        label: JAVA
      - lang: Elixir
        source: 'Lob.SelfMailer.list(%{limit: 2})

          '
        label: ELIXIR
      - lang: CSharp
        source: "SelfMailersApi api = new SelfMailersApi(config);\n\nList<string> includeList = new List<string>();\nincludeList.Add(\"total_count\");\nDictionary<String, String> metadata = new Dictionary<String, String>();\nmetadata.Add(\"name\", \"Harry\");\nDictionary<String, DateTime> dateCreated = new Dictionary<String, DateTime>();\nDateTime dateCreatedDate = DateTime.Today.AddMonths(-1);\ndateCreated.Add(\"lt\", dateCreatedDate);\nDictionary<String, String> sendDate = new Dictionary<String, String>();\nsendDate.Add(\"lt\", DateTime.Now.ToString(\"yyyy-MM-ddTHH\\\\:mm\\\\:ss.fffffffzzz\"));\nSortBy3 sortBy = new SortBy3(SortBy3.DateCreatedEnum.Asc);\n\ntry {\n  SelfMailerList response = api.list(\n    2, // limit\n    null, // before\n    null, // after\n    includeList, // include\n    dateCreated, // dateCreated\n    metadata, // metadata\n    null, // size\n    true, // scheduled\n    sendDate, // sendDate\n    MailType.FirstClass, // mailType\n    sortBy // sortBy\n  );\n} catch (ApiException e) {\n  Console.WriteLine(e.ToString());\n}\n"
        label: CSHARP
      - lang: Go
        source: "var context = context.Background()\ncontext = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv(\"<YOUR_API_KEY>\")})\n\nvar apiClient = *lob.NewAPIClient(configuration)\nSelfMailerList = apiClient.SelfMailersApi.List(context).Execute()\nif err != nil {\n    return err\n}\n"
        label: GO
    post:
      operationId: self_mailer_create
      summary: Create
      description: Creates a new self_mailer given information
      tags:
      - Self  Mailers
      parameters:
      - $ref: '#/components/parameters/idem-header'
      - $ref: '#/components/parameters/idem-query'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/self_mailer_editable'
            example:
              description: Demo Self Mailer job
              to: adr_bae820679f3f536b
              from: adr_210a8d4b0b76d77b
              inside: https://lob.com/selfmailerinside.pdf
              outside: https://lob.com/selfmaileroutside.pdf
              size: 12x9_bifold
              metadata:
                spiffy: 'true'
              mail_type: usps_standard
              merge_variables:
                name: Harry
              send_date: '2017-11-01T00:00:00.000Z'
              use_type: marketing
              qr_code:
                position: relative
                redirect_url: https://www.lob.com
                width: '2.5'
                top: '2.5'
                right: '2.5'
                pages: inside,outside
              fsc: true
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/self_mailer_editable'
            example:
              description: Demo Self Mailer job
              to: adr_bae820679f3f536b
              from: adr_210a8d4b0b76d77b
              inside: https://lob.com/selfmailerinside.pdf
              outside: https://lob.com/selfmaileroutside.pdf
              size: 12x9_bifold
              metadata:
                spiffy: 'true'
              mail_type: usps_standard
              merge_variables:
                name: Harry
              send_date: '2017-11-01T00:00:00.000Z'
              use_type: marketing
              qr_code:
                position: relative
                redirect_url: https://www.lob.com
                width: '2.5'
                top: '2.5'
                right: '2.5'
                pages: inside,outside
              fsc: true
            encoding:
              merge_variables:
                style: deepObject
                explode: true
              metadata:
                style: deepObject
                explode: true
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/self_mailer_editable'
            example:
              description: Demo Self Mailer job
              to: adr_bae820679f3f536b
              from: adr_210a8d4b0b76d77b
              inside: https://lob.com/selfmailerinside.pdf
              outside: https://lob.com/selfmaileroutside.pdf
              size: 12x9_bifold
              metadata:
                spiffy: 'true'
              mail_type: usps_standard
              merge_variables:
                name: Harry
              send_date: '2017-11-01T00:00:00.000Z'
              use_type: marketing
              qr_code:
                position: relative
                redirect_url: https://www.lob.com
                width: '2.5'
                top: '2.5'
                right: '2.5'
                pages: inside,outside
              fsc: true
      responses:
        '200':
          $ref: '#/components/responses/post_self_mailer'
        default:
          $ref: '#/components/responses/mailpiece_error'
      x-codeSamples:
      - lang: Shell
        source: "curl https://api.lob.com/v1/self_mailers \\\n  -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \\\n  -d \"description=Demo Self Mailer job\" \\\n  -d \"to[name]=Harry Zhang\" \\\n  -d \"to[address_line1]=210 King St\" \\\n  -d \"to[address_city]=San Francisco\" \\\n  -d \"to[address_state]=CA\" \\\n  -d \"to[address_zip]=94107\" \\\n  -d \"from=adr_210a8d4b0b76d77b\" \\\n  -d \"use_type=marketing\" \\\n  -d 'qr_code[position]=relative' \\\n  -d 'qr_code[redirect_url]=https://www.lob.com' \\\n  -d 'qr_code[width]=2.5' \\\n  -d 'qr_code[bottom]=2.5' \\\n  -d 'qr_code[left]=2.5' \\\n  -d 'qr_code[pages]=inside,outside'\n  --data-urlencode \"inside=<html style='padding: 1in; font-size: 50;'>Inside HTML for {{name}}</html>\" \\\n  --data-urlencode \"outside=<html style='padding: 1in; font-size: 20;'>Outside HTML for {{name}}</html>\" \\\n  -d \"merge_variables[name]=Harry\" \\\n  -d 'fsc=true'\n"
        label: CURL
      - lang: Typescript
        source: "const selfMailerCreate = new SelfMailerEditable({\n  to: {\n  name: 'Harry Zhang',\n  address_line1: '210 King St',\n  address_line2: '# 6100',\n  address_city: 'San Francisco',\n  address_state: 'CA',\n  address_zip: '94107',\n},\n  from: 'adr_xxxx',\n  inside:\n  'https://s3.us-west-2.amazonaws.com/public.lob.com/assets/templates/self_mailers/6x18_sfm_inside.pdf',\n  outside:\n  'https://s3.us-west-2.amazonaws.com/public.lob.com/assets/templates/self_mailers/6x18_sfm_outside.pdf',\n  use_type: 'marketing'\n  qr_code : {\n    position: 'relative',\n    redirect_url: 'https://www.lob.com',\n    width: '2.5',\n    bottom: '2.5',\n    left: '2.5',\n    pages: 'inside'\n  },\n  fsc: true\n});\n\ntry {\n  const mySelfMailer = await new SelfMailersApi(config).create(selfMailerCreate);\n} catch (err: any) {\n  console.error(err);\n}\n"
        label: TYPESCRIPT
      - lang: Javascript
        source: "Lob.selfMailers.create({\n  description: 'Demo Self Mailer job',\n  to: {\n    name: 'Harry Zhang',\n    address_line1: '210 King St',\n    address_city: 'San Francisco',\n    address_state: 'CA',\n    address_zip: '94107'\n  },\n  from: 'adr_210a8d4b0b76d77b',\n  inside: '<html style=\"padding: 1in; font-size: 50;\">Inside HTML for {{name}}</html>',\n  outside: '<html style=\"padding: 1in; font-size: 20;\">Outside HTML for {{name}}</html>',\n  merge_variables: {\n    name: 'Harry'\n  },\n  use_type: 'marketing'\n  qr_code : {\n    position: 'relative',\n    redirect_url: 'https://www.lob.com',\n    width: '2.5',\n    bottom: '2.5',\n    left: '2.5',\n    pages: 'inside'\n  },\n  fsc: true\n}, function (err, res) {\n  console.log(err, res);\n});\n"
        label: NODE
      - lang: Ruby
        source: "selfMailerCreate = SelfMailerEditable.new({\n  description: \"Demo Self Mailer job\",\n  from: \"adr_210a8d4b0b76d77b\",\n  inside: \"<html style='padding: 1in; font-size: 50;'>Inside HTML for {{name}}</html>\",\n  outside: \"<html style='padding: 1in; font-size: 20;'>Outside HTML for {{name}}</html>\",\n  to: AddressEditable.new({\n    name: \"Harry Zhang\",\n    address_line1: \"210 King St\",\n    address_line2: \"# 6100\",\n    address_city: \"San Francisco\",\n    address_state: \"CA\",\n    address_zip: \"94107\",\n  }),\n  merge_variables: {\n    name: \"Harry\"\n  },\n  use_type: 'marketing'\n  qr_code : {\n    position: 'relative',\n    redirect_url: 'https://www.lob.com',\n    width: '2.5',\n    bottom: '2.5',\n    left: '2.5',\n    pages: 'inside'\n  },\n  fsc: true\n});\n\nselfMailerApi = SelfMailersApi.new(config)\n\nbegin\n  createdSelfMailer = selfMailerApi.create(selfMailerCreate)\nrescue => err\n  p err.message\nend\n"
        label: RUBY
      - lang: Python
        source: "self_mailer_editable = SelfMailerEditable(\n  description = \"Demo Self Mailer job\",\n  _from = \"adr_210a8d4b0b76d77b\",\n  inside = \"<html style='padding: 1in; font-size: 50;'>Inside HTML for {{name}}</html>\",\n  outside = \"<html style='padding: 1in; font-size: 20;'>Outside HTML for {{name}}</html>\",\n  to = AddressEditable(\n    name = \"Harry Zhang\",\n    address_line1 = \"210 King St\",\n    address_line2 = \"# 6100\",\n    address_city = \"San Francisco\",\n    address_state = \"CA\",\n    address_zip = \"94107\",\n  ),\n  merge_variables = MergeVariables(\n    name = \"Harry\",\n  ),\n  use_type = \"marketing\"\n  qr_code = {\n    position: \"relative\",\n    redirect_url: \"https://www.lob.com\",\n    width: \"2.5\",\n    bottom: \"2.5\",\n    left: \"2.5\",\n    pages: \"inside\"\n  },\n  fsc = true\n)\n\nwith ApiClient(configuration) as api_client:\n  api = SelfMailersApi(api_client)\n\ntry:\n  created_self_mailer = api.create(self_mailer_editable)\nexcept ApiException as e:\n  print(e)\n"
        label: PYTHON
      - lang: PHP
        source: "$to = new OpenAPI\\Client\\Model\\AddressEditable(\n  array(\n    \"name\"     => \"Harry Zhang\",\n    \"address_line1\"     => \"210 King St\",\n    \"address_line2\"     => \"# 6100\",\n    \"address_city\"     => \"San Francisco\",\n    \"address_state\"     => \"CA\",\n    \"address_zip\"     => \"94107\",\n  )\n);\n\n$merge_variables = new stdClass;\n$merge_variables->name = \"Harry\";\n\n$use_type = \"marketing\";\n$fsc = true;\n\n$qr_code = new OpenAPI\\Client\\Model\\QRCode(\n  array(\n    \"position\" => \"relative\",\n    \"redirect_url\" => \"https://www.lob.com\",\n    \"width\" => \"2\",\n    \"bottom\" => \"2\",\n    \"left\" => \"2\",\n    \"pages\" => \"inside,outside\"\n  )\n);\n\n$apiInstance = new OpenAPI\\Client\\Api\\SelfMailersApi($config, new GuzzleHttp\\Client());\n$self_mailer_editable = new OpenAPI\\Client\\Model\\SelfMailerEditable(\n  array(\n    \"description\"     => \"Demo Self Mailer job\",\n    \"from\"     => \"adr_210a8d4b0b76d77b\",\n    \"inside\"     => \"<html style='padding: 1in; font-size: 50;'>Inside HTML for {{name}}</html>\",\n    \"outside\"     => \"<html style='padding: 1in; font-size: 20;'>Outside HTML for {{name}}</html>\",\n    \"to\"     => $to,\n    \"merge_variables\"     => $merge_variables,\n    \"use_type\"    => $use_type,\n    \"qr_code\"   => $qr_code,\n    \"fsc\"  => $fsc\n  )\n);\n\ntry {\n    $result = $apiInstance->create($self_mailer_editable);\n} catch (Exception $e) {\n    echo $e->getMessage(), PHP_EOL;\n}\n"
      - lang: Java
        source: "Map<String, String> merge_variables = new HashMap<String, String>();\nmerge_variables.put(\"name\", \"Harry\");\n\nSelfMailersApi apiInstance = new SelfMailersApi(config);\n\nAddressEditable to = new AddressEditable();\nto.setName(\"Harry Zhang\");\nto.setAddressLine1(\"210 King St\");\nto.setAddressLine2(\"# 6100\");\nto.setAddressCity(\"San Francisco\");\nto.setAddressState(\"CA\");\nto.setAddressZip(\"94107\");\n\nQRCode qrCode = new QRCode();\nqrCode.setPosition(\"relative\");\nqrCode.setRedirectUrl(\"https://www.lob.com\");\nqrCode.setWidth(\"2\");\nqrCode.setLeft(\"2\");\nqrCode.setBottom(\"2\");\nqrCode.setPages(\"outside\");\n\ntry {\n  SelfMailerEditable selfMailerEditable = new SelfMailerEditable();\n  selfMailerEditable.setDescription(\"Demo Self Mailer job\");\n  selfMailerEditable.setFrom(\"adr_210a8d4b0b76d77b\");\n  selfMailerEditable.setInside(\"<html style='padding: 1in; font-size: 50;'>Inside HTML for {{name}}</html>\");\n  selfMailerEditable.setOutside(\"<html style='padding: 1in; font-size: 20;'>Outside HTML for {{name}}</html>\");\n  selfMailerEditable.setTo(to);\n  selfMailerEditable.setMergeVariables(merge_variables);\n  selfMailerEditable.setUseType(\"marketing\");\n  selfMailerEditable.setQRCode(qrCode);\n  selfMailerEditable.setFsc(true);\n\n\n  SelfMailer result = apiInstance.create(selfMailerEditable, null);\n} catch (ApiException e) {\n  e.printStackTrace();\n}\n"
        label: JAVA
      - lang: Elixir
        source: "Lob.SelfMailer.create(%{\n  description: \"Demo Self Mailer job\",\n  to: %{\n    name: \"Harry Zhang\",\n    address_line1: \"210 King St\",\n    address_city: \"San Francisco\",\n    address_state: \"CA\",\n    address_zip: \"94107\"\n  },\n  from: \"adr_210a8d4b0b76d77b\",\n  inside: \"<html style='padding: 1in; font-size: 50;'>Inside HTML for {{name}}</html>\",\n  outside: \"<html style='padding: 1in; font-size: 20;'>Outside HTML for {{name}}</html>\",\n  merge_variables: %{\n    name: \"Harry\"\n  },\n  use_type: \"marketing\"\n  qr_code: %{\n    position: 'relative',\n    redirect_url: 'https://www.lob.com',\n    width: '2',\n    bottom: '2',\n    left: '2',\n    pages: 'inside,outside'\n  },\n  fsc: true\n})\n"
        label: ELIXIR
      - lang: CSharp
        source: "Dictionary<string, string> mergeVariables = new Dictionary<string, string>();\nmergeVariables.Add(\"name\", \"Harry\");\n\nSelfMailersApi api = new SelfMailersApi(config);\n\nAddressEditable to = new AddressEditable(\n  \"210 King St\",  // addressLine1\n  \"# 6100\",  // addressLine2\n  \"San Francisco\",  // addressCity\n  \"CA\",  // addressState\n  \"94107\",  // addressZip\n  default(CountryExtended),  // addressCounty\n  null,  // description\n  \"Harry Zhang\" // name\n);\n\nQRCode qrCode = new QRCode(\n  \"relative\",  //position,\n  \"https://www.lob.com\", //redirect_url\n  \"2\", //width\n  \"2\", //left\n  \"2\", //bottom\n  \"inside\", //pages\n);\n\nFsc fsc = new Fsc(true);\n\nSelfMailerEditable selfMailerEditable = new SelfMailerEditable(\n  to.ToJson(),  // to\n  \"adr_249af768103d2810\",  // from\n  default(SelfMailerSize),  // size\n  \"Demo Self Mailer Job\",  // description\n  default(Dictionary<string, string>),  // metadata\n  default(MailType),  // mailType\n  mergeVariables,  // mergeVariables\n  default(DateTime),  // sendDate\n  \"<html style='padding: 1in; font-size: 50;'>Inside HTML for {{name}}</html>\",  // inside\n  \"<html style='padding: 1in; font-size: 20;'>Outside HTML for {{name}}</html>\", // outside\n  \"marketing\", // use_type \n  qrCode,\n  fsc\n);\n\ntry {\n  SelfMailer result = api.create(selfMailerEditable, null);\n} catch (ApiException e) {\n  Console.WriteLine(e.ToString());\n}\n"
        label: CSHARP
      - lang: Go
        source: "var context = context.Background()\ncontext = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv(\"<YOUR_API_KEY>\")})\n\nvar apiClient = *lob.NewAPIClient(configuration)\n\nvar to = *lob.NewAddressEditable()\nto.SetAddressLine1(\"210 King St\")\nto.SetAddressLine2(\"# 6100\")\nto.SetAddressCity(\"San Francisco\")\nto.SetAddressState(\"CA\")\nto.SetAddressZip(\"94107\")\nto.SetAddressCountry(lob.COUNTRYEXTENDED_US)\nto.SetDescription(\"\")\nto.SetName(\"Harry Zhang\")\n\nvar selfMailerCreate = *lob.NewSelfMailerEditable()\nselfMailerCreate.SetDescription(\"Demo Self Mailer job\")\nselfMailerCreate.SetFrom(\"adr_210a8d4b0b76d77b\")\nselfMailerCreate.SetInside(\"<html style='padding: 1in; font-size: 50;'>Inside HTML for {{name}}</html>\")\nselfMailerCreate.SetOutside(\"<html style='padding: 1in; font-size: 20;'>Outside HTML for {{name}}</html>\")\nselfMailerCreate.SetTo(to)\nselfMailerCreate.SetFsc(true)\n\n\ncreatedselfMailer, _, err := apiClient.SelfMailersApi.Create(context).SelfMailerEditable(selfMailerCreate).Execute()\n\nif err != nil {\n    return err\n}\n"
        label: GO
components:
  schemas:
    date_created:
      type: string
      format: date-time
      description: A timestamp in ISO 8601 format of the date the resource was created.
    local_file_path:
      type: string
      description: The path to a local file.
      pattern: ^(?!https://)[a-zA-Z0-9@:%._+~#=/]{1,256}.(html?|pdf|png|jpg)$
    tracking_event_details:
      type: object
      required:
      - event
      - description
      - action_required
      properties:
        event:
          type: string
          enum:
          - package_accepted
          - package_arrived
          - package_departed
          - package_processing
          - package_processed
          - package_in_local_area
          - delivery_scheduled
          - out_for_delivery
          - pickup_available
          - delivered
          - package_forwarded
          - returned_to_sender
          - address_issue
          - contact_carrier
          - delayed
          - delivery_attempted
          - delivery_rescheduled
          - location_inaccessible
          - notice_left
          - package_damaged
          - package_disposed
          - package_held
          - package_lost
          - package_unclaimed
          - package_undeliverable
          - reschedule_delivery
          - other
          description: 'Find the full table [here](#tag/Tracking-Events). A detailed substatus about the event:

            * `package_accepted` - Package has been accepted into the carrier network for delivery.

            * `package_arrived` - Package has arrived at an intermediate location in the carrier network.

            * `package_departed` - Package has departed from an intermediate location in the carrier network.

            * `package_processing` - Package is processing at an intermediate location in the carrier network.

            * `package_processed` - Package has been processed at an intermediate location.

            * `package_in_local_area` - Package is at a location near the end destination.

            * `delivery_scheduled` - Package is scheduled for delivery.

            * `out_for_delivery` - Package is out for delivery.

            * `pickup_available` - Package is available for pickup at carrier location.

            * `delivered` - Package has been delivered.

            * `package_forwarded` - Package has been forwarded.

            * `returned_to_sender` - Package is to be returned to sender.

            * `address_issue` - Address information is incorrect. Contact carrier to ensure delivery.

            * `contact_carrier` - Contact the carrier for more information.

            * `delayed` - Delivery of package is delayed.

            * `delivery_attempted` - Delivery of package has been attempted. Contact carrier to ensure delivery.

            * `delivery_rescheduled` - Delivery of package has been rescheduled.

            * `location_inaccessible` - Delivery location inaccessible to carrier. Contact carrier to ensure delivery.

            * `notice_left` - Carrier left notice during attempted delivery. Follow carrier instructions on notice.

            * `package_damaged` - Package has been damaged. Contact carrier for more details.

            * `package_disposed` - Package has been disposed.

            * `package_held` - Package held at carrier location. Contact carrier for more details.

            * `package_lost` - Package has been lost. Contact carrier for more details.

            * `package_unclaimed` - Package is unclaimed.

            * `package_undeliverable` - Package is not able to be delivered.

            * `reschedule_delivery` - Contact carrier to reschedule delivery.

            * `other` - Unrecognized carrier status.

            '
        description:
          type: string
          description: The description as listed in the description for event.
        notes:
          type: string
          description: Event-specific notes from USPS about the tracking event.
        action_required:
          type: boolean
          description: '`true` if action is required by the end recipient, `false` otherwise.

            '
    adr_id:
      type: string
      description: Unique identifier prefixed with `adr_`.
      pattern: ^adr_[a-zA-Z0-9]+$
    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 on Lob's end.
      required:
      - error
      properties:
        error:
          type: object
          required:
          - message
          - status_code
          - code
          properties:
            message:
              type: string
              description: A human-readable message with more details about the error
              example: Rate limit exceeded. Please wait 5 seconds and try your request again.
            status_code:
              $ref: '#/components/schemas/failure_status_code'
            code:
              type: string
              enum:
              - bad_request
              - conflict
              - feature_limit_reached
              - internal_server_error
              - invalid
              - not_deletable
              - not_found
              - request_timeout
              - service_unavailable
              - unrecognized_endpoint
              - unsupported_lob_version
              - address_length_exceeds_limit
              - bank_account_already_verified
              - bank_error
              - billing_address_required
              - custom_envelope_inventory_depleted
              - deleted_bank_account
              - failed_deliverability_strictness
              - file_pages_below_min
              - file_pages_exceed_max
              - file_size_exceeds_limit
              - foreign_return_address
              - inconsistent_page_dimensions
              - invalid_bank_account
              - invalid_bank_account_verification
              - invalid_check_international
              - invalid_country_covid
              - invalid_file
              - invalid_file_dimensions
              - invalid_file_download_time
              - invalid_file_url
              - invalid_image_dpi
              - invalid_international_feature
              - invalid_perforation_return_envelope
              - invalid_template_html
              - mail_use_type_can_not_be_null
              - merge_variable_required
              - merge_variable_whitespace
              - payment_method_unverified
              - pdf_encrypted
              - special_characters_restricted
              - unembedded_fonts
              - email_required
              - invalid_api_key
              - publishable_key_not_allowed
              - rate_limit_exceeded
              - unauthorized
              - unauthorized_token
              description: 'A pre-defined string identifying an error. Error codes fall into three categories:


                **GENERIC**

                * `bad_request` - 422: an invalid request was made. See error message for details.

                * `conflict` - 409/422: this operation would leave data in a conflicted state.

                * `feature_limit_reached` - 403: the account has reached its resource limit and requires upgrading to add more.

                * `internal_server_error` - 500: an error has occured on Lob''s servers. Please try request again.

                * `invalid` - 422: an invalid request was made. See error message for details.

                * `not_deletable` - 422: an attempt was made to delete a resource, but the resource cannot be deleted.

                * `not_found` - 404: the requested resource was not found.

                * `request_timeout` - 408: the request took too long. Please try again.

                * `service_unavailable` - 503: the Lob servers are temporarily unavailable. Please try agian.

                * `unrecognized_endpoint` - 404: the requested endpoint doesn''t exist.

                * `unsupported_lob_version` - 422: an unsupported Lob API version was requested.


                **ADVANCED**

                * `address_length_exceeds_limit` - 422: the sum of to.address_line1 and to.address_line2 cannot surpass 50 characters.

                * `bank_account_already_verified` - 422: the bank account has already been verified.

                * `bank_error` - 422: there''s an issue with the bank account.

                * `billing_address_required` - 403: in order to create a live mail piece, your account needs to set up a billing address.

                * `custom_envelope_inventory_depleted` - 422: custom envelope inventory is depleted, and more will need to be ordered.

                * `deleted_bank_account` - 404: checks cannot be created with a deleted bank account.

                * `failed_deliverability_strictness` - 422: the `to` address doesn''t meet strictness requirements. See <a href="https://dashboard.lob.com/#/settings/account" target="_blank">Account Settings</a> to configure strictness.

                * `file_pages_below_min` - 422: not enough pages.

                * `file_pages_exceed_max` - 422: too many pages.

                * `file_size_exceeds_limit` - 422: the file size is too large. See description for details.

                * `foreign_return_address` - 422: the `from` address must be a US address.

                * `inconsistent_page_dimensions` - 422: all pages of the input file must have the same dimensions.

                * `invalid_bank_account` - 422: the provided bank routing number is invalid.

                * `invalid_bank_account_verification` - 422: verification amounts do not match.

                * `invalid_check_international` - 422: checks cannot be sent internationally.

                * `invalid_country_covid` - 422: the postal service in the specified country is currently unable to process the request due to COVID-19 restrictions.

                * `invalid_file` - 422: the file is invalid.

                * `invalid_file_dimensions` - 422: file dimensions are incorrect for the selected mail type.

                * `invalid_file_download_time` - 422: file download from remote server took too long.

                * `invalid_file_url` - 422: the file URL when creating a resource is invalid.

                * `invalid_image_dpi` - 422: DPI must be at least 300.

                * `invalid_international_feature` - 422: the specified product cannot be sent to the destination.

                * `invalid_perforation_return_envelope` - 422: both `return_envelope` and `perforation` must be used together.

                * `invalid_template_html` - 422: the provided HTML is invalid.

                * `mail_use_type_can_not_be_null` - 422: use_type must be one of "marketing" or "operational". Alternatively, an admin can set the account default use type in Account Settings.

                * `merge_variable_required` - 422: a required merge variable is missing.

                * `merge_variable_whitespace` - 422: merge variable names cannot contain whitespace.

                * `payment_method_unverified` - 401: you must have a verified bank account or credit card to submit live requests.

                * `pdf_encrypted` - 422: an encrypted PDF was provided.

                * `special_characters_restricted` - 422: cannot use special characters for merge variable names.

                * `unembedded_fonts` - 422: the provided PDF contains non-standard unembedded fonts. See description for details.


                **AUTHENTICATION**

                * `email_required` - 401: account must have a verified email address before creating live resources.

                * `invalid_api_key` - 401/403: the API key is invalid.

                * `publishable_key_not_allowed` - 403: the requested operation needs a secret key, not a publishable key. See [API Keys](#section/API-Keys) for more information.

                * `rate_limit_exceeded` - 429: requests were sent too quickly and must be slowed down.

                * `unauthorized` - 401: the request isn''t authorized.

                * `unauthorized_token` - 401: token isn''t authorized.

                '
    signed_link:
      type: string
      description: A [signed link](#section/Asset-URLs) served over HTTPS. The link returned will expire in 30 days to prevent mis-sharing. Each time a GET request is initiated, a new signed URL will be generated.
      pattern: ^https://lob-assets.com/(letters|postcards|bank-accounts|checks|self-mailers|cards|order-creatives)/([a-z]{3,4}_[a-z0-9]{15,16}|[a-z]{3}_[a-z0-9]{26}_[a-z]{4}_[a-z0-9]{26})('|_signature)(.pdf|_thumb_[a-z]+_[0-9]+.png|.png)?(version=[a-z0-9]*&)expires=[0-9]{10}&signature=[a-zA-Z0-9-_]+
    count:
      type: integer
      description: number of resources in a set
    tmpl_id:
      type: string
      descripti

# --- truncated at 32 KB (97 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/lob/refs/heads/main/openapi/lob-self-mailers-api-openapi.yml