Lob.com Snap Packs API
The Snap Packs API from Lob.com — 2 operation(s) for snap packs.
The Snap Packs API from Lob.com — 2 operation(s) for snap packs.
openapi: 3.0.3
info:
title: Lob Accounts Snap Packs 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: Snap Packs
paths:
/snap_packs/{snap_pack_id}:
parameters:
- in: path
name: snap_pack_id
description: id of the snap_pack
required: true
schema:
$ref: '#/components/schemas/snap_pack_id'
get:
operationId: snap_pack_retrieve
summary: Retrieve
description: Retrieves the details of an existing snap_pack. You need to only supply the unique snap_pack identifier that was returned upon snap_pack creation.
tags:
- Snap Packs
responses:
'200':
description: Returns a snap_pack object
content:
$ref: '#/components/mediaTypes/snap_pack'
default:
$ref: '#/components/responses/mailpiece_error'
x-codeSamples:
- lang: Shell
source: "curl -X GET \"https://api.lob.com/v1/snap_packs/ord_0d6a16a3fff6318ac8f8008dc1\" \\\n -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:\n"
label: CURL
- lang: typescript
source: "try {\n const snapPack = await new SnapPacksApi(config).get('ord_xxxx');\n} catch (err: any) {\n console.error(err);\n}\n"
label: TYPESCRIPT
- lang: Javascript
source: "Lob.snapPacks.retrieve('ord_0d6a16a3fff6318ac8f8008dc1', function (err, res) {\n console.log(err, res);\n});\n"
label: NODE
- lang: Ruby
source: "snapPackApi = SnapPacksApi.new(config)\n\nbegin\n retrievedSnapPack = snapPackApi.get(\"ord_0d6a16a3fff6318ac8f8008dc1\")\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_pack = api.get(\"ord_0d6a16a3fff6318ac8f8008dc1\")\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->get(\"ord_0d6a16a3fff6318ac8f8008dc1\");\n} catch (Exception $e) {\n echo $e->getMessage(), PHP_EOL;\n}\n"
- lang: Java
source: "SnapPacksApi apiInstance = new SnapPacksApi(config);\n\ntry {\n SnapPack response = apiInstance.get(\"ord_0d6a16a3fff6318ac8f8008dc1\");\n} catch (ApiException e) {\n e.printStackTrace();\n}\n"
label: JAVA
- lang: Elixir
source: 'Lob.SnapPack.find("ord_0d6a16a3fff6318ac8f8008dc1")
'
label: ELIXIR
- lang: CSharp
source: "SnapPacksApi api = new SnapPacksApi(config);\n\ntry {\n SnapPack response = api.get(\"ord_0d6a16a3fff6318ac8f8008dc1\");\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\nfetchedSnapPack, _, err := apiClient.SnapPacksApi.Get(context,\"ord_0d6a16a3fff6318ac8f8008dc1\").Execute()\n\nif err != nil {\n return err\n}\n"
label: GO
delete:
operationId: snap_pack_delete
summary: Delete
description: Completely removes a snap pack from production. This can only be done if the snap pack's `send_date` has not yet passed. If the snap pack is successfully canceled, you will not be charged for it.
tags:
- Snap Packs
responses:
'200':
$ref: '#/components/responses/snap_pack_deleted'
default:
$ref: '#/components/responses/mailpiece_error'
x-codeSamples:
- lang: Shell
source: "curl -X DELETE https://api.lob.com/v1/snap_packs/ord_0d6a16a3fff6318ac8f8008dc1 \\\n -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:\n"
label: CURL
- lang: typescript
source: "try {\n const deleteSnapPack = await new SnapPacksApi(config).delete('ord_xxxx');\n} catch (err: any) {\n console.error(err);\n}\n"
label: TYPESCRIPT
- lang: Javascript
source: "Lob.snapPacks.delete('ord_0d6a16a3fff6318ac8f8008dc1', function (err, res) {\n console.log(err, res);\n});\n"
label: NODE
- lang: Ruby
source: "snapPackApi = SnapPacksApi.new(config)\n\nbegin\n deletedSnapPack = snapPackApi.delete(\"ord_0d6a16a3fff6318ac8f8008dc1\")\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 deleted_resource = api.delete(\"ord_0d6a16a3fff6318ac8f8008dc1\")\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->delete(\"ord_0d6a16a3fff6318ac8f8008dc1\");\n} catch (Exception $e) {\n echo $e->getMessage(), PHP_EOL;\n}\n"
- lang: Java
source: "SnapPacksApi apiInstance = new SnapPacksApi(config);\n\ntry {\n SnapPackDeletion response = apiInstance.delete(\"ord_0d6a16a3fff6318ac8f8008dc1\");\n} catch (ApiException e) {\n e.printStackTrace();\n}\n"
label: JAVA
- lang: Elixir
source: 'Lob.SnapPack.destroy("ord_0d6a16a3fff6318ac8f8008dc1")
'
label: ELIXIR
- lang: CSharp
source: "SnapPacksApi api = new SnapPacksApi(config);\n\ntry {\n SnapPackDeletion response = api.delete(\"ord_0d6a16a3fff6318ac8f8008dc1\");\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\ndeletedSnapPack, _, err := apiClient.SnapPacksApi.Delete(context, \"ord_0d6a16a3fff6318ac8f8008dc1\").Execute()\n\nif err != nil {\n return err\n}\n"
label: GO
/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
print_speed: core
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
print_speed: core
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 -d 'print_speed=core'\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 print_speed: 'core'\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 print_speed: 'core'\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 print_speed: \"core\"\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 print_speed = \"core\"\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$print_speed = 'core';\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 \"print_speed\" => \"core\"\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 SnapPackEditable.setPrintSpeed(\"core\");\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 print_speed: 'core'\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);\nPrintSpeed printSpeed = new PrintSpeed(\"core\");\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 \"core\" // print_speed\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)\nSnapPackCreate.SetPrintSpeed(\"core\")\n\n\ncreatedSnapPack, _, err := apiClient.SnapPacksApi.Create(context).SnapPackEditable(SnapPackCreate).Execute()\n\nif err != nil {\n return err\n}\n"
label: GO
components:
parameters:
metadata:
in: query
name: metadata
description: Filter by metadata key-value pair`.
schema:
$ref: '#/components/schemas/metadata'
style: deepObject
explode: true
idem-header:
in: header
name: Idempotency-Key
required: false
description: 'A string of no longer than 256 characters that uniquely identifies this resource. For more help integrating idempotency keys, refer to our <a href="https://help.lob.com/print-and-mail/building-a-mail-strategy/managing-mail-settings#idempotent-requests-12" target="_blank">implementation guide</a>.
'
schema:
type: string
maxLength: 256
example: 026e7634-24d7-486c-a0bb-4a17fd0eebc5
status:
in: query
name: status
description: 'A string describing the render status:
* `processed` - the rendering process is currently underway.
* `rendered` - the rendering process has completed successfully.
* `failed` - the rendering process has failed.
'
schema:
$ref: '#/components/schemas/status'
send_date:
in: query
name: send_date
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 ≥, and `lte` is ≤.
'
schema:
$ref: '#/components/schemas/send_date'
date_created:
in: query
name: date_created
description: 'Filter by date created. Accepted formats are ISO-8601 date or datetime, e.g. `{ "gt": "2012-01-01", "lt": "2012-01-31T12:34:56Z" }` where `gt` is >, `lt` is <, `gte` is ≥, and `lte` is ≤.'
schema:
$ref: '#/components/schemas/date_filter'
style: deepObject
explode: true
idem-query:
in: query
name: idempotency_key
required: false
description: 'A string of no longer than 256 characters that uniquely identifies this resource. For more help integrating idempotency keys, refer to our <a href="https://help.lob.com/print-and-mail/building-a-mail-strategy/managing-mail-settings#idempotent-requests-12" target="_blank">implementation guide</a>.
'
schema:
type: string
maxLength: 256
example: 026e7634-24d7-486c-a0bb-4a17fd0eebc5
include:
in: query
name: include
description: 'Request that the response include the total count by specifying `include=["total_count"]`.
'
schema:
type: array
items:
type: string
explode: true
campaign_id:
in: query
name: campaign_id
required: false
description: Filters resources created by the provided campaign id, prefixed with `cmp_`. In the case of snap packs, booklets, and letters with size `us_legal`, however, the campaign id is prefixed with `camp_` instead of `cmp_`.
schema:
$ref: '#/components/schemas/campaign_id'
limit:
in: query
name: limit
required: false
description: How many results to return.
schema:
type: integer
minimum: 1
default: 10
maximum: 100
example: 10
mail_type:
in: query
name: mail_type
description: 'A string designating the mail postage type: * `usps_first_class` - (default) * `usps_standard` - a <a href="https://lob.com/pricing/print-mail#compare" target="_blank">cheaper option</a> which is less predictable and takes longer to deliver. `usps_standard` cannot be used with `4x6` postcards or for any postcards sent outside of the United States.
'
schema:
$ref: '#/components/schemas/mail_type'
sort_by:
in: query
name: sort_by
description: 'Sorts items by ascending or descending dates. Use either `date_created` or `send_date`, not both.
'
schema:
allOf:
- type: object
properties:
date_created:
type: string
enum:
- asc
- desc
send_date:
type: string
enum:
- asc
- desc
- oneOf:
- required:
- date_created
- required:
- send_date
before_after:
in: query
name: before/after
required: false
description: '`before` and `after` are both optional but only one of them can be in the query at a time.
'
schema:
allOf:
- type: object
properties:
before:
type: string
description: 'A reference to a list entry used for paginating to the previous set of entries. This field is pre-populated in the `previous_url` field in the return response.
'
after:
type: string
description: 'A reference to a list entry used for paginating to the next set of entries. This field is pre-populated in the `next_url` field in the return response.
'
- oneOf:
- required:
- before
- required:
- after
schemas:
send_date:
type: string
description: A timestamp in ISO 8601 format which specifies a date after the current time and up to 180 days in the future to send the letter off for production. Setting a send date overrides the default [cancellation window](#section/Cancellation-Windows) applied to the mailpiece. Until the `send_date` has passed, the mailpiece can be canceled. If a date in the format `2017-11-01` is passed, it will evaluate to midnight UTC of that date (`2017-11-01T00:00:00.000Z`). If a datetime is passed, that exact time will be used. A `send_date` passed with no time zone will default to UTC, while a `send_date` passed with a time zone will be converted to UTC.
anyOf:
- format: date-time
- format: date
input_to:
type: object
properties:
to:
description: 'Must either be an address ID or an inline object with correct address parameters. If an object is used, an address will be created, corrected, and standardized for free whenever possible using our US Address Verification engine (if it is a US address), and returned back with an ID. Depending on your <a href="https://dashboard.lob.com/#/settings/editions" target="_blank">Print & Mail Edition</a>, US addresses may also be run through <a href="#tag/National-Change-of-Address">National Change of Address Linkage(NCOALink)</a>. Non-US addresses will be standardized into uppercase only. If a US address used does not meet your account’s <a href="https://dashboard.lob.com/#/settings/account" target="_blank">US Mail strictness setting</a>, the request will fail. <a href="https://help.lob.com/print-and-mail/all-about-addresses" target="_blank">Lob Guide: Verification of Mailing Addresses</a>'
oneOf:
- $ref: '#/components/schemas/adr_id'
- $ref: '#/components/schemas/inline_address'
snap_pack_base:
allOf:
- $ref: '#/components/schemas/editable'
- type: object
properties:
size:
$ref: '#/components/schemas/snap_pack_size'
date_modified:
type: string
format: date-time
description: A timestamp in ISO 8601 format of the date the resource was last modified.
deleted:
type: boolean
description: Only returned if the resource has been successfully deleted.
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'
print_speed:
$ref: '#/components/schemas/print_speed'
address_editable_intl:
allOf:
- $ref: '#/components/schemas/address_fields_intl'
- 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
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
nullable: true
company:
$ref: '#/components/schemas/company'
phone:
type: string
description: Must be no longer than 40 characters.
maxLength: 40
nullable: true
email:
type: string
description: Must be no longer than 100 characters.
maxLength: 100
nullable: true
address_country:
$ref: '#/components/schemas/country_extended'
metadata:
$ref: '#/components/schemas/metadata'
local_file_path:
type: string
description: The path to a local file.
pattern: ^(?!https://)[a-zA-Z0-9@:%._+~#=/]{1,256}.(html?|pdf|png|jpg)$
input_from_us:
type: object
properties:
from:
description: '*Required* if `to` address is international. Must either be an address ID or an inline object with correct address parameters. Must either be an address ID or an inline object with correct address parameters. All addresses will be standardized into uppercase without being modified by verification.'
oneOf:
- $ref: '#/components/schemas/adr_id'
- $ref: '#/components/schemas/inline_address_us'
failure_reason_error:
type: object
description: Failure error details
properties:
url:
type: string
description: Failed URL of asset
nullable: true
host:
type: string
description: URL host
nullable: true
path:
type: string
description: URL path
nullable: true
protocol:
type: string
description: Network protocol
nullable: true
remediati
# --- truncated at 32 KB (97 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/lobcom/refs/heads/main/openapi/lobcom-snap-packs-api-openapi.yml