Lob Snap Packs API
The Snap Packs API from Lob — 1 operation(s) for snap packs.
The Snap Packs API from Lob — 1 operation(s) for snap packs.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/lob-snap-packs-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Lob Snap Packs API
version: 1.20.2
description: Experience direct mail like never before, with unmatched personalization and scalability 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: Snap Packs
paths:
/snap_packs:
get:
operationId: snap_packs_list
summary: List
description: Returns a list of your snap_packs. The snap_packs are returned sorted by creation date, with the most recently created snap_packs appearing first.
tags:
- Snap Packs
parameters:
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/before_after'
- $ref: '#/components/parameters/include'
- $ref: '#/components/parameters/date_created'
- $ref: '#/components/parameters/metadata'
- $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_snap_packs'
default:
$ref: '#/components/responses/mailpiece_error'
x-codeSamples:
- lang: Shell
source: "curl -X GET \"https://api.lob.com/v1/snap_packs?limit=2\" \\\n -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:\n"
label: CURL
- lang: typescript
source: "try {\n const snapPacks = await new snapPacksApi(config).list(2);\n} catch (err: any) {\n console.error(err);\n}\n"
label: TYPESCRIPT
- lang: Javascript
source: "Lob.snapPacks.list({limit: 2}, function (err, res) {\n console.log(err, res);\n});\n"
label: NODE
- lang: Ruby
source: "snapPacksApi = SnapPacksApi.new(config)\n\nbegin\n snapPacks = snapPacksApi.list({ limit: 2 })\nrescue => err\n p err.message\nend\n"
label: RUBY
- lang: Python
source: "with ApiClient(configuration) as api_client:\n api = SnapPacksApi(api_client)\n\ntry:\n snap_packs = api.list(limit=2)\nexcept ApiException as e:\n print(e)\n"
label: PYTHON
- lang: PHP
source: "$apiInstance = new OpenAPI\\Client\\Api\\SnapPacksApi($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: "SnapPacksApi apiInstance = new SnapPacksApi(config);\n\ntry {\n SnapPackList 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.SnapPack.list(%{limit: 2})
'
label: ELIXIR
- lang: CSharp
source: "SnapPacksApi api = new SnapPacksApi(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 SnapPackList 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)\nSnapPackList = apiClient.SnapPacksApi.List(context).Execute()\nif err != nil {\n return err\n}\n"
label: GO
post:
operationId: snap_pack_create
summary: Create
description: Creates a new snap_pack given information
tags:
- Snap Packs
parameters:
- $ref: '#/components/parameters/idem-header'
- $ref: '#/components/parameters/idem-query'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/snap_pack_editable'
example:
description: Demo Snap Pack Job
to: adr_bae820679f3f536b
from: adr_210a8d4b0b76d77b
inside: https://lob.com/snappackinside.pdf
outside: https://lob.com/snappackoutside.pdf
size: 8.5x11
metadata:
spiffy: 'true'
mail_type: usps_standard
merge_variables:
name: Harry
send_date: '2017-11-01T00:00:00.000Z'
use_type: marketing
multipart/form-data:
schema:
$ref: '#/components/schemas/snap_pack_editable'
example:
description: Demo Snap Pack job
to: adr_bae820679f3f536b
from: adr_210a8d4b0b76d77b
inside: https://lob.com/snappackinside.pdf
outside: https://lob.com/snappackoutside.pdf
size: 8.5x11
metadata:
spiffy: 'true'
mail_type: usps_standard
merge_variables:
name: Harry
send_date: '2017-11-01T00:00:00.000Z'
use_type: marketing
responses:
'200':
$ref: '#/components/responses/post_snap_pack'
default:
$ref: '#/components/responses/mailpiece_error'
x-codeSamples:
- lang: Shell
source: "curl https://api.lob.com/v1/snap_packs \\\n -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \\\n -d \"description=Demo Snap Pack 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 --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=false'\n"
label: CURL
- lang: Typescript
source: "const snapPackCreate = new SnapPackEditable({\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/8.5x11_Snappack_template_address.pdf',\n outside:\n 'https://s3.us-west-2.amazonaws.com/public.lob.com/assets/8.5x11_Snappack_template_address.pdf',\n use_type: 'marketing'\n fsc: false\n});\n\ntry {\n const mySnapPack = await new SnapPacksApi(config).create(snapPackCreate);\n} catch (err: any) {\n console.error(err);\n}\n"
label: TYPESCRIPT
- lang: Javascript
source: "Lob.snapPacks.create({\n description: 'Demo Snap Packs 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 fsc: false\n}, function (err, res) {\n console.log(err, res);\n});\n"
label: NODE
- lang: Ruby
source: "snapPackCreate = SnapPackEditable.new({\n description: \"Demo Snap Pack 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 fsc: true\n});\n\nsnapPackApi = SnapPacksApi.new(config)\n\nbegin\n createdSnapPack = snapPackApi.create(snapPackCreate)\nrescue => err\n p err.message\nend\n"
label: RUBY
- lang: Python
source: "snap_pack_editable = SnapPackEditable(\n description = \"Demo Snap Pack 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 fsc = true\n)\n\nwith ApiClient(configuration) as api_client:\n api = SnapPacksApi(api_client)\n\ntry:\n created_snap_pack = api.create(snap_pack_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$apiInstance = new OpenAPI\\Client\\Api\\SnapPacksApi($config, new GuzzleHttp\\Client());\n$snap_pack_editable = new OpenAPI\\Client\\Model\\SnapPackEditable(\n array(\n \"description\" => \"Demo Snap Pack 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 \"fsc\" => $fsc\n )\n);\n\ntry {\n $result = $apiInstance->create($snap_pack_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\nSnapPacksApi apiInstance = new SnapPacksApi(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\ntry {\n SnapPackEditable SnapPackEditable = new SnapPackEditable();\n SnapPackEditable.setDescription(\"Demo Snap Pack job\");\n SnapPackEditable.setFrom(\"adr_210a8d4b0b76d77b\");\n SnapPackEditable.setInside(\"<html style='padding: 1in; font-size: 50;'>Inside HTML for {{name}}</html>\");\n SnapPackEditable.setOutside(\"<html style='padding: 1in; font-size: 20;'>Outside HTML for {{name}}</html>\");\n SnapPackEditable.setTo(to);\n SnapPackEditable.setMergeVariables(merge_variables);\n SnapPackEditable.setUseType(\"marketing\");\n SnapPackEditable.setFsc(true);\n\n\n SnapPack result = apiInstance.create(SnapPackEditable, null);\n} catch (ApiException e) {\n e.printStackTrace();\n}\n"
label: JAVA
- lang: Elixir
source: "Lob.SnapPack.create(%{\n description: \"Demo Snap Pack 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 fsc: true\n})\n"
label: ELIXIR
- lang: CSharp
source: "Dictionary<string, string> mergeVariables = new Dictionary<string, string>();\nmergeVariables.Add(\"name\", \"Harry\");\n\nSnapPacksApi api = new SnapPacksApi(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\nFsc fsc = new Fsc(true);\n\nSnapPackEditable SnapPackEditable = new SnapPackEditable(\n to.ToJson(), // to\n \"adr_249af768103d2810\", // from\n default(SnapPacksize), // size\n \"Demo Snap Pack 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 fsc\n);\n\ntry {\n SnapPack result = api.create(SnapPackEditable, 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 SnapPackCreate = *lob.NewSnapPackEditable()\nSnapPackCreate.SetDescription(\"Demo Snap Pack job\")\nSnapPackCreate.SetFrom(\"adr_210a8d4b0b76d77b\")\nSnapPackCreate.SetInside(\"<html style='padding: 1in; font-size: 50;'>Inside HTML for {{name}}</html>\")\nSnapPackCreate.SetOutside(\"<html style='padding: 1in; font-size: 20;'>Outside HTML for {{name}}</html>\")\nSnapPackCreate.SetTo(to)\nSnapPackCreate.SetFsc(true)\n\n\ncreatedSnapPack, _, err := apiClient.SnapPacksApi.Create(context).SnapPackEditable(SnapPackCreate).Execute()\n\nif err != nil {\n return err\n}\n"
label: GO
components:
schemas:
snap_pack_editable:
allOf:
- $ref: '#/components/schemas/snap_pack_base'
- $ref: '#/components/schemas/input_to'
- $ref: '#/components/schemas/input_from_us'
- type: object
required:
- to
- inside
- outside
- use_type
properties:
inside:
description: "The artwork to use as the inside of your snap pack.\n\nNotes:\n- HTML merge variables should not include delimiting whitespace.\n- PDF, PNG, and JPGs must be sized at 8.5\"x11\" at 300 DPI, while supplied HTML will be rendered to the specified `size`.\n- Be sure to leave room for address and postage information by following the template provided here:\n - <a href=\"https://s3.us-west-2.amazonaws.com/public.lob.com/assets/8.5x11_Snappack_template_address.pdf\" target=\"_blank\">8.5x11 snap pack template</a>\n\n\nSee [here](#section/HTML-Examples) for HTML examples.\n"
oneOf:
- $ref: '#/components/schemas/html_string'
- $ref: '#/components/schemas/tmpl_id'
- $ref: '#/components/schemas/remote_file_url'
- $ref: '#/components/schemas/local_file_path'
outside:
description: 'The artwork to use as the outside of your snap pack.
Notes:
- HTML merge variables should not include delimiting whitespace.
- PDF, PNG, and JPGs must be sized at 6"x18" at 300 DPI, while supplied HTML will be rendered to the specified `size`.
See [here](#section/HTML-Examples) for HTML examples.
'
oneOf:
- $ref: '#/components/schemas/html_string'
- $ref: '#/components/schemas/tmpl_id'
- $ref: '#/components/schemas/remote_file_url'
- $ref: '#/components/schemas/local_file_path'
billing_group_id:
$ref: '#/components/schemas/billing_group_id'
use_type:
$ref: '#/components/schemas/snap_pack_use_type'
color:
allOf:
- $ref: '#/components/schemas/color'
- default: false
qr_code:
$ref: '#/components/schemas/qr_code'
qr_code:
type: object
description: Customize and place a QR code on the creative at the required position.
required:
- position
- redirect_url
- width
properties:
position:
type: string
enum:
- relative
description: Sets how a QR code is being positioned in the document. Together with this, you should provide one of 'top' or 'bottom', and one of 'left' or 'right'.
top:
type: number
description: Vertical distance (in inches) to place QR code from the top. Only allowed if "bottom" isn't provided.
right:
type: number
description: Horizontal distance (in inches) to place QR code from the right. Only allowed if "left" isn't provided.
left:
type: number
description: Horizontal distance (in inches) to place QR code from the left. Only allowed if "right" isn't provided.
bottom:
type: number
description: Vertical distance (in inches) to place QR code from the bottom. Only allowed if "top" isn't provided.
redirect_url:
type: string
description: The url to redirect the user when a QR code is scanned. The URL can be a literal URL, a template URL containing merge variables, or consist entirely of merge variables. For example, `https://www.example.com` or `https://www.example.com?q={{name}}` or `{{name}}`, respectively. When a merge variable exists in the URL, it is replaced with data from merge_variables. If the variable does not exist, then nothing with be replaced and the destination URL will be the same as the input URL. More details on merge variables can be found in <a href="https://help.lob.com/print-and-mail/designing-mail-creatives/adding-qr-codes#destination-url-and-redirects" target="_blank">our help center</a>.
width:
type: number
description: The size (in inches) of the QR code with a minimum of 1 inch. All QR codes are generated as a square.
pages:
type: string
description: Specify the pages where the QR code should be stamped in a comma separated format. Your QR code can be printed in the same position on multiple pages. For postcards, the values should either be "front", "back" (for either front or back) or "front,back" (for the QR code to be printed on both sides). For self-mailers and snap packs, the values should either be "inside", "outside" (for either inside or outside) or "inside,outside" (for the QR code to be printed on both sides). For letters and booklets, the values can be specific page numbers ("1", "3"), page number ranges such as "1-3", or a comma separated combination of both ("1,3,5-7").
logo:
type: object
description: Allows specifying a logo to be placed over the center of the QR code. Logos must be in PNG or JPEG format and have a maximum file size of 1 MB.
properties:
url:
type: string
description: The public URL of the logo image to be retrieved and placed over the center of the QR code.
pattern: ^https://[-a-zA-Z0-9@:%._+~#=/]{1,256}.(png|jpe?g)$
style:
type: object
description: Customizes the appearance of the QR code.
properties:
background_color:
type: string
description: The background color of the QR code in hexadecimal format. For example, `#000000` is black and `#FFFFFF` is white.
pattern: ^#[A-Fa-f0-9]{6}$
foreground_color:
type: string
description: The foreground color of the QR code in hexadecimal format. For example, `#000000` is black and `#FFFFFF` is white.
pattern: ^#[A-Fa-f0-9]{6}$
snap_pack:
allOf:
- $ref: '#/components/schemas/snap_pack_base'
- $ref: '#/components/schemas/generated'
- $ref: '#/components/schemas/from_us'
- type: object
required:
- id
- url
- use_type
properties:
id:
$ref: '#/components/schemas/snap_pack_id'
outside_template_id:
description: The unique ID of the HTML template used for the outside of the snap pack.
allOf:
- $ref: '#/components/schemas/tmpl_id'
- type:
- string
- 'null'
inside_template_id:
description: The unique ID of the HTML template used for the inside of the snap pack.
allOf:
- $ref: '#/components/schemas/tmpl_id'
- type:
- string
- 'null'
outside_template_version_id:
description: The unique ID of the specific version of the HTML template used for the outside of the snap pack.
allOf:
- $ref: '#/components/schemas/vrsn_id'
- type:
- string
- 'null'
inside_template_version_id:
description: The unique ID of the specific version of the HTML template used for the inside of the snap pack.
allOf:
- $ref: '#/components/schemas/vrsn_id'
- type:
- string
- 'null'
object:
type: string
description: Value is resource type.
enum:
- snap_pack
default: snap_pack
tracking_events:
description: An array of tracking events ordered by ascending `time`. Not populated in test mode.
type: array
items:
$ref: '#/components/schemas/tracking_event_normal'
use_type:
$ref: '#/components/schemas/snap_pack_use_type'
url:
$ref: '#/components/schemas/signed_link'
fsc:
type: boolean
description: Contact support@lob.com or your account contact to learn more. Not available for snap_pack currently.
default: false
status:
$ref: '#/components/schemas/status'
campaign_id:
$ref: '#/components/schemas/campaign_id'
failure_reason:
allOf:
- $ref: '#/components/schemas/failure_reason'
- {}
color:
$ref: '#/components/schemas/color'
expected_delivery_date:
type: string
description: A date in YYYY-MM-DD format of the mailpiece's expected delivery date based on its `send_date`.
format: date
editable:
type: object
properties:
description:
$ref: '#/components/schemas/resource_description'
metadata:
$ref: '#/components/schemas/metadata'
mail_type:
$ref: '#/components/schemas/mail_type'
merge_variables:
$ref: '#/components/schemas/merge_variables'
send_date:
$ref: '#/components/schemas/send_date'
snap_pack_use_type:
description: The use type for each mailpiece. Can be one of marketing, operational, or null. Null use_type is only allowed if an account default use_type is selected in Account Settings. For more information on use_type, see our [Help Center article](https://help.lob.com/print-and-mail/building-a-mail-strategy/managing-mail-settings/declaring-mail-use-type).
type:
- string
- 'null'
enum:
- marketing
- operational
- null
count:
type: integer
description: number of resources in a set
address_editable_us:
allOf:
- $ref: '#/components/schemas/address_fields_us'
- type: object
anyOf:
- title: address obj with `name` defined
required:
- name
- title: address obj with `company` defined
required:
- company
properties:
description:
$ref: '#/components/schemas/resource_description'
name:
type:
- string
- 'null'
description: 'Either `name` or `company` is required, you may also add both. Must be no longer than 40 characters. If both `name` and `company` are provided, they will be printed on two separate lines above the rest of the address.
'
maxLength: 40
company:
$ref: '#/components/schemas/company'
phone:
type:
- string
- 'null'
description: Must be no longer than 40 characters.
maxLength: 40
email:
type:
- string
- 'null'
description: Must be no longer than 100 characters.
maxLength: 100
address_country:
type: string
enum:
- US
default: US
metadata:
$ref: '#/components/schemas/metadata'
remote_file_url:
type: string
description: 'The location of a remote file. Remote URLs have a 5 MB file size limit and must be downloaded within 40 seconds.
'
pattern: ^https://[-a-zA-Z0-9@:%._+~#=/]{1,256}.(html?|pdf|png|jpg)$
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-_]+
failure_status_code:
type: integer
enum:
- 401
- 403
- 404
- 413
- 422
- 429
- 500
description: "A conventional HTTP status code:\n * `401` - Authorization error with your API key or account\n * `403` - Forbidden error with your API key or account\n * `404` - The requested item does not exist\n * `413` - Payload too large\n * `422` - The query or body parameters did not pass validation\n * `429` - Too many requests have been sent with an API key in a given amount of time\n * `500` - An internal server error occurred, please contact support@lob.com\n"
date_filter:
type: object
additionalProperties:
type: string
description: 'Filter by ISO-8601 date or datetime, e.g. `{ "gt": "2012-01-01", "lt": "2012-01-31T12:34:56Z" }` where `gt` is >, `lt` is <, `gte` is e, and `lte` is d.'
tracking_event_normal:
allOf:
- $ref: '#/components/schemas/tracking_event_base'
- type: object
required:
- type
- name
properties:
type:
description: non-Certified postcards, self mailers, letters, checks and snap packs
type: string
enum:
- normal
name:
type: string
enum:
- Mailed
- In Transit
- In Local Area
- Processed for Delivery
- Delivered
- Re-Routed
- Returned to Sender
- International Exit
description: "Name of tracking event (for normal postcards, self mailers, letters, checks and snap packs):\n\n * `Mailed` - The mailpiece has been handed off to and accepted by USPS\n and is en route. <a href=\"https://help.lob.com/print-and-mail/getting-data-and-results/tracking-your-mail#mailed-tracking-events-4\" target=\"_blank\">More about\n Mailed.</a>\n Note this data is only available in Enterprise editions of\n Lob. <a href=\"https://lob.com/support/contact#contact\" target=\"_blank\">Contact Sales</a> if\n you want access to this feature.\n\n * `In Transit` - The mailpiece is being processed at the entry/origin facility.\n\n * `In Local Area` - The mailpiece is being processed at the destination facility.\n\n * `Processed for Delivery` - The mailpiece has been greenlit for\n delivery at the recipient's nearest postal facility. The mailpiece\n should reach the mailbox within 1 business day of this tracking\n event.\n\n * `Delivered` - The mail piece has been delivered to \n the recipients address. The final scan is generated when the mail \n carrier's GPS unit leaves the delivery area.\n\n * `Re-Routed` - The mailpiece is re-routed due to recipient change of\n address, address errors, or USPS relabeling of barcode/ID tag\n area.\n\n * `Returned to Sender` - The mailpiece is being returned to sender due\n to barcode, ID tag area, or address errors.\n \n * `International Exit` - The mail piece has been processed to \n ship to a destination abroad. This is typically the last \n scan a US-originated international mail piece will receive \n from the USPS.\n\n<a href=\"https://help.lob.com/print-and-mail/getting-data-and-results/tracking-your-mail#mailed-tracking-events-4\" target=\"_blank\">More about tracking</a>\n"
details:
description: Will be `null` for `type=normal` events
type:
- object
- 'null'
enum:
- null
location:
type:
- string
- 'null'
description: 'The zip code in which the scan event occurred. Null for `Mailed` events.
'
evnt_id:
type: string
description: Unique identifier prefixed with `evnt_`.
pattern: ^evnt_[a-zA-Z0-9]+$
merge_variables:
type:
- object
- 'null'
description: 'You can input a merge variable payload object to your template or QR code redirect URLs to render dynamic content. For example, if you have a template like: `{{variable_name}}`, pass in `{"variable_name": "Harry"}` to render `Harry`. `merge_variables` must be an object. Any type of value is accepted as long as the object is valid JSON; you can use `strings`, `numbers`, `booleans`, `arrays`, `objects`, or `null`. The max length of the object is 25,000 characters. If you call `JSON.stringify` on your object, it can be no longer than 25,000 characters. Your variable names cannot contain any whitespace or any of the following special characters: `!`, `"`, `#`, `%`, `&`, `''`, `(`, `)`, `*`, `+`, `,`, `/`, `;`, `<`, `=`, `>`, `@`, `[`, `\`, `]`, `^`, `` ` ``, `{`, `|`, `}`, `~`. More instructions can be found in <a href="https://help.lob.com/print-and-mail/designing-mail-creatives/dynamic-personalization#using-html-and-merge-variables-10" target="_blank">our guide to using html and merge variables</a>. Depending on your <a href="https://dashboard.lob.com/#/settings/account" target="_blank">Merge Vari
# --- truncated at 32 KB (90 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/lob/refs/heads/main/openapi/lob-snap-packs-api-openapi.yml