---
title: "Manage Call with `callLeg`"
method: PATCH
path: "/calling/v1/calls/id/{callId}/leg/{callLeg}"
tags: ["Calls"]
---

# Manage Call with `callLeg`

`PATCH /calling/v1/calls/id/{callId}/leg/{callLeg}`

This method is used to manage ongoing, connected calls. This method is only used when using the `PlayFiles` and `Say` instructions in the request body. This method uses SVAML in the request body to perform various tasks related to the call. For more information about SVAML, see the [Callback API](https://developers.sinch.com/docs/voice/api-reference/svaml/) documentation.

Note: You can only use this method for calls that originate from or terminate to PSTN or SIP networks.

## Request body

- PATCHSVAMLRequestBody — SVAML is a call control markup language. When a server receives a callback event from the Sinch platform, it can respond with a SVAML object to control the voice call. The following is an example of a SVAML object type and its contents.
  - `instructions` SvamlInstruction[] — The collection of instructions that can perform various tasks during the call. You can include as many instructions as necessary.
    - union — Instructions allow an application to play a message or file, start recording, and various other tasks. For more information about instructions, see the [SVAML](https://developers.sinch.com/docs/voice/api-reference/svaml/) documentation.
      - object — Plays Interactive Voice Response (IVR) files for the supported locale or SSML commands at the Sinch backend. An IVR message is played only on the caller's side.
        - `name` 'playFiles', required — The `name` property. Must have the value `playFiles`.
        - `ids` string[], required — The IDs of the files which will be played. These can be a URL to a file, SSML commands using the `#ssml[]` element, or text using the `#tts[]` element.
        - `locale` string — If using SSML or TTS, this is a required field. The voice and language you want to use for the text-to-speech message. This can either be defined by the ISO 639 locale and language code or by specifying a particular voice. Supported languages and voices are detailed [here](https://developers.sinch.com/docs/voice/api-reference/voice-locales).
      - object — Plays a synthesized text-to-speech message to the end user. The message is provided in the text field.
        - `name` 'say', required — The `name` property. Must have the value `say`.
        - `text` string — Contains the message that will be spoken. Default maximum length is 600 characters. To change this limit, please contact support.
        - `locale` string — The voice and language you want to use for the text-to-speech message. This can either be defined by the ISO 639 locale and language code or by specifying a particular voice. Supported languages and voices are detailed [here](https://developers.sinch.com/docs/voice/api-reference/voice-locales).
      - object — Plays DTMF tones in the call.
        - `name` 'sendDtmf', required — The `name` property. Must have the value `sendDtmf`.
        - `value` string — A string that determines the DTMF tones to play to the callee when the call is picked up. Valid characters are: `0-9`, `#`, and `w`. `w` renders a 500ms pause. For example, the string `ww1234#w#`, plays a 1 second pause, the DTMF tones for `1`, `2`, `3`, `4`, and `#`, followed by a 500ms pause and finally the `#` tone. This is useful if the callout destination requires a conference PIN code or an extension. If there is a calling party, it will hear progress while the DTMF is sent.
      - object — Creates a cookie for the duration of the call.
        - `name` 'setCookie', required — The `name` property. Must have the value `setCookie`.
        - `key` string — The name of the cookie you want to set.
        - `value` string — The value of the cookie you want to set.
      - object — Forces the callee to answer the call.
        - `name` 'answer', required — The `name` property. Must have the value `answer`.
      - object — Starts a recording of the call.
        - `name` 'startRecording', required — The `name` property. Must have the value `startRecording`.
        - `options` SvamlInstructionStartRecordingOptions
          - `destinationUrl` string
          - `credentials` string
          - `format` string
          - `notificationEvents` boolean
          - `transcriptionOptions` object
            - `enabled` boolean
            - `locale` string
      - object — Stops the recording of the call.
        - `name` 'stopRecording', required — The `name` property. Must have the value `stopRecording`.
  - `action` union — The action that will control the call. Each SVAML object can only include one action.
    - object — Hangs up a call. Available to use in a response to an [Incoming Call Event](https://developers.sinch.com/docs/voice/api-reference/voice/callbacks/ice) callback or an [Answered Call Event](https://developers.sinch.com/docs/voice/api-reference/voice/callbacks/ace) callback.
      - `name` 'hangup', required — The name property. Must have the value `hangup`.
    - object — Continues to set up a call. Available to use in a response to an [Answered Call Event](https://developers.sinch.com/docs/voice/api-reference/voice/callbacks/ace) callback.
      - `name` 'continue', required — The name property. Must have the value `continue`.
    - object — Parks the call and places the caller on hold. The caller is placed into a loop, listening to an IVR prompt (either a pre-recorded audio file or generated by text to speech). If the call is unparked, prompts will stop playing immediately. If the max duration is reached, the last prompt will be fully played until the call ends.
      - `name` 'park', required — The name property. Must have the value `park`.
      - `locale` string — The voice and language you want to use for the text-to-speech message. This can either be defined by the ISO 639 locale and language code or by specifying a particular voice. Supported languages and voices are detailed [here](https://developers.sinch.com/docs/voice/api-reference/voice-locales).
      - `introPrompt` string — That prompt that is played when the call is first answered. You can use text-to-speech using the `#tts[]` element, SSML commands using the `#ssml[]` element.
      - `holdPrompt` string — The prompt that is played on repeat until the call is unparked or the until the `maxDuration` value is reached. You can use text-to-speech using the `#tts[]` element, SSML commands using the `#ssml[]` element.
      - `maxDuration` integer — The maximum amount of time in seconds that the `holdPrompt` will be played.

## Response `200`

A success response, or an [Error](https://developers.sinch.com/docs/voice/api-reference/errors/).

---

[API](https://skmtc.net/sinch/apis/voice-api-sinch.md) · [All operations](https://skmtc.net/sinch/apis/voice-api-sinch/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sinch/voice-api-sinch/revisions/a59ac1ee7b2c/schema)
