Skip to main content

Start mailing Lob postcards with

Get your Lob API key

If you don’t have a Lob account, start by creating one over at In your Lob account, you’ll want the API Key from your account. We recommend starting with your “Test API Key” from your settings.

Create your campaign

Create a campaign in where you want to add the webhook action. For our example, we’re using a segment triggered campaign with the segment “Paid 3 times” as our trigger.

Add your webhook action to the workflow

Add a new webhook action in the campaign’s workflow, and give it a name. Then click Add Request.

You’ll then be brought to the Webhook composer.

Add your webhook headers

Next to POST, add in the API key and the postcard API endpoint in this format:https://[API-KEY], so the API key followed by a colon : and an @ sign.

Note: If you’re trying to send a letter or a check, more endpoints are in the Lob documentation.

Your headers should look something like:

Customize your postcard

Copy and paste this example code in to the content area for your webhook.

You’ll want to adjust the liquid for mailing addresses to match your custom attribute names in

For details on customizing the front or back of the postcard, take a look at Lob’s documentation.

When you’re done, you’ll have a finished webhook that looks something like:

Send Request

When you’re ready to test, you can click Send Request. will show you the response from the Lob API.

If you’re successful, you’ll see a 200 OK.


In Lob, you should now see your postcard successfully created.

Track Conversions

Conversions in are credited to the last message sent before a person enters or leaves a segment. Webhooks work a little differently.  We give you the option to enable conversion tracking just on the webhook actions you chose. For this campaign, we recommend enabling conversions for this webhook, since it triggers a customer-facing message.

We’re excited to hear how you end up using Lob with’s Webhook Action. If you have any trouble, let us know! We’re happy to help.