Menu

Expand
Rate this page:

Task

The Task resource represents the primary meaning of a user's text or speech when they interact with an Assistant.

Tasks should be modeled based on the intentions and tasks expected from end users. For instance, Tasks can be as simple as confirm or cancel actions or complex task-oriented actions like talk_to_sales or book_a_flight.

Once a Task is created, you should create Samples that define how people might express the task speaking naturally. A Task with Samples constitutes the core training data that creates your Assistant's Natural Language Understanding model.

All Autopilot REST API resources use the following base URL:

https://autopilot.twilio.com/v1

Task properties

Resource Properties in REST API format
account_sid
sid<AC> Not PII

The SID of the Account that created the Task resource.

date_created
date_time<iso8601> Not PII

The date and time in GMT when the resource was created specified in RFC 2822 format.

date_updated
date_time<iso8601> Not PII

The date and time in GMT when the resource was last updated specified in RFC 2822 format.

friendly_name
string Not PII

The string that you assigned to describe the resource. It is not unique and can be up to 255 characters long.

links
uri_map Not PII

A list of the URLs of related resources.

assistant_sid
sid<UA> Not PII

The SID of the Assistant that is the parent of the resource.

sid
sid<UD> Not PII

The unique string that we created to identify the Task resource.

unique_name
string Not PII

An application-defined string that uniquely identifies the resource. It can be used in place of the resource's sid in the URL to address the resource.

actions_url
url Not PII

The URL from which the Assistant can fetch actions.

url
url Not PII

The absolute URL of the Task resource.

Create a Task resource

post
https://autopilot.twilio.com/v1/Assistants/{AssistantSid}/Tasks

Creates a new Task resource for the Assistant specified with {AssistantSid} or {AssistantUniqueName}.

Parameters
Parameters in REST API format
assistant_sid
Path
post sid_like<UA> Not PII

The SID of the Assistant that is the parent of the new resource.

unique_name
Required
post string Not PII

An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the sid in the URL path to address the resource. This value must be unique and 64 characters or less in length.

friendly_name
Optional
post string Not PII

A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long.

actions
Optional
post object Not PII

The JSON string that specifies the actions that instruct the Assistant on how to perform the task. It is optional and not unique.

actions_url
Optional
post url Not PII

The URL from which the Assistant can fetch actions.

Example 1
        
        
        

        Create a Task

        Example 2
              
              
              

              Create a Task that includes actions

              Fetch a Task resource

              get
              https://autopilot.twilio.com/v1/Assistants/{AssistantSid}/Tasks/{Sid}

              Returns the Task instance identified by the {TaskSid}.

              Parameters
              Parameters in REST API format
              assistant_sid
              Path
              get sid_like<UA> Not PII

              The SID of the Assistant that is the parent of the resource to fetch.

              sid
              Path
              get sid_like<UD> Not PII

              The Twilio-provided string that uniquely identifies the Task resource to fetch.

              Example 1
                    
                    
                    

                    Fetch Task

                    Read multiple Task resources

                    get
                    https://autopilot.twilio.com/v1/Assistants/{AssistantSid}/Tasks

                    Returns a list of Tasks for this Assistant. The list includes paging information.

                    Parameters
                    Parameters in REST API format
                    assistant_sid
                    Path
                    get sid_like<UA> Not PII

                    The SID of the Assistant that is the parent of the resources to read.

                    Example 1
                          
                          
                          

                          Read: List all Tasks for an Assistant

                          Update a Task resource

                          post
                          https://autopilot.twilio.com/v1/Assistants/{AssistantSid}/Tasks/{Sid}

                          Updates the Task instance identified by {TaskSid} or {TaskUniqueName}.

                          Parameters
                          Parameters in REST API format
                          assistant_sid
                          Path
                          post sid_like<UA> Not PII

                          The SID of the Assistant that is the parent of the resource to update.

                          sid
                          Path
                          post sid_like<UD> Not PII

                          The Twilio-provided string that uniquely identifies the Task resource to update.

                          friendly_name
                          Optional
                          post string Not PII

                          A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long.

                          unique_name
                          Optional
                          post string Not PII

                          An application-defined string that uniquely identifies the resource. This value must be 64 characters or less in length and be unique. It can be used as an alternative to the sid in the URL path to address the resource.

                          actions
                          Optional
                          post object Not PII

                          The JSON string that specifies the actions that instruct the Assistant on how to perform the task.

                          actions_url
                          Optional
                          post url Not PII

                          The URL from which the Assistant can fetch actions.

                          Example 1
                                
                                
                                

                                Update a Task

                                Example 2
                                      
                                      
                                      

                                      Update a Task to set task actions

                                      Delete a Task resource

                                      delete
                                      https://autopilot.twilio.com/v1/Assistants/{AssistantSid}/Tasks/{Sid}

                                      Deletes a Task.

                                      All Fields and Samples associated with the Task must be deleted before deleting the Task.

                                      Parameters
                                      Parameters in REST API format
                                      assistant_sid
                                      Path
                                      delete sid_like<UA> Not PII

                                      The SID of the Assistant that is the parent of the resources to delete.

                                      sid
                                      Path
                                      delete sid_like<UD> Not PII

                                      The Twilio-provided string that uniquely identifies the Task resource to delete.

                                      Example 1
                                            
                                            
                                            

                                            Delete Task

                                            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 Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

                                                  
                                                  
                                                  

                                                  Thank you for your feedback!

                                                  Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

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

                                                  Thanks for your feedback!

                                                  thanks-feedback-gif