Lob.com Addresses API
To add an address to your address book, you create a new address object. You can retrieve and delete individual addresses as well as get a list of addresses. Addresses are identified by a unique random ID. back to top
To add an address to your address book, you create a new address object. You can retrieve and delete individual addresses as well as get a list of addresses. Addresses are identified by a unique random ID. back to top
openapi: 3.2.0
info:
title: Lob Addresses 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: Addresses
description: 'To add an address to your address book, you create a new address object. You can retrieve and delete individual
addresses as well as get a list of addresses. Addresses are identified by a unique random ID.
<div class="back-to-top" ><a href="#" onclick="toTopLink()">back to top</a></div>
'
paths:
/addresses:
get:
operationId: addresses_list
summary: List
description: Returns a list of your addresses. The addresses are returned sorted by creation date, with the most recently created addresses appearing first.
tags:
- Addresses
parameters:
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/before_after'
- $ref: '#/components/parameters/include'
- $ref: '#/components/parameters/date_created'
- $ref: '#/components/parameters/metadata'
responses:
'200':
$ref: '#/components/responses/all_addresses'
default:
$ref: '#/components/responses/address_error'
x-codeSamples:
- lang: Shell
source: "curl -X GET \"https://api.lob.com/v1/addresses?limit=2\" \\\n -u REDACTED_LOB_KEY:\n"
label: CURL
- lang: Typescript
source: "try {\n const addresses = await new AddressesApi(config).list(2);\n} catch (err: any) {\n console.error(err);\n}\n"
label: TYPESCRIPT
- lang: Javascript
source: "Lob.addresses.list({limit: 2}, function (err, res) {\n console.log(err, res);\n});\n"
label: NODE
- lang: Ruby
source: "addressesApi = AddressesApi.new(config)\n\nbegin\n addresses = addressesApi.list({ limit: 2 })\nrescue => err\n p err.message\nend\n"
label: RUBY
- lang: Python
source: "with ApiClient(configuration) as api_client:\n api = AddressesApi(api_client)\n\ntry:\n addresses = api.list(limit=2)\nexcept ApiException as e:\n print(e)\n"
label: PYTHON
- lang: PHP
source: "$apiInstance = new OpenAPI\\Client\\Api\\AddressesApi($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: "AddressesApi apiInstance = new AddressesApi(config);\n\ntry {\n AddressList response = apiInstance.list(\n 2, // limit\n null, // before\n null, // after\n null, // include\n null, // dateCreated\n null // metadata\n );\n} catch (ApiException e) {\n e.printStackTrace();\n}\n"
label: JAVA
- lang: Elixir
source: 'Lob.Address.list(%{limit: 2})
'
label: ELIXIR
- lang: CSharp
source: "AddressesApi api = new AddressesApi(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);\n\ntry {\n AddressList response = api.list(\n 2, // limit\n null, // before\n null, // after\n includeList, // include\n dateCreated, // dateCreated\n metadata // metadata\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)\nAddressList = apiClient.AddressesApi.List(context).Execute()\nif err != nil {\n return err\n}\n"
label: GO
post:
operationId: address_create
summary: Create
description: Creates a new address given information
tags:
- Addresses
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/address_editable'
examples:
full_us:
value:
description: Harry - Office
name: Harry Zhang
company: Lob
email: harry@lob.com
phone: '5555555555'
address_line1: 210 King St
address_line2: '# 6100'
address_city: San Francisco
address_state: CA
address_zip: '94107'
address_country: US
ncoa_us_test:
value:
description: Harry - Office
name: Harry Zhang
company: Lob
email: harry@lob.com
phone: '5555555555'
address_line1: NCOA
address_line2: '#6100'
address_city: San Francisco
address_state: CA
address_zip: '94107'
address_country: US
full_intl:
value:
description: Harry - Office
name: Harry Zhang
company: Lob
email: harry@lob.com
phone: '5555555555'
address_line1: 370 WATER ST
address_line2: ''
address_city: SUMMERSIDE
address_state: PRINCE EDWARD ISLAND
address_zip: C1N 1C4
address_country: CA
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/address_editable'
examples:
full_us:
value:
description: Harry - Office
name: Harry Zhang
company: Lob
email: harry@lob.com
phone: '5555555555'
address_line1: 210 King St
address_line2: '# 6100'
address_city: San Francisco
address_state: CA
address_zip: '94107'
address_country: US
ncoa_us_test:
value:
description: Harry - Office
name: Harry Zhang
company: Lob
email: harry@lob.com
phone: '5555555555'
address_line1: NCOA
address_line2: '# 6100'
address_city: San Francisco
address_state: CA
address_zip: '94107'
address_country: US
full_intl:
value:
description: Harry - Office
name: Harry Zhang
company: Lob
email: harry@lob.com
phone: '5555555555'
address_line1: 370 WATER ST
address_line2: ''
address_city: SUMMERSIDE
address_state: PRINCE EDWARD ISLAND
address_zip: C1N 1C4
address_country: CA
encoding:
metadata:
style: deepObject
explode: true
multipart/form-data:
schema:
$ref: '#/components/schemas/address_editable'
examples:
full_us:
value:
description: Harry - Office
name: Harry Zhang
company: Lob
email: harry@lob.com
phone: '5555555555'
address_line1: 210 King St
address_line2: '# 6100'
address_city: San Francisco
address_state: CA
address_zip: '94107'
address_country: US
ncoa_us_test:
value:
description: Harry - Office
name: Harry Zhang
company: Lob
email: harry@lob.com
phone: '5555555555'
address_line1: NCOA
address_line2: '# 6100'
address_city: San Francisco
address_state: CA
address_zip: '94107'
address_country: US
full_intl:
value:
description: Harry - Office
name: Harry Zhang
company: Lob
email: harry@lob.com
phone: '5555555555'
address_line1: 370 WATER ST
address_line2: ''
address_city: SUMMERSIDE
address_state: PRINCE EDWARD ISLAND
address_zip: C1N 1C4
address_country: CA
responses:
'200':
$ref: '#/components/responses/post_address'
default:
$ref: '#/components/responses/address_error'
x-codeSamples:
- lang: Shell
source: "curl https://api.lob.com/v1/addresses \\\n -u REDACTED_LOB_KEY: \\\n -d \"description=Harry - Office\" \\\n -d \"name=Harry Zhang\" \\\n -d \"company=Lob\" \\\n -d \"email=harry@lob.com\" \\\n -d \"phone=5555555555\" \\\n -d \"address_line1=210 King St\" \\\n -d \"address_line2=# 6100\" \\\n -d \"address_city=San Francisco\" \\\n -d \"address_state=CA\" \\\n -d \"address_zip=94107\" \\\n -d \"address_country=US\"\n"
label: CURL
- lang: Typescript
source: "const addressCreate = new AddressEditable({\n description: 'Harry - Office',\n name: 'Harry Zhang',\n company: 'Lob',\n email: 'harry@lob.com',\n phone: '5555555555',\n address_line1: '210 King St',\n address_line2: '# 6100',\n address_city: 'San Francisco',\n address_state: 'CA',\n address_zip: '94107',\n address_country: 'US'\n});\n\ntry {\n const myAddress = await new AddressesApi(config).create(addressCreate);\n} catch (err: any) {\n console.error(err);\n}\n"
label: TYPESCRIPT
- lang: Javascript
source: "Lob.addresses.create({\n description: 'Harry - Office',\n name: 'Harry Zhang',\n company: 'Lob',\n email: 'harry@lob.com',\n phone: '5555555555',\n address_line1: '210 King St',\n address_line2: '# 6100',\n address_city: 'San Francisco',\n address_state: 'CA',\n address_zip: '94107',\n address_country: 'US'\n}, function (err, res) {\n console.log(err, res);\n});\n"
label: NODE
- lang: Ruby
source: "addressCreate = AddressEditable.new({\n description: \"Harry - Office\",\n name: \"Harry Zhang\",\n company: \"Lob\",\n email: \"harry@lob.com\",\n phone: \"5555555555\",\n address_line1: \"210 King St\",\n address_line2: \"# 6100\",\n address_city: \"San Francisco\",\n address_state: \"CA\",\n address_zip: \"94107\",\n address_country: \"US\",\n});\n\naddressApi = AddressesApi.new(config)\n\nbegin\n createdAddress = addressApi.create(addressCreate)\nrescue => err\n p err.message\nend\n"
label: RUBY
- lang: Python
source: "address_editable = AddressEditable(\n description = \"Harry - Office\",\n name = \"Harry Zhang\",\n company = \"Lob\",\n email = \"harry@lob.com\",\n phone = \"5555555555\",\n address_line1 = \"210 King St\",\n address_line2 = \"# 6100\",\n address_city = \"San Francisco\",\n address_state = \"CA\",\n address_zip = \"94107\",\n address_country = CountryExtended(\"US\"),\n)\n\nwith ApiClient(configuration) as api_client:\n api = AddressesApi(api_client)\n\ntry:\n created_address = api.create(address_editable)\nexcept ApiException as e:\n print(e)\n"
label: PYTHON
- lang: PHP
source: "$apiInstance = new OpenAPI\\Client\\Api\\AddressesApi($config, new GuzzleHttp\\Client());\n\n$address_editable = new OpenAPI\\Client\\Model\\AddressEditable(\n array(\n \"description\" => \"Harry - Office\",\n \"name\" => \"Harry Zhang\",\n \"company\" => \"Lob\",\n \"email\" => \"harry@lob.com\",\n \"phone\" => \"5555555555\",\n \"address_line1\" => \"210 King St\",\n \"address_line2\" => \"# 6100\",\n \"address_city\" => \"San Francisco\",\n \"address_state\" => \"CA\",\n \"address_zip\" => \"94107\",\n \"address_country\" => \"US\",\n )\n);\n\ntry {\n $result = $apiInstance->create($address_editable);\n} catch (Exception $e) {\n echo $e->getMessage(), PHP_EOL;\n}\n"
- lang: Java
source: "AddressesApi apiInstance = new AddressesApi(config);\n\ntry {\n AddressEditable addressEditable = new AddressEditable();\n addressEditable.setDescription(\"Harry - Office\");\n addressEditable.setName(\"Harry Zhang\");\n addressEditable.setCompany(\"Lob\");\n addressEditable.setEmail(\"harry@lob.com\");\n addressEditable.setPhone(\"5555555555\");\n addressEditable.setAddressLine1(\"210 King St\");\n addressEditable.setAddressLine2(\"# 6100\");\n addressEditable.setAddressCity(\"San Francisco\");\n addressEditable.setAddressState(\"CA\");\n addressEditable.setAddressZip(\"94107\");\n addressEditable.setAddressCountry(CountryExtended.US);\n\n Address result = apiInstance.create(addressEditable);\n} catch (ApiException e) {\n e.printStackTrace();\n}\n"
label: JAVA
- lang: Elixir
source: "Lob.Address.create(%{\n description: \"Harry - Office\",\n name: \"Harry Zhang\",\n company: \"Lob\",\n email: \"harry@lob.com\",\n phone: \"5555555555\",\n address_line1: \"210 King St\",\n address_line2: \"# 6100\",\n address_city: \"San Francisco\",\n address_state: \"CA\",\n address_country: \"US\",\n address_zip: \"94107\"\n})\n"
label: ELIXIR
- lang: CSharp
source: "AddressesApi api = new AddressesApi(config);\n\nAddressEditable addressEditable = new AddressEditable(\n \"210 King St\", // addressLine1\n \"# 6100\", // addressLine2\n \"San Francisco\", // addressCity\n \"CA\", // addressState\n \"94107\", // addressZip\n CountryExtended.US, // addressCountry\n \"Harry - Office\", // description\n \"Harry Zhang\", // name\n \"Lob\", // company\n \"5555555555\", // phone\n \"harry@lob.com\" // email\n);\n\ntry {\n Address result = api.create(addressEditable);\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\n\nvar addressCreate = *lob.NewAddressEditable()\naddressCreate.SetDescription(\"Harry - Office\")\naddressCreate.SetName(\"Harry Zhang\")\naddressCreate.SetCompany(\"Lob\")\naddressCreate.SetEmail(\"harry@lob.com\")\naddressCreate.SetPhone(\"5555555555\")\naddressCreate.SetAddressLine1(\"210 King St\")\naddressCreate.SetAddressLine2(\"# 6100\")\naddressCreate.SetAddressCity(\"San Francisco\")\naddressCreate.SetAddressState(\"CA\")\naddressCreate.SetAddressZip(\"94107\")\naddressCreate.SetAddressCountry(\"US\")\n\n\n\ncreatedaddress, _, err := apiClient.AddressesApi.Create(context).AddressEditable(addressCreate).Execute()\n\nif err != nil {\n return err\n}\n"
label: GO
/addresses/{adr_id}:
parameters:
- in: path
name: adr_id
description: id of the address
required: true
schema:
$ref: '#/components/schemas/adr_id'
get:
operationId: address_retrieve
summary: Retrieve
description: Retrieves the details of an existing address. You need only supply the unique identifier that was returned upon address creation.
tags:
- Addresses
responses:
'200':
$ref: '#/components/responses/address'
default:
$ref: '#/components/responses/address_error'
x-codeSamples:
- lang: Shell
source: "curl https://api.lob.com/v1/addresses/adr_fa85158b26c3eb7c \\\n -u REDACTED_LOB_KEY:\n"
label: CURL
- lang: Typescript
source: "try {\n const address = await new AddressesApi(config).get('adr_xxxx');\n} catch (err: any) {\n console.error(err);\n}\n"
label: TYPESCRIPT
- lang: Javascript
source: "Lob.addresses.retrieve('adr_fa85158b26c3eb7c', function (err, res) {\n console.log(err, res);\n});\n"
label: NODE
- lang: Ruby
source: "addressApi = AddressesApi.new(config)\n\nbegin\n retrievedAddress = addressApi.get(\"adr_fa85158b26c3eb7c\")\nrescue => err\n p err.message\nend\n"
label: RUBY
- lang: Python
source: "with ApiClient(configuration) as api_client:\n api = AddressesApi(api_client)\n\ntry:\n address = api.get(\"adr_fa85158b26c3eb7c\")\nexcept ApiException as e:\n print(e)\n"
label: PYTHON
- lang: PHP
source: "$apiInstance = new OpenAPI\\Client\\Api\\AddressesApi($config, new GuzzleHttp\\Client());\n\ntry {\n $result = $apiInstance->get(\"adr_fa85158b26c3eb7c\");\n} catch (Exception $e) {\n echo $e->getMessage(), PHP_EOL;\n}\n"
- lang: Java
source: "AddressesApi apiInstance = new AddressesApi(config);\n\ntry {\n Address response = apiInstance.get(\"adr_fa85158b26c3eb7c\");\n} catch (ApiException e) {\n e.printStackTrace();\n}\n"
label: JAVA
- lang: Elixir
source: 'Lob.Address.retrieve("adr_fa85158b26c3eb7c")
'
label: ELIXIR
- lang: CSharp
source: "AddressesApi api = new AddressesApi(config);\n\ntry {\n Address response = api.get(\"adr_fa85158b26c3eb7c\");\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\nfetchedAddress, _, err := apiClient.AddressesApi.Get(context,\"adr_fa85158b26c3eb7c\").Execute()\n\nif err != nil {\n return err\n}\n"
label: GO
delete:
operationId: address_delete
summary: Delete
description: Deletes the details of an existing address. You need only supply the unique identifier that was returned upon address creation.
tags:
- Addresses
responses:
'200':
$ref: '#/components/responses/address_deleted'
default:
$ref: '#/components/responses/address_error'
x-codeSamples:
- lang: Shell
source: "curl -X DELETE https://api.lob.com/v1/addresses/adr_43769b47aed248c2 \\\n -u REDACTED_LOB_KEY:\n"
label: CURL
- lang: Typescript
source: "try {\n const deleteAddress = await new AddressesApi(config).delete('adr_xxxx');\n} catch (err: any) {\n console.error(err);\n}\n"
label: TYPESCRIPT
- lang: Javascript
source: "Lob.addresses.delete('adr_43769b47aed248c2', function (err, res) {\n console.log(err, res);\n});\n"
label: NODE
- lang: Ruby
source: "addressApi = AddressesApi.new(config)\n\nbegin\n deletedAddress = addressApi.delete(\"adr_43769b47aed248c2\")\nrescue => err\n p err.message\nend\n"
label: RUBY
- lang: Python
source: "with ApiClient(configuration) as api_client:\n api = AddressesApi(api_client)\n\ntry:\n deleted_resource = api.delete(\"adr_43769b47aed248c2\")\nexcept ApiException as e:\n print(e)\n"
label: PYTHON
- lang: PHP
source: "$apiInstance = new OpenAPI\\Client\\Api\\AddressesApi($config, new GuzzleHttp\\Client());\n\ntry {\n $result = $apiInstance->delete(\"adr_43769b47aed248c2\");\n} catch (Exception $e) {\n echo $e->getMessage(), PHP_EOL;\n}\n"
- lang: Java
source: "AddressesApi apiInstance = new AddressesApi(config);\n\ntry {\n AddressDeletion response = apiInstance.delete(\"adr_43769b47aed248c2\");\n} catch (ApiException e) {\n e.printStackTrace();\n}\n"
label: JAVA
- lang: Elixir
source: 'Lob.Address.delete("adr_43769b47aed248c2")
'
label: ELIXIR
- lang: CSharp
source: "AddressesApi api = new AddressesApi(config);\n\ntry {\n AddressDeletion response = api.delete(\"adr_43769b47aed248c2\");\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\ndeletedAddress, _, err := apiClient.AddressesApi.Delete(context, \"adr_43769b47aed248c2\").Execute()\n\nif err != nil {\n return err\n}\n"
label: GO
components:
schemas:
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"
address_fields_us:
type: object
required:
- address_line1
- address_city
- address_state
- address_zip
properties:
address_line1:
type: string
description: The primary number, street name, and directional information.
maxLength: 64
address_line2:
type:
- string
- 'null'
description: An optional field containing any information which can't fit into line 1.
maxLength: 64
address_city:
type: string
maxLength: 200
address_state:
type: string
description: 2 letter state short-name code
pattern: ^[a-zA-Z]{2}$
address_zip:
type: string
description: 'Must follow the ZIP format of `12345` or ZIP+4 format of `12345-1234`.
'
pattern: ^\d{5}(-\d{4})?$
lob_base:
type: object
required:
- date_created
- date_modified
- object
properties:
date_created:
$ref: '#/components/schemas/date_created'
date_modified:
$ref: '#/components/schemas/date_modified'
deleted:
$ref: '#/components/schemas/deleted'
object:
$ref: '#/components/schemas/object'
date_modified:
type: string
format: date-time
description: A timestamp in ISO 8601 format of the date the resource was last modified.
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
- '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:
$ref: '#/components/schemas/country_extended'
metadata:
$ref: '#/components/schemas/metadata'
metadata:
type: object
additionalProperties:
type: string
description: 'Use metadata to store custom information for tagging and labeling back to your internal systems. Must be an object with up to 20 key-value pairs. Keys must be at most 40 characters and values must be at most 500 characters. Neither can contain the characters `"` and `\`. i.e. ''{"customer_id" : "NEWYORK2015"}'' Nested objects are not supported. See [Metadata](#section/Metadata) for more information.'
maxLength: 500
pattern: '[^"\\]{0,500}'
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
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_whit
# --- truncated at 32 KB (62 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/lobcom/refs/heads/main/openapi/lobcom-addresses-api-openapi.yml