# Collect leads

> Capture contact details — name, email, phone — directly inside the chat with a lead form. Configure which fields to ask for, the success message, and what happens when a visitor dismisses it.

The **Collect leads** action shows a short form inside the chat so visitors can hand over their contact details without leaving the conversation. It's the simplest way to turn an anonymous chat into a known [contact](/docs/contacts/overview).

> **WHEN THE FORM APPEARS:** The agent surfaces the lead form when it makes sense in the conversation — for example after answering a pre-sales question, or when a visitor asks to be contacted. You guide that timing through the action's description.

## Add the action

1. **Open Actions → Collect leads** — From your agent's Actions tab, add the Collect leads action.
2. **Choose the fields** — Pick which fields to ask for. Email is the default; you can add name, phone, and more.
3. **Set the messages** — Write a success message shown after the visitor submits, and an optional dismiss message if they skip it.
4. **Describe when to ask** — In the description, tell the agent the moments to offer the form (e.g. "when the visitor wants a follow-up or a human will need to reach them").

## Configuration

The action is a built-in of kind `collect_leads`. Its config controls the rendered form:

| Setting | Description | Default |
| --- | --- | --- |
| `fields` | The fields to collect, in order. | `["email"]` |
| `success_message` | Shown after the visitor submits the form. | "Thanks — we'll be in touch!" |
| `dismiss_message` | Optional message shown if the visitor dismisses the form. | (empty) |

```json
{
  "kind": "collect_leads",
  "fields": ["name", "email", "phone"],
  "success_message": "Thanks! Our team will email you within one business day.",
  "dismiss_message": "No problem — ask me anything else in the meantime."
}
```

> **ASK FOR LESS:** Every extra field lowers completion. Email alone is usually enough to follow up — add phone only when you genuinely need it.

## Where leads go

Submitted leads are attached to the conversation and saved as [contacts](/docs/contacts/overview) in your workspace, where you can enrich them with [custom attributes](/docs/contacts/custom-attributes), filter, and export them. You can also pull leads programmatically through the [Leads API](/docs/api/v1/leads).

## FAQ

**Can I require the form before the agent answers?**

No — the lead form is offered in-conversation, not as a gate. To require details up front, ask for them in your agent's greeting or system prompt instead.

**What fields can I collect?**

Name, email, and phone are the common ones. Add only the fields you'll actually act on; longer forms convert worse.

**Does it run automatically?**

Yes. Collecting a lead is read-only from your systems' perspective, so it typically runs in `auto` mode without a confirm step.

## What's next

- [Contacts overview](/docs/contacts/overview) — See and manage the leads you capture.
- [Custom attributes](/docs/contacts/custom-attributes) — Add structured data to each contact.
- [Leads API](/docs/api/v1/leads) — Pull captured leads into your CRM.
