> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Create lead

> Create a Close lead with contacts and custom fields.

`close.createLead` create a Close lead with contacts and custom fields.

```ts automations/close-create-lead.automation.ts theme={null}
import { automation, onDashboardRun } from "automate.ax"
import { close } from "automate.ax/close"

export default automation("Create lead", () => {
  onDashboardRun({ title: "Create lead" })
  close.createLead({
    name: "Acme",
    source: "Website",
    contacts: [{ name: "Ada", emails: [{ email: "ada@acme.example" }] }],
  })
})
```

## Inputs

All fields are optional. Provide `name`, `description`, `url`, `source`, addresses, nested contacts, or `customFields` keyed by `cf_...`. Choose either `status` or `statusId`, not both. Optional second argument `{ account }` selects a named Close binding.

## Output

Returns the created `CloseLead`, including Close-generated IDs and timestamps. Nested contacts are created with the lead.
