> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# add_verb_to_section

> Add a SWML verb to a specific named section of the document.

Add a verb to a specific named section of the SWML document. If the section does not
exist, it is created automatically before the verb is appended. Raises
`SchemaValidationError` if validation is enabled and the verb config is invalid.

## **Parameters**

**`section_name`** `str` — required

Name of the section to add the verb to (e.g., `"main"`, `"transfer_flow"`).

---

**`verb_name`** `str` — required

The SWML verb name.

---

**`config`** `dict[str, Any] | int` — required

Configuration dictionary for the verb, or a direct `int` for the `sleep` verb.

---

## **Returns**

`bool` — `True` if the verb was added successfully, `False` if the config type was
invalid (non-dict for non-sleep verbs).

## **Example**

```python {10}
from signalwire import SWMLService

service = SWMLService(name="transfer-flow")

# Build the main section
service.add_verb("answer", {})
service.add_verb("ai", {"prompt": {"text": "You are a helpful assistant"}})

# Build a separate transfer section
service.add_verb_to_section("transfer", "connect", {
    "to": "+15551234567",
    "from": "+15559876543"
})

print(service.render_document())
```