Level up your Twilio API skills in TwilioQuest, an educational game for Mac, Windows, and Linux. Download Now

Menu

Expand
Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

TwiML Redirect

TwiML Redirect Widget.png

Description:

TwiML Redirect allows you to redirect a Voice Call to be handled outside of Studio and optionally return control back to Studio.

Returning control to Studio

To handle returning control to Studio, you need to specify a <Redirect> to the Studio Webhook URL and append ?FlowEvent=return. Any additional parameters specified in the return URL will be injected into the Studio context and addressable via Liquid template variables.

Example:

<Response>
  <Say>Returning you back to the Studio Flow.</Say>
  <Redirect>https://webhooks.twilio.com/v1/...?FlowEvent=return&foo=bar</Redirect>
</Response>

The URL parameter foo illustrated above will be passed automatically into your Flow and can be referenced via Liquid as {{widgets.your_redirect_widget_name.foo}}.

Tip: To retrieve the Studio Webhook URL, in your Studio flow, click the red Trigger widget. The URL starting with https://webhooks.twilio.com/v1/... is the Webhook URL.

Required Configuration:

Name

Description

Default

URL

URL where the call or message will be redirected.

None

Optional Configuration:

Name

Description

Default

Method

HTTP method to be used in the redirect

POST

Timeout

Number of seconds to wait for control to be returned to Studio. Set to 0 if returning control is not desired.

Possible values in seconds: 0 to 14400 seconds (4 hours)

14400

Transitions:

These are the events that trigger transitions from this widget:

Name

Key

Description

Return

return

Fired when the next TwiML fetch is received from Voice or Messaging for the current Execution

Timeout

timeout

Fired when the timer is expired, and no new TwiML fetch is received for the current Execution

Failed

failed

Fired when the URL is not successfully returned (or has an error)

Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.