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

# manage_leads

> Everything that writes to a lead or to the records hanging off it — the lead, its notes, its manual logs, and backfilled activity.

> [!WARNING]
>
> **WRITE** · 12 operations · may change data

Everything that writes to a lead or to the records hanging off it — the lead itself, its notes, its manual logs, and backfilled activity entries.

```js theme={null}
manage_leads({ action, ids?, lead_id?, fields?, owner?, confirm_token? })
```

`action`: `create` · `update` · `assign` · `update_property` · `add_inquiry` · `trash` · `add_note` · `update_note` · `delete_note` · `add_manual_log` · `delete_manual_log` · `add_activity`

| `action` | Required | Notes |
| - | - | - |
| `create` | `fields.firstName` | `fields` is the new lead body (`LeadRequest`) — one lead per call, not an array. `update` takes a *different* body shape (`EditLeadRequest`): `welcomeEmail`/`leadAlert`/`leadRouting`/`assignGroupId`/`content`/`isPin` only apply on `create`; `tagsRemove`/`clearAllTags`/`isHidden` only apply on `update`. |
| `add_activity` | `fields.created`, `fields.link`, `fields.picture`, `fields.text`, `fields.type` | All five are required by the real endpoint. |
| `assign` | `owner` | Accepts an account **email**, or a team member's name resolved against the team's member list — not a raw numeric id. An ambiguous or unmatched name is a clear error, never a guess. `fields.preview: true` reports who *would* receive the lead without committing. `fields.role` is one of `Agent`/`Assistant`/`Lender` (default `Agent`). |
| `trash` | `fields.reason` | `reason` is sent as a query parameter, not part of the lead body — `fields` behaves differently here than for every other action. |
| `add_note` | `fields.content`, `fields.isPin` | `isPin` is required despite the name sounding optional — the real API rejects a call without it. |
| `update_note` | `lead_id`, `fields.content`, `fields.isPin` | The real endpoint's note-update body requires `leadId` even though only the note id is in the URL — `lead_id` here is that value, injected into the body automatically, the same way `add_note` already does. |
| `add_manual_log` | `fields.logType` (`logCall`/`logEmail`/`logText`), `fields.content` | `fields.leadPhoneNumber` is additionally required when `logType` is `logCall`. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.