Skip to main content

Enrich a contact list from scratch

In this tutorial you will prepare a JSONL file of contacts, submit it for async email and phone enrichment, wait for the batch to complete, and download the results. By the end you will have a hands-on understanding of how the contact-enrich workflow operates. What you will need: landbase-cli installed and authenticated.

1. Prepare your contact list

Create a file called leads.jsonl. Each line is one JSON object representing a person. The minimum required fields are a LinkedIn URL, or a full name plus a company domain:
{"first_name": "Sarah", "last_name": "Chen", "linkedin_url": "https://www.linkedin.com/in/sarahchen", "company_domain": "example.com"}
{"first_name": "Marco", "last_name": "Rossi", "linkedin_url": "https://www.linkedin.com/in/marcorossi", "company_domain": "acme.io"}
{"first_name": "Priya", "last_name": "Nair", "company_domain": "startupco.com", "linkedin_url": "https://www.linkedin.com/in/priyanair"}
Save this as leads.jsonl in your working directory.
You do not need to have a LinkedIn URL for every contact. A first name, last name, and company domain is enough to attempt a match. LinkedIn URLs improve accuracy when you have them.

2. Submit the batch

landbase-cli contact-enrich submit ./leads.jsonl --enrich-phone --wait
Breaking this down:
  • ./leads.jsonl — path to your file
  • --enrich-phone — request phone numbers in addition to emails (email enrichment is on by default)
  • --wait — block the terminal until the batch finishes (instead of returning a request ID immediately)
You will see progress output as the batch runs. When it completes you will see the enriched results printed as JSON.

3. Read what came back

The response includes a results array. Each entry in the array corresponds to one contact. Look for the email and phone fields:
{
  "request_id": "cer_abc123",
  "status": "SUCCEEDED",
  "results": [
    {
      "first_name": "Sarah",
      "last_name": "Chen",
      "email": "sarah.chen@example.com",
      "phone": "+14155551234",
      "linkedin_url": "https://www.linkedin.com/in/sarahchen"
    }
  ]
}
If Landbase could not find an email or phone for a contact, that field will be absent or null — this is normal, not an error. Coverage varies by contact.

4. Save the results to a file

Pipe the output to a file:
landbase-cli contact-enrich submit ./leads.jsonl --enrich-phone --wait > enriched.json
Or if you already submitted and have a request_id, retrieve the completed job:
landbase-cli contact-enrich get <request-id> > enriched.json

5. Try a larger batch

For real-world use you will have more than three contacts. Keep each batch at or below 100 leads. For larger files, split them first:
split -l 100 big-list.jsonl chunk-
for f in chunk-*; do
  landbase-cli contact-enrich submit "$f" --wait >> all-enriched.jsonl
done

What you learned

  • Contact enrichment is asynchronous — the CLI submits a job and polls for results
  • --wait blocks the terminal until the batch reaches a terminal status
  • --enrich-phone adds phone enrichment on top of the default email enrichment
  • If a contact cannot be enriched, the field is absent — not an error
  • You can retrieve a completed job by request_id if you need to fetch results later
Next step: See How enrichment works to understand the difference between contact-enrich, enrich, and the batch workflow enrich.