{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-docs/functions/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["partial"]},"type":"markdown"},"seo":{"title":"Developer Documentation","siteUrl":"https://developers.sinch.com","llmstxt":{"title":"Sinch Developer Documentation","description":"LLMs.txt containing a map of all the documentation files for Sinch.","sections":[{"title":"SMS API","description":"The SMS API allows you to send and receive SMS messages with a few easy steps. You can also send bulk SMS messages to multiple customers using the Sinch SMS service.","includeFiles":["docs/sms/**/*.md","docs/sms/**/*.yaml"],"excludeFiles":["docs/sms/index.md"]},{"title":"Numbers API","description":"The Numbers API enables you to search for, view, and activate numbers. It's considered a precursor to other APIs in the Sinch product family. The numbers API can be used in tandem with any of our APIs that perform messaging or calling.","includeFiles":["docs/numbers/**/*.md","docs/numbers/**/*.yaml"],"excludeFiles":["docs/numbers/index.md"]},{"title":"Conversation API","description":"Send and receive messages globally on many popular channels with ease and confidence when using Sinch's Conversation API. Conversation API is the preferred API for sending mobile messages on SMS and other social channels with Sinch. It is a simple API with unified error messages, consistent request payloads, and common webhook payloads that are channel-agnostic.","includeFiles":["docs/conversation/**/*.md","docs/conversation/**/*.yaml"],"excludeFiles":["docs/conversation/index.md"]},{"title":"Voice API","description":"The Voice API works as a big telephony switch. The Voice API handles incoming phone calls (also known as incoming call “legs”), sets up outgoing phone calls (or outgoing call “legs”), and bridges the two. The incoming call leg may come in over a data connection (from a smartphone or web application using the Sinch SDKs) or through a local phone number (from the PSTN network). Similarly, the outgoing call leg can be over data (to another smartphone or web application using the Sinch SDKs) or the PSTN network.","includeFiles":["docs/voice/**/*.md","docs/voice/**/*.yaml"],"excludeFiles":["docs/voice/index.md"]},{"title":"Verification API","description":"The Verification API is a platform for phone number verification. It consists of the API and different software development kits (the Sinch SDKs) that you integrate with your smartphone or web application and cloud based back-end services. Together they enable SMS, Flashcall, Phone Call and Data verification in your application.","includeFiles":["docs/verification/**/*.md","docs/verification/**/*.yaml"],"excludeFiles":["docs/verification/index.md"]},{"title":"Provisioning API","description":"Provisioning API allows you to programmatically set up your senders, accounts and templates on your favorite messaging platforms on the Conversation API. For now, you can create your first WhatsApp channel through Meta's Embedded sign up, you can configure your first SMS App and configure your webhooks. As development continues, we will be adding the most commonly used channels.","includeFiles":["docs/provisioning-api/**/*.md","docs/provisioning-api/**/*.json"],"excludeFiles":["docs/provisioning-api/index.md"]},{"title":"Elastic SIP Trunking API","description":"With Elastic SIP Trunking you can create and manage your SIP trunks and phone numbers programmatically.","includeFiles":["docs/est/**/*.md","docs/est/**/*.yaml"],"excludeFiles":["docs/est/index.md"]},{"title":"Fax API","description":"Send and receive HIPAA compliant faxes on our modern fax platform using our developer-friendly API.","includeFiles":["docs/fax/**/*.md","docs/fax/**/*.yaml"],"excludeFiles":["docs/fax/index.md"]},{"title":"In-app Voice and Video SDK","description":"The In-app Voice and Video SDK enables you to add voice and video calling capabilities directly into your mobile or web application using the Sinch SDKs.","includeFiles":["docs/in-app-calling/**/*.md"],"excludeFiles":["docs/in-app-calling/index.md"]}],"hide":false,"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"svaml","__idx":0},"children":["SVAML"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["SVAML"]}," (Sinch Voice Application Markup Language) is the JSON format you return from voice callbacks to tell Sinch what to do with a call. \"Say this message.\" \"Run this menu.\" \"Connect to this number.\" \"Record the call.\" \"Hang up.\""]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You almost never write raw SVAML. Both runtimes ship fluent builders that produce the JSON for you, and your IDE autocompletes every action. This page explains what SVAML is, how the builders work, and when to care about the underlying JSON."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"what-svaml-looks-like","__idx":1},"children":["What SVAML looks like"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A SVAML response is a JSON object with an ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["action"]}," field and optional ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["instructions"]},". A minimal example:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"instructions\": [\n    { \"name\": \"say\", \"text\": \"Welcome to Acme Corp.\" }\n  ],\n  \"action\": {\n    \"name\": \"connectPstn\",\n    \"number\": \"+15551234567\"\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Instructions"]}," are things to do before the action — play audio, say a message, set a parameter. ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["The action"]}," is the main thing the platform does — run a menu, connect a call, record, hang up."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You never need to remember this structure. The builders hide it."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"builders-in-nodejs","__idx":2},"children":["Builders in Node.js"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"import { IceSvamlBuilder, MenuTemplates } from '@sinch/functions-runtime';\n\nreturn new IceSvamlBuilder()\n  .say('Welcome to Acme Corp.')\n  .runMenu(MenuTemplates.business('Acme Corp'))\n  .build();\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["There are three builders matching the three callbacks that return SVAML:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Builder"},"children":["Builder"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Used in"},"children":["Used in"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["IceSvamlBuilder"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ice"]}," handler — the full set of voice actions"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PieSvamlBuilder"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pie"]}," handler — same actions as ICE except ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["answer"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AceSvamlBuilder"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ace"]}," handler — only ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["continue()"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hangup()"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"builders-in-c","__idx":3},"children":["Builders in C#"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["C# uses ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["IceSvamletBuilder"]}," / ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PieSvamletBuilder"]}," / ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AceSvamletBuilder"]},". The naming quirk is historical — \"SVAMLet\" was an older name for a single SVAML document."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"csharp","header":{"controls":{"copy":{}}},"source":"using SinchFunctions.Utils;\n\nreturn Ok(new IceSvamletBuilder()\n    .Instructions.Say(\"Welcome to Acme Corp.\")\n    .Action.RunMenu(MenuTemplates.Business(\"Acme Corp\"))\n    .Build());\n","lang":"csharp"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["C# builders split instructions from the action using ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".Instructions"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".Action"]}," accessors. The Node builder flattens both onto the same chain because TypeScript does not need the separation."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"the-most-common-actions","__idx":4},"children":["The most common actions"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You will use a handful of actions over and over. Here they are with Node snippets — see the ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/functions/reference/svaml-cheatsheet"},"children":["SVAML cheat sheet"]}," for the C# mirror and the full list."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"// Speak text to the caller (text-to-speech)\n.say('Welcome to Acme Corp.')\n\n// Play an audio file (from assets/ or a URL)\n.play('assets/greeting.wav')\n\n// Connect the call to a phone number\n.connectPstn('+15551234567', { cli: '+15559876543' })\n\n// Run an interactive menu\n.runMenu({ prompt: 'Press 1 for sales, 2 for support', options: [...] })\n\n// Record the call\n.startRecording({ destinationUrl: 'https://...' })\n\n// Hang up\n.hangup()\n\n// Bridge to a WebSocket for streaming audio\n.connectStream('wss://your-function.fn.sinch.com/stream')\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"menubuilder","__idx":5},"children":["MenuBuilder"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Menus are their own little sub-language. Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["createMenu()"]}," or one of the pre-built ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["MenuTemplates"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"import { createMenu, MenuTemplates } from '@sinch/functions-runtime';\n\n// Pre-built\n.runMenu(MenuTemplates.business('Acme Corp'))\n\n// Custom\nconst menu = createMenu()\n  .prompt('Press 1 for sales, press 2 for support.')\n  .option('1', 'return(sales)')\n  .option('2', 'return(support)')\n  .timeout(5000)\n  .maxDigits(1)\n  .build();\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Available templates: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["business"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["yesNo"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["language"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["afterHours"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["recordingConsent"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["numericInput"]}," (Node); C# adds ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CallbackRequest"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CustomerService"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SatisfactionSurvey"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When a menu completes, Sinch fires a PIE callback with the result — see ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"#"},"children":["voice callbacks"]}," for how to handle it."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"when-to-care-about-the-raw-json","__idx":6},"children":["When to care about the raw JSON"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Almost never. The builders cover every documented action and are versioned alongside the Sinch voice API. The one case where you might look at raw SVAML is when debugging — Sinch logs the exact JSON your function returned, and recognizing the shape is useful."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you need an action that is not on a builder yet, you can still emit raw SVAML by returning a plain object that matches the schema. Prefer filing a runtime issue though — it usually means the builder is missing coverage."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"full-specification","__idx":7},"children":["Full specification"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The authoritative specification of every SVAML action, every parameter, and every edge case lives on the Sinch developer portal:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/voice/api-reference/svaml/"},"children":["developers.sinch.com/docs/voice/api-reference/svaml"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Treat our docs as \"how to use SVAML from the runtime\" and the Sinch spec as \"what SVAML actually contains.\""]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"related","__idx":8},"children":["Related"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/functions/reference/svaml-cheatsheet"},"children":["SVAML cheat sheet"]}," — quick reference for the most-used actions in both runtimes"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"#"},"children":["Voice callbacks"]}," — which callbacks return SVAML and when"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"#"},"children":["Build an IVR guide"]}," — end-to-end example using menus and PIE"]}]}]},"headings":[{"value":"SVAML","id":"svaml","depth":1},{"value":"What SVAML looks like","id":"what-svaml-looks-like","depth":2},{"value":"Builders in Node.js","id":"builders-in-nodejs","depth":2},{"value":"Builders in C#","id":"builders-in-c","depth":2},{"value":"The most common actions","id":"the-most-common-actions","depth":2},{"value":"MenuBuilder","id":"menubuilder","depth":2},{"value":"When to care about the raw JSON","id":"when-to-care-about-the-raw-json","depth":2},{"value":"Full specification","id":"full-specification","depth":2},{"value":"Related","id":"related","depth":2}],"frontmatter":{"seo":{"title":""}},"lastModified":"2026-04-15T14:23:23.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/functions/concepts/svaml","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}