View as Markdown
Lob icon

Lob ACTION

Create Postcard

Creates a new postcard given information. See docs here.
  • Action
  • Writes data
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Lob account once, then configure and run Create Postcard from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "lob-create-postcard",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    lob: { authProvisionId: "apn_xxxxxxx" },
    description: "Description",
    to: "To",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Create Postcard inputs
Property Type Description
description Description string
An internal description that identifies this resource
Required
to To string
Must either be an addressId or an inline object with correct address parameters
Required Dynamic
front Front string
The artwork to use as the front of your postcard. May be a templateId or a HTML string. HTML Examples
Required
back Back string
The artwork to use as the back of your postcard. May be a templateId or a HTML string. Be sure to leave room for address and postage information as in this example template.
Required
size Size string
Specifies the size of the postcard. Only 4x6 postcards can be sent to international destinations
Required
mailType Mail Type string
The mail postage type: usps_first_class (default) or usps_standard - a cheaper option which is less predictable and takes longer to deliver
Required
mergeVariables Merge Variables object
An object for substituting variables to render dynamic content in your template. Merge Variables Guide
Optional
sendDate Send Date string
A timestamp in ISO 8601 format which specifies a date after the current time and up to 180 days in the future to send the letter off for production. Until the send_date has passed, the mailpiece can be canceled
Optional
from From string
Required if to address is international. Must either be an addressId or an inline object with correct address parameters
Optional Dynamic

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
lob-create-postcard
Version
0.0.5
App
Lob
Authentication
API key
Read-only
No
Destructive
No
Open world
Yes