Event Resource
TaskRouter logs Events for each state change in the Workspace for the purpose of historical reporting and auditing; it keeps that data for 30 days. To learn more about what events to expect and how they work, please visit the Event Reference page.
Event properties
Pagination is not supported under this resource. Please avoid usage of the page
query parameter.
Resource Properties in REST API format | |
---|---|
account_sid
|
The SID of the Account that created the Event resource. |
actor_sid
|
The SID of the resource that triggered the event. |
actor_type
|
The type of resource that triggered the event. |
actor_url
|
The absolute URL of the resource that triggered the event. |
description
|
A description of the event. |
event_data
|
Data about the event. For more information, see Event types. |
event_date
|
The time the event was sent, specified in ISO 8601 format. |
event_date_ms
|
The time the event was sent in milliseconds. |
event_type
|
The identifier for the event. |
resource_sid
|
The SID of the object the event is most relevant to, such as a TaskSid, ReservationSid, or a WorkerSid. |
resource_type
|
The type of object the event is most relevant to, such as a Task, Reservation, or a Worker). |
resource_url
|
The URL of the resource the event is most relevant to. |
sid
|
The unique string that we created to identify the Event resource. |
source
|
Where the Event originated. |
source_ip_address
|
The IP from which the Event originated. |
url
|
The absolute URL of the Event resource. |
workspace_sid
|
The SID of the Workspace that contains the Event. |
Fetch an Event resource
https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/Events/{Sid}
Parameters
Parameters in REST API format | |
---|---|
workspace_sid
Path
|
The SID of the Workspace with the Event to fetch. |
sid
Path
|
The SID of the Event resource to fetch. |
Example 1
List all Events
https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/Events
Parameters
Parameters in REST API format | |
---|---|
workspace_sid
Path
|
The SID of the Workspace with the Events to read. Returns only the Events that pertain to the specified Workspace. |
end_date
Optional
|
Only include Events that occurred on or before this date, specified in GMT as an ISO 8601 date-time. |
event_type
Optional
|
The type of Events to read. Returns only Events of the type specified. |
minutes
Optional
|
The period of events to read in minutes. Returns only Events that occurred since this many minutes in the past. The default is |
reservation_sid
Optional
|
The SID of the Reservation with the Events to read. Returns only Events that pertain to the specified Reservation. |
start_date
Optional
|
Only include Events from on or after this date and time, specified in ISO 8601 format. Task Attributes for Events older than 30 days will be redacted. |
task_queue_sid
Optional
|
The SID of the TaskQueue with the Events to read. Returns only the Events that pertain to the specified TaskQueue. |
task_sid
Optional
|
The SID of the Task with the Events to read. Returns only the Events that pertain to the specified Task. |
worker_sid
Optional
|
The SID of the Worker with the Events to read. Returns only the Events that pertain to the specified Worker. |
workflow_sid
Optional
|
The SID of the Workflow with the Events to read. Returns only the Events that pertain to the specified Workflow. |
task_channel
Optional
|
The TaskChannel with the Events to read. Returns only the Events that pertain to the specified TaskChannel. |
sid
Optional
|
The SID of the Event resource to read. |
Example 1
Example 2
If the StartDate
of the Events request is greater than 30 days in the past then the query will be serviced a 400
-error response.
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.