openapi: 3.0.3 info: title: Lob version: 1.20.2 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.
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.
- name: Authentication x-traitTag: true description: | Requests made to the API are protected with HTTP Basic authentication. In order to properly authenticate with the API you must use your API key as the username while leaving the password blank. Requests not properly authenticated will return a `401` [error code](#tag/Errors). You can find your account's API keys in your Dashboard Settings. ### Example Request curl uses the -u flag to pass basic auth credentials (adding a colon after your API key will prevent it from asking you for a password). One of our test API keys has been filled into all the examples on the page, so you can test out any example right away. ```bash curl https://api.lob.com/v1/addresses \ -u test_0dc8dXXXXXXXXXXXXXXXXXXXXXX5b0cc: ``` ## API Keys Lob authenticates your API requests using your account's API keys. If you do not include your key when making an API request, or use one that is incorrect or outdated, Lob returns an error with a `401` HTTP response code. You can find all API keys in your dashboard under Settings. There are two types of API keys: *secret* and *publishable*. - **Secret API keys** should be kept confidential and only stored on your own servers. Your account's secret API key can perform any API request to Lob without restriction. - **Publishable API keys** are limited to US verifications, international verifications, and US autocomplete requests. For maximum security, we encourage you to not expose your secret key. You can include the publishable keys in JavaScript code or in an Android or iPhone app without exposing your Lob Print and Mail account services or your secret key. Publishable keys are always prefixed with `[environment]_pub`. Every type comes with a pair of keys: one for the testing environment and one for the live environment. We recommend reading [Test and Live Environments](#tag/Test-and-Live-Environments) for more information.ATTRIBUTE | DESCRIPTION |
---|---|
code |
A consistent machine-keyable string identifying the error |
status_code |
A conventional HTTP status code |
message |
A human-readable, subject-to-change message with more details about the error |
STATUS_CODE | CODE | MESSAGE |
---|---|---|
200 |
SUCCESS | Successful API request |
401 |
UNAUTHORIZED | Authorization error with your API key or account |
403 |
FORBIDDEN | Forbidden error with your API key or account |
404 |
NOT FOUND | The requested item does not exist |
422 |
BAD REQUEST | The query or body parameters did not pass validation |
429 |
TOO MANY REQUESTS | Too many requests have been sent with an API key in a given amount of time |
500 |
SERVER ERROR | An internal server error occurred, please contact support@lob.com |
STATUS_CODE | CODE | MESSAGE |
---|---|---|
422 |
BAD_REQUEST | An invalid request was made. See error message for details. |
409/422 |
CONFLICT | This operation would leave data in a conflicted state. |
403 |
FEATURE_LIMIT_REACHED | The account has reached its resource limit and requires upgrading to add more. |
500 |
INTERNAL_SERVER_ERROR | An error has occured on Lob's servers. Please try request again. |
422 |
INVALID | An invalid request was made. See error message for details. |
422 |
NOT_DELETABLE | An attempt was made to delete a resource, but the resource cannot be deleted. |
404 |
NOT_FOUND | The requested resource was not found. |
408 |
REQUEST_TIMEOUT | The request took too long. Please try again. |
503 |
SERVICE_UNAVAILABLE | The Lob servers are temporarily unavailable. Please try again. |
404 |
UNRECOGNIZED_ENDPOINT | The requested endpoint doesn't exist. |
422 |
UNSUPPORTED_LOB_VERSION | An unsupported Lob API version was requested. |
STATUS_CODE | CODE | MESSAGE |
---|---|---|
401 |
EMAIL_REQUIRED | Account must have a verified email address before creating live resources. |
401 |
UNAUTHORIZED | The request isn't authorized. |
401 |
UNAUTHORIZED_TOKEN | Token isn't authorized. |
401/403 |
INVALID_API_KEY | The API key is invalid. |
403 |
PUBLISHABLE_KEY_NOT_ALLOWED | The requested operation needs a secret key, not a publishable key. See [API Keys](#tag/API-Keys) for more information. |
429 |
RATE_LIMIT_EXCEEDED | Requests were sent too quickly and must be slowed down. |
STATUS_CODE | CODE | MESSAGE |
---|---|---|
401 |
PAYMENT_METHOD_UNVERIFIED | You must have a verified bank account or credit card to submit live requests. |
404 |
DELETED_BANK_ACCOUNT | Checks cannot be created with a deleted bank account. |
422 |
ADDRESS_LENGTH_EXCEEDS_LIMIT | The sum of to.address_line1 and to.address_line2 cannot surpass 50 characters. |
422 |
BANK_ACCOUNT_ALREADY_VERIFIED | The bank account has already been verified. |
422 |
BANK_ERROR | There's an issue with the bank account. |
403 |
BILLING_ADDRESS_REQUIRED | In order to create a live mail piece, your account needs to set up a billing address. |
422 |
CUSTOM_ENVELOPE_INVENTORY_DEPLETED | Custom envelope inventory is depleted, and more will need to be ordered. |
422 |
FAILED_DELIVERABILITY_STRICTNESS | The to address doesn't meet strictness requirements. See Account Settings to configure strictness. |
422 |
FILE_PAGES_BELOW_MIN | Not enough pages. |
422 |
FILE_PAGES_EXCEED_MAX | Too many pages. |
422 |
FILE_SIZE_EXCEEDS_LIMIT | The file size is too large. See description for details. |
422 |
FOREIGN_RETURN_ADDRESS | The 'from' address must be a US address. |
422 |
INCONSISTENT_PAGE_DIMENSIONS | All pages of the input file must have the same dimensions. |
422 |
INVALID_BANK_ACCOUNT | The provided bank routing number is invalid. |
422 |
INVALID_BANK_ACCOUNT_VERIFICATION | Verification amounts do not match. |
422 |
INVALID_CHECK_INTERNATIONAL | Checks cannot be sent internationally. |
422 |
INVALID_COUNTRY_COVID | The postal service in the specified country is currently unable to process the request due to COVID-19 restrictions. |
422 |
INVALID_FILE | The file is invalid. |
422 |
INVALID_FILE_DIMENSIONS | File dimensions are incorrect for the selected mail type. |
422 |
INVALID_FILE_DOWNLOAD_TIME | File download from remote server took too long. |
422 |
INVALID_FILE_URL | The file URL when creating a resource is invalid. |
422 |
INVALID_IMAGE_DPI | DPI must be at least 300. |
422 |
INVALID_INTERNATIONAL_FEATURE | The specified product cannot be sent to the destination. |
422 |
INVALID_PERFORATION_RETURN_ENVELOPE | Both `return_envelope` and `perforation` must be used together. |
422 |
INVALID_TEMPLATE_HTML | The provided HTML is invalid. |
422 |
MAIL_USE_TYPE_CAN_NOT_BE_NULL | `use_type` must be one of "marketing" or "operational". Alternatively, an admin can set the account default use type in Account Settings. |
422 |
MERGE_VARIABLE_REQUIRED | A required merge variable is missing. |
422 |
MERGE_VARIABLE_WHITESPACE | Merge variable names cannot contain whitespace. |
422 |
PDF_ENCRYPTED | An encrypted PDF was provided. |
422 |
SPECIAL_CHARACTERS_RESTRICTED | Cannot use special characters for merge variable names. |
422 |
UNEMBEDDED_FONTS | The provided PDF contains non-standard unembedded fonts. See description for details. |
EVENT TYPE | LIVE-ONLY | WHEN EVENT TYPE OCCURS |
---|---|---|
postcard.created |
false |
A postcard is successfully created (Lob returns a 200 status code). |
postcard.rejected |
false |
A postcard was not successfully created (Usually happens when one or more postcards fail the creation step during a batch request) |
postcard.rendered_pdf |
false |
A postcard's PDF proof is successfully rendered. |
postcard.rendered_thumbnails |
false |
A postcard's thumbnails are successfully rendered. |
postcard.deleted |
false |
A postcard is successfully canceled. |
postcard.mailed |
true |
A postcard receives a "Mailed" tracking event. Only enabled for certain Print & Mail Editions. |
postcard.in_transit |
true |
A postcard receives an "In Transit" tracking event. |
postcard.in_local_area |
true |
A postcard receives an "In Local Area" tracking event. |
postcard.processed_for_delivery |
true |
A postcard receives a "Processed for Delivery" tracking event. |
postcard.delivered |
false |
A postcard receives a "Delivered" tracking event. |
postcard.failed |
false |
A postcard receives a "Failed" rendering error or tracking event. |
postcard.re-routed |
true |
A postcard receives a "Re-Routed" tracking event. |
postcard.returned_to_sender |
true |
A postcard receives a "Returned to Sender" tracking event. |
postcard.international_exit |
true |
A postcard receives a "International Exit" tracking event. |
postcard.viewed |
false |
A postcard QR code or URL was scanned or viewed by the recipient. |
EVENT TYPE | LIVE-ONLY | WHEN EVENT TYPE OCCURS |
---|---|---|
self_mailer.created |
false |
A self_mailer is successfully created (Lob returns a 200 status code). |
self_mailer.rejected |
false |
A self_mailer was not successfully created (Usually happens when one or more self_mailers fail the creation step during a batch request) |
self_mailer.rendered_pdf |
false |
A self_mailer's PDF proof is successfully rendered. |
self_mailer.rendered_thumbnails |
false |
A self_mailer's thumbnails are successfully rendered. |
self_mailer.deleted |
false |
A self_mailer is successfully canceled. |
self_mailer.mailed |
true |
A self_mailer receives a "Mailed" tracking event. Only enabled for certain Print & Mail Editions. |
self_mailer.in_transit |
true |
A self_mailer receives an "In Transit" tracking event. |
self_mailer.in_local_area |
true |
A self_mailer receives an "In Local Area" tracking event. |
self_mailer.processed_for_delivery |
true |
A self_mailer receives a "Processed for Delivery" tracking event. |
self_mailer.delivered |
true |
A self_mailer receives an "Delivered" tracking event. |
self_mailer.failed |
false |
A self_mailer receives an "Failed" rendering error or tracking event. |
self_mailer.re-routed |
true |
A self_mailer receives a "Re-Routed" tracking event. |
self_mailer.returned_to_sender |
true |
A self_mailer receives a "Returned to Sender" tracking event. |
self_mailer.international_exit |
true |
A self_mailer receives an "International Exit" tracking event. |
self_mailer.viewed |
false |
A self_mailer's QR code or URL was scanned or viewed by the recipient. |
EVENT TYPE | LIVE-ONLY | WHEN EVENT TYPE OCCURS |
---|---|---|
letter.created |
false |
A letter is successfully created (Lob returns a 200 status code). |
letter.rejected |
false |
A letter was not successfully created (Usually happens when one or more letters fail the creation step during a batch request) |
letter.rendered_pdf |
false |
A letter's PDF proof is successfully rendered. |
letter.rendered_thumbnails |
false |
A letter's thumbnails are successfully rendered. |
letter.deleted |
false |
A letter is successfully canceled. |
letter.mailed |
true |
A letter receives a "Mailed" tracking event. Only enabled for certain Print & Mail Editions. |
letter.in_transit |
true |
A letter receives an "In Transit" tracking event. |
letter.in_local_area |
true |
A letter receives an "In Local Area" tracking event. |
letter.processed_for_delivery |
true |
A letter receives a "Processed for Delivery" tracking event. |
letter.delivered |
true |
A letter receives a "Delivered" tracking event. |
letter.failed |
false |
A letter receives a "Failed" rendering error or tracking event. |
letter.re-routed |
true |
A letter receives a "Re-Routed" tracking event. |
letter.returned_to_sender |
true |
A letter receives a "Returned to Sender" tracking event. |
letter.international_exit |
true |
A letter receives a "International Exit" tracking event. |
letter.viewed |
false |
A letter's QR code or URL was scanned or viewed by the recipient. |
letter.certified.mailed |
true |
A certified letter receives a "Mailed" tracking event. Only enabled for certain Print & Mail Editions. |
letter.certified.in_transit |
true |
A certified letter receives an "In Transit" tracking event. |
letter.certified.in_local_area |
true |
A certified letter receives an "In Transit" tracking event. |
letter.certified.processed_for_delivery |
true |
A certified letter receives a "Processed for Delivery" tracking event. |
letter.certified.re-routed |
true |
A certified letter receives a "Re-Routed" tracking event. |
letter.certified.returned_to_sender |
true |
A certified letter receives a "Returned to Sender" tracking event. |
letter.certified.delivered |
true |
A certified letter receives a "Delivered" tracking event. |
letter.certified.pickup_available |
true |
A certified letter receives a "Pickup Available" tracking event. |
letter.certified.issue |
true |
A certified letter receives an "Issue" tracking event. |
letter.return_envelope.created |
false |
A return envelope is created (occurs simultaneously with letter creation). |
letter.return_envelope.in_transit |
true |
A return envelope receives an "In Transit" tracking event. |
letter.return_envelope.in_local_area |
true |
A return envelope receives an "In Local Area" tracking event. |
letter.return_envelope.processed_for_delivery |
true |
A return envelope receives a "Processed for Delivery" tracking event. |
letter.return_envelope.re-routed |
true |
A return envelope receives a "Re-Routed" tracking event. |
letter.return_envelope.returned_to_sender |
true |
A return envelope receives a "Returned to Sender" tracking event. |
EVENT TYPE | LIVE-ONLY | WHEN EVENT TYPE OCCURS |
---|---|---|
check.created |
false |
A check is successfully created (Lob returns a 200 status code). |
check.rejected |
false |
A check was not successfully created (Usually happens when one or more checks fail the creation step during a batch request) |
check.rendered_pdf |
false |
A check's PDF proof is successfully rendered. |
check.rendered_thumbnails |
false |
A check's thumbnails are successfully rendered. |
check.deleted |
false |
A check is successfully canceled. |
check.mailed |
true |
A check receives a "Mailed" tracking event. Only enabled for certain Print & Mail Editions. |
check.in_transit |
true |
A check receives an "In Transit" tracking event. |
check.in_local_area |
true |
A check receives an "In Local Area" tracking event. |
check.processed_for_delivery |
true |
A check receives a "Processed for Delivery" tracking event. |
check.delivered |
true |
A check receives a "Delivered" tracking event. |
check.failed |
false |
A check receives a "Failed" rendering error or tracking event. |
check.re-routed |
true |
A check receives a "Re-Routed" tracking event. |
check.returned_to_sender |
true |
A check receives a "Returned to Sender" tracking event. |
EVENT TYPE | LIVE-ONLY | WHEN EVENT TYPE OCCURS |
---|---|---|
address.created |
false |
An address is successfully created (Lob returns a 200 status code). |
address.deleted |
false |
An address is successfully deleted. |
EVENT TYPE | LIVE-ONLY | WHEN EVENT TYPE OCCURS |
---|---|---|
bank_account.created |
false |
A bank account is successfully created (Lob returns a 200 status code). |
bank_account.deleted |
false |
A bank account is successfully deleted. |
bank_account.verified |
false |
A bank account is successfully verified. |
DELIVERABILITY OF SAMPLE RESPONSE | SET primary_line TO |
---|---|
deliverable |
deliverable |
deliverable_missing_info |
deliverable missing info |
undeliverable |
undeliverable |
no_match |
no match |
X-Rate-Limit-Limit: | the rate limit ceiling for a given request |
X-Rate-Limit-Remaining: | the number of requests remaining in this window |
X-Rate-Limit-Reset: | the time at which the rate limit window resets (in UTC epoch seconds) |
Idempotency-Key: |
optional
A string of no longer than 256 characters that uniquely identifies this resource. |
idempotency-key: |
optional
A string of no longer than 256 characters that uniquely identifies this resource. |
FONT NAME | TYPES |
---|---|
Arial |
TrueType, CID TrueType |
Arial,Bold |
TrueType, CID TrueType |
Arial,BoldItalic |
TrueType, CID TrueType |
Arial,Italic |
TrueType, CID TrueType |
ArialMT |
TrueType, CID TrueType |
Arial-BoldMT |
TrueType |
Arial-BoldItalicMT |
TrueType |
Arial-ItalicMT |
TrueType |
ArialNarrow |
TrueType |
ArialNarrow-Bold |
TrueType |
Calibri |
TrueType |
Calibri-Bold |
TrueType |
Calibri-Italic |
TrueType |
Courier |
Type 1 |
Courier-Oblique |
Type 1 |
Courier-Bold |
Type 1 |
Courier-BoldOblique |
Type 1 |
CourierNewPSMT |
TrueType |
CourierNewPS-ItalicMT |
TrueType |
CourierNewPS-BoldMT |
TrueType |
Helvetica |
Type 1 |
Helvetica-Bold |
Type 1 |
Helvetica-BoldOblique |
Type 1 |
Helvetica-Oblique |
Type 1 |
LucidaConsole |
TrueType |
MsSansSerif |
TrueType |
MsSansSerif,Bold |
TrueType |
Symbol |
Type 1, TrueType |
Tahoma |
TrueType |
Tahoma-Bold |
TrueType |
Times-Bold |
Type 1 |
Times-BoldItalic |
Type 1 |
Times-Italic |
Type 1 |
Times-Roman |
Type 1 |
TimesNewRomanPS-BoldItalicMT |
TrueType |
TimesNewRomanPS-BoldMT |
TrueType |
TimesNewRomanPS-ItalicMT |
TrueType |
TimesNewRomanPSMT |
TrueType, CID TrueType |
TimesNewRomanPSMT,Bold |
TrueType |
Verdana |
TrueType |
Verdana-Bold |
TrueType |
Verdana,Italic |
TrueType |
ZapfDingbats |
Type 1 |
NAME | EVENT | DESCRIPTION | ACTION REQUIRED |
---|---|---|---|
Mailed | package_accepted |
Package has been accepted into the carrier network for delivery. | false |
In Transit | package_arrived |
Package has arrived at an intermediate location in the carrier network. | false |
In Transit | package_departed |
Package has departed from an intermediate location in the carrier network. | false |
In Transit | package_processing |
Package is processing at an intermediate location in the carrier network. | false |
In Transit | package_processed |
Package has been processed at an intermediate location. | false |
In Local Area | package_in_local_area |
Package is at a location near the end destination. | false |
Processed For Delivery | delivery_scheduled |
Package is scheduled for delivery. | false |
Processed For Delivery | out_for_delivery |
Package is out for delivery. | false |
Pickup Available | pickup_available |
Package is available for pickup at carrier location. | true |
Delivered | delivered |
Package has been delivered. | false |
Re-Routed | package_forwarded |
Package has been forwarded. | false |
Returned to Sender | returned_to_sender |
Package is to be returned to sender. | false |
Issue | address_issue |
Address information is incorrect. Contact carrier to ensure delivery. | true |
Issue | contact_carrier |
Contact the carrier for more information. | true |
Issue | delayed |
Delivery of package is delayed. | false |
Issue | delivery_attempted |
Delivery of package has been attempted. Contact carrier to ensure delivery. | true |
Issue | delivery_rescheduled |
Delivery of package has been rescheduled. | false |
Issue | location_inaccessible |
Delivery location inaccessible to carrier. Contact carrier to ensure delivery. | true |
Issue | notice_left |
Carrier left notice during attempted delivery. Follow carrier instructions on notice. | true |
Issue | package_damaged |
Package has been damaged. Contact carrier for more details. | true |
Issue | package_disposed |
Package has been disposed. | false |
Issue | package_held |
Package held at carrier location. Contact carrier for more details. | true |
Issue | package_lost |
Package has been lost. Contact carrier for more details. | true |
Issue | package_unclaimed |
Package is unclaimed. | true |
Issue | package_undeliverable |
Package is not able to be delivered. | true |
Issue | reschedule_delivery |
Contact carrier to reschedule delivery. | true |
Issue | other |
Unrecognized carrier status. | false |
components[zip_code_type]
standard |
The default ZIP code type. Used when none of the other types apply. |
po_box |
The ZIP code contains only PO Boxes. |
unique |
The ZIP code is uniquely assigned to a single organization (such as a government agency) that receives a large volume of mail. |
military |
The ZIP code contains military addresses. |
empty string | A match could not be made with the provided inputs. |
components[record_type]
street |
The default address type. |
highrise |
The address is a commercial building, apartment complex, highrise, etc. |
firm |
The address is of an organizational entity which receives a minimum number of mailpieces per day. |
po_box |
The address is a PO Box. |
rural_route |
The address exists on a Rural Route. This is an older system of mail delivery which is still used in some parts of the country. |
general_delivery |
The address is part of the USPS General Delivery service, which allows individuals without permanent addresses to receive mail. |
empty string | A match could not be made with the provided inputs. |
components[carrier_route_type]
city_delivery |
The default carrier route type. Used when none of the other types apply. |
rural_route |
The carrier route is a Rural Route. This is an older system of mail delivery which is still used in some parts of the country. |
highway_contract |
The carrier route is a Highway Contract Route. This is an older system of mail delivery which is still used in some parts of the country. |
po_box |
The carrier route consists of PO Boxes. |
general_delivery |
The carrier route is part of the USPS General Delivery service, which allows individuals without permanent addresses to receive mail. |
empty string | A match could not be made with the provided inputs. |
deliverability_analysis[dpv_footnotes]
AA |
Some parts of the address (such as the street and ZIP code) are valid. |
A1 |
The address is invalid based on given inputs. |
BB |
The address is deliverable. |
CC |
The address is deliverable by removing the provided secondary unit designator. |
TA |
The address is deliverable by dropping a trailing alphabet from the primary number. |
IA |
The address is an Informed Address. The recipient and the street address is replaced with a special code provided by the USPS. |
N1 |
The address is deliverable but is missing a secondary information (apartment, unit, etc). |
F1 |
The address is a deliverable military address. |
G1 |
The address is a deliverable General Delivery address. General Delivery is a USPS service which allows individuals without permanent addresses to receive mail. |
U1 |
The address is a deliverable unique address. A unique ZIP code is assigned to a single organization (such as a government agency) that receives a large volume of mail. |
C1 |
The primary number was confirmed whereas the secondary number is unconfirmed and required to be deliverable. |
M1 |
The primary number is missing. |
M3 |
The primary number is invalid. |
P1 |
PO Box, Rural Route, or Highway Contract box number is missing. |
P3 |
PO Box, Rural Route, or Highway Contract box number is invalid. |
PB |
The address is identified as PO Box street address. |
R1 |
The address matched to a CMRA and private mailbox information is not present. |
R7 |
The address matched to a Phantom Carrier Route (carrier_route of R777 ), which corresponds to physical addresses that are not eligible for delivery. |
RR |
The address matched to a CMRA and private mailbox information is present. |
ADDRESS TYPE FOR SAMPLE RESPONSE | DELIVERABILITY | SET primary_line OR address TO |
---|---|---|
Commercial highrise | deliverable |
commercial highrise |
Residential highrise | deliverable |
residential highrise |
Residential house | deliverable |
residential house |
PO Box | deliverable |
po box |
Rural route | deliverable |
rural route |
Puerty Rico address w/ urbanization | deliverable |
puerto rico |
Military address | deliverable |
military |
Department of state | deliverable |
department of state |
Generic deliverable | deliverable |
deliverable |
Missing a suite number | deliverable_missing_unit |
missing unit |
Suite number doesn't exist | deliverable_incorrect_unit |
incorrect unit |
Residential house with unnecessary suite number | deliverable_unnecessary_unit |
unnecessary unit |
Undeliverable and block matched | undeliverable |
undeliverable block match |
Undeliverable and no block matched | undeliverable |
undeliverable no match |