@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Twilio - Taskrouter
@base https://taskrouter.twilio.com
@version 1.0.0
@auth Bearer basic
@endpoints 61
@hint download_for_search
@toc Workspaces(61)

@endpoint GET /v1/Workspaces/{WorkspaceSid}/Activities/{Sid}
@required {WorkspaceSid: str # The SID of the Workspace with the Activity resources to fetch., Sid: str # The SID of the Activity resource to fetch.}
@returns(200) {account_sid: str?, available: bool?, date_created: str(date-time)?, date_updated: str(date-time)?, friendly_name: str?, sid: str?, workspace_sid: str?, url: str(uri)?, links: map?} # OK

@endpoint POST /v1/Workspaces/{WorkspaceSid}/Activities/{Sid}
@required {WorkspaceSid: str # The SID of the Workspace with the Activity resources to update., Sid: str # The SID of the Activity resource to update.}
@returns(200) {account_sid: str?, available: bool?, date_created: str(date-time)?, date_updated: str(date-time)?, friendly_name: str?, sid: str?, workspace_sid: str?, url: str(uri)?, links: map?} # OK

@endpoint DELETE /v1/Workspaces/{WorkspaceSid}/Activities/{Sid}
@required {WorkspaceSid: str # The SID of the Workspace with the Activity resources to delete., Sid: str # The SID of the Activity resource to delete.}
@returns(204) The resource was deleted successfully.

@endpoint GET /v1/Workspaces/{WorkspaceSid}/Activities
@required {WorkspaceSid: str # The SID of the Workspace with the Activity resources to read.}
@optional {FriendlyName: str # The `friendly_name` of the Activity resources to read., Available: str # Whether return only Activity resources that are available or unavailable. A value of `true` returns only available activities. Values of '1' or `yes` also indicate `true`. All other values represent `false` and return activities that are unavailable., PageSize: int(int64) # How many resources to return in each list page. The default is 50, and the maximum is 1000., Page: int # The page index. This value is simply for client state., PageToken: str # The page token. This is provided by the API.}
@returns(200) {activities: [map], meta: map{first_page_url: str(uri), key: str, next_page_url: str(uri)?, page: int, page_size: int, previous_page_url: str(uri)?, url: str(uri)}} # OK

@endpoint POST /v1/Workspaces/{WorkspaceSid}/Activities
@required {WorkspaceSid: str # The SID of the Workspace that the new Activity belongs to.}
@returns(201) {account_sid: str?, available: bool?, date_created: str(date-time)?, date_updated: str(date-time)?, friendly_name: str?, sid: str?, workspace_sid: str?, url: str(uri)?, links: map?} # Created

@endpoint GET /v1/Workspaces/{WorkspaceSid}/Events/{Sid}
@required {WorkspaceSid: str # The SID of the Workspace with the Event to fetch., Sid: str # The SID of the Event resource to fetch.}
@returns(200) {account_sid: str?, actor_sid: str?, actor_type: str?, actor_url: str(uri)?, description: str?, event_data: any?, event_date: str(date-time)?, event_date_ms: int(int64)?, event_type: str?, resource_sid: str?, resource_type: str?, resource_url: str(uri)?, sid: str?, source: str?, source_ip_address: str?, url: str(uri)?, workspace_sid: str?} # OK

@endpoint GET /v1/Workspaces/{WorkspaceSid}/Events
@required {WorkspaceSid: str # The SID of the Workspace with the Events to read. Returns only the Events that pertain to the specified Workspace.}
@optional {EndDate: str(date-time) # Only include Events that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time., EventType: str # The type of Events to read. Returns only Events of the type specified., Minutes: int # The period of events to read in minutes. Returns only Events that occurred since this many minutes in the past. The default is `15` minutes. Task Attributes for Events occuring more 43,200 minutes ago will be redacted., ReservationSid: str # The SID of the Reservation with the Events to read. Returns only Events that pertain to the specified Reservation., StartDate: str(date-time) # Only include Events from on or after this date and time, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Task Attributes for Events older than 30 days will be redacted., TaskQueueSid: str # The SID of the TaskQueue with the Events to read. Returns only the Events that pertain to the specified TaskQueue., TaskSid: str # The SID of the Task with the Events to read. Returns only the Events that pertain to the specified Task., WorkerSid: str # The SID of the Worker with the Events to read. Returns only the Events that pertain to the specified Worker., WorkflowSid: str # The SID of the Workflow with the Events to read. Returns only the Events that pertain to the specified Workflow., TaskChannel: str # The TaskChannel with the Events to read. Returns only the Events that pertain to the specified TaskChannel., Sid: str # The SID of the Event resource to read., PageSize: int(int64) # How many resources to return in each list page. The default is 50, and the maximum is 1000., Page: int # The page index. This value is simply for client state., PageToken: str # The page token. This is provided by the API.}
@returns(200) {events: [map], meta: map{first_page_url: str(uri), key: str, next_page_url: str(uri)?, page: int, page_size: int, previous_page_url: str(uri)?, url: str(uri)}} # OK

@endpoint GET /v1/Workspaces/{WorkspaceSid}/Tasks/{Sid}
@required {WorkspaceSid: str # The SID of the Workspace with the Task to fetch., Sid: str # The SID of the Task resource to fetch.}
@returns(200) {account_sid: str?, age: int, assignment_status: str, attributes: str?, addons: str?, date_created: str(date-time)?, date_updated: str(date-time)?, task_queue_entered_date: str(date-time)?, priority: int, reason: str?, sid: str?, task_queue_sid: str?, task_queue_friendly_name: str?, task_channel_sid: str?, task_channel_unique_name: str?, timeout: int, workflow_sid: str?, workflow_friendly_name: str?, workspace_sid: str?, url: str(uri)?, links: map?, virtual_start_time: str(date-time)?, ignore_capacity: bool?, routing_target: str?} # OK

@endpoint POST /v1/Workspaces/{WorkspaceSid}/Tasks/{Sid}
@required {WorkspaceSid: str # The SID of the Workspace with the Task to update., Sid: str # The SID of the Task resource to update.}
@optional {If-Match: str # If provided, applies this mutation if (and only if) the [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) header of the Task matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match).}
@returns(200) {account_sid: str?, age: int, assignment_status: str, attributes: str?, addons: str?, date_created: str(date-time)?, date_updated: str(date-time)?, task_queue_entered_date: str(date-time)?, priority: int, reason: str?, sid: str?, task_queue_sid: str?, task_queue_friendly_name: str?, task_channel_sid: str?, task_channel_unique_name: str?, timeout: int, workflow_sid: str?, workflow_friendly_name: str?, workspace_sid: str?, url: str(uri)?, links: map?, virtual_start_time: str(date-time)?, ignore_capacity: bool?, routing_target: str?} # OK

@endpoint DELETE /v1/Workspaces/{WorkspaceSid}/Tasks/{Sid}
@required {WorkspaceSid: str # The SID of the Workspace with the Task to delete., Sid: str # The SID of the Task resource to delete.}
@optional {If-Match: str # If provided, deletes this Task if (and only if) the [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) header of the Task matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match).}
@returns(204) The resource was deleted successfully.

@endpoint GET /v1/Workspaces/{WorkspaceSid}/Tasks
@required {WorkspaceSid: str # The SID of the Workspace with the Tasks to read.}
@optional {Priority: int # The priority value of the Tasks to read. Returns the list of all Tasks in the Workspace with the specified priority., AssignmentStatus: [str] # 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: str # The SID of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this SID., WorkflowName: str # The friendly name of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this friendly name., TaskQueueSid: str # The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID., TaskQueueName: str # The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name., EvaluateTaskAttributes: str # The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter., RoutingTarget: str # A SID of a Worker, Queue, or Workflow to route a Task to, Ordering: str # 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: bool # Whether to read Tasks with Add-ons. If `true`, returns only Tasks with Add-ons. If `false`, returns only Tasks without Add-ons., PageSize: int(int64) # How many resources to return in each list page. The default is 50, and the maximum is 1000., Page: int # The page index. This value is simply for client state., PageToken: str # The page token. This is provided by the API.}
@returns(200) {tasks: [map], meta: map{first_page_url: str(uri), key: str, next_page_url: str(uri)?, page: int, page_size: int, previous_page_url: str(uri)?, url: str(uri)}} # OK

@endpoint POST /v1/Workspaces/{WorkspaceSid}/Tasks
@required {WorkspaceSid: str # The SID of the Workspace that the new Task belongs to.}
@returns(201) {account_sid: str?, age: int, assignment_status: str, attributes: str?, addons: str?, date_created: str(date-time)?, date_updated: str(date-time)?, task_queue_entered_date: str(date-time)?, priority: int, reason: str?, sid: str?, task_queue_sid: str?, task_queue_friendly_name: str?, task_channel_sid: str?, task_channel_unique_name: str?, timeout: int, workflow_sid: str?, workflow_friendly_name: str?, workspace_sid: str?, url: str(uri)?, links: map?, virtual_start_time: str(date-time)?, ignore_capacity: bool?, routing_target: str?} # Created

@endpoint GET /v1/Workspaces/{WorkspaceSid}/TaskChannels/{Sid}
@required {WorkspaceSid: str # The SID of the Workspace with the Task Channel to fetch., Sid: str # The SID of the Task Channel resource to fetch.}
@returns(200) {account_sid: str?, date_created: str(date-time)?, date_updated: str(date-time)?, friendly_name: str?, sid: str?, unique_name: str?, workspace_sid: str?, channel_optimized_routing: bool?, url: str(uri)?, links: map?} # OK

@endpoint POST /v1/Workspaces/{WorkspaceSid}/TaskChannels/{Sid}
@required {WorkspaceSid: str # The SID of the Workspace with the Task Channel to update., Sid: str # The SID of the Task Channel resource to update.}
@returns(200) {account_sid: str?, date_created: str(date-time)?, date_updated: str(date-time)?, friendly_name: str?, sid: str?, unique_name: str?, workspace_sid: str?, channel_optimized_routing: bool?, url: str(uri)?, links: map?} # OK

@endpoint DELETE /v1/Workspaces/{WorkspaceSid}/TaskChannels/{Sid}
@required {WorkspaceSid: str # The SID of the Workspace with the Task Channel to delete., Sid: str # The SID of the Task Channel resource to delete.}
@returns(204) The resource was deleted successfully.

@endpoint GET /v1/Workspaces/{WorkspaceSid}/TaskChannels
@required {WorkspaceSid: str # The SID of the Workspace with the Task Channel to read.}
@optional {PageSize: int(int64) # How many resources to return in each list page. The default is 50, and the maximum is 1000., Page: int # The page index. This value is simply for client state., PageToken: str # The page token. This is provided by the API.}
@returns(200) {channels: [map], meta: map{first_page_url: str(uri), key: str, next_page_url: str(uri)?, page: int, page_size: int, previous_page_url: str(uri)?, url: str(uri)}} # OK

@endpoint POST /v1/Workspaces/{WorkspaceSid}/TaskChannels
@required {WorkspaceSid: str # The SID of the Workspace that the new Task Channel belongs to.}
@returns(201) {account_sid: str?, date_created: str(date-time)?, date_updated: str(date-time)?, friendly_name: str?, sid: str?, unique_name: str?, workspace_sid: str?, channel_optimized_routing: bool?, url: str(uri)?, links: map?} # Created

@endpoint GET /v1/Workspaces/{WorkspaceSid}/TaskQueues/{Sid}
@required {WorkspaceSid: str # The SID of the Workspace with the TaskQueue to fetch., Sid: str # The SID of the TaskQueue resource to fetch.}
@returns(200) {account_sid: str?, assignment_activity_sid: str?, assignment_activity_name: str?, date_created: str(date-time)?, date_updated: str(date-time)?, friendly_name: str?, max_reserved_workers: int, reservation_activity_sid: str?, reservation_activity_name: str?, sid: str?, target_workers: str?, task_order: str, url: str(uri)?, workspace_sid: str?, links: map?} # OK

@endpoint POST /v1/Workspaces/{WorkspaceSid}/TaskQueues/{Sid}
@required {WorkspaceSid: str # The SID of the Workspace with the TaskQueue to update., Sid: str # The SID of the TaskQueue resource to update.}
@returns(200) {account_sid: str?, assignment_activity_sid: str?, assignment_activity_name: str?, date_created: str(date-time)?, date_updated: str(date-time)?, friendly_name: str?, max_reserved_workers: int, reservation_activity_sid: str?, reservation_activity_name: str?, sid: str?, target_workers: str?, task_order: str, url: str(uri)?, workspace_sid: str?, links: map?} # OK

@endpoint DELETE /v1/Workspaces/{WorkspaceSid}/TaskQueues/{Sid}
@required {WorkspaceSid: str # The SID of the Workspace with the TaskQueue to delete., Sid: str # The SID of the TaskQueue resource to delete.}
@returns(204) The resource was deleted successfully.

@endpoint GET /v1/Workspaces/{WorkspaceSid}/TaskQueues
@required {WorkspaceSid: str # The SID of the Workspace with the TaskQueue to read.}
@optional {FriendlyName: str # The `friendly_name` of the TaskQueue resources to read., EvaluateWorkerAttributes: str # The attributes of the Workers to read. Returns the TaskQueues with Workers that match the attributes specified in this parameter., WorkerSid: str # The SID of the Worker with the TaskQueue resources to read., Ordering: str # Sorting parameter for TaskQueues, PageSize: int(int64) # How many resources to return in each list page. The default is 50, and the maximum is 1000., Page: int # The page index. This value is simply for client state., PageToken: str # The page token. This is provided by the API.}
@returns(200) {task_queues: [map], meta: map{first_page_url: str(uri), key: str, next_page_url: str(uri)?, page: int, page_size: int, previous_page_url: str(uri)?, url: str(uri)}} # OK

@endpoint POST /v1/Workspaces/{WorkspaceSid}/TaskQueues
@required {WorkspaceSid: str # The SID of the Workspace that the new TaskQueue belongs to.}
@returns(201) {account_sid: str?, assignment_activity_sid: str?, assignment_activity_name: str?, date_created: str(date-time)?, date_updated: str(date-time)?, friendly_name: str?, max_reserved_workers: int, reservation_activity_sid: str?, reservation_activity_name: str?, sid: str?, target_workers: str?, task_order: str, url: str(uri)?, workspace_sid: str?, links: map?} # Created

@endpoint POST /v1/Workspaces/{WorkspaceSid}/TaskQueues/RealTimeStatistics
@desc Fetch a Task Queue Real Time Statistics in bulk for the array of TaskQueue SIDs, support upto 50 in a request.
@required {WorkspaceSid: str # The unique SID identifier of the Workspace.}
@returns(200) {account_sid: str?, workspace_sid: str?, task_queue_data: [any]?, task_queue_response_count: int, url: str(uri)?} # OK

@endpoint GET /v1/Workspaces/{WorkspaceSid}/TaskQueues/{TaskQueueSid}/CumulativeStatistics
@required {WorkspaceSid: str # The SID of the Workspace with the TaskQueue to fetch., TaskQueueSid: str # The SID of the TaskQueue for which to fetch statistics.}
@optional {EndDate: str(date-time) # Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time., Minutes: int # Only calculate statistics since this many minutes in the past. The default is 15 minutes., StartDate: str(date-time) # Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format., TaskChannel: str # Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`., SplitByWaitTime: str # A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. TaskRouter will calculate statistics on up to 10,000 Tasks/Reservations for any given threshold.}
@returns(200) {account_sid: str?, avg_task_acceptance_time: int, start_time: str(date-time)?, end_time: str(date-time)?, reservations_created: int, reservations_accepted: int, reservations_rejected: int, reservations_timed_out: int, reservations_canceled: int, reservations_rescinded: int, split_by_wait_time: any?, task_queue_sid: str?, wait_duration_until_accepted: any?, wait_duration_until_canceled: any?, wait_duration_in_queue_until_accepted: any?, tasks_canceled: int, tasks_completed: int, tasks_deleted: int, tasks_entered: int, tasks_moved: int, workspace_sid: str?, url: str(uri)?} # OK

@endpoint GET /v1/Workspaces/{WorkspaceSid}/TaskQueues/{TaskQueueSid}/RealTimeStatistics
@required {WorkspaceSid: str # The SID of the Workspace with the TaskQueue to fetch., TaskQueueSid: str # The SID of the TaskQueue for which to fetch statistics.}
@optional {TaskChannel: str # The TaskChannel for which to fetch statistics. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`.}
@returns(200) {account_sid: str?, activity_statistics: [any]?, longest_task_waiting_age: int, longest_task_waiting_sid: str?, longest_relative_task_age_in_queue: int, longest_relative_task_sid_in_queue: str?, task_queue_sid: str?, tasks_by_priority: any?, tasks_by_status: any?, total_available_workers: int, total_eligible_workers: int, total_tasks: int, workspace_sid: str?, url: str(uri)?} # OK

@endpoint GET /v1/Workspaces/{WorkspaceSid}/TaskQueues/{TaskQueueSid}/Statistics
@required {WorkspaceSid: str # The SID of the Workspace with the TaskQueue to fetch., TaskQueueSid: str # The SID of the TaskQueue for which to fetch statistics.}
@optional {EndDate: str(date-time) # Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time., Minutes: int # Only calculate statistics since this many minutes in the past. The default is 15 minutes., StartDate: str(date-time) # Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format., TaskChannel: str # Only calculate real-time and cumulative statistics for the specified TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`., SplitByWaitTime: str # A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed.}
@returns(200) {account_sid: str?, cumulative: any?, realtime: any?, task_queue_sid: str?, workspace_sid: str?, url: str(uri)?} # OK

@endpoint GET /v1/Workspaces/{WorkspaceSid}/TaskQueues/Statistics
@required {WorkspaceSid: str # The SID of the Workspace with the TaskQueues to read.}
@optional {EndDate: str(date-time) # Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time., FriendlyName: str # The `friendly_name` of the TaskQueue statistics to read., Minutes: int # Only calculate statistics since this many minutes in the past. The default is 15 minutes., StartDate: str(date-time) # Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format., TaskChannel: str # Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`., SplitByWaitTime: str # A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed., PageSize: int(int64) # How many resources to return in each list page. The default is 50, and the maximum is 1000., Page: int # The page index. This value is simply for client state., PageToken: str # The page token. This is provided by the API.}
@returns(200) {task_queues_statistics: [map], meta: map{first_page_url: str(uri), key: str, next_page_url: str(uri)?, page: int, page_size: int, previous_page_url: str(uri)?, url: str(uri)}} # OK

@endpoint GET /v1/Workspaces/{WorkspaceSid}/Tasks/{TaskSid}/Reservations
@required {WorkspaceSid: str # The SID of the Workspace with the TaskReservation resources to read., TaskSid: str # The SID of the reserved Task resource with the TaskReservation resources to read.}
@optional {ReservationStatus: str # Returns the list of reservations for a task with a specified ReservationStatus.  Can be: `pending`, `accepted`, `rejected`, or `timeout`., WorkerSid: str # The SID of the reserved Worker resource to read., PageSize: int(int64) # How many resources to return in each list page. The default is 50, and the maximum is 1000., Page: int # The page index. This value is simply for client state., PageToken: str # The page token. This is provided by the API.}
@returns(200) {reservations: [map], meta: map{first_page_url: str(uri), key: str, next_page_url: str(uri)?, page: int, page_size: int, previous_page_url: str(uri)?, url: str(uri)}} # OK

@endpoint GET /v1/Workspaces/{WorkspaceSid}/Tasks/{TaskSid}/Reservations/{Sid}
@required {WorkspaceSid: str # The SID of the Workspace with the TaskReservation resource to fetch., TaskSid: str # The SID of the reserved Task resource with the TaskReservation resource to fetch., Sid: str # The SID of the TaskReservation resource to fetch.}
@returns(200) {account_sid: str?, date_created: str(date-time)?, date_updated: str(date-time)?, reservation_status: str, sid: str?, task_sid: str?, worker_name: str?, worker_sid: str?, workspace_sid: str?, url: str(uri)?, links: map?} # OK

@endpoint POST /v1/Workspaces/{WorkspaceSid}/Tasks/{TaskSid}/Reservations/{Sid}
@required {WorkspaceSid: str # The SID of the Workspace with the TaskReservation resources to update., TaskSid: str # The SID of the reserved Task resource with the TaskReservation resources to update., Sid: str # The SID of the TaskReservation resource to update.}
@optional {If-Match: str # The If-Match HTTP request header}
@returns(200) {account_sid: str?, date_created: str(date-time)?, date_updated: str(date-time)?, reservation_status: str, sid: str?, task_sid: str?, worker_name: str?, worker_sid: str?, workspace_sid: str?, url: str(uri)?, links: map?} # OK

@endpoint GET /v1/Workspaces/{WorkspaceSid}/Workers
@required {WorkspaceSid: str # The SID of the Workspace with the Workers to read.}
@optional {ActivityName: str # The `activity_name` of the Worker resources to read., ActivitySid: str # The `activity_sid` of the Worker resources to read., Available: str # Whether to return only Worker resources that are available or unavailable. Can be `true`, `1`, or `yes` to return Worker resources that are available, and `false`, or any value returns the Worker resources that are not available., FriendlyName: str # The `friendly_name` of the Worker resources to read., TargetWorkersExpression: str # Filter by Workers that would match an expression. In addition to fields in the workers' attributes, the expression can include the following worker fields: `sid`, `friendly_name`, `activity_sid`, or `activity_name`, TaskQueueName: str # The `friendly_name` of the TaskQueue that the Workers to read are eligible for., TaskQueueSid: str # The SID of the TaskQueue that the Workers to read are eligible for., Ordering: str # Sorting parameter for Workers, PageSize: int(int64) # How many resources to return in each list page. The default is 50, and the maximum is 1000., Page: int # The page index. This value is simply for client state., PageToken: str # The page token. This is provided by the API.}
@returns(200) {workers: [map], meta: map{first_page_url: str(uri), key: str, next_page_url: str(uri)?, page: int, page_size: int, previous_page_url: str(uri)?, url: str(uri)}} # OK

@endpoint POST /v1/Workspaces/{WorkspaceSid}/Workers
@required {WorkspaceSid: str # The SID of the Workspace that the new Worker belongs to.}
@returns(201) {account_sid: str?, activity_name: str?, activity_sid: str?, attributes: str?, available: bool?, date_created: str(date-time)?, date_status_changed: str(date-time)?, date_updated: str(date-time)?, friendly_name: str?, sid: str?, workspace_sid: str?, url: str(uri)?, links: map?} # Created

@endpoint GET /v1/Workspaces/{WorkspaceSid}/Workers/{Sid}
@required {WorkspaceSid: str # The SID of the Workspace with the Worker to fetch., Sid: str # The SID of the Worker resource to fetch.}
@returns(200) {account_sid: str?, activity_name: str?, activity_sid: str?, attributes: str?, available: bool?, date_created: str(date-time)?, date_status_changed: str(date-time)?, date_updated: str(date-time)?, friendly_name: str?, sid: str?, workspace_sid: str?, url: str(uri)?, links: map?} # OK

@endpoint POST /v1/Workspaces/{WorkspaceSid}/Workers/{Sid}
@required {WorkspaceSid: str # The SID of the Workspace with the Worker to update., Sid: str # The SID of the Worker resource to update.}
@optional {If-Match: str # The If-Match HTTP request header}
@returns(200) {account_sid: str?, activity_name: str?, activity_sid: str?, attributes: str?, available: bool?, date_created: str(date-time)?, date_status_changed: str(date-time)?, date_updated: str(date-time)?, friendly_name: str?, sid: str?, workspace_sid: str?, url: str(uri)?, links: map?} # OK

@endpoint DELETE /v1/Workspaces/{WorkspaceSid}/Workers/{Sid}
@required {WorkspaceSid: str # The SID of the Workspace with the Worker to delete., Sid: str # The SID of the Worker resource to delete.}
@optional {If-Match: str # The If-Match HTTP request header}
@returns(204) The resource was deleted successfully.

@endpoint GET /v1/Workspaces/{WorkspaceSid}/Workers/{WorkerSid}/Channels
@required {WorkspaceSid: str # The SID of the Workspace with the WorkerChannels to read., WorkerSid: str # The SID of the Worker with the WorkerChannels to read.}
@optional {PageSize: int(int64) # How many resources to return in each list page. The default is 50, and the maximum is 1000., Page: int # The page index. This value is simply for client state., PageToken: str # The page token. This is provided by the API.}
@returns(200) {channels: [map], meta: map{first_page_url: str(uri), key: str, next_page_url: str(uri)?, page: int, page_size: int, previous_page_url: str(uri)?, url: str(uri)}} # OK

@endpoint GET /v1/Workspaces/{WorkspaceSid}/Workers/{WorkerSid}/Channels/{Sid}
@required {WorkspaceSid: str # The SID of the Workspace with the WorkerChannel to fetch., WorkerSid: str # The SID of the Worker with the WorkerChannel to fetch., Sid: str # The SID of the WorkerChannel to fetch.}
@returns(200) {account_sid: str?, assigned_tasks: int, available: bool?, available_capacity_percentage: int, configured_capacity: int, date_created: str(date-time)?, date_updated: str(date-time)?, sid: str?, task_channel_sid: str?, task_channel_unique_name: str?, worker_sid: str?, workspace_sid: str?, url: str(uri)?} # OK

@endpoint POST /v1/Workspaces/{WorkspaceSid}/Workers/{WorkerSid}/Channels/{Sid}
@required {WorkspaceSid: str # The SID of the Workspace with the WorkerChannel to update., WorkerSid: str # The SID of the Worker with the WorkerChannel to update., Sid: str # The SID of the WorkerChannel to update.}
@returns(200) {account_sid: str?, assigned_tasks: int, available: bool?, available_capacity_percentage: int, configured_capacity: int, date_created: str(date-time)?, date_updated: str(date-time)?, sid: str?, task_channel_sid: str?, task_channel_unique_name: str?, worker_sid: str?, workspace_sid: str?, url: str(uri)?} # OK

@endpoint GET /v1/Workspaces/{WorkspaceSid}/Workers/{WorkerSid}/Statistics
@required {WorkspaceSid: str # The SID of the Workspace with the WorkerChannel to fetch., WorkerSid: str # The SID of the Worker with the WorkerChannel to fetch.}
@optional {Minutes: int # Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends., StartDate: str(date-time) # Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format., EndDate: str(date-time) # Only include usage that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time., TaskChannel: str # Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`.}
@returns(200) {account_sid: str?, cumulative: any?, worker_sid: str?, workspace_sid: str?, url: str(uri)?} # OK

@endpoint GET /v1/Workspaces/{WorkspaceSid}/Workers/{WorkerSid}/Reservations
@required {WorkspaceSid: str # The SID of the Workspace with the WorkerReservation resources to read., WorkerSid: str # The SID of the reserved Worker resource with the WorkerReservation resources to read.}
@optional {ReservationStatus: str # Returns the list of reservations for a worker with a specified ReservationStatus. Can be: `pending`, `accepted`, `rejected`, `timeout`, `canceled`, or `rescinded`., PageSize: int(int64) # How many resources to return in each list page. The default is 50, and the maximum is 1000., Page: int # The page index. This value is simply for client state., PageToken: str # The page token. This is provided by the API.}
@returns(200) {reservations: [map], meta: map{first_page_url: str(uri), key: str, next_page_url: str(uri)?, page: int, page_size: int, previous_page_url: str(uri)?, url: str(uri)}} # OK

@endpoint GET /v1/Workspaces/{WorkspaceSid}/Workers/{WorkerSid}/Reservations/{Sid}
@required {WorkspaceSid: str # The SID of the Workspace with the WorkerReservation resource to fetch., WorkerSid: str # The SID of the reserved Worker resource with the WorkerReservation resource to fetch., Sid: str # The SID of the WorkerReservation resource to fetch.}
@returns(200) {account_sid: str?, date_created: str(date-time)?, date_updated: str(date-time)?, reservation_status: str, sid: str?, task_sid: str?, worker_name: str?, worker_sid: str?, workspace_sid: str?, url: str(uri)?, links: map?} # OK

@endpoint POST /v1/Workspaces/{WorkspaceSid}/Workers/{WorkerSid}/Reservations/{Sid}
@required {WorkspaceSid: str # The SID of the Workspace with the WorkerReservation resources to update., WorkerSid: str # The SID of the reserved Worker resource with the WorkerReservation resources to update., Sid: str # The SID of the WorkerReservation resource to update.}
@optional {If-Match: str # The If-Match HTTP request header}
@returns(200) {account_sid: str?, date_created: str(date-time)?, date_updated: str(date-time)?, reservation_status: str, sid: str?, task_sid: str?, worker_name: str?, worker_sid: str?, workspace_sid: str?, url: str(uri)?, links: map?} # OK

@endpoint GET /v1/Workspaces/{WorkspaceSid}/Workers/Statistics
@required {WorkspaceSid: str # The SID of the Workspace with the Worker to fetch.}
@optional {Minutes: int # Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends., StartDate: str(date-time) # Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format., EndDate: str(date-time) # Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time., TaskQueueSid: str # The SID of the TaskQueue for which to fetch Worker statistics., TaskQueueName: str # The `friendly_name` of the TaskQueue for which to fetch Worker statistics., FriendlyName: str # Only include Workers with `friendly_name` values that match this parameter., TaskChannel: str # Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`.}
@returns(200) {realtime: any?, cumulative: any?, account_sid: str?, workspace_sid: str?, url: str(uri)?} # OK

@endpoint GET /v1/Workspaces/{WorkspaceSid}/Workers/CumulativeStatistics
@required {WorkspaceSid: str # The SID of the Workspace with the resource to fetch.}
@optional {EndDate: str(date-time) # Only calculate statistics from this date and time and earlier, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format., Minutes: int # Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends., StartDate: str(date-time) # Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format., TaskChannel: str # Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`.}
@returns(200) {account_sid: str?, start_time: str(date-time)?, end_time: str(date-time)?, activity_durations: [any]?, reservations_created: int, reservations_accepted: int, reservations_rejected: int, reservations_timed_out: int, reservations_canceled: int, reservations_rescinded: int, workspace_sid: str?, url: str(uri)?} # OK

@endpoint GET /v1/Workspaces/{WorkspaceSid}/Workers/RealTimeStatistics
@required {WorkspaceSid: str # The SID of the Workspace with the resource to fetch.}
@optional {TaskChannel: str # Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`.}
@returns(200) {account_sid: str?, activity_statistics: [any]?, total_workers: int, workspace_sid: str?, url: str(uri)?} # OK

@endpoint GET /v1/Workspaces/{WorkspaceSid}/Workflows/{Sid}
@required {WorkspaceSid: str # The SID of the Workspace with the Workflow to fetch., Sid: str # The SID of the Workflow resource to fetch.}
@returns(200) {account_sid: str?, assignment_callback_url: str(uri)?, configuration: str?, date_created: str(date-time)?, date_updated: str(date-time)?, document_content_type: str?, fallback_assignment_callback_url: str(uri)?, friendly_name: str?, sid: str?, task_reservation_timeout: int, workspace_sid: str?, url: str(uri)?, links: map?} # OK

@endpoint POST /v1/Workspaces/{WorkspaceSid}/Workflows/{Sid}
@required {WorkspaceSid: str # The SID of the Workspace with the Workflow to update., Sid: str # The SID of the Workflow resource to update.}
@returns(200) {account_sid: str?, assignment_callback_url: str(uri)?, configuration: str?, date_created: str(date-time)?, date_updated: str(date-time)?, document_content_type: str?, fallback_assignment_callback_url: str(uri)?, friendly_name: str?, sid: str?, task_reservation_timeout: int, workspace_sid: str?, url: str(uri)?, links: map?} # OK

@endpoint DELETE /v1/Workspaces/{WorkspaceSid}/Workflows/{Sid}
@required {WorkspaceSid: str # The SID of the Workspace with the Workflow to delete., Sid: str # The SID of the Workflow resource to delete.}
@returns(204) The resource was deleted successfully.

@endpoint GET /v1/Workspaces/{WorkspaceSid}/Workflows
@required {WorkspaceSid: str # The SID of the Workspace with the Workflow to read.}
@optional {FriendlyName: str # The `friendly_name` of the Workflow resources to read., PageSize: int(int64) # How many resources to return in each list page. The default is 50, and the maximum is 1000., Page: int # The page index. This value is simply for client state., PageToken: str # The page token. This is provided by the API.}
@returns(200) {workflows: [map], meta: map{first_page_url: str(uri), key: str, next_page_url: str(uri)?, page: int, page_size: int, previous_page_url: str(uri)?, url: str(uri)}} # OK

@endpoint POST /v1/Workspaces/{WorkspaceSid}/Workflows
@required {WorkspaceSid: str # The SID of the Workspace that the new Workflow to create belongs to.}
@returns(201) {account_sid: str?, assignment_callback_url: str(uri)?, configuration: str?, date_created: str(date-time)?, date_updated: str(date-time)?, document_content_type: str?, fallback_assignment_callback_url: str(uri)?, friendly_name: str?, sid: str?, task_reservation_timeout: int, workspace_sid: str?, url: str(uri)?, links: map?} # Created

@endpoint GET /v1/Workspaces/{WorkspaceSid}/Workflows/{WorkflowSid}/CumulativeStatistics
@required {WorkspaceSid: str # The SID of the Workspace with the resource to fetch., WorkflowSid: str # Returns the list of Tasks that are being controlled by the Workflow with the specified Sid value.}
@optional {EndDate: str(date-time) # Only include usage that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time., Minutes: int # Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends., StartDate: str(date-time) # Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format., TaskChannel: str # Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`., SplitByWaitTime: str # A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. TaskRouter will calculate statistics on up to 10,000 Tasks for any given threshold.}
@returns(200) {account_sid: str?, avg_task_acceptance_time: int, start_time: str(date-time)?, end_time: str(date-time)?, reservations_created: int, reservations_accepted: int, reservations_rejected: int, reservations_timed_out: int, reservations_canceled: int, reservations_rescinded: int, split_by_wait_time: any?, wait_duration_until_accepted: any?, wait_duration_until_canceled: any?, tasks_canceled: int, tasks_completed: int, tasks_entered: int, tasks_deleted: int, tasks_moved: int, tasks_timed_out_in_workflow: int, workflow_sid: str?, workspace_sid: str?, url: str(uri)?} # OK

@endpoint GET /v1/Workspaces/{WorkspaceSid}/Workflows/{WorkflowSid}/RealTimeStatistics
@required {WorkspaceSid: str # The SID of the Workspace with the Workflow to fetch., WorkflowSid: str # Returns the list of Tasks that are being controlled by the Workflow with the specified SID value.}
@optional {TaskChannel: str # Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`.}
@returns(200) {account_sid: str?, longest_task_waiting_age: int, longest_task_waiting_sid: str?, tasks_by_priority: any?, tasks_by_status: any?, total_tasks: int, workflow_sid: str?, workspace_sid: str?, url: str(uri)?} # OK

@endpoint GET /v1/Workspaces/{WorkspaceSid}/Workflows/{WorkflowSid}/Statistics
@required {WorkspaceSid: str # The SID of the Workspace with the Workflow to fetch., WorkflowSid: str # Returns the list of Tasks that are being controlled by the Workflow with the specified SID value.}
@optional {Minutes: int # Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends., StartDate: str(date-time) # Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format., EndDate: str(date-time) # Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time., TaskChannel: str # Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`., SplitByWaitTime: str # A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA.}
@returns(200) {account_sid: str?, cumulative: any?, realtime: any?, workflow_sid: str?, workspace_sid: str?, url: str(uri)?} # OK

@endpoint GET /v1/Workspaces/{Sid}
@required {Sid: str # The SID of the Workspace resource to fetch.}
@returns(200) {account_sid: str?, date_created: str(date-time)?, date_updated: str(date-time)?, default_activity_name: str?, default_activity_sid: str?, event_callback_url: str(uri)?, events_filter: str?, friendly_name: str?, multi_task_enabled: bool?, sid: str?, timeout_activity_name: str?, timeout_activity_sid: str?, prioritize_queue_order: str, url: str(uri)?, links: map?} # OK

@endpoint POST /v1/Workspaces/{Sid}
@required {Sid: str # The SID of the Workspace resource to update.}
@returns(200) {account_sid: str?, date_created: str(date-time)?, date_updated: str(date-time)?, default_activity_name: str?, default_activity_sid: str?, event_callback_url: str(uri)?, events_filter: str?, friendly_name: str?, multi_task_enabled: bool?, sid: str?, timeout_activity_name: str?, timeout_activity_sid: str?, prioritize_queue_order: str, url: str(uri)?, links: map?} # OK

@endpoint DELETE /v1/Workspaces/{Sid}
@required {Sid: str # The SID of the Workspace resource to delete.}
@returns(204) The resource was deleted successfully.

@endpoint GET /v1/Workspaces
@optional {FriendlyName: str # The `friendly_name` of the Workspace resources to read. For example `Customer Support` or `2014 Election Campaign`., PageSize: int(int64) # How many resources to return in each list page. The default is 50, and the maximum is 1000., Page: int # The page index. This value is simply for client state., PageToken: str # The page token. This is provided by the API.}
@returns(200) {workspaces: [map], meta: map{first_page_url: str(uri), key: str, next_page_url: str(uri)?, page: int, page_size: int, previous_page_url: str(uri)?, url: str(uri)}} # OK

@endpoint POST /v1/Workspaces
@returns(201) {account_sid: str?, date_created: str(date-time)?, date_updated: str(date-time)?, default_activity_name: str?, default_activity_sid: str?, event_callback_url: str(uri)?, events_filter: str?, friendly_name: str?, multi_task_enabled: bool?, sid: str?, timeout_activity_name: str?, timeout_activity_sid: str?, prioritize_queue_order: str, url: str(uri)?, links: map?} # Created

@endpoint GET /v1/Workspaces/{WorkspaceSid}/CumulativeStatistics
@required {WorkspaceSid: str # The SID of the Workspace to fetch.}
@optional {EndDate: str(date-time) # Only include usage that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time., Minutes: int # Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends., StartDate: str(date-time) # Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format., TaskChannel: str # Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`., SplitByWaitTime: str # A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. TaskRouter will calculate statistics on up to 10,000 Tasks for any given threshold.}
@returns(200) {account_sid: str?, avg_task_acceptance_time: int, start_time: str(date-time)?, end_time: str(date-time)?, reservations_created: int, reservations_accepted: int, reservations_rejected: int, reservations_timed_out: int, reservations_canceled: int, reservations_rescinded: int, split_by_wait_time: any?, wait_duration_until_accepted: any?, wait_duration_until_canceled: any?, tasks_canceled: int, tasks_completed: int, tasks_created: int, tasks_deleted: int, tasks_moved: int, tasks_timed_out_in_workflow: int, workspace_sid: str?, url: str(uri)?} # OK

@endpoint GET /v1/Workspaces/{WorkspaceSid}/RealTimeStatistics
@required {WorkspaceSid: str # The SID of the Workspace to fetch.}
@optional {TaskChannel: str # Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`.}
@returns(200) {account_sid: str?, activity_statistics: [any]?, longest_task_waiting_age: int, longest_task_waiting_sid: str?, tasks_by_priority: any?, tasks_by_status: any?, total_tasks: int, total_workers: int, workspace_sid: str?, url: str(uri)?} # OK

@endpoint GET /v1/Workspaces/{WorkspaceSid}/Statistics
@required {WorkspaceSid: str # The SID of the Workspace to fetch.}
@optional {Minutes: int # Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends., StartDate: str(date-time) # Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format., EndDate: str(date-time) # Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time., TaskChannel: str # Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`., SplitByWaitTime: str # A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA.}
@returns(200) {realtime: any?, cumulative: any?, account_sid: str?, workspace_sid: str?, url: str(uri)?} # OK

@end
