Rate this page:

TwiML™ Voice: <Autopilot>

With Autopilot, you can build AI-powered conversational IVRs that recognizes user's intent, collects data from users, answers frequently (or infrequently) asked questions, and routes calls to other users.

Autopilot does the speech recognition and natural language understanding (NLU) to detect what users say and match it to Tasks that they need to acomplish. Tasks can be programmed to ask questions to collect data, answer questions or connect calls to other users. They are trained to recognize different phrases or ways users might invoke a given Task.

Learn more about Autopilot here or create your first Autopilot Assistant in the console.

You can use TwiML's <Autopilot> noun to connect a call to an Autopilot Conversational IVR.

The following example shows how to use the <Autopilot> TwiML noun:

<?xml version="1.0" encoding="UTF-8"?>
        Toggle to your preferred programming language, or view the raw TwiML to see how the libraries and TwiML syntax differ

        Connect to <Autopilot>

        Toggle to your preferred programming language, or view the raw TwiML to see how the libraries and TwiML syntax differ

        <Connect> Attributes

        <Autopilot> supports the following attributes that change its behavior:

        Attribute name Allowed values Default value
        action URL (relative or absolute) current document URL
        method GET or POST POST


        The action attribute takes an absolute or relative URL as a value. The Autopilot dialogue ends either by doing a handoff or the absence of a listen.

        If you do not provide an action parameter, Twilio will POST to the URL that houses the active TwiML document.

        <?xml version="1.0" encoding="UTF-8"?>
          <Connect action="">

        Autopilot Parameters

        Parameter Description

        A string representing the unique name of the destination Task. If no TargetTask is provided, the destination task is determined by the natural language understanding.

        TargetTask is useful when you want to control what task a user is routed to.

        Any call sent with a TargetTask parameter will start the Autopilot session on that task. This will override the initiation task specified in the defaults.

        Without an action URL, Twilio will re-request the URL that hosts the TwiML you just executed. This can lead to unwanted looping behavior if you're not careful. See our example below for more information.

        Useful Autopilot resources

        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 by visiting Twilio's Community Forums or 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. Please select the reason(s) for your feedback or provide additional information about how we can improve:

              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