***

title: addVerb
slug: /reference/typescript/agents/swml-builder/add-verb
description: Append a verb to the main section of the SWML document.
max-toc-depth: 3
---------------------

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

Append a verb to the `main` section of the SWML document. Validates the verb config
against the bundled schema when validation is enabled.

## **Parameters**

<ParamField path="verbName" type="string" required={true} toc={true}>
  The SWML verb name (e.g., `"answer"`, `"ai"`, `"play"`, `"hangup"`).
</ParamField>

<ParamField path="config" type="unknown" required={true} toc={true}>
  The verb's configuration payload. Most verbs accept an object of parameters.
  The `sleep` verb accepts a number (duration in milliseconds).
</ParamField>

## **Returns**

`void` -- Throws an `Error` if the verb fails schema validation (when validation
is enabled and the verb is defined in the schema).

## **Example**

```typescript {4}
import { SwmlBuilder } from '@signalwire/sdk';

const builder = new SwmlBuilder();
builder.addVerb('answer', {});
builder.addVerb('play', { url: 'https://example.com/greeting.mp3' });
builder.addVerb('hangup', {});

console.log(builder.renderDocument());
```