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?

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

Names in PHP format
accountSid
sid<AC> Not PII

The SID of the Account that created the Task resource.

dateCreated
date_time<iso8601> Not PII

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

dateUpdated
date_time<iso8601> Not PII

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

friendlyName
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.

assistantSid
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.

uniqueName
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.

actionsUrl
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
Names in None format
assistant_sid
Required
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
        
        
        
        
        Example 2
              
              
              
              

              Fetch a Task resource

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

              Returns the Task instance identified by the {TaskSid}.

              Parameters
              Names in None format
              assistant_sid
              Required
              get sid_like<UA> Not PII

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

              sid
              Required
              get sid_like<UD> Not PII

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

              Example
                    
                    
                    
                    

                    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
                    Names in None format
                    assistant_sid
                    Required
                    get sid_like<UA> Not PII

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

                    Example 1
                          
                          
                          
                          

                          Update a Task resource

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

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

                          Parameters
                          Names in None format
                          assistant_sid
                          Required
                          post sid_like<UA> Not PII

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

                          sid
                          Required
                          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
                                
                                
                                
                                
                                Example 2
                                      
                                      
                                      
                                      

                                      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
                                      Names in None format
                                      assistant_sid
                                      Required
                                      delete sid_like<UA> Not PII

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

                                      sid
                                      Required
                                      delete sid_like<UD> Not PII

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

                                      Example
                                            
                                            
                                            
                                            
                                            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.