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

# Actions

> Everything an automation step can do — create and update leads, send messages, and look up CRM records.

## Overview

Actions are the steps that do the work in an automation. They come in two groups in the **Add step** dialog:

* **Apten Actions** — operate on leads in Apten.
* **CRM Actions** — look up a record in your connected CRM and expose its fields to later steps.

### The find-then-act pattern

Most Apten actions need an **Apten lead ID** to know which lead to operate on. The standard pattern is to start with a **Find Lead** step, then reference its output in later steps: type **/** in the **Apten lead ID** field and pick the Find Lead step's **Apten lead ID** output. A **Create Lead** step works the same way — later steps can reference the ID of the lead it just created.

## Apten Actions

### Find Lead

Looks up an existing Apten lead by CRM record ID, Apten lead ID, or phone number. Provide at least one; if you set multiple, they're tried in order — **Apten lead ID → CRM record ID → Phone** — and the first match wins, which makes a useful fallback chain.

Outputs include whether a lead was found, the Apten lead ID, name, phone, email, customer profile, and status flags such as whether the lead has replied, is marked hot, or has unsubscribed. Pair it with a [Filter step](/automations/control-steps) on the **Lead found?** output to stop runs for unknown leads.

### Create Lead

Creates a new lead in Apten and starts outreach. Required fields: **First name**, **Phone**, and **Customer profile**. Optional fields include **Last name**, **Email**, and **Link to CRM record** — set the link so the new lead syncs back to the CRM record that triggered the run (typically `{{trigger.Id}}`).

Under **Advanced** you can also set:

* **Time zone** — an IANA identifier like `America/New_York`. If your CRM doesn't store time zones in this format, add a [Resolve Timezone](#resolve-timezone) step first and reference its **Timezone** output here.
* **Scheduled import time** — defer Apten's first outbound message until a future timestamp (up to 365 days out)
* **Outbound phone** — override the phone number Apten texts from
* **Custom fields** — extra key-value data stored on the lead

<Note>
  The keys `integrationSource`, `salesforceId`, and `dynamicsId` are reserved — use the **Link to CRM record** field instead.
</Note>

Creating a lead follows the same rules as every other import path: numbers on your Do Not Contact list are rejected, duplicates by phone number are rejected, and your organization's lead quota applies.

### Turn Off Lead

Pauses outreach for a lead — Apten stops sending messages until the lead is turned back on. Takes an **Apten lead ID** (not a CRM record ID).

### Send Message

Sends a text message to a lead. Fields:

* **Apten lead ID** — the lead to message.
* **Message** — the message body. Besides **/** references to trigger and step data, you can template lead variables with double braces, e.g. `{{firstName}}`. Variables with no value render as `[MISSING VALUE]` in the sent message, so make sure the fields you reference are set.

<img src="https://mintcdn.com/apten/dt2EoaEINXY39JcG/images/automations-send-message.png?fit=max&auto=format&n=dt2EoaEINXY39JcG&q=85&s=3a93ebe32ebc98f7b7c83894be40aaca" alt="Send Message step" width="375" height="756" data-path="images/automations-send-message.png" />

Under **Advanced**:

* **Scheduled time** — send at a future time instead of immediately
* **Send when lead is off** — deliver even if the lead is currently turned off
* **Schedule follow-ups** — have the AI continue following up after this message
* **Override business hours** — send outside the lead's business hours; otherwise delivery waits for the next window

Messages from automations go through the same compliance checks as all Apten outreach — unsubscribed leads and Do Not Contact numbers are never messaged.

### Switch Profile

Moves a lead to a different **Customer profile**. Under **Advanced** you can **Clear memory** (start the conversation fresh) and **Send a message after switch**, optionally with a **Delay before message** in hours or minutes.

<Note>
  Switching profiles always cancels any pending scheduled follow-up for the lead (manually scheduled messages are preserved). **Send a message after switch** is off by default — if you leave it off, no new follow-up is scheduled, so the lead has **no pending outreach** until some other event re-triggers follow-up logic (e.g. the lead replies, or a later step/automation schedules a message). The new profile's follow-up cadence does not start automatically just from the switch. Turn on **Send a message after switch** if you want the new profile to reach out on a delay after the switch.
</Note>

### Add Context

Appends information to a lead for the AI to use. Provide at least one of:

* **Context** — free-text background, e.g. notes from the CRM record
* **Command** — an instruction for the AI, e.g. "Schedule a follow-up for tomorrow at 9am."
* **Custom fields** — key-value data stored on the lead

### Register DNC

Adds a phone number to your organization's Do Not Contact list, blocking all future outreach to it across every lead. A common pattern is to reference the **Phone** output of a Find Lead step.

<Note>
  Registering a number on the DNC list blocks outreach to that number but does not turn the lead off. Pair **Register DNC** with a **Turn Off Lead** step to do both.
</Note>

### Resolve Timezone

Converts location data you already have into a time zone Apten can use — so leads are contacted at the right local hours even when your CRM doesn't store time zones. Provide at least one input; if you set multiple, they're tried in order — **Timezone value → Zip code → Phone → State** — and the first match wins. A value the step doesn't recognize isn't an error; it just falls through to the next input.

* **Timezone value** — a field that already holds time zone information, in any common format: an IANA identifier (`America/New_York`), a Dynamics **Time Zone** field (the numeric codes those fields store bind directly), or a Salesforce/Microsoft time zone label like `(GMT-08:00) Pacific Standard Time (America/Los_Angeles)` or `(UTC-08:00) Pacific Time (US & Canada)`.
* **Zip code** — US zip codes, five-digit or ZIP+4. Leading zeros stripped by numeric CRM fields or spreadsheets are repaired automatically (`2108` is read as `02108`).
* **Phone** — US and Canada numbers; the time zone is inferred from the area code. Toll-free numbers carry no location, so they're skipped.
* **State** — a US state, territory, or Canadian province, as a full name or abbreviation in any casing (`California`, `CA`, `ca`). States spanning two time zones use the zone where most of the state's population lives.

Outputs are **Timezone resolved?** and **Timezone**. The typical shape is Resolve Timezone followed by Create Lead, with the new lead's **Time zone** field referencing the **Timezone** output.

<Note>
  If none of the inputs resolve, later steps still run: a Create Lead step referencing the **Timezone** output simply creates the lead without a time zone, and outreach follows your organization's default hours. A miss never blocks lead creation.
</Note>

<Note>
  Abbreviations like `EST` and bare GMT/UTC offsets are deliberately not recognized — they're ambiguous or unreliable across daylight saving — and fall through to the next input instead.
</Note>

## CRM Actions

### Find CRM Record

Looks up a single record of any object in your connected CRM — for example, the Account behind the Contact that triggered the run, or a lead's next appointment — and exposes its fields to later steps.

* **Object** — the CRM object to search.
* **Search by field** / **Search value** — the record is looked up where this field equals the value; typically an ID or lookup field referencing the trigger record, e.g. `{{trigger.AccountId}}`.
* **Conditions (optional)** — extra conditions the record must meet on top of the search match. Supports [condition groups](/automations/control-steps#condition-groups) for mixed AND/OR logic.
* **If multiple match, pick the record with…** — a tie-breaker: choose a field and **lowest** or **highest** (for example, lowest start date = the soonest upcoming appointment).

The step's outputs are the found record's fields, plus a **Record found?** flag you can filter or branch on.

<Note>
  The CRM is fixed when you add the step (each connected CRM appears as its own entry in the **Add step** dialog, e.g. **Find Salesforce Record**). To target a different CRM, delete the step and add the other variant.
</Note>
