> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # Guides ## Docs - [Control program flow](https://signalwire.com/docs/swml/guides/goto-execute-transfer-disambiguation.md): Learn how to use the goto, execute, and transfer methods in SWML. - [Deploy SWML from web servers](https://signalwire.com/docs/swml/guides/deployment.md): Learn how to serve SWML scripts from web servers and Relay applications. - [Handle incoming calls from code](https://signalwire.com/docs/swml/guides/remote-server.md): Learn how to handle incoming calls from a remote server using SWML. - [Send simple HTTP requests](https://signalwire.com/docs/swml/guides/request.md): Learn how to use the request method in SWML to send HTTP requests to a web server. - [Verify SWML request signatures](https://signalwire.com/docs/swml/guides/webhook-security.md): Verify the HMAC signature SignalWire sends with every request for a SWML document, so your server can reject forged requests. - [Call whisper](https://signalwire.com/docs/swml/guides/call-whisper.md): A guide that shows you how to perform a Call Whisper using SWML. - [Forwarding calls](https://signalwire.com/docs/swml/guides/forward-calls.md): Use SWML to forward calls - [Setting up voicemail](https://signalwire.com/docs/swml/guides/voicemail.md): Set up voicemail on a number using SWML. - [Simple IVR](https://signalwire.com/docs/swml/guides/ivr.md): Learn how to create a simple IVR with SWML. - [SWAIG](https://signalwire.com/docs/swml/guides/swaig.md): The SignalWire AI Gateway connects your AI Agents to functionality on your backend. - [Enable functions dynamically](https://signalwire.com/docs/swml/guides/toggle-functions.md): Learn how to use `toggle_functions` to toggle functions on and off. - [Execute SWML from a function](https://signalwire.com/docs/swml/guides/executing-swml.md): Learn how to execute SWML from a SWAIG function. - [Handle SWAIG function calls inline](https://signalwire.com/docs/swml/guides/data-map.md): Learn how to use `data_map` in SWML SWAIG functions to process, transform, and utilize incoming data effectively. - [Store data outside LLM context](https://signalwire.com/docs/swml/guides/set-meta-data.md): Learn how to use the `set_meta_data` action to store function metadata without exposing it to the LLM. - [Switch AI context mid-call](https://signalwire.com/docs/swml/guides/context-switch.md): Learn how to use `context_switch` to shift the focus of the conversation. > **Note:** This page contains both a page directory (above) and the landing page content (below). The page directory is generated for agent use and does not appear on the landing page. > Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # Quickstart > Deploy your first SWML script in minutes with this step-by-step guide This guide will walk you through deploying your first SWML script to handle incoming calls. By the end of this quickstart, you'll have a working phone number that runs your SWML application. ## Prerequisites Before you begin, make sure you have: * A [SignalWire account](https://signalwire.com/signups/new) * A SWML script ready for deployment ## Deploy your SWML script ### Create new script From your [SignalWire Dashboard](https://my.signalwire.com), click **Script**, then **SWML script**. This will open the New SWML Script dialog box. Paste your SWML Script into the Primary Script field, then select **Create**. If necessary, copy and paste the below example script: #### YAML ```yaml version: 1.0.0 sections: main: - answer: {} - play: url: "say:Hello World!" - play: url: "say:Congratulations on successfully deploying your script!" - hangup: {} ``` #### JSON ```json { "version": "1.0.0", "sections": { "main": [ { "answer": {} }, { "play": { "url": "say:Hello World!" } }, { "play": { "url": "say:Congratulations on successfully deploying your script!" } }, { "hangup": {} } ] } } ``` Your script will be saved in the "My Resources" section under "Scripts". It will remain housed here under the name you provide for easy reference. ### Assign a phone number * Navigate to **Phone Numbers** in your Dashboard. * Purchase a phone number if needed by clicking the "+ New" button in the top right hand corner of the page. * Click on your phone number, then click "Edit Settings". * Click on "+ Assign Resource", then assign your SWML Script. ### Test your application Call your assigned phone number to test your SWML application. #### In the Legacy Dashboard You can write and save new SWML scripts from the "Relay/SWML" section of your Dashboard. In that section, switch to the tab named [SWML Scripts](https://my.signalwire.com/relay-bins). Once there, you can create a new SWML script: On the **New SWML Script** page, enter a name, paste the script into the **SWML** field, and click **Save**. After you save the SWML, navigate to the [Phone Numbers](https://my.signalwire.com/phone_numbers) page. Open the settings for a phone number you own (you may have to buy a new one), and configure it to handle incoming calls using the SWML script you just saved. In **Voice and Fax Settings**, set **Accept Incoming Calls As** to **Voice Calls**, set **Handle Calls Using** to **a SWML Script**, and choose the saved script under **When a Call Comes In**. Enable the external-URL fallback option only if you need a fallback SWML handler. #### Learn about the Legacy Dashboard migration For SignalWire Spaces created before January 2025 Identify your Dashboard and select between Legacy and New UIs using the tabs below. #### New Dashboard The new Dashboard has a unified **My Resources** entry in its left sidebar. The new SignalWire Dashboard features a streamlined sidebar menu. Many items are now located in the unified My Resources menu. Resources that were previously accessible in the sidebar of the legacy UI are now located in the unified **My Resources** menu. #### Legacy Dashboard The legacy Dashboard has no **My Resources** entry; resource types such as **Relay/SWML**, **SIP**, and **cXML/LaML** appear separately in its left sidebar. In the Legacy Dashboard, there is no **My Resources** tab. Instead, Resources are accessible as individual tabs in the main navigational sidebar. To upgrade your Space to the New UI, [contact Support](https://support.signalwire.com/). ## Next steps Now that you've deployed your first SWML script, explore these resources: #### [Methods reference](/docs/swml/reference) Explore all available SWML methods #### [SWML AI guides](/docs/swml/guides) Learn how AI methods are used in SWML #### [Deployment](/docs/swml/guides/deployment) Learn about deploying SWML via your own web server #### [Server SDK quickstart](/docs/server-sdks/guides/quickstart) Get started with the Server SDK