Get Started

REST API: Notifications

A Notification instance resource represents a single log entry made by Twilio in the course of handling your calls or your use of the REST API. It is very useful for debugging purposes. The Notifications list resource represents the set of notifications generated for an account.

For convenience, a Notifications list resource is also available as a subresource of a Call instance resource. This resource is scoped to an individual call, so that you can navigate directly from a call to the notifications generated from that call.

Notification Instance Resource

This resource represents an individual notification entry.

Resource URI

/2010-04-01/Accounts/{AccountSid}/Notifications/{NotificationSid}

Resource Properties

A Notification resource is represented by the following properties:

SPECIAL NOTE: Unlike other areas of this REST API, the representation of a Notification instance is different from that of the Notification representations within responses from the list resource. Due to the potentially voluminous amount of data in a notification, the full HTTP request and response data is only returned in the Notification instance resource representation.
Property Description
Sid A 34 character string that uniquely identifies this resource.
DateCreated The date that this resource was created, given in RFC 2822 format.
DateUpdated The date that this resource was last updated, given in RFC 2822 format.
AccountSid The unique id of the Account responsible for this notification.
CallSid CallSid is the unique id of the call during which the notification was generated. Empty if the notification was generated by the REST API without regard to a specific phone call.
ApiVersion The version of the Twilio in use when this notification was generated. May be empty for events that don't have a specific API version, like incoming phone calls.
Log An integer log level corresponding to the type of notification: 0 is ERROR, 1 is WARNING.
ErrorCode A unique error code for the error condition. You can lookup errors, with possible causes and solutions, in our Error Dictionary.
MoreInfo A URL for more information about the error condition. The URL is a page in our Error Dictionary.
MessageText The text of the notification.
MessageDate The date the notification was actually generated, given in RFC 2822 format. Due to buffering, this may be slightly different than the DateCreated date.
RequestUrl The URL of the resource that generated the notification.
If the notification was generated during a phone call:
This is the URL of the resource on YOUR SERVER that caused the notification.
If the notification was generated by your use of the REST API:
This is the URL of the REST resource you were attempting to request on Twilio's servers.
RequestMethod The HTTP method in use for the request that generated the notification.
If the notification was generated during a phone call:
The HTTP Method use to request the resource on your server.
If the notification was generated by your use of the REST API:
This is the HTTP method used in your request to the REST resource on Twilio's servers.
RequestVariables The Twilio-generated HTTP GET or POST variables sent to your server. Alternatively, if the notification was generated by the REST API, this field will include any HTTP POST or PUT variables you sent to the REST API.
ResponseHeaders The HTTP headers returned by your server.
ResponseBody The HTTP body returned by your server.
Uri The URI for this resource, relative to https://api.twilio.com

HTTP GET

Example

HTTP POST

Not Supported.

HTTP PUT

Not Supported.

HTTP DELETE

Deletes the notification identified by {NotificationSid} from an account's log. If successful, returns HTTP status 204 (No Content) with no body.

Examples

Notifications List Resource

Resource URI

/2010-04-01/Accounts/{AccountSid}/Notifications
/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Notifications

HTTP GET

Returns a list of notifications generated for an account. The list includes paging information.

List Filters

The following GET query string parameters allow you to limit the list returned. Note, parameters are case-sensitive:

Parameter Description
Log Only show notifications for this log, using the integer log values shown above.
MessageDate Only show notifications for this date. Should be formatted as YYYY-MM-DD. You can also specify inequality, such as MessageDate<=YYYY-MM-DD for messages logged at or before midnight on a date, and MessageDate>=YYYY-MM-DD for messages logged at or after midnight on a date.
Example 1
Example 2

Only show WARNING notifications generated on Jul 06th, 2009.

Example 3

Only show WARNING notifications generated on or after midnight on Jul 06th, 2009.

Example 4

Only show WARNING notifications generated between midnight Jul 06th, 2009 and midnight Jul 08th, 2009.

HTTP POST

Not Supported.

HTTP PUT

Not Supported.

HTTP DELETE

Not Supported.