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.
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/lobcom-snap-packs-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
openapi: 3.2.0
info:
title: Lob 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 REDACTED_LOB_KEY:\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 REDACTED_LOB_KEY:\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 REDACTED_LOB_KEY:\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 REDACTED_LOB_KEY: \\\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:
schemas:
tmpl_id:
type: string
description: Unique identifier prefixed with `tmpl_`. ID of a saved [HTML template](#section/HTML-Templates).
pattern: ^tmpl_[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.
'
company:
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. This field can be used for any secondary recipient information which is not part of the actual mailing address (Company Name, Department, Attention Line, etc).
'
maxLength: 40
failure_reason:
type: object
description: An object describing the reason for failure if the resource failed to render.
properties:
remediation:
type: string
description: Instructions on how to resolve the error
failure_reason:
type: string
description: Reason failure occurred
errors:
type:
- array
- 'null'
items:
$ref: '#/components/schemas/failure_reason_error'
local_file_path:
type: string
description: The path to a local file.
pattern: ^(?!https://)[a-zA-Z0-9@:%._+~#=/]{1,256}.(html?|pdf|png|jpg)$
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 ≥, and `lte` is ≤.'
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"
adr_id:
type: string
description: Unique identifier prefixed with `adr_`.
pattern: ^adr_[a-zA-Z0-9]+$
date_created:
type: string
format: date-time
description: A timestamp in ISO 8601 format of the date the resource was created.
address_editable_intl:
allOf:
- $ref: '
# --- 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