Source: https://cli.nylas.com/guides/extract-contacts-appointments-ai

# Extract Meetings and Contacts From Email

An AI agent reads an email, pulls the meeting time and the sender's contact details with a model, and writes a calendar event plus a new contact record.

Written by [Aaron de Mello](https://cli.nylas.com/authors/aaron-de-mello) Senior Engineering Manager

Updated June 14, 2026

> **TL;DR:** An agent reads a message with `nylas email list --json`, a model pulls the meeting time and the sender's details into JSON, and the agent writes a `nylas calendar events create` and a `nylas contacts create` from one email — two entities in one pass.

## How does an AI agent extract meetings and contacts from an email?

The agent reads an inbound message, passes the body to a model that returns two structured entities — a meeting and a contact — and writes each to the calendar and contacts. A single “Can we meet Thursday at 2pm? — Dana, VP Sales, Globex” email becomes a calendar event and a saved contact without anyone retyping the details. The model does the reading; code does the writing.

One email passes through a model that extracts two entities — a meeting and a contact — which become a calendar event and a contact recordEmailemail listModelextract entitiesCalendar eventevents createContact recordcontacts create

Both entities come from one pass over the same message, which is the efficiency gain. Manually copying a proposed time into the calendar and the sender into contacts takes a minute or two per email; the agent does both in under 2 seconds and never forgets the second step. This is body-text extraction, not signature parsing — for deep signature enrichment, see the guide linked at the end.

## How does the model pull a meeting and a contact from one message?

Give the model one schema with both entities and it fills them in a single call. You define the meeting fields (title, start, end, attendees) and the contact fields (name, email, company, title), and the model returns one JSON object holding both. Asking for both at once costs one model call instead of two and keeps the meeting and the person linked.

```json
{
  "meeting": {
    "title": "Globex / Acme sync",
    "start": "2026-06-18T14:00:00",
    "end": "2026-06-18T14:30:00",
    "attendees": ["dana@globex.com"]
  },
  "contact": {
    "name": "Dana Reyes",
    "email": "dana@globex.com",
    "company": "Globex",
    "title": "VP Sales"
  }
}
```

Validate before writing. If the model returns a start time it can't parse or a meeting with no attendee, route that email to a human instead of creating a malformed event. Roughly 1 in 20 free-text scheduling emails is ambiguous enough to need that fallback.

## How do you create the calendar event?

Feed the extracted meeting fields to `nylas calendar events create`. The command takes a title, a start, an end, and participants, and writes the event to the agent's calendar in one call. The times follow the same calendar model as the iCalendar standard, [RFC 5545](https://datatracker.ietf.org/doc/html/rfc5545), so a 30-minute slot maps cleanly to a start and end.

```bash
# Create the event from the extracted meeting fields
nylas calendar events create \
  --title "Globex / Acme sync" \
  --start "2026-06-18T14:00:00Z" \
  --end "2026-06-18T14:30:00Z" \
  --participant dana@globex.com
```

## How do you create the contact?

Write the extracted person to `nylas contacts create` with their name and email. The contact model mirrors the vCard standard, [RFC 6350](https://datatracker.ietf.org/doc/html/rfc6350), so name and email are the two fields you always have. Check for an existing contact with that email first so a repeat sender doesn't create a second record.

```bash
# Create the contact from the extracted person
nylas contacts create \
  --first-name "Dana" \
  --last-name "Reyes" \
  --email dana@globex.com
```

This guide creates a contact from a single email's body. To go deeper — mining job titles, phone numbers, and company data out of signature blocks across many emails — pair it with the signature-enrichment guide linked below, which handles the regex-heavy extraction this skips.

## How do you keep extraction safe and accurate?

An inbound email is untrusted content, so a scheduling message can carry text that tries to steer the model — the [prompt-injection risk (OWASP LLM01)](https://genai.owasp.org/llmrisk/llm01-prompt-injection/) that tops the LLM threat list. Treat the extracted JSON as data to validate, never as a command. A model that “decides” to invite 50 people is a parsing error you catch by capping attendees in code.

Accuracy comes from validation, not trust. Parse every date, confirm the email is a real address, and require a human review for any event where the model's confidence is low. Running the agent on a dedicated inbox keeps the blast radius to its own calendar and contacts, so a bad extraction can't corrupt a person's real schedule.

## Next steps

- [Enrich Contacts From Email Signatures](https://cli.nylas.com/guides/enrich-contacts-from-email) — deep signature parsing for titles, phone numbers, and company data
- [Extract Attachment Data With an AI Agent](https://cli.nylas.com/guides/agent-attachment-data-extraction) — the same extract-validate-write pattern applied to file attachments
- [Build a Meeting-Booking Agent](https://cli.nylas.com/guides/meeting-booking-agent-account) — turn extracted meetings into a full back-and-forth scheduling flow
- [Full command reference](https://cli.nylas.com/docs/commands) — every `nylas calendar` and `nylas contacts` subcommand

## Try Nylas CLI

Install the CLI with `curl -fsSL https://cli.nylas.com/install.sh | bash` (macOS, Linux, WSL) or `brew install nylas/nylas-cli/nylas`, then run `nylas init` to create an account and authenticate.

**Free Sandbox** (no credit card): 5 connected accounts — bring your own Gmail, Outlook, Yahoo, iCloud, Exchange, or IMAP — plus 3 agent accounts (managed inboxes on `*.nylas.email`). Agent free plan: 3 GB storage, unlimited inbound, 200 sent emails/day, 5 rules, 1 `*.nylas.email` subdomain, and unlimited custom domains. Production is uncapped and requires a credit card: https://www.nylas.com/pricing/
