SWML (SignalWire Markup Language)
SWML (SignalWire Markup Language)
SWML (SignalWire Markup Language)
SWML (SignalWire Markup Language) is a document that instructs SignalWire how to handle a phone call. SWML can be written in JSON or YAML format — this guide uses JSON throughout. When a call comes in, SignalWire requests SWML from your agent, then executes the instructions.

Every SWML document has this structure:
Key parts:
version: Always "1.0.0"sections: Contains named sections (usually just main)Here’s what your agent generates:
ai Verb in DetailThe ai verb is the heart of voice AI agents. Here’s what each part does:
The AI’s system prompt — its personality and instructions:
Or using POM (Prompt Object Model):
Defines functions the AI can call:
Words that help speech recognition accuracy:
Voice and language configuration:
AI behavior settings:
You don’t write SWML by hand. Your agent configuration becomes SWML automatically. Each SDK method maps to a section of the SWML document:
The above examples all produce identical SWML output. See the Architecture section for the full API comparison table.
When SignalWire requests SWML, the agent’s render method (_render_swml() in Python, renderSwml() in TypeScript):

You can see the SWML your agent generates:
The SDK validates SWML against the official schema:
signalwire/core/schema.jsonWhen a SWAIG function returns a transfer action, the SWML for transfer is embedded in the response:
Now that you understand SWML structure, let’s look at SWAIG — how AI calls your functions.