Events is a platform feature that provides comprehensive event-logging and change-tracking for Twilio resources.
For example, Events log when you provision a phone number, change your account's security settings, delete a recording, and so on. Events log virtually every action taken within Twilio, regardless of whether that action was taken through the API, by a user in the Twilio Console, or even by a Twilio employee.
The Events REST resource provides an API to retrieve this event-log. Each Event is like a log entry that captures:
Events work at any scale and across all Twilio products. They can be an instrumental tool in giving you full visibility into your Twilio applications. The API can be used to retrieve your event log and push it into the log aggregation or SIEM solution of your choice.
account_sid
type: SID<AC>The SID of the Account that created the Event resource.
^AC[0-9a-fA-F]{32}$
34
34
actor_sid
type: SID<US>The SID of the actor that caused the event, if available. Can be null
.
^US[0-9a-fA-F]{32}$
34
34
actor_type
type: stringThe type of actor that caused the event. Can be: user
for a change made by a logged-in user in the Twilio Console, account
for an event caused by an API request by an authenticating Account, twilio-admin
for an event caused by a Twilio employee, and so on.
event_data
type: objectAn object with additional data about the event. The contents depend on event_type
. For example, event-types of the form RESOURCE.updated
, this value contains a resource_properties
dictionary that describes the previous and updated properties of the resource.
event_date
type: string<date-time>The date and time in GMT when the event was recorded specified in ISO 8601 format.
event_type
type: stringThe event's type. Event-types are typically in the form: RESOURCE_TYPE.ACTION
, where RESOURCE_TYPE
is the type of resource that was affected and ACTION
is what happened to it. For example, phone-number.created
. For a full list of all event-types, see the Monitor Event Types.
resource_sid
type: SIDThe SID of the resource that was affected.
^[a-zA-Z]{2}[0-9a-fA-F]{32}$
34
34
resource_type
type: stringThe type of resource that was affected. For a full list of all resource-types, see the Monitor Event Types.
sid
type: SID<AE>The unique string that we created to identify the Event resource.
^AE[0-9a-fA-F]{32}$
34
34
source
type: stringThe originating system or interface that caused the event. Can be: web
for events caused by user action in the Twilio Console, api
for events caused by a request to our API, or twilio
for events caused by an automated or internal Twilio system.
source_ip_address
type: stringThe IP address of the source, if the source is outside the Twilio cloud. This value is null
for events with source
of twilio
These fields make it easy to build Event notifications or list pages. For example, you can display human-readable strings like "On {`event_date`}, a {`event_type`} event was generated for resource {`resource_type`} via {`source`} by {`actor_type`} {`actor_sid`} from {`source_ip_address`}".
Sources, actor-types, and actor-sids are closely interrelated. They all help to indicate who or what caused the event, and from where. Here's a table describing the most common combinations you're likely to see:
source | actor_type | actor_sid | description |
---|---|---|---|
api | account | AC123 | The Account AC123 authenticated against the API and caused the event. |
web | user | US456 | The User whose sid is US456 was logged in the Twilio Console and caused the event. The User's Sid can be seen in the Manager Users page of the Twilio Console. |
twilio | twilio-admin | null | A Twilio Administrator made the change through Twilio's administration interface. |
GET https://monitor.twilio.com/v1/Events/{Sid}
Sid
type: SID<AE>The SID of the Event resource to fetch.
^AE[0-9a-fA-F]{32}$
34
34
GET https://monitor.twilio.com/v1/Events
Returns a list of Events in this account, sorted by event-date
. This list includes paging information.
By default, all Events are included. You can always filter your Events by event-date using the StartDate
and EndDate
parameters.
In addition, you may filter by any one of the other fields. Filtering on more than one field in the same request is not supported and will result in a 400 Bad Request
error.
ActorSid
type: SID<US>Only include events initiated by this Actor. Useful for auditing actions taken by specific users or API credentials.
^US[0-9a-fA-F]{32}$
34
34
ResourceSid
type: SIDOnly include events that refer to this resource. Useful for discovering the history of a specific resource.
^[a-zA-Z]{2}[0-9a-fA-F]{32}$
34
34
SourceIpAddress
type: stringOnly include events that originated from this IP address. Useful for tracking suspicious activity originating from the API or the Twilio Console.
StartDate
type: string<date-time>Only include events that occurred on or after this date. Specify the date in GMT and ISO 8601 format.
EndDate
type: string<date-time>Only include events that occurred on or before this date. Specify the date in GMT and ISO 8601 format.
PageSize
type: integerHow many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Page
type: integerThe page index. This value is simply for client state.
0
An example that filters for all events in March, 2015
Using the Events list resource and the ResourceSid
filter to find out everything that happened a a specific phone-number
Using the SourceIpAddress
filter to track the activity of a particular IP address on a day in April
ActorSid
, ResourceSid
, and SourceIpAddress
may only be used one at a time, so this request that uses both ActorSid
and ResourceSid
returns an HTTP 400 error
Events currently tracks the following resource types and associated event types. All of the event types are available via the console and API:
Resource Type | Event Types |
---|---|
account | account.created account.updated account.deleted |
account-api-keys | account-api-keys.created account-api-keys.deleted account-api-keys.updated |
account-auth-token | account-auth-token.deleted account-auth-token.promoted account-auth-token.updated account-auth-token.created account-auth-token.secondary-created account-auth-token.secondary-deleted |
account-credentials | account-credentials.created account-credentials.deleted account-credentials.updated |
account-keys | account-keys.created account-keys.deleted account-keys.updated |
application | application.created application.updated application.deleted |
authorized-connect-app | authorized-connect-app.created authorized-connect-app.deleted authorized-connect-app.updated |
bulkexports | bulkexports.created bulkexports.deleted bulkexports.downloaded bulkexports.updated |
byoc-trunk | byoc-trunk.updated byoc-trunk.created byoc-trunk.deleted |
call | call.deleted |
call.status | call.status.updated |
caller-id | caller-id.created caller-id.updated caller-id.deleted |
config | config.created config.deleted config.updated |
connect-app | connect-app.created connect-app.updated connect-app.deleted |
connection-policy | connection-policy.created connection-policy.deleted connection-policy.updated |
copilot-application | copilot-application.created copilot-application.updated copilot-application.deleted |
copilot-number-pool | copilot-number-pool.created copilot-number-pool.deleted copilot-number-pool.updated |
data-access-policy | data-access-policy.updated |
data-policy | data-policy.created data-policy.updated data-policy.deleted |
interconnect-connection | interconnect-connection.created interconnect-connection.updated interconnect-connection.deleted |
invoice-settings | invoice-settings.created invoice-settings.deleted invoice-settings.updated |
ip-access-control-list | ip-access-control-list.created ip-access-control-list.deleted ip-access-control-list.updated |
ip-messaging.channel | ip-messaging.channel.created ip-messaging.channel.updated ip-messaging.channel.deleted |
ip-messaging.credential | ip-messaging.credential.created ip-messaging.credential.updated ip-messaging.credential.deleted |
ip-messaging.member | ip-messaging.member.created ip-messaging.member.updated ip-messaging.member.deleted |
ip-messaging.message | ip-messaging.message.created ip-messaging.message.deleted ip-messaging.message.updated |
ip-messaging.role | ip-messaging.role.created ip-messaging.role.updated ip-messaging.role.deleted |
ip-messaging.service | ip-messaging.service.created ip-messaging.service.updated ip-messaging.service.deleted |
ip-messaging.user | ip-messaging.user.deleted ip-messaging.user.created ip-messaging.user.updated |
ip-record | ip-record.created ip-record.updated ip-record.deleted |
message | message.updated message.deleted |
message-body | message-body.deleted |
message-media | message-media.deleted message-media.deletedall message-media.created message-media.updated |
messaging-settings | messaging-settings.updated |
payment | payment.created payment.deleted payment.updated |
payment-method | payment-method.created payment-method.updated payment-method.deleted |
payment-refund | payment-refund.created payment-refund.deleted payment-refund.updated |
phone-number | phone-number.created phone-number.updated phone-number.deleted |
recharge-trigger | recharge-trigger.created recharge-trigger.updated recharge-trigger.deleted |
recording | recording.created recording.updated recording.deleted recording.bulk-delete.created recording.accessed |
report | report.cloned report.updated |
rtc-app-config | rtc-app-config.created rtc-app-config.updated rtc-app-config.deleted |
security-settings | security-settings.created security-settings.deleted security-settings.updated |
sender-id | sender-id.created sender-id.updated sender-id.deleted sender-id.country.created sender-id.country.deleted sender-id.country.status.updated sender-id.country.override_status.updated sender-id.registration.added sender-id.registration.removed |
service | |
service-record | service-record.created service-record.updated service-record.deleted |
shortcode | shortcode.created shortcode.updated shortcode.deleted |
sipmanipulation | sipmanipulation.created sipmanipulation.updated sipmanipulation.deleted |
sip-credential-list | sip-credential-list.created sip-credential-list.updated sip-credential-list.deleted |
sip-domain | sip-domain.created sip-domain.updated sip-domain.deleted |
sip-ip-access-control-list | sip-ip-access-control-list.created sip-ip-access-control-list.updated sip-ip-access-control-list.deleted |
slapchop-api | slapchop-api.created slapchop-api.updated slapchop-api.deleted |
sms-geographic-permissions | sms-geographic-permissions.created sms-geographic-permissions.deleted sms-geographic-permissions.updated |
support-plan | support-plan.updated support-plan.created support-plan.deleted |
taskrouter-rate-limit | taskrouter-rate-limit.updated |
transcription | transcription.created transcription.deleted transcription.accessed |
trunk | trunk.created trunk.deleted trunk.updated |
usage-trigger | usage-trigger.created usage-trigger.updated usage-trigger.deleted |
user | user.created user.deleted user.updated |
user-invitation | user-invitation.created user-invitation.deleted user-invitation.updated |
user-password | user-password.created user-password.deleted user-password.updated |
user-session | user-session.created user-session.deleted user-session.updated |
verify-fraud-guard | verify-fraud-guard.updated |
verify-fraud-guard-mode | verify-fraud-guard-mode.updated |
verify-geo-permissions-sms | verify-geo-permissions-sms.updated |
verify-geo-permissions-voice | verify-geo-permissions-voice.updated |
voice-geographic-permissions | voice-geographic-permissions.created voice-geographic-permissions.deleted voice-geographic-permissions.updated |
voice-insights-account-flags | voice-insights-account-flags.updated |
voice-trace | voice-trace.updated |
wireless-sim | wireless-sim.updated |
wireless-sim.connection | wireless-sim.connection.updated |