Guide

Send Email to Airtable from the Terminal

Airtable is the database teams reach for when a spreadsheet isn't enough, and a lot of what fills it starts as email. The default bridge is a Zapier task billed per record. The Nylas CLI gives you the inbox as JSON; the Airtable API creates records with your fields mapped. This guide builds an email-to-Airtable pipeline that maps sender, subject, and date to columns, batches up to ten records per call, and runs on a schedule for free.

Written by Hazik Director of Product Management

VerifiedCLI 3.1.16 · Gmail, Outlook · last tested June 8, 2026

Command references used in this guide: nylas email search, nylas email list, and nylas email read.

How do you send email to Airtable?

You send email to Airtable by pulling the messages as JSON and POSTing them as records to a table. The CLI returns structured messages with nylas email search --json, and the Airtable API creates records when you POST a records array to the base-and-table endpoint. The create-records contract, including the 10-records-per-request limit, is in the Airtable Web API reference.

You'll need a personal access token scoped to the base and the base and table IDs, both visible in the API docs for your base. Field names in your request must match the table's columns exactly, since Airtable rejects unknown fields. With those in hand, each message maps to one record.

# Pull the messages to file into Airtable
nylas email search "subject:application newer_than:1d" --json --limit 50 > apps.json

How do you map a message to Airtable fields?

Map each message to a fields object whose keys are your column names. A row of Subject, Sender, and Received maps directly from the message's subject, from-address, and date. Build the records array with jq, wrapping each message under a fields key so the output matches the API's expected body shape exactly.

Batch up to ten records per call to stay within the API limit and cut round trips — filing 50 messages is five requests, not 50. Use jq's _nwise or a chunking loop to split the array into tens. Null-safe fallbacks keep a missing subject from creating a record Airtable rejects for a type mismatch.

BASE="appXXXX"; TABLE="Applications"
jq -c '[.[] | {fields: {Subject: (.subject // "(no subject)"),
                        Sender: (.from[0].email // "")}}]
        | _nwise(10)' apps.json | while read -r batch; do
  curl -s -X POST "https://api.airtable.com/v0/$BASE/$TABLE" \
    -H "Authorization: Bearer $AIRTABLE_TOKEN" \
    -H "Content-Type: application/json" \
    -d "{\"records\": $batch}"
done

How do you avoid duplicate records?

Avoid duplicates by storing the message ID in a field and skipping any message already present. The simplest version scopes the search to newer_than:1d and runs daily, so each run only sees the last day's mail and can't re-import older records. For exactness, query Airtable for the message ID before creating, or use an upsert by a unique field.

Run the pipeline on a schedule — cron, CI, or a Kubernetes CronJob — to keep the base current. A daily job that files new applications costs nothing per record, unlike a per-task automation. The Airtable token is separate from the mailbox grant, so scope it to just the one base and rotate it independently.

Next steps