> ## 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.

# notify_agent

> Push an app notification, system SMS or system email to an internal agent, or fire an opportunity alert.

<Warning>**WRITE** · 4 operations · may change data</Warning>

Push an app notification, system SMS or system email **to an internal agent**, or fire an opportunity alert.

```js theme={null}
notify_agent({ channel: "app_push" | "sms" | "email" | "opportunity_alert", agent_id, body, confirm_token })
```

<Warning>Recipients are always internal agents, never leads.</Warning>

<Note>
  `agent_id` targets a specific teammate for `channel: "sms"` and `channel: "email"` only — the
  teammate must be on the caller's own team. `app_push` and `opportunity_alert` never accept a
  redirect: `app_push` always notifies the assignee of the given `task_id`, and
  `opportunity_alert` always resolves its recipient from the named `lead_id`. This is by design,
  not a gap — both of those exist to notify the person actually responsible for a task or a lead,
  and letting a caller redirect that to an unrelated third party would defeat the point of the
  channel rather than extend it.
</Note>

Each channel also needs its own extra parameter:

```js theme={null}
// app_push: task_id required, no body, agent_id has no effect.
notify_agent({ channel: "app_push", task_id })

// sms: body required. agent_id optional - defaults to the caller.
notify_agent({ channel: "sms", body, agent_id })

// email: subject and body required. agent_id optional - defaults to the caller.
notify_agent({ channel: "email", subject, body, agent_id })

// opportunity_alert: lead_id required, body is the alert description, agent_id has no effect.
notify_agent({ channel: "opportunity_alert", lead_id, body })
```
