Programmatically send physical mail at scale

Join Onovative, Booking.com, Counsyl, and 5,000 other companies using Lob's modern API

Try it Now

Know exactly where your mail is

Have confidence that your mail is getting to its destination with our piece-by-piece mail tracking. Our product offers 99% deliverability.

Arm your team with modern tools

Whether it's webhooks, managed templates, or our API libraries, our product comes with tools to make sending mail even easier.

Be compliant

Easily audit your historical mailings to see exactly what was sent, to whom it was sent, and when it was processed for delivery.

Iterate quickly

With our modern API, Lob makes it possible to spin up new print workflows in days instead of months.

Get started with the Lob API in minutes

Lob offers pre-built wrappers in Node, Ruby, Python, PHP, and Java to make integration as easy as possible.

Read the Docs View Libraries
  • curl

  • Node

  • Ruby

  • Python

  • PHP

  • Java

  • 
    curl https://api.lob.com/v1/postcards \
      -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
      -d "description=Demo Postcard job" \
      -d "to[name]=Harry Zhang" \
      -d "to[address_line1]=123 Test Street" \
      -d "to[address_city]=Mountain View" \
      -d "to[address_state]=CA" \
      -d "to[address_zip]=94041" \
      -d "to[address_country]=US" \
      --data-urlencode "front=<html style='padding: 1in; font-size: 50;'>Front HTML for {{name}}</html>" \
      --data-urlencode "back=<html style='padding: 1in; font-size: 20;'>Back HTML for {{name}}</html>" \
      -d "merge_variables[name]=Harry"
    
              
    
    Lob.postcards.create({
      description: 'Demo Postcard job',
      to: {
        name: 'Harry Zhang',
        address_line1: '123 Main Street',
        address_city: 'Mountain View',
        address_state: 'CA',
        address_zip: '94041'
      },
      front: '<html style="padding: 1in; font-size: 50;">Front HTML for {{name}}</html>',
      back: '<html style="padding: 1in; font-size: 20;">Back HTML for {{name}}</html>',
      merge_variables: {
        name: 'Harry'
      }
    }, function (err, res) {
      console.log(err, res);
    });
    
              
    
    @lob.postcards.create(
      description: "Demo Postcard job",
      to: {
        name: "Harry Zhang",
        address_line1: "123 Test Street",
        address_city: "Mountain View",
        address_state: "CA",
        address_country: "US",
        address_zip: 94041
      },
      front: "<html style='padding: 1in; font-size: 50;'>Front HTML for {{name}}</html>",
      back: "<html style='padding: 1in; font-size: 20;'>Back HTML for {{name}}</html>",
      merge_variables: {
        name: "Harry"
      }
    )
    
              
    
    lob.Postcard.create(
      to_address = {
        'name': 'Harry Zhang',
        'address_line1': '123 Test Street',
        'address_city': 'Mountain View',
        'address_state': 'CA',
        'address_zip': '94041',
        'address_country': 'US'
      },
      front = '<html style="padding: 1in; font-size: 50;">Front HTML for {{name}}</html>',
      back = '<html style="padding: 1in; font-size: 20;">Back HTML for {{name}}</html>',
      merge_variables = {
        'name': 'Harry'
      }
    )
    
              
    
    $lob->postcards()->create(array(
      'description' => 'Demo Postcard job',
      'to'      => array(
        'name'          => 'Harry Zhang',
        'address_line1' => '123 Main Street',
        'address_city'  => 'Mountain View',
        'address_state' => 'CA',
        'address_zip'   => '94041',
      ),
      'front'                 => '<html style="padding: 1in; font-size: 50;">Front HTML for {{name}}</html>',
      'back'                  => '<html style="padding: 1in; font-size: 20;">Back HTML for {{name}}</html>',
      'merge_variables[name]' => 'Harry'
    ));
    
              
    
    final Map<String, String> mergeVariables = Maps.newHashMap();
    mergeVariables.put("name", "Harry");
    
    final PostcardRequest postcardRequest = PostcardRequest.builder()
      .to(AddressRequest.builder()
        .name("Harry Zhang")
        .line1("123 Test Street")
        .city("Mountain View")
        .state("CA")
        .zip("94041")
        .country("US")
        .build())
      .front("<html style='padding: 1in; font-size: 50;'>Front HTML for {{name}}</html>")
      .back("<html style='padding: 1in; font-size: 20;'>Back HTML for {{name}}</html>")
      .mergeVariables(mergeVariables)
      .build();
    final PostcardResponse postcard = client.createPostcard(postcardRequest).get();