List task

GET /v1/Workspaces/{WorkspaceSid}/Tasks

Path parameters

  • WorkspaceSid string Required

    The SID of the Workspace with the Tasks to read.

    Minimum length is 34, maximum length is 34. Format should match the following pattern: ^WS[0-9a-fA-F]{32}$.

Query parameters

  • Priority integer

    The priority value of the Tasks to read. Returns the list of all Tasks in the Workspace with the specified priority.

  • AssignmentStatus array[string]

    The assignment_status of the Tasks you want to read. Can be: pending, reserved, assigned, canceled, wrapping, or completed. Returns all Tasks in the Workspace with the specified assignment_status.

  • WorkflowSid string

    The SID of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this SID.

    Minimum length is 34, maximum length is 34. Format should match the following pattern: ^WW[0-9a-fA-F]{32}$.

  • WorkflowName string

    The friendly name of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this friendly name.

  • TaskQueueSid string

    The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID.

    Minimum length is 34, maximum length is 34. Format should match the following pattern: ^WQ[0-9a-fA-F]{32}$.

  • TaskQueueName string

    The friendly_name of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name.

  • EvaluateTaskAttributes string

    The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter.

  • RoutingTarget string

    A SID of a Worker, Queue, or Workflow to route a Task to

  • Ordering string

    How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: Attribute:Order, where Attribute can be either DateCreated, Priority, or VirtualStartTime and Order can be either asc or desc. For example, Priority:desc returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as Priority:desc,DateCreated:asc, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime.

  • HasAddons boolean

    Whether to read Tasks with Add-ons. If true, returns only Tasks with Add-ons. If false, returns only Tasks without Add-ons.

  • PageSize integer(int64)

    How many resources to return in each list page. The default is 50, and the maximum is 1000.

    Minimum value is 1, maximum value is 1000.

  • Page integer

    The page index. This value is simply for client state.

    Minimum value is 0.

  • PageToken string

    The page token. This is provided by the API.

Responses

  • 200 application/json

    OK

    Hide headers attributes Show headers attributes
    • ETag string
    • X-Rate-Limit-Limit string
    • X-Rate-Limit-Remaining string
    • X-Rate-Limit-Config string
    • Access-Control-Allow-Origin string

      Specify the origin(s) allowed to access the resource

    • Access-Control-Allow-Methods string

      Specify the HTTP methods allowed when accessing the resource

    • Access-Control-Allow-Headers string

      Specify the headers allowed when accessing the resource

    • Access-Control-Allow-Credentials boolean

      Indicates whether the browser should include credentials

    • Access-Control-Expose-Headers string

      Headers exposed to the client

    Hide response attributes Show response attributes object
    • tasks array[object]
      Hide tasks attributes Show tasks attributes object
      • account_sid string | null

        The SID of the Account that created the Task resource.

        Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AC[0-9a-fA-F]{32}$.

      • age integer

        The number of seconds since the Task was created.

        Default value is 0.

      • assignment_status string

        The current status of the Task's assignment. Can be: pending, reserved, assigned, canceled, wrapping, or completed.

        Values are pending, reserved, assigned, canceled, completed, or wrapping.

      • attributes string | null

        The JSON string with custom attributes of the work. Note If this property has been assigned a value, it will only be displayed in FETCH action that returns a single resource. Otherwise, it will be null.

      • addons string | null

        An object that contains the Add-on data for all installed Add-ons.

      • date_created string(date-time) | null

        The date and time in GMT when the resource was created specified in ISO 8601 format.

      • date_updated string(date-time) | null

        The date and time in GMT when the resource was last updated specified in ISO 8601 format.

      • task_queue_entered_date string(date-time) | null

        The date and time in GMT when the Task entered the TaskQueue, specified in ISO 8601 format.

      • priority integer

        The current priority score of the Task as assigned to a Worker by the workflow. Tasks with higher priority values will be assigned before Tasks with lower values.

        Default value is 0.

      • reason string | null

        The reason the Task was canceled or completed, if applicable.

      • sid string | null

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

        Minimum length is 34, maximum length is 34. Format should match the following pattern: ^WT[0-9a-fA-F]{32}$.

      • task_queue_sid string | null

        The SID of the TaskQueue.

        Minimum length is 34, maximum length is 34. Format should match the following pattern: ^WQ[0-9a-fA-F]{32}$.

      • task_queue_friendly_name string | null

        The friendly name of the TaskQueue.

      • task_channel_sid string | null

        The SID of the TaskChannel.

        Minimum length is 34, maximum length is 34. Format should match the following pattern: ^TC[0-9a-fA-F]{32}$.

      • task_channel_unique_name string | null

        The unique name of the TaskChannel.

      • timeout integer

        The amount of time in seconds that the Task can live before being assigned.

        Default value is 0.

      • workflow_sid string | null

        The SID of the Workflow that is controlling the Task.

        Minimum length is 34, maximum length is 34. Format should match the following pattern: ^WW[0-9a-fA-F]{32}$.

      • workflow_friendly_name string | null

        The friendly name of the Workflow that is controlling the Task.

      • workspace_sid string | null

        The SID of the Workspace that contains the Task.

        Minimum length is 34, maximum length is 34. Format should match the following pattern: ^WS[0-9a-fA-F]{32}$.

      • url string(uri) | null

        The absolute URL of the Task resource.

      • virtual_start_time string(date-time) | null

        The date and time in GMT indicating the ordering for routing of the Task specified in ISO 8601 format.

      • ignore_capacity boolean | null

        A boolean that indicates if the Task should respect a Worker's capacity and availability during assignment. This field can only be used when the RoutingTarget field is set to a Worker SID. By setting IgnoreCapacity to a value of true, 1, or yes, the Task will be routed to the Worker without respecting their capacity and availability. Any other value will enforce the Worker's capacity and availability. The default value of IgnoreCapacity is true when the RoutingTarget is set to a Worker SID.

      • routing_target string | null

        A SID of a Worker, Queue, or Workflow to route a Task to

    • meta object
      Hide meta attributes Show meta attributes object
      • first_page_url string(uri)
      • key string
      • next_page_url string(uri) | null
      • page integer
      • page_size integer
      • previous_page_url string(uri) | null
      • url string(uri)
GET /v1/Workspaces/{WorkspaceSid}/Tasks
curl \
 --request GET 'https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/Tasks' \
 --user "username:password"
{
  "meta": {
    "key": "tasks",
    "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks?TaskQueueSid=WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&RoutingTarget=WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&TaskQueueName=task_queue_name&WorkflowName=workflow_name&WorkflowSid=WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&AssignmentStatus=pending%2Creserved&Priority=1&PageSize=50&Page=0",
    "page": 0,
    "page_size": 50,
    "next_page_url": null,
    "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks?TaskQueueSid=WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&RoutingTarget=WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&TaskQueueName=task_queue_name&WorkflowName=workflow_name&WorkflowSid=WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&AssignmentStatus=pending%2Creserved&Priority=1&PageSize=50&Page=0",
    "previous_page_url": null
  },
  "tasks": [
    {
      "age": 25200,
      "sid": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "links": {
        "workflow": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "task_queue": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "reservations": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations"
      },
      "addons": "{}",
      "reason": "Test Reason",
      "timeout": 60,
      "priority": 0,
      "attributes": "{\"body\": \"hello\"}",
      "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "date_created": "2014-05-14T14:26:54Z",
      "date_updated": "2014-05-15T16:03:42Z",
      "workflow_sid": "WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "routing_target": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "task_queue_sid": "WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "ignore_capacity": false,
      "task_channel_sid": "TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "assignment_status": "pending",
      "required_attention": 0,
      "virtual_start_time": "2014-05-14T14:26:54Z",
      "workflow_friendly_name": "Test Workflow",
      "task_queue_entered_date": "2014-05-14T14:26:54Z",
      "task_channel_unique_name": "task-channel",
      "task_queue_friendly_name": "Test Queue"
    }
  ]
}
{
  "meta": {
    "key": "tasks",
    "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks?TaskQueueSid=WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&RoutingTarget=WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&TaskQueueName=task_queue_name&WorkflowName=workflow_name&WorkflowSid=WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&AssignmentStatus=pending&Priority=1&PageSize=50&Page=0",
    "page": 0,
    "page_size": 50,
    "next_page_url": null,
    "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks?TaskQueueSid=WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&RoutingTarget=WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&TaskQueueName=task_queue_name&WorkflowName=workflow_name&WorkflowSid=WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&AssignmentStatus=pending&Priority=1&PageSize=50&Page=0",
    "previous_page_url": null
  },
  "tasks": []
}
{
  "meta": {
    "key": "tasks",
    "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks?TaskQueueSid=WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&RoutingTarget=WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&TaskQueueName=task_queue_name&WorkflowName=workflow_name&WorkflowSid=WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&AssignmentStatus=pending&AssignmentStatus=reserved&Priority=1&PageSize=50&Page=0",
    "page": 0,
    "page_size": 50,
    "next_page_url": null,
    "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks?TaskQueueSid=WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&RoutingTarget=WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&TaskQueueName=task_queue_name&WorkflowName=workflow_name&WorkflowSid=WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&AssignmentStatus=pending&AssignmentStatus=reserved&Priority=1&PageSize=50&Page=0",
    "previous_page_url": null
  },
  "tasks": []
}