Menu

Expand
Rate this page:

TwiML™ Voice: <Redirect>

The <Redirect> verb transfers control of a call to the TwiML at a different URL. All verbs after <Redirect> are unreachable and ignored.

Verb Attributes

The <Redirect> verb supports the following attributes that modify its behavior:

Attribute Name Allowed Values Default Value
method GET, POST POST

method

The 'method' attribute takes the value 'GET' or 'POST'. This tells Twilio whether to request the <Redirect> URL via HTTP GET or POST. 'POST' is the default.

Use it in a <Redirect> verb like so:

        
        
        
        

        Nouns

        The "noun" of a TwiML verb is the stuff nested within the verb that's not a verb itself; it's the stuff the verb acts upon. These are the nouns for <Redirect>:

        Noun TwiML Interpretation
        plain text An absolute or relative URL for a different TwiML document.

        Nesting Rules

        No verbs can be nested within <Redirect> and <Redirect> can't be nested in any other verbs.

        Examples

        Example 1: Absolute URL Redirect

        In this example, we have a <Redirect> verb after a <Dial> verb with no URL. When the <Dial> verb finishes, the <Redirect> executes. <Redirect> makes a request to http://www.foo.com/nextInstructions and transfers the call flow to the TwiML received in response to that request.

              
              
              
              

              Example 2: Relative URL Redirect

              Redirects call flow control to the TwiML at a URL relative to the current URL.

                    
                    
                    
                    
                    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.

                          
                          
                          

                          Thank you for your feedback!

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

                          Sending your feedback...
                          🎉 Thank you for your feedback!
                          Something went wrong. Please try again.

                          Thanks for your feedback!

                          Refer us and get $10 in 3 simple steps!

                          Step 1

                          Get link

                          Get a free personal referral link here

                          Step 2

                          Give $10

                          Your user signs up and upgrade using link

                          Step 3

                          Get $10

                          1,250 free SMSes
                          OR 1,000 free voice mins
                          OR 12,000 chats
                          OR more