SWML Scripts
About
The SWML Resource type is used to create and manage SWML scripts. SWML allows you to write Relay applications using simple statements in a YAML or JSON document.

The Resource selection menu
Details
A SWML Script Resource has the following details:
- Hosted Scripts
- External URL
| Detail | Description |
|---|---|
NameOptional | The unique name for the SWML script resource. |
Handle usingOptional | Hosted Script is SWML script that will be hosted on SignalWire. |
Primary ScriptOptional | This is the main SWML script that will run when controlling a call or message. |
Status Change WebhookOptional | As a call or message progresses through the various states of its lifecycle, you can receive updates to your own application. Enter a URL to receive a JSON event when the status of a call or message changes. |
| Detail | Description |
|---|---|
NameOptional | The unique name for the SWML script resource. |
Handle usingOptional | External URL indicates the SWML script lives on a remote server. |
Primary script URLRequired | The URL that will respond with a valid SWML script that will run when controlling a call or message. |
Fallback script URLOptional | If the primary script cannot be reached or fails in any way, you can define a fallback script to handle the call or message. Defining a fallback ensures calls and messages are still handled even if your application experiences an issue. |
Status Change WebhookOptional | As a call or message progresses through the various states of its lifecycle, you can receive updates to your own application. Enter a URL to receive a JSON event when the status of a call or message changes. |

Creating a SWML Script Resource
Learn more
For more information on SWML, please refer to the SWML documentation.