---
title: "Update call flow"
method: PUT
path: "/api/fabric/resources/call_flows/{id}"
tags: ["Call Flows"]
---

# Update call flow

`PUT /api/fabric/resources/call_flows/{id}`

Updates a Call Flow by ID

#### Permissions

The API token used to authenticate must have the following scope(s) enabled to make a successful request: _Voice_, _Messaging_, _Fax_, or _Video_.

[Learn more about API scopes](/docs/platform/your-signalwire-api-space).

## Path parameters

- `id` string, uuid, required — Universal Unique Identifier.

## Request body

- CallFlowUpdateRequest
  - `title` string — The name of the Call Flow
  - `document_version` integer, required — The current revision of the call flow. Must equal the call flow's existing `document_version + 1`.
  - `flow_data` object, required — Call Flow Builder state, stored as an opaque JSON object.
  - `relayml` SWMLCallingSWMLObject, required — A SWML document for handling inbound and outbound calls. Contains a `sections` map where each section holds an array of methods that run sequentially. Execution starts at `sections.main`. See the [Calling SWML reference](/docs/swml/reference/calling) for the full list of available methods.
    - `version` '1.0.0'
    - `sections` SWMLCallingSection, required
      - `main` SWMLCallingSWMLMethod[], required
        - union
          - SWMLCallingAnswer
            - `answer` object, required — Answer incoming call and set an optional maximum duration.
              - …
          - SWMLCallingAI
            - `ai` SWMLCallingAIObject, required
              - …
          - SWMLCallingAISidecar
            - `ai_sidecar` SWMLCallingAISidecarObject, required
              - …
          - SWMLCallingAmazonBedrock
            - `amazon_bedrock` SWMLCallingAmazonBedrockObject, required
              - …
          - SWMLCallingCond
            - `cond` SWMLCallingCondParams[], required — Execute a sequence of instructions depending on the value of a JavaScript condition.
              - …
          - SWMLCallingConnect
            - `connect` union, required — Connect to a phone number, SIP URI, Resource Address, queue, or WebSocket stream.
              - …
          - SWMLCallingDenoise
            - `denoise` object, required — Start noise reduction. You can stop it at any time using `stop_denoise`.
          - SWMLCallingEnterQueue
            - `enter_queue` SWMLCallingEnterQueueObject, required
              - …
          - SWMLCallingExecute
            - `execute` object, required — Execute a specified section or URL as a subroutine, and upon completion, return to the current document. Use the return statement to pass any return values or objects back to the current document.
              - …
          - SWMLCallingGoto
            - `goto` object, required — Jump to a label within the current section, optionally based on a condition. The goto method will only navigate to a label within the same section.
              - …
          - SWMLCallingLabel
            - `label` string, required — Mark any point of the SWML section with a label so that goto can jump to it.
          - SWMLCallingLiveTranscribe
            - `live_transcribe` object, required — Start live transcription of the call. The transcription will be sent to the specified webhook URL.
              - …
          - SWMLCallingLiveTranslate
            - `live_translate` object, required — Start live translation of the call. The translation will be sent to the specified webhook URL.
              - …
          - SWMLCallingHangup
            - `hangup` object, required — End the call with an optional reason.
              - …
          - SWMLCallingJoinRoom
            - `join_room` object, required — Join a Relay room. If the room doesn't exist, it creates a new room.
              - …
          - SWMLCallingJoinConference
            - `join_conference` SWMLCallingJoinConferenceObject, required
              - …
          - SWMLCallingPlay
            - `play` union, required — Play file(s), ringtones, speech or silence.
              - …
          - SWMLCallingPrompt
            - `prompt` object, required — Play a prompt and wait for input. The input can be received either as digits from the keypad, or from speech, or both depending on what parameters are set. By default, only digit input is enabled. To enable speech input, set at least one speech parameter. To enable both digit and speech input, set at least one parameter for each.
              - …
          - SWMLCallingReceiveFax
            - `receive_fax` object, required — Receive a fax being delivered to this call.
              - …
          - SWMLCallingRecord
            - `record` object, required — Record the call audio in the foreground, pausing further SWML execution until recording ends. Use this, for example, to record voicemails. To record calls in the background in a non-blocking fashion, use the record_call method.
              - …
          - SWMLCallingRecordCall
            - `record_call` object, required — Record call in the background. Unlike the record method, the record_call method will start the recording and continue executing the SWML script while allowing the recording to happen in the background. To stop call recordings started with record_call, use the stop_record_call method.
              - …
          - SWMLCallingRequest
            - `request` object, required — Send a GET, POST, PUT, or DELETE request to a remote URL.
              - …
          - SWMLCallingReturn
            - `return` unknown, required
          - SWMLCallingSendDigits
            - `send_digits` object, required — Send digit presses as DTMF tones.
              - …
          - SWMLCallingSendFax
            - `send_fax` object, required — Send a fax.
              - …
          - SWMLCallingSendSMS
            - `send_sms` union, required — Send an outbound SMS or MMS message to a PSTN phone number.
              - …
          - SWMLCallingSet
            - `set` object, required — Set script variables to the specified values. Accepts an object mapping variable names to values. Variables set using set can be removed using unset.
          - SWMLCallingSleep
            - `sleep` union, required — Pause execution for a specified duration.
              - …
          - SWMLCallingSIPRefer
            - `sip_refer` object, required — Send SIP REFER to a SIP call.
              - …
          - SWMLCallingStopDenoise
            - `stop_denoise` object, required — Stop noise reduction that was started with denoise.
          - SWMLCallingStopRecordCall
            - `stop_record_call` object, required — Stop an active background recording.
              - …
          - SWMLCallingStopStream
            - `stop_stream` object, required — Stop an active audio stream.
              - …
          - SWMLCallingStopTap
            - `stop_tap` object, required — Stop an active tap stream.
              - …
          - SWMLCallingStream
            - `stream` object, required — Start a background audio stream from the call to a WebSocket endpoint. Runs alongside the call as an independent operation.
              - …
          - SWMLCallingSwitch
            - `switch` object, required — Execute different instructions based on a variable's value.
              - …
          - SWMLCallingTap
            - `tap` object, required — Start background call tap. Media is streamed over Websocket or RTP to customer controlled URI.
              - …
          - SWMLCallingTranscribe
            - `transcribe` object, required — Transcribe the entire call in the background. Execution continues to the next instruction while the call proceeds; the transcription covers the whole call and completes when the call ends. For real-time transcription delivered as the call happens, use `live_transcribe` instead. Only one transcription can be active on a call at a time. To stop it, use the `transcribe_stop` method.
              - …
          - SWMLCallingTranscribeStop
            - `transcribe_stop` object, required — Stop the transcription currently running on the call, started with `transcribe`. No parameters are required.
          - SWMLCallingTransfer
            - `transfer` object, required — Transfer the execution of the script to a different SWML section, URL, or Relay application. Once the transfer is complete, the script will continue executing SWML from the new location.
              - …
          - SWMLCallingUnset
            - `unset` union, required — Unset specified variables. The variables may have been set using the set method or as a byproduct of other statements or methods. Accepts a single variable name as a string or an array of variable names.
              - …
          - SWMLCallingPay
            - `pay` object, required — Enables secure payment processing during voice calls. When implemented, it manages the entire payment flow including data collection, validation, and processing through your configured payment gateway.
              - …
          - SWMLCallingDetectMachine
            - `detect_machine` object, required — A detection method that combines AMD (Answering Machine Detection) and fax detection. Detect whether the user on the other end of the call is a machine (fax, voicemail, etc.) or a human. The detection result(s) will be sent to the specified status_url as a POST request and will also be saved in the detect_result variable.
              - …
          - SWMLCallingUserEvent
            - `user_event` object, required — Allows the user to set and send events to the connected client on the call. This is useful for triggering actions on the client side. Commonly used with the [browser-sdk](/docs/browser-sdk/v3/js/reference/signalwire/client). The event object can be any valid JSON object. Any key-value pair in the object is sent to the client as an event type called `user_event`.
              - …

## Response `200`

The request has succeeded.

- CallFlowResponse
  - `id` string, uuid, required — Universal Unique Identifier.
  - `project_id` string, uuid, required — Universal Unique Identifier.
  - `display_name` string, required — Display name of the Call Flow Fabric Resource
  - `type` 'call_flow', required — Type of the Fabric Resource
  - `created_at` string, date-time, required — Date and time when the resource was created.
  - `updated_at` string, date-time, required — Date and time when the resource was updated.
  - `call_flow` CallFlow, required
    - `id` string, uuid, required — Universal Unique Identifier.
    - `title` string, required — The name of the Call Flow
    - `flow_data` object — Call Flow Builder state, stored as an opaque JSON object. Produced and consumed by the SignalWire Call Flow Builder UI; not used by SWML execution.
    - `relayml` SWMLCallingSWMLObject — A SWML document for handling inbound and outbound calls. Contains a `sections` map where each section holds an array of methods that run sequentially. Execution starts at `sections.main`. See the [Calling SWML reference](/docs/swml/reference/calling) for the full list of available methods.
      - `version` '1.0.0'
      - `sections` SWMLCallingSection, required
        - `main` SWMLCallingSWMLMethod[], required
          - union
            - SWMLCallingAnswer
              - …
            - SWMLCallingAI
              - …
            - SWMLCallingAISidecar
              - …
            - SWMLCallingAmazonBedrock
              - …
            - SWMLCallingCond
              - …
            - SWMLCallingConnect
              - …
            - SWMLCallingDenoise
              - …
            - SWMLCallingEnterQueue
              - …
            - SWMLCallingExecute
              - …
            - SWMLCallingGoto
              - …
            - SWMLCallingLabel
              - …
            - SWMLCallingLiveTranscribe
              - …
            - SWMLCallingLiveTranslate
              - …
            - SWMLCallingHangup
              - …
            - SWMLCallingJoinRoom
              - …
            - SWMLCallingJoinConference
              - …
            - SWMLCallingPlay
              - …
            - SWMLCallingPrompt
              - …
            - SWMLCallingReceiveFax
              - …
            - SWMLCallingRecord
              - …
            - SWMLCallingRecordCall
              - …
            - SWMLCallingRequest
              - …
            - SWMLCallingReturn
              - …
            - SWMLCallingSendDigits
              - …
            - SWMLCallingSendFax
              - …
            - SWMLCallingSendSMS
              - …
            - SWMLCallingSet
              - …
            - SWMLCallingSleep
              - …
            - SWMLCallingSIPRefer
              - …
            - SWMLCallingStopDenoise
              - …
            - SWMLCallingStopRecordCall
              - …
            - SWMLCallingStopStream
              - …
            - SWMLCallingStopTap
              - …
            - SWMLCallingStream
              - …
            - SWMLCallingSwitch
              - …
            - SWMLCallingTap
              - …
            - SWMLCallingTranscribe
              - …
            - SWMLCallingTranscribeStop
              - …
            - SWMLCallingTransfer
              - …
            - SWMLCallingUnset
              - …
            - SWMLCallingPay
              - …
            - SWMLCallingDetectMachine
              - …
            - SWMLCallingUserEvent
              - …
    - `document_version` integer — The current revision of the call flow. Every update must increase this number.

## Other responses

- `401` — Access is unauthorized.
- `404` — The server cannot find the requested resource.
- `422` — The request contains invalid parameters. See errors for details.
- `500` — An internal server error occurred.

---

[API](https://skmtc.net/signalwire/apis/signalwire-rest-api.md) · [All operations](https://skmtc.net/signalwire/apis/signalwire-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/signalwire/signalwire-rest-api/versions/05c5164b85c7/schema)
