{"items":[{"type":"link","label":"Voice Relay Web-Socket","link":"/docs/voice-2.0/api-reference/voice-relay","routeSlug":"/docs/voice-2.0/api-reference/voice-relay","content":{"contentType":"overview","children":[{"nodeType":"container","panels":[{"title":"Download AsyncAPI description","titleTranslationKey":"download.description.title","children":[{"kind":"download","label":"voice-relay.json","url":"/_bundle/docs/voice-2.0/api-reference/voice-relay.json?download"},{"kind":"download","label":"voice-relay.yaml","url":"/_bundle/docs/voice-2.0/api-reference/voice-relay.yaml?download"}]},{"title":"Overview","titleTranslationKey":"info.title","children":[]}],"children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"header","showPageActions":true,"level":1,"label":"Voice Relay Web-Socket 1.0.1"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":"Enables real-time voice-to-text and text-to-speech communication between the Sinch platform and customer endpoints. \nThe Voice Relay service transcribes incoming audio to text, relays it to your AI chatbot or agent system for processing, \nand synthesizes text responses back into audio for playback on active voice channels."}],"sectionId":"/docs/voice-2.0/api-reference/voice-relay"}],"sectionId":"/docs/voice-2.0/api-reference/voice-relay"}]}]}},{"label":"outboundStream","type":"group","link":"/docs/voice-2.0/api-reference/voice-relay/channels/outboundstream","routeSlug":"/docs/voice-2.0/api-reference/voice-relay/channels/outboundstream","httpVerb":"channel","badges":[],"metadata":{"seo":{"title":"outboundStream"}},"content":{"contentType":"item","itemVariant":"channel","meta":{"name":"outboundStream","pointer":"/channels/outboundStream","protocolTag":{"label":"Channel","color":"channel"}},"seo":{"title":"outboundStream"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"outboundStream","showPageActions":true,"protocolTag":{"label":"Channel","color":"channel"}}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Messages","labelTranslationKey":"messages","deepLinkSuffix":"messages"},{"nodeType":"item-content","variant":"messages","messages":[{"name":"ConnectRequest","label":"ConnectRequest","schemaId":"components/messages/ConnectRequest/payload","payload":{"$ref":"#/components/schemas/ConnectRequestPayload"},"payloadLabel":"Payload"},{"name":"AnswerResponse","label":"AnswerResponse","schemaId":"components/messages/AnswerResponse/payload","payload":{"$ref":"#/components/schemas/AnswerResponsePayload"},"payloadLabel":"Payload"},{"name":"TextMessage","label":"TextMessage","schemaId":"components/messages/TextMessage/payload","payload":{"$ref":"#/components/schemas/TextMessagePayload"},"payloadLabel":"Payload"},{"name":"TextResponseMessage","label":"TextResponseMessage","schemaId":"components/messages/TextResponseMessage/payload","payload":{"$ref":"#/components/schemas/TextResponseMessagePayload"},"payloadLabel":"Payload"},{"name":"InterruptDetect","label":"InterruptDetect","schemaId":"components/messages/InterruptDetect/payload","payload":{"$ref":"#/components/schemas/InterruptDetectPayload"},"payloadLabel":"Payload"},{"name":"Interrupt","label":"Interrupt","schemaId":"components/messages/Interrupt/payload","payload":{"$ref":"#/components/schemas/InterruptPayload"},"payloadLabel":"Payload"},{"name":"DtmfReceive","label":"DtmfReceive","schemaId":"components/messages/DtmfReceive/payload","payload":{"$ref":"#/components/schemas/DtmfReceivePayload"},"payloadLabel":"Payload"},{"name":"DtmfSend","label":"DtmfSend","schemaId":"components/messages/DtmfSend/payload","payload":{"$ref":"#/components/schemas/DtmfSendPayload"},"payloadLabel":"Payload"},{"name":"PlaybackEvent","label":"PlaybackEvent","schemaId":"components/messages/PlaybackEvent/payload","payload":{"$ref":"#/components/schemas/TextPlaybackEventPayload"},"payloadLabel":"Payload"}],"pointer":"channels/outboundStream/messages"}],"panels":[{"children":[{"kind":"payload","panelLabel":"Payload","schemaId":"components/messages/ConnectRequest/payload","examples":[],"messagesByKey":{"ConnectRequest":{"schemaId":"components/messages/ConnectRequest/payload"},"AnswerResponse":{"schemaId":"components/messages/AnswerResponse/payload"},"TextMessage":{"schemaId":"components/messages/TextMessage/payload"},"TextResponseMessage":{"schemaId":"components/messages/TextResponseMessage/payload"},"InterruptDetect":{"schemaId":"components/messages/InterruptDetect/payload"},"Interrupt":{"schemaId":"components/messages/Interrupt/payload"},"DtmfReceive":{"schemaId":"components/messages/DtmfReceive/payload"},"DtmfSend":{"schemaId":"components/messages/DtmfSend/payload"},"PlaybackEvent":{"schemaId":"components/messages/PlaybackEvent/payload"}}}]}]}]},"items":[{"label":"Connection initiated from the Sinch Platform","type":"link","link":"/docs/voice-2.0/api-reference/voice-relay/channels/outboundstream/operations/connect","routeSlug":"/docs/voice-2.0/api-reference/voice-relay/channels/outboundstream/operations/connect","httpVerb":"send","badges":[],"metadata":{"seo":{"title":"Connection initiated from the Sinch Platform","description":"This is the first message sent from the Sinch platform for all outgoing stream connections. This message carries information about the call, including call headers, the Call-ID, Service-ID, etc. Based on the information that this command carries, the customer can make a decision if the request should be accepted or not."}},"content":{"contentType":"item","itemVariant":"channelOperation","meta":{"name":"Connection initiated from the Sinch Platform","pointer":"/operations/connect","protocolTag":{"label":"Send","color":"send"},"action":"send","actionLabel":"Send"},"seo":{"title":"Connection initiated from the Sinch Platform","description":"This is the first message sent from the Sinch platform for all outgoing stream connections. This message carries information about the call, including call headers, the Call-ID, Service-ID, etc. Based on the information that this command carries, the customer can make a decision if the request should be accepted or not."},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Send"},{"nodeType":"header","level":5,"label":"Connection initiated from the Sinch Platform","badges":[],"showPageActions":true,"protocolTag":{"label":"Send","color":"send"}},{"nodeType":"markdoc","content":"Connection initiated from the Sinch Platform"},{"nodeType":"markdoc","content":"This is the first message sent from the Sinch platform for all outgoing stream connections. This message carries information about the call, including call headers, the Call-ID, Service-ID, etc. Based on the information that this command carries, the customer can make a decision if the request should be accepted or not."},{"nodeType":"message-links","channelLink":"/channels/outboundstream","messages":[{"name":"ConnectRequest","label":"ConnectRequest"}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/channels/outboundstream/operations/connect"}],"panels":[]}],"showDivider":true}},{"label":"Sinch sends the transcribed text from the audio channel to the server","type":"link","link":"/docs/voice-2.0/api-reference/voice-relay/channels/outboundstream/operations/text","routeSlug":"/docs/voice-2.0/api-reference/voice-relay/channels/outboundstream/operations/text","httpVerb":"send","badges":[],"metadata":{"seo":{"title":"Sinch sends the transcribed text from the audio channel to the server","description":"Speech from incoming audio channel is transcribed and the text is sent to the server."}},"content":{"contentType":"item","itemVariant":"channelOperation","meta":{"name":"Sinch sends the transcribed text from the audio channel to the server","pointer":"/operations/text","protocolTag":{"label":"Send","color":"send"},"action":"send","actionLabel":"Send"},"seo":{"title":"Sinch sends the transcribed text from the audio channel to the server","description":"Speech from incoming audio channel is transcribed and the text is sent to the server."},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":5,"label":"Sinch sends the transcribed text from the audio channel to the server","badges":[],"showPageActions":true,"protocolTag":{"label":"Send","color":"send"}},{"nodeType":"markdoc","content":"Sinch sends the transcribed text from the audio channel to the server"},{"nodeType":"markdoc","content":"Speech from incoming audio channel is transcribed and the text is sent to the server."},{"nodeType":"message-links","channelLink":"/channels/outboundstream","messages":[{"name":"TextMessage","label":"TextMessage"}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/channels/outboundstream/operations/text"}],"panels":[]}],"showDivider":true}},{"label":"TTS interruption due to detected speech","type":"link","link":"/docs/voice-2.0/api-reference/voice-relay/channels/outboundstream/operations/interruptdetect","routeSlug":"/docs/voice-2.0/api-reference/voice-relay/channels/outboundstream/operations/interruptdetect","httpVerb":"send","badges":[],"metadata":{"seo":{"title":"TTS interruption due to detected speech","description":"Speech detected while TTS is played on the audio channel."}},"content":{"contentType":"item","itemVariant":"channelOperation","meta":{"name":"TTS interruption due to detected speech","pointer":"/operations/interruptDetect","protocolTag":{"label":"Send","color":"send"},"action":"send","actionLabel":"Send"},"seo":{"title":"TTS interruption due to detected speech","description":"Speech detected while TTS is played on the audio channel."},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":5,"label":"TTS interruption due to detected speech","badges":[],"showPageActions":true,"protocolTag":{"label":"Send","color":"send"}},{"nodeType":"markdoc","content":"TTS interruption due to detected speech"},{"nodeType":"markdoc","content":"Speech detected while TTS is played on the audio channel."},{"nodeType":"message-links","channelLink":"/channels/outboundstream","messages":[{"name":"InterruptDetect","label":"InterruptDetect"}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/channels/outboundstream/operations/interruptdetect"}],"panels":[]}],"showDivider":true}},{"label":"DTMF received","type":"link","link":"/docs/voice-2.0/api-reference/voice-relay/channels/outboundstream/operations/dtmfreceived","routeSlug":"/docs/voice-2.0/api-reference/voice-relay/channels/outboundstream/operations/dtmfreceived","httpVerb":"send","badges":[],"metadata":{"seo":{"title":"DTMF received","description":"A DTMF tone or sequence was received."}},"content":{"contentType":"item","itemVariant":"channelOperation","meta":{"name":"DTMF received","pointer":"/operations/dtmfReceived","protocolTag":{"label":"Send","color":"send"},"action":"send","actionLabel":"Send"},"seo":{"title":"DTMF received","description":"A DTMF tone or sequence was received."},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":5,"label":"DTMF received","badges":[],"showPageActions":true,"protocolTag":{"label":"Send","color":"send"}},{"nodeType":"markdoc","content":"DTMF received"},{"nodeType":"markdoc","content":"A DTMF tone or sequence was received."},{"nodeType":"message-links","channelLink":"/channels/outboundstream","messages":[{"name":"DtmfReceive","label":"DtmfReceive"}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/channels/outboundstream/operations/dtmfreceived"}],"panels":[]}],"showDivider":true}},{"label":"Sinch platform reports the playback status of a TTS batch.","type":"link","link":"/docs/voice-2.0/api-reference/voice-relay/channels/outboundstream/operations/playbackevent","routeSlug":"/docs/voice-2.0/api-reference/voice-relay/channels/outboundstream/operations/playbackevent","httpVerb":"send","badges":[],"metadata":{"seo":{"title":"Sinch platform reports the playback status of a TTS batch.","description":"Sent from the Sinch platform to the server when the playback status of a TTS batch changes on the active voice channel."}},"content":{"contentType":"item","itemVariant":"channelOperation","meta":{"name":"Sinch platform reports the playback status of a TTS batch.","pointer":"/operations/playbackEvent","protocolTag":{"label":"Send","color":"send"},"action":"send","actionLabel":"Send"},"seo":{"title":"Sinch platform reports the playback status of a TTS batch.","description":"Sent from the Sinch platform to the server when the playback status of a TTS batch changes on the active voice channel."},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":5,"label":"Sinch platform reports the playback status of a TTS batch.","badges":[],"showPageActions":true,"protocolTag":{"label":"Send","color":"send"}},{"nodeType":"markdoc","content":"Sinch platform reports the playback status of a TTS batch."},{"nodeType":"markdoc","content":"Sent from the Sinch platform to the server when the playback status of a TTS batch changes on the active voice channel."},{"nodeType":"message-links","channelLink":"/channels/outboundstream","messages":[{"name":"PlaybackEvent","label":"PlaybackEvent"}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/channels/outboundstream/operations/playbackevent"}],"panels":[]}],"showDivider":true}},{"label":"Server accepts the connection","type":"link","link":"/docs/voice-2.0/api-reference/voice-relay/channels/outboundstream/operations/answer","routeSlug":"/docs/voice-2.0/api-reference/voice-relay/channels/outboundstream/operations/answer","httpVerb":"receive","badges":[],"metadata":{"seo":{"title":"Server accepts the connection","description":"Server response accepting the connection. Send this acknowledgment before the platform starts streaming transcription results or processing text-to-speech messages."}},"content":{"contentType":"item","itemVariant":"channelOperation","meta":{"name":"Server accepts the connection","pointer":"/operations/answer","protocolTag":{"label":"Receive","color":"receive"},"action":"receive","actionLabel":"Receive"},"seo":{"title":"Server accepts the connection","description":"Server response accepting the connection. \nSend this acknowledgment before the platform starts streaming transcription results or processing text-to-speech messages."},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Receive"},{"nodeType":"header","level":5,"label":"Server accepts the connection","badges":[],"showPageActions":true,"protocolTag":{"label":"Receive","color":"receive"}},{"nodeType":"markdoc","content":"Server accepts the connection"},{"nodeType":"markdoc","content":"Server response accepting the connection. \nSend this acknowledgment before the platform starts streaming transcription results or processing text-to-speech messages."},{"nodeType":"message-links","channelLink":"/channels/outboundstream","messages":[{"name":"AnswerResponse","label":"AnswerResponse"}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/channels/outboundstream/operations/answer"}],"panels":[]}],"showDivider":true}},{"label":"Server sends a text message to be synthesized and played on the active voice channel.","type":"link","link":"/docs/voice-2.0/api-reference/voice-relay/channels/outboundstream/operations/textresponse","routeSlug":"/docs/voice-2.0/api-reference/voice-relay/channels/outboundstream/operations/textresponse","httpVerb":"receive","badges":[],"metadata":{"seo":{"title":"Server sends a text message to be synthesized and played on the active voice channel.","description":"Sent from the server to the Sinch platform to synthesize text into speech and play it on the active voice channel."}},"content":{"contentType":"item","itemVariant":"channelOperation","meta":{"name":"Server sends a text message to be synthesized and played on the active voice channel.","pointer":"/operations/textResponse","protocolTag":{"label":"Receive","color":"receive"},"action":"receive","actionLabel":"Receive"},"seo":{"title":"Server sends a text message to be synthesized and played on the active voice channel.","description":"Sent from the server to the Sinch platform to synthesize text into speech and play it\non the active voice channel."},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":5,"label":"Server sends a text message to be synthesized and played on the active voice channel.","badges":[],"showPageActions":true,"protocolTag":{"label":"Receive","color":"receive"}},{"nodeType":"markdoc","content":"Server sends a text message to be synthesized and played on the active voice channel."},{"nodeType":"markdoc","content":"Sent from the server to the Sinch platform to synthesize text into speech and play it\non the active voice channel."},{"nodeType":"message-links","channelLink":"/channels/outboundstream","messages":[{"name":"TextResponseMessage","label":"TextResponseMessage"}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/channels/outboundstream/operations/textresponse"}],"panels":[]}],"showDivider":true}},{"label":"Stop TTS playback and clear buffers","type":"link","link":"/docs/voice-2.0/api-reference/voice-relay/channels/outboundstream/operations/interrupt","routeSlug":"/docs/voice-2.0/api-reference/voice-relay/channels/outboundstream/operations/interrupt","httpVerb":"receive","badges":[],"metadata":{"seo":{"title":"Stop TTS playback and clear buffers","description":"Active TTS playback will be interrupted on the audio channel."}},"content":{"contentType":"item","itemVariant":"channelOperation","meta":{"name":"Stop TTS playback and clear buffers","pointer":"/operations/interrupt","protocolTag":{"label":"Receive","color":"receive"},"action":"receive","actionLabel":"Receive"},"seo":{"title":"Stop TTS playback and clear buffers","description":"Active TTS playback will be interrupted on the audio channel."},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":5,"label":"Stop TTS playback and clear buffers","badges":[],"showPageActions":true,"protocolTag":{"label":"Receive","color":"receive"}},{"nodeType":"markdoc","content":"Stop TTS playback and clear buffers"},{"nodeType":"markdoc","content":"Active TTS playback will be interrupted on the audio channel."},{"nodeType":"message-links","channelLink":"/channels/outboundstream","messages":[{"name":"Interrupt","label":"Interrupt"}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/channels/outboundstream/operations/interrupt"}],"panels":[]}],"showDivider":true}},{"label":"Send DTMF tone or sequence.","type":"link","link":"/docs/voice-2.0/api-reference/voice-relay/channels/outboundstream/operations/dtmfsend","routeSlug":"/docs/voice-2.0/api-reference/voice-relay/channels/outboundstream/operations/dtmfsend","httpVerb":"receive","badges":[],"metadata":{"seo":{"title":"Send DTMF tone or sequence.","description":"Sends a single DTMF tone or a sequence or tones over the audio channel."}},"content":{"contentType":"item","itemVariant":"channelOperation","meta":{"name":"Send DTMF tone or sequence.","pointer":"/operations/dtmfSend","protocolTag":{"label":"Receive","color":"receive"},"action":"receive","actionLabel":"Receive"},"seo":{"title":"Send DTMF tone or sequence.","description":"Sends a single DTMF tone or a sequence or tones over the audio channel."},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":5,"label":"Send DTMF tone or sequence.","badges":[],"showPageActions":true,"protocolTag":{"label":"Receive","color":"receive"}},{"nodeType":"markdoc","content":"Send DTMF tone or sequence."},{"nodeType":"markdoc","content":"Sends a single DTMF tone or a sequence or tones over the audio channel."},{"nodeType":"message-links","channelLink":"/channels/outboundstream","messages":[{"name":"DtmfSend","label":"DtmfSend"}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/channels/outboundstream/operations/dtmfsend"}],"panels":[]}],"showDivider":false}}]}],"store":{"schemaStore":{"components/schemas/ConnectRequestPayload":{"id":"components/schemas/ConnectRequestPayload","kind":"json-schema","title":"ConnectRequestPayload","data":{"type":"object","additionalProperties":false,"description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Connection request message sent from the Sinch platform to establish a Voice Relay WebSocket session."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Contains session metadata including call identification, language settings, and TTS configuration."},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The server must respond with an "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"answer"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" command to proceed, or disconnect to decline the connection."},"children":[]}]}]}],"required":["command","version","callId","serviceId","sttLanguage","ttsVoice","interruptionsEnabled","callHeaders"],"properties":{"command":{"type":"string","const":"connect","description":"Connect message"},"version":{"type":"integer","const":1,"description":"Protocol version"},"callId":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$","description":"Unique Call ID"},"serviceId":{"type":"string","format":"uuid","description":"Service Unique ID"},"sttLanguage":{"type":"string","description":"BCP-47 language tag used for speech-to-text transcription of the inbound audio.\n\nThis is the language set in the SVAML command when the voice relay session was initiated.","example":"en-US"},"ttsVoice":{"type":"string","description":"Name of the default voice that will be used when synthesizing speech.\n\nThis is the TTS voice name set in the SVAML command when the voice relay session was initiated."},"interruptionsEnabled":{"type":"boolean","description":"Indicates if automatic interruption on detected speech is enabled for this session."},"callHeaders":{"type":"object","description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Arbitrary key/value pairs (header name -> header value)."},"children":[]}]}]}],"additionalProperties":{"type":"string"}}},"example":{"command":"connect","version":1,"callId":"01KHKF468K4P1T3CZ4XJ1NYVN3","serviceId":"5c90f98a-5002-4f8a-9b02-c1cb552bed95","sttLanguage":"en-US","ttsVoice":"Joanna","interruptionsEnabled":true,"callHeaders":{"key1":"value1","key2":"value2"}}}},"components/schemas/AnswerResponsePayload":{"id":"components/schemas/AnswerResponsePayload","kind":"json-schema","title":"AnswerResponsePayload","data":{"type":"object","additionalProperties":false,"description":"Server response accepting the connection. \n\nMust be sent before the platform begins streaming transcribed text and processing text-to-speech messages.","required":["command"],"properties":{"command":{"type":"string","const":"answer"}}}},"components/schemas/TextMessagePayload":{"id":"components/schemas/TextMessagePayload","kind":"json-schema","title":"TextMessagePayload","data":{"type":"object","additionalProperties":false,"description":"Message sent from the Sinch platform to the server when incoming audio is detected and successfully transcribed to text.\n\nContains the transcribed text, language tag, and a flag indicating whether this message corrects a previous transcription.","required":["command","text","sttLanguage","isCorrection"],"properties":{"command":{"type":"string","const":"text"},"text":{"type":"string","description":"Transcribed text from the voice channel. This is the speech-to-text output of the incoming audio."},"sttLanguage":{"type":"string","description":"BCP-47 language tag used for speech-to-text transcription of the inbound audio."},"isCorrection":{"type":"boolean","description":"Indicates whether this message corrects a previous transcription. \n\nThis occurs when additional speech is detected after a pause, refining the earlier transcription result."}},"example":{"command":"text","text":"Hello there, can you help me with this task?","sttLanguage":"en-US","isCorrection":false}}},"components/schemas/TextResponseMessagePayload":{"id":"components/schemas/TextResponseMessagePayload","kind":"json-schema","title":"TextResponseMessagePayload","data":{"type":"object","additionalProperties":false,"description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Command sent from the server to the Sinch platform to synthesize text into speech"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"and play it on the active voice channel."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Text can be streamed in chunks by sending multiple messages in sequence. Set "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"isLast"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"to "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"false"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" on intermediate messages, and "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"true"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" on the final message to signal the end"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"of the batch and trigger an audio flush."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The TTS voice is determined by the first message in a batch. Any "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"ttsVoice"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" value on"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"subsequent messages in the same batch is ignored. If "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"ttsVoice"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" is omitted, the default"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"voice configured when the session was initiated is used."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Even when "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"isInterruptible"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" is "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"false"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", playback can still be stopped by explicitly"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"sending an "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"interrupt"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" command over the WebSocket."},"children":[]}]}]}],"required":["command","text","isLast"],"properties":{"command":{"type":"string","const":"text"},"text":{"type":"string","description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Plain text or SSML to synthesize and play on the active voice channel."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"When streaming, send this field in multiple messages with "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"isLast: false"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" until"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"the final chunk, which must have "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"isLast: true"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"When using SSML, tags must not span across message boundaries within a batch."},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Each chunk must be independently valid XML if SSML is used."},"children":[]}]}]}]},"format":{"type":"string","enum":["TEXT","SSML"],"default":"TEXT","x-enumDescriptions":{"TEXT":"Plain text format for synthesis","SSML":"XML-based Speech Synthesis Markup Language for advanced control over prosody, phonemes, and audio effects"}},"ttsVoice":{"type":"string","description":"Name of the TTS voice to use for this batch.\n\nOnly the value from the first message in a batch takes effect; this field is ignored\non subsequent messages in the same batch. If omitted, the default voice configured\nwhen the session was initiated is used."},"isLast":{"type":"boolean","description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Indicates whether this is the final message in the current TTS batch."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Set to "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"false"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" on all intermediate chunks and "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"true"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" on the last chunk to signal"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"the end of the batch and trigger an audio flush. The next message with "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"isLast: false"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"begins a new batch."},"children":[]}]}]}]},"isInterruptible":{"type":"boolean","description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Controls whether speech detected on the voice channel can automatically interrupt"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"this TTS batch."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Overrides the "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"enableInterruptions"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" setting from the session for this batch only."},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Even when set to "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"false"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", playback can still be stopped by explicitly sending an"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"interrupt"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" command over the WebSocket. Defaults to "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"true"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" when not specified."},"children":[]}]}]}]}},"example":{"command":"text","text":"This is a test message","ttsVoice":"Emma","isLast":true,"isInterruptible":true}}},"components/schemas/InterruptDetectPayload":{"id":"components/schemas/InterruptDetectPayload","kind":"json-schema","title":"InterruptDetectPayload","data":{"type":"object","additionalProperties":false,"description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Sent from the Sinch platform when speech is detected during text-to-speech playback."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"If the TTS message is marked as interruptible, playback stops automatically."},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Uninterruptible messages continue playing but can be manually interrupted using an "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"interrupt"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" command."},"children":[]}]}]}],"required":["command","reason"],"properties":{"command":{"type":"string","const":"interrupt"},"reason":{"type":"string","enum":["speech-detected"],"description":"The reason that triggered the interrupt message.","x-enumDescriptions":{"speech-detected":"Indicates that the interrupt signal was triggered by the detection of active speech \non the voice channel. This typically occurs when the system detects audio input that \nexceeds the speech activity threshold, signaling potential user input."}}},"example":{"command":"interrupt","reason":"speech-detected"}}},"components/schemas/InterruptPayload":{"id":"components/schemas/InterruptPayload","kind":"json-schema","title":"InterruptPayload","data":{"type":"object","additionalProperties":false,"description":"Command sent from the server to the Sinch platform to interrupt text-to-speech playback.\n\nStops any ongoing TTS message batch immediately, regardless of whether the batch is marked as interruptible.\nUse this to allow manual interruption of non-interruptible messages or to cancel playback on demand.","required":["command"],"properties":{"command":{"type":"string","const":"interrupt"}},"example":{"command":"interrupt"}}},"components/schemas/DtmfReceivePayload":{"id":"components/schemas/DtmfReceivePayload","kind":"json-schema","title":"DtmfReceivePayload","data":{"type":"object","additionalProperties":false,"description":"Message sent from the Sinch platform when DTMF tones are detected on the voice channel.\n\nContains the sequence of DTMF digits received during the active call.","required":["command","sequence"],"properties":{"command":{"type":"string","const":"dtmf"},"sequence":{"type":"string","description":"A single or multiple DTMF tones."}},"example":{"command":"dtmf","sequence":"123"}}},"components/schemas/DtmfSendPayload":{"id":"components/schemas/DtmfSendPayload","kind":"json-schema","title":"DtmfSendPayload","data":{"type":"object","additionalProperties":false,"description":"Command sent from the server to the Sinch platform to send DTMF tones to the voice channel.\n\nAllows playback of a sequence of DTMF digits on the active call.","required":["command","sequence"],"properties":{"command":{"type":"string","const":"dtmf"},"sequence":{"type":"string","description":"A single or multiple DTMF tones."}},"example":{"command":"dtmf","sequence":"123"}}},"components/schemas/TextPlaybackEventPayload":{"id":"components/schemas/TextPlaybackEventPayload","kind":"json-schema","title":"TextPlaybackEventPayload","data":{"type":"object","additionalProperties":false,"description":"Event sent from the Sinch platform to the server to report the playback status of a TTS batch\non the active voice channel.","required":["command","batchSequence"],"properties":{"command":{"type":"string","description":"Identifies the type of playback event.","enum":["textPlaybackStart","textPlaybackStop","textPlaybackCancel"],"x-enumDescriptions":{"textPlaybackStart":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Emitted when the Sinch platform begins playing the TTS batch on the voice channel."},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"A "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"textPlaybackStop"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" or "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"textPlaybackCancel"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" event will always follow."},"children":[]}]}]}],"textPlaybackStop":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Emitted when playback of the TTS batch has ended. This event is sent regardless of"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"whether the batch played to completion or was cut short by an "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"interrupt"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" command"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"or detected speech."},"children":[]}]}]}],"textPlaybackCancel":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Emitted when a queued TTS batch is discarded before playback begins. This occurs"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"when an "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"interrupt"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" command is received while the batch is still waiting in the"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"playback queue."},"children":[]}]}]}]}},"batchSequence":{"type":"integer","description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Auto-incrementing sequence number that identifies the TTS batch this event relates to."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The sequence starts at "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"0"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" for the first batch sent after the session is accepted and"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"increments by "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"1"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" for each subsequent batch. Use this value to correlate playback"},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"events with the "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"textResponse"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" messages sent from the server."},"children":[]}]}]}]}}}},"components/messages/ConnectRequest/payload":{"id":"components/messages/ConnectRequest/payload","kind":"json-schema","title":"ConnectRequest payload","data":{"$ref":"#/components/schemas/ConnectRequestPayload"}},"components/messages/AnswerResponse/payload":{"id":"components/messages/AnswerResponse/payload","kind":"json-schema","title":"AnswerResponse payload","data":{"$ref":"#/components/schemas/AnswerResponsePayload"}},"components/messages/TextMessage/payload":{"id":"components/messages/TextMessage/payload","kind":"json-schema","title":"TextMessage payload","data":{"$ref":"#/components/schemas/TextMessagePayload"}},"components/messages/TextResponseMessage/payload":{"id":"components/messages/TextResponseMessage/payload","kind":"json-schema","title":"TextResponseMessage payload","data":{"$ref":"#/components/schemas/TextResponseMessagePayload"}},"components/messages/InterruptDetect/payload":{"id":"components/messages/InterruptDetect/payload","kind":"json-schema","title":"InterruptDetect payload","data":{"$ref":"#/components/schemas/InterruptDetectPayload"}},"components/messages/Interrupt/payload":{"id":"components/messages/Interrupt/payload","kind":"json-schema","title":"Interrupt payload","data":{"$ref":"#/components/schemas/InterruptPayload"}},"components/messages/DtmfReceive/payload":{"id":"components/messages/DtmfReceive/payload","kind":"json-schema","title":"DtmfReceive payload","data":{"$ref":"#/components/schemas/DtmfReceivePayload"}},"components/messages/DtmfSend/payload":{"id":"components/messages/DtmfSend/payload","kind":"json-schema","title":"DtmfSend payload","data":{"$ref":"#/components/schemas/DtmfSendPayload"}},"components/messages/PlaybackEvent/payload":{"id":"components/messages/PlaybackEvent/payload","kind":"json-schema","title":"PlaybackEvent payload","data":{"$ref":"#/components/schemas/TextPlaybackEventPayload"}}},"exampleStore":{},"securitySchemeStore":{},"specType":"asyncapi"},"options":{"mockServer":{"url":"/_mock/docs/voice-2.0/api-reference/voice-relay","position":"off","description":"Mock server"},"disableRouter":true,"downloadUrls":[{"url":"/_bundle/docs/voice-2.0/api-reference/voice-relay.json?download"},{"url":"/_bundle/docs/voice-2.0/api-reference/voice-relay.yaml?download"}],"excludeFromSearch":false,"replayFeatures":{"graphql":false},"specType":"asyncapi","markdocOptions":{"tags":{},"nodes":{},"components":{}},"metadata":{"title":"Voice Relay Web-Socket","description":"Enables real-time voice-to-text and text-to-speech communication between the Sinch platform and customer endpoints. \nThe Voice Relay service transcribes incoming audio to text, relays it to your AI chatbot or agent system for processing, \nand synthesizes text responses back into audio for playback on active voice channels."}},"baseSlug":"/docs/voice-2.0/api-reference/voice-relay","routesMapping":{}}