List task

GET /v1/Workspaces/{WorkspaceSid}/Tasks

TODO: Resource-level docs

Path parameters

  • WorkspaceSid string Required

    The SID of the Workspace with the Tasks to read.

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.

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

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

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

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

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

  • Ordering string

    How to order the returned Task resources. y default, Tasks are sorted by ascending DateCreated. This value is specified as: Attribute:Order, where Attribute can be either Priority or DateCreated and Order can be either asc or desc. For example, Priority:desc returns Tasks ordered in descending order of their Priority. Multiple 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.

  • HasAddons boolean

    Whether to read Tasks with addons. If true, returns only Tasks with addons. If false, returns only Tasks without addons.

  • PageSize integer

    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.

Responses

  • OK

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

        The SID of the Account that created the resource

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

      • addons string | null

        An object that contains the addon data for all installed addons

      • age integer | null

        The number of seconds since the Task was created

      • assignment_status string | null

        The current status of the Task's assignment

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

      • attributes string | null

        The JSON string with custom attributes of the work

      • date_created string(date-time) | null

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

      • date_updated string(date-time) | null

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

      • priority integer | null

        Retrieve the list of all Tasks in the Workspace with the specified priority

      • reason string | null

        The reason the Task was canceled or completed

      • sid string | null

        The unique string that identifies the resource

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

      • 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}$.

      • The unique name of the TaskChannel

      • task_queue_entered_date string(date-time) | null

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

      • The friendly name of the TaskQueue

      • 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}$.

      • timeout integer | null

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

      • url string(uri) | null

        The absolute URL of the Task resource

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

      • 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}$.

      • 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}$.

GET /v1/Workspaces/{WorkspaceSid}/Tasks
curl \
 -X GET https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/Tasks \
 --user "username:password"
Response examples (200)
{
  "meta": {
    "first_page_url": "https://example.com",
    "key": "string",
    "next_page_url": "https://example.com",
    "page": 42,
    "page_size": 42,
    "previous_page_url": "https://example.com",
    "url": "https://example.com"
  },
  "tasks": [
    {
      "account_sid": "string",
      "addons": "string",
      "age": 42,
      "assignment_status": "pending",
      "attributes": "string",
      "date_created": "2023-05-04T09:42:00+00:00",
      "date_updated": "2023-05-04T09:42:00+00:00",
      "links": {},
      "priority": 42,
      "reason": "string",
      "sid": "string",
      "task_channel_sid": "string",
      "task_channel_unique_name": "string",
      "task_queue_entered_date": "2023-05-04T09:42:00+00:00",
      "task_queue_friendly_name": "string",
      "task_queue_sid": "string",
      "timeout": 42,
      "url": "https://example.com",
      "workflow_friendly_name": "string",
      "workflow_sid": "string",
      "workspace_sid": "string"
    }
  ]
}
Response examples (200)
{
  "meta": {
    "first_page_url": "https://example.com",
    "key": "string",
    "next_page_url": "https://example.com",
    "page": 42,
    "page_size": 42,
    "previous_page_url": "https://example.com",
    "url": "https://example.com"
  },
  "tasks": [
    {
      "account_sid": "string",
      "addons": "string",
      "age": 42,
      "assignment_status": "pending",
      "attributes": "string",
      "date_created": "2024-05-04T09:42:00+00:00",
      "date_updated": "2024-05-04T09:42:00+00:00",
      "links": {},
      "priority": 42,
      "reason": "string",
      "sid": "string",
      "task_channel_sid": "string",
      "task_channel_unique_name": "string",
      "task_queue_entered_date": "2024-05-04T09:42:00+00:00",
      "task_queue_friendly_name": "string",
      "task_queue_sid": "string",
      "timeout": 42,
      "url": "https://example.com",
      "workflow_friendly_name": "string",
      "workflow_sid": "string",
      "workspace_sid": "string"
    }
  ]
}