First-party app
Lob

Lob

Print and mail postcards, letters, checks and self-mailers, verify and autocomplete addresses, and manage address books, templates and bank accounts through Lob.

stable MarketingDeveloper Tools

About

Lob ships in the w6w first-party pack. It declares 37 actions, 2 health checks, and the host runs its code in a sandbox that never sees the credential.

App id
io.w6w.lob
Version
0.1.0
Author
w6w
Licence
MIT
Categories
Marketing · Developer Tools

Overview

Lob is a developer API for physical mail and address data. This app lets a workflow put a real postcard, letter, self-mailer or check in the post from any trigger, and verify the address it is going to before it does.

It covers the full lifecycle of each mailpiece: create it (inline address or a saved one, HTML or a saved template as the artwork, optionally scheduled up to 180 days ahead), list and look it up with its tracking events, and cancel it while Lob still allows. Around that it manages the address book, HTML templates and their versions, and the bank accounts checks are drawn on, including micro-deposit verification.

Address verification covers US addresses, international addresses, US autocomplete for typeahead and ZIP code lookup. Lob issues separate test and live keys against the same host, so connect one of each: a test key prints and bills nothing. The app sends an idempotency key with every mailpiece create, so a retried step does not mail twice, and it keeps a bank account’s full number out of workflow results.

Build with Lob

Three routes to the same 37 actions. The Workflow tab is generated from Lob's own manifest and carries its real ids, so it is copy-pasteable; the Code and CLI examples are the same call for any action on any app, so every app-specific value in them is a blank you fill in.

Create Address

address-create

Save an address to the address book. Lob does not deduplicate: creating the same address twice makes two records.

Delete Address

address-delete

Permanently delete a saved address from the address book. Mailpieces already created from it are unaffected.

Get Address

address-get

Retrieve a saved address by id.

List Addresses

address-list

List the saved addresses in the address book, newest first, with cursor paging.

Create Bank Account

bank-account-create

Register a US bank account that checks can be drawn on. It must then be verified (Verify Bank Account) before Lob will create a check from it. The returned record omits the full account number.

Delete Bank Account

bank-account-delete

Delete a bank account. Checks already created from it are unaffected.

Get Bank Account

bank-account-get

Retrieve a bank account by id, including whether it is verified. The full account number is removed from the result (Lob echoes it back).

List Bank Accounts

bank-account-list

List bank accounts that checks can be drawn on, with cursor paging. The full account number is removed from the result (Lob echoes it back).

Verify Bank Account

bank-account-verify

Verify a bank account with the two micro-deposit amounts (in cents) or the 6-character descriptor code from the bank statement. The bank account record says which one it needs (microdeposit_type).

Cancel Check

check-cancel

Cancel a check before it goes to production. Lob documents this as possible only when the mailpiece has a send date that has not yet passed; a cancelled piece is not charged. Scheduling and cancellation are a paid-edition feature.

Create Check

check-create

Create and mail a check drawn on a verified bank account (or schedule it with a send date). On a live key this issues a real check; on a test key nothing is mailed.

Get Check

check-get

Retrieve one check by id, including its tracking events and expected delivery date.

List Checks

check-list

List checks sent from this account, with status, mail type, send date and metadata filters and cursor paging.

Get Lob Credits Balance

credits-balance-get

Return the account's current balance of Lob Credits.

Verify International Address

intl-verify

Verify and standardize an address outside the US and US territories (use Verify US Address for those). Needs the country; pass separate fields or a free-form address. A test key returns a dummy response based on the primary line you send.

Cancel Letter

letter-cancel

Cancel a letter before it goes to production. Lob documents this as possible only when the mailpiece has a send date that has not yet passed; a cancelled piece is not charged. Scheduling and cancellation are a paid-edition feature.

Create Letter

letter-create

Create and mail a letter (or schedule it with a send date). On a live key this prints, bills and mails a real letter; on a test key nothing is mailed.

Get Letter

letter-get

Retrieve one letter by id, including its tracking events and expected delivery date.

List Letters

letter-list

List letters sent from this account, with status, mail type, send date and metadata filters and cursor paging.

Cancel Postcard

postcard-cancel

Cancel a postcard before it goes to production. Lob documents this as possible only when the mailpiece has a send date that has not yet passed; a cancelled piece is not charged. Scheduling and cancellation are a paid-edition feature.

Create Postcard

postcard-create

Create and mail a postcard (or schedule it with a send date). On a live key this prints, bills and mails a real postcard; on a test key nothing is mailed.

Get Postcard

postcard-get

Retrieve one postcard by id, including its tracking events and expected delivery date.

List Postcards

postcard-list

List postcards sent from this account, with status, mail type, send date and metadata filters and cursor paging.

Create Self Mailer

self-mailer-create

Create and mail a self-mailer (a folded piece addressed on its outside), or schedule it with a send date. On a live key this mails a real piece; on a test key nothing is mailed.

Delete Self Mailer

self-mailer-delete

Delete a self mailer before it goes to production. Lob documents this as possible only when the mailpiece has a send date that has not yet passed; a cancelled piece is not charged. Scheduling and cancellation are a paid-edition feature.

Get Self Mailer

self-mailer-get

Retrieve one self mailer by id, including its tracking events and expected delivery date.

List Self Mailers

self-mailer-list

List self mailers sent from this account, with status, mail type, send date and metadata filters and cursor paging.

Create Template

template-create

Create a reusable HTML template (its first version). Reference the returned tmpl_ id as the artwork of a postcard, letter, self-mailer or check.

Delete Template

template-delete

Delete a template and all of its versions. Mailpieces that reference it by id will fail afterwards.

Get Template

template-get

Retrieve a template, its published version and its versions.

List Templates

template-list

List saved HTML templates with cursor paging.

Update Template

template-update

Change a template's description and/or which version is published (the one mailpieces render). To change the HTML, create a new version instead.

Create Template Version

template-version-create

Add a new version (new HTML) to an existing template. It is NOT published automatically; use Update Template to publish it.

List Template Versions

template-version-list

List the versions of one template with cursor paging.

Autocomplete US Address

us-autocomplete

Suggest up to 10 US addresses from a street-line prefix. Useful behind a typeahead field; set Only deliverable to drop unverifiable suggestions.

Verify US Address

us-verify

Verify and standardize a US address. Pass either the separate fields or one free-form address string. A test key returns a canned result rather than a real verification.

Look Up US ZIP Code

us-zip-lookup

Return the cities, states and counties a 5-digit US ZIP code covers, and the ZIP type.

A workflow step names the app and the action, and the editor fills in the connection when you pick one. This is the Step shape from the workflow spec, carrying Lob's real ids.

{
  "manifestVersion": "2",
  "name": "lob-example",
  "steps": [
    {
      "id": "address-create",
      "uses": {
        "app": "io.w6w.lob",
        "action": "address-create",
        "connection": "conn_YOUR_CONNECTION_ID"
      },
      "with": {
        "addressLine1": "<addressLine1>"
      }
    }
  ]
}

Here are some of the things you can do

  • Create Address

    perform
    address-create
  • Get Address

    read
    address-get
  • List Addresses

    search
    address-list
  • Create Bank Account

    perform
    bank-account-create
  • Get Bank Account

    read
    bank-account-get

+32 more actions available

Every app-specific value here is a blank you have to fill in. An app action is reached through the connection that authenticates it, so the address is a connection id, not the app id — and connections belong to your account, so a public page cannot know yours. Create one for Lob, then fill in the three blanks: conn_YOUR_CONNECTION_ID, the action key, and the parameters that action declares. The call itself is real — the shape is transcribed from the studio's own snippet builder, which prints the same kind of blanks — but nothing in it is specific to Lob. The Workflow tab is where this app's real ids are.

Install
npm install @w6w/sdk
yarn add @w6w/sdk
pnpm add @w6w/sdk
deno add npm:@w6w/sdk
Code
import { W6wClient, isActionRun } from "@w6w/sdk";

// Reads W6W_BASE_URL and W6W_TOKEN from the environment when omitted.
const client = new W6wClient();

const envelope = await client.run({
  urn: "conn_YOUR_CONNECTION_ID",
  action: "address-create",
  payload: {
    // name: "<value>",
    // company: "<value>",
    addressLine1: "<value>",
    // addressLine2: "<value>",
    // addressCity: "<value>",
    // addressState: "<value>",
    // addressZip: "<value>",
    // addressCountry: "<value>",
    // phone: "<value>",
    // email: "<value>",
    // metadata: "<value>",
  },
});

if (isActionRun(envelope)) console.log(envelope.value);
Install the CLI
npm install -g @w6w/cli
CLI
w6w run conn_YOUR_CONNECTION_ID --action address-create --payload '{"addressLine1":"<value>"}'

Give an AI agent Lob — without giving it Lob's credentials. One MCP endpoint exposes every app, function and workflow the caller is entitled to, as tools it can discover and run. Access is granted per team while we onboard.

One tool call
{
  "name": "w6w_invoke",
  "arguments": {
    "ref": "app:io.w6w.lob#address-create",
    "input": {
      "addressLine1": "<addressLine1>"
    }
  }
}

Every tool names its target with a single ref. The app: form above doesn't name a connection at all — the host resolves which of the caller's Lob connections to sign with, and refuses rather than guesses when the answer is ambiguous.

What the agent gets

Credentials it can't read

The token is attached host-side, at the moment of the call. It is never a tool argument, never in the model's context, and never in a transcript — so a prompt injection has nothing to exfiltrate.

A tool surface scoped to the caller

Tools are derived per end user from what that person has actually connected and is entitled to — not one shared bot identity carrying the union of everyone's access.

A durable workflow in one call

Multi-step work runs on the workflow engine and returns a run handle the agent can poll — retries, branching and state survive the conversation that started them.

Health-aware discovery

Lob's declared health checks are on the surface too, so an agent can tell "the vendor is down" from "your credential expired" before it burns a retry on either.

The MCP surface is part of the hosted platform. Lob itself is MIT, and the runtime that executes it is source-available (FSL).

Request MCP access

Health checks

Lob declares its own checks, so its health is a property of the app rather than something the host guesses at.

service

Lob platform status

Component status from status.lob.com (served from lob.statuspage.io): the API, the Dashboard and Webhooks.

quota

API rate-limit headroom