Twilio

class twilio.Twilio(account_sid, auth_token)

Create a Twilio service.

Variables:
  • account_sid (str) – The users’s account SID
  • auth_token (str) – THe account’s API token

Account

Twilio.account(sid)

Return the representation of an Account or SubAccount.

Application

Account.application(sid)

Return a Application resource representation, representing an application within this account.

Application.delete()

Delete this resource.

Application.get()

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Application.update(obj)

Update this resource.

Variables:obj (dict) – a Python object representing the updated resource, usually in the same format as returned from get. Refer to the upstream documentation for details.

Applications

Account.applications()

Return a list of Application resource representations, each representing an application within this account.

Applications.create(obj)

Create a new resource.

Variables:obj – a Python object representing the resource to be created, usually in the same format as returned from get. Refer to the upstream documentation for details.
Applications.get(FriendlyName=None, Page=None, PageSize=None, AfterSid=None)

Fetch the Applications belonging to an account.

Variables:
  • FriendlyName (str) – Only return the Account resources with friendly names that exactly match this name.
  • Page (int) – The current page number. Zero-indexed, so the first page is 0.
  • PageSize (int) – How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • AfterSid (str) – The last Sid returned in the previous page, used to avoid listing duplicated resources if new ones are created while paging.

AuthorizedConnectApp

Account.authorized_connect_app(sid)

Return a Connect App resource representation, representing a Connect App you’ve authorized to access this account.

AuthorizedConnectApp.get()

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

AuthorizedConnectApps

Account.authorized_connect_apps()

Return a list of Connect App resource representations, each representing a Connect App you’ve authorized to access this account.

AuthorizedConnectApps.get(Page=None, PageSize=None, AfterSid=None)

Fetch the Authorized Connect Apps belonging to an account.

Variables:
  • Page (int) – The current page number. Zero-indexed, so the first page is 0.
  • PageSize (int) – How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • AfterSid (str) – The last Sid returned in the previous page, used to avoid listing duplicated resources if new ones are created while paging.

AvailablePhoneNumbers

Account.available_phone_numbers()

Return an AvailablePhoneNumbers resource that allows querying local and toll-free available for this account.

AvailablePhoneNumbersLocal

AvailablePhoneNumbers.local(country_code)

Return a list of local AvailablePhoneNumber resource representations that match the specified filters, each representing a phone number that is currently available for provisioning within this account.

AvailablePhoneNumbersLocal.get(AreaCode=None, Contains=None, InRegion=None, InPostalCode=None, NearLatLong=None, NearNumber=None, InLata=None, InRateCenter=None, Distance=None)

Fetch available local phone numbers for an account.

Variables:
  • AreaCode (str) – Find phone numbers in the specified area code.
  • Contains (str) – A pattern to match phone numbers on. Valid characters are * and [0-9a-zA-Z]. The * character will match any single digit.
  • InRegion (str) – Limit results to a particular region (State/Province). Given a phone number, search within the same Region as that number. (US and Canada only)
  • InPostalCode (str) – Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. (US and Canada only)
  • NearLatLong (str) – Given a latitude/longitude pair lat,long find geographically close numbers within Distance miles. (US and Canada only)
  • NearNumber (str) – Given a phone number, find a geographically close number within Distance miles. Distance defaults to 25 miles. (US and Canada only)
  • InLata (str) – Limit results to a specific Local access and transport area (LATA). Given a phone number, search within the same LATA as that number. (US and Canada only)
  • InRateCenter (str) – Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires InLata to be set as well. (US and Canada only)
  • InDistance (int) – Specifies the search radius for a Near- query in miles. If not specified this defaults to 25 miles. (US and Canada only)

AvailablePhoneNumbersTollFree

AvailablePhoneNumbers.toll_free(country_code)

Return a list of toll-free AvailablePhoneNumber resource representations that match the specified filters, each representing a phone number that is currently available for provisioning within this account.

AvailablePhoneNumbersTollFree.get(AreaCode=None, Contains=None)

Fetch available toll-free phone numbers for an account.

Variables:
  • AreaCode (str) – Find phone numbers in the specified area code.
  • Contains (str) – A pattern to match phone numbers on. Valid characters are * and [0-9a-zA-Z]. The * character will match any single digit.

Call

Account.call(sid)

Return a phone call made to and from this account.

Notifications

Call.notifications()

Return a list of notifications generated for this call.

Notifications.get(Log=None, MessageDate=None, MessageDateGT=None, MessageDateLT=None, Page=None, PageSize=None, AfterSid=None)

Fetch notifications for an account or call.

Variables:
  • Log (int) – Only show notifications for this log, using the integer log values.
  • MessageDate (str) – Only show notifications for this date, given as YYYY-MM-DD.
  • MessageDateGT (str) – Greater than inequality for MessageDate, use it for messages logged at or after midnight on a date (generates MessageDate>=YYYY-MM-DD).
  • MessageDateLT – Lower than inequality for MessageDate, use it for messages logged at or before midnight on a date (generates MessageDate<=YYYY-MM-DD).
  • Page (int) – The current page number. Zero-indexed, so the first page is 0.
  • PageSize (int) – How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • AfterSid (str) – The last Sid returned in the previous page, used to avoid listing duplicated resources if new ones are created while paging.

Recordings

Call.recordings()

Return a list of Recording resource representations, each representing a recording generated during the course of this phone call.

Recordings.get(CallSid=None, DateCreated=None, DateCreatedGT=None, DateCreatedLT=None, Page=None, PageSize=None, AfterSid=None)

Fetch the list of transcriptions for an account or call.

Variables:
  • CallSid (str) – Show only recordings made during the call given by this sid.
  • DateCreated (str) – Only show recordings created on this date, given as YYYY-MM-DD.
  • DateCreatedGT (str) – Greater than inequality for DateCreated, use it for recordings created at or after midnight on a date (generates DateCreated>=YYYY-MM-DD).
  • DateCreatedLT – Lower than inequality for DateCreated, use it for recordings created at or before midnight on a date (generates DateCreated<=YYYY-MM-DD).
  • Page (int) – The current page number. Zero-indexed, so the first page is 0.
  • PageSize (int) – How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • AfterSid (str) – The last Sid returned in the previous page, used to avoid listing duplicated resources if new ones are created while paging.
Call.get()

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Call.update(obj)

Update this resource.

Variables:obj (dict) – a Python object representing the updated resource, usually in the same format as returned from get. Refer to the upstream documentation for details.

Calls

Account.calls()

Return a list of phone calls made to and from this account.

Calls.create(obj)

Create a new resource.

Variables:obj – a Python object representing the resource to be created, usually in the same format as returned from get. Refer to the upstream documentation for details.
Calls.get(To=None, From=None, Status=None, StartTime=None, StartTimeGT=None, StartTimeLT=None, ParentCallSid=None, Page=None, PageSize=None, AfterSid=None)

Fetch the calls made to or from an account.

Variables:
  • To (str) – Only show calls to this phone number or Client identifier.
  • From (str) – Only show calls from this phone number or Client identifier.
  • Status (str) – Only show calls currently in this status. May be queued, ringing, in-progress, completed, failed, busy or no-answer.
  • StartTime (str) – Only show calls that started on this date, given as YYYY-MM-DD.
  • StartTimeGT (str) – Greater than inequality for StartTime, use it for calls that started at or after midnight on a date (generates StartTime>=YYYY-MM-DD).
  • StartTimeLT – Lower than inequality for StartTime, use it for calls that started at or before midnight on a date (generates StartTime<=YYYY-MM-DD).
  • ParentCallSid (str) – Only show calls spawned by the call with this Sid.
  • Page (int) – The current page number. Zero-indexed, so the first page is 0.
  • PageSize (int) – How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • AfterSid (str) – The last Sid returned in the previous page, used to avoid listing duplicated resources if new ones are created while paging.

Conference

Account.conference(sid)

Return a conference within this account.

Participant

Conference.participant(sid)

Return a participant in this conference.

Participant.delete()

Delete this resource.

Participant.get()

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Participant.update(obj)

Update this resource.

Variables:obj (dict) – a Python object representing the updated resource, usually in the same format as returned from get. Refer to the upstream documentation for details.

Participants

Conference.participants()

Return the list of participants in this conference.

Participants.get(Muted=None, Page=None, PageSize=None, AfterSid=None)

Fetch the participants of a conference.

Variables:
  • Muted (bool) – Only show participants that are muted or unmuted. Either True or False.
  • Page (int) – The current page number. Zero-indexed, so the first page is 0.
  • PageSize (int) – How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • AfterSid (str) – The last Sid returned in the previous page, used to avoid listing duplicated resources if new ones are created while paging.
Conference.get()

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Conferences

Account.conferences()

Return a list of conferences within this account.

Conferences.get(Status=None, FriendlyName=None, DateCreated=None, DateCreatedGT=None, DateCreatedLT=None, DateUpdated=None, DateUpdatedGT=None, DateUpdatedLT=None, Page=None, PageSize=None, AfterSid=None)

Fetch the calls made to or from an account.

Variables:
  • Status (str) – Only show conferences currently in with this status. May be init, in-progress, or completed.
  • FriendlyName (str) – List conferences who’s FriendlyName is the exact match of this string.
  • DateCreated (str) – Only show conferences that started on this date, given as YYYY-MM-DD.
  • DateCreatedGT (str) – Greater than inequality for DateCreated, use it for conferences that started at or after midnight on a date (generates DateCreated>=YYYY-MM-DD).
  • DateCreatedLT – Lower than inequality for DateCreated, use it for conferences that started at or before midnight on a date (generates DateCreated<=YYYY-MM-DD).
  • DateUpdated (str) – Only show conferences that were last updated on this date, given as YYYY-MM-DD.
  • DateUpdatedGT (str) – Greater than inequality for DateUpdated, use it for conferences that were last updated at or after midnight on a date (generates DateUpdated>=YYYY-MM-DD).
  • DateUpdatedLT – Lower than inequality for DateUpdated, use it for conferences that were last updated at or before midnight on a date (generates DateUpdated<=YYYY-MM-DD).
  • Page (int) – The current page number. Zero-indexed, so the first page is 0.
  • PageSize (int) – How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • AfterSid (str) – The last Sid returned in the previous page, used to avoid listing duplicated resources if new ones are created while paging.

ConnectApp

Account.connect_app(sid)

Return a Connect App resource representations, representing a Connect App in this account.

ConnectApp.get()

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

ConnectApp.update(obj)

Update this resource.

Variables:obj (dict) – a Python object representing the updated resource, usually in the same format as returned from get. Refer to the upstream documentation for details.

ConnectApps

Account.connect_apps()

Return a list of Connect App resource representations, each representing a Connect App in this account.

ConnectApps.get(Page=None, PageSize=None, AfterSid=None)

Fetch the Connect Apps belonging to an account.

Variables:
  • Page (int) – The current page number. Zero-indexed, so the first page is 0.
  • PageSize (int) – How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • AfterSid (str) – The last Sid returned in the previous page, used to avoid listing duplicated resources if new ones are created while paging.

IncomingPhoneNumber

Account.incoming_phone_number(sid)

Return an IncomingPhoneNumber resource representation, representing a phone number given to this account.

IncomingPhoneNumber.delete()

Delete this resource.

IncomingPhoneNumber.get()

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

IncomingPhoneNumber.update(obj)

Update this resource.

Variables:obj (dict) – a Python object representing the updated resource, usually in the same format as returned from get. Refer to the upstream documentation for details.

IncomingPhoneNumbers

Account.incoming_phone_numbers()

Return a list of IncomingPhoneNumber resource representations, each representing a phone number given to this account.

IncomingPhoneNumbersLocal

IncomingPhoneNumbers.local()
IncomingPhoneNumbersLocal.create(obj)

Create a new resource.

Variables:obj – a Python object representing the resource to be created, usually in the same format as returned from get. Refer to the upstream documentation for details.
IncomingPhoneNumbersLocal.get(PhoneNumber=None, FriendlyName=None, Page=None, PageSize=None, AfterSid=None)

Fetch incoming phone numbers list for an account.

Variables:
  • PhoneNumber (str) – Only show the incoming phone number resources that match this pattern. You can specify partial numbers and use * as a wildcard for any digit.
  • FriendlyName (str) – Only show the incoming phone number resources with friendly names that exactly match this name.
  • Page (int) – The current page number. Zero-indexed, so the first page is 0.
  • PageSize (int) – How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • AfterSid (str) – The last Sid returned in the previous page, used to avoid listing duplicated resources if new ones are created while paging.

IncomingPhoneNumbersTollFree

IncomingPhoneNumbers.toll_free()
IncomingPhoneNumbersTollFree.create(obj)

Create a new resource.

Variables:obj – a Python object representing the resource to be created, usually in the same format as returned from get. Refer to the upstream documentation for details.
IncomingPhoneNumbersTollFree.get(PhoneNumber=None, FriendlyName=None, Page=None, PageSize=None, AfterSid=None)

Fetch incoming phone numbers list for an account.

Variables:
  • PhoneNumber (str) – Only show the incoming phone number resources that match this pattern. You can specify partial numbers and use * as a wildcard for any digit.
  • FriendlyName (str) – Only show the incoming phone number resources with friendly names that exactly match this name.
  • Page (int) – The current page number. Zero-indexed, so the first page is 0.
  • PageSize (int) – How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • AfterSid (str) – The last Sid returned in the previous page, used to avoid listing duplicated resources if new ones are created while paging.
IncomingPhoneNumbers.create(obj)

Create a new resource.

Variables:obj – a Python object representing the resource to be created, usually in the same format as returned from get. Refer to the upstream documentation for details.
IncomingPhoneNumbers.get(PhoneNumber=None, FriendlyName=None, Page=None, PageSize=None, AfterSid=None)

Fetch incoming phone numbers list for an account.

Variables:
  • PhoneNumber (str) – Only show the incoming phone number resources that match this pattern. You can specify partial numbers and use * as a wildcard for any digit.
  • FriendlyName (str) – Only show the incoming phone number resources with friendly names that exactly match this name.
  • Page (int) – The current page number. Zero-indexed, so the first page is 0.
  • PageSize (int) – How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • AfterSid (str) – The last Sid returned in the previous page, used to avoid listing duplicated resources if new ones are created while paging.

Notification

Account.notification(sid)

Return a notification generated for this account.

Notification.delete()

Delete this resource.

Notification.get()

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Notifications

Account.notifications()

Return a list of notifications generated for this account.

Notifications.get(Log=None, MessageDate=None, MessageDateGT=None, MessageDateLT=None, Page=None, PageSize=None, AfterSid=None)

Fetch notifications for an account or call.

Variables:
  • Log (int) – Only show notifications for this log, using the integer log values.
  • MessageDate (str) – Only show notifications for this date, given as YYYY-MM-DD.
  • MessageDateGT (str) – Greater than inequality for MessageDate, use it for messages logged at or after midnight on a date (generates MessageDate>=YYYY-MM-DD).
  • MessageDateLT – Lower than inequality for MessageDate, use it for messages logged at or before midnight on a date (generates MessageDate<=YYYY-MM-DD).
  • Page (int) – The current page number. Zero-indexed, so the first page is 0.
  • PageSize (int) – How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • AfterSid (str) – The last Sid returned in the previous page, used to avoid listing duplicated resources if new ones are created while paging.

OutgoingCallerId

Account.outgoing_caller_id(sid)

Return an OutgoingCallerId resource representation, representing a Caller ID number valid for this account.

OutgoingCallerId.delete()

Delete this resource.

OutgoingCallerId.get()

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

OutgoingCallerId.update(obj)

Update this resource.

Variables:obj (dict) – a Python object representing the updated resource, usually in the same format as returned from get. Refer to the upstream documentation for details.

OutgoingCallerIds

Account.outgoing_caller_ids()

Return a list of OutgoingCallerId resource representations, each representing a Caller ID number valid for this account.

OutgoingCallerIds.create(obj)

Create a new resource.

Variables:obj – a Python object representing the resource to be created, usually in the same format as returned from get. Refer to the upstream documentation for details.
OutgoingCallerIds.get(PhoneNumber=None, FriendlyName=None, Page=None, PageSize=None, AfterSid=None)

Fetch outgoing caller ids for an account.

Variables:
  • PhoneNumber (str) – Only show the incoming phone number resources that match this pattern. You can specify partial numbers and use * as a wildcard for any digit.
  • FriendlyName (str) – Only show the incoming phone number resources with friendly names that exactly match this name.
  • Page (int) – The current page number. Zero-indexed, so the first page is 0.
  • PageSize (int) – How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • AfterSid (str) – The last Sid returned in the previous page, used to avoid listing duplicated resources if new ones are created while paging.

Queue

Account.queue(sid)

Return a queue within this account.

Member

Queue.member(sid)

Return a member in this queue.

Member.get()

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Member.update(obj)

Update this resource.

Variables:obj (dict) – a Python object representing the updated resource, usually in the same format as returned from get. Refer to the upstream documentation for details.

Members

Queue.members()

Return the list of members in this queue.

Members.get(Page=None, PageSize=None, AfterSid=None)

Fetch the list of members for a conference.

Variables:
  • Page (int) – The current page number. Zero-indexed, so the first page is 0.
  • PageSize (int) – How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • AfterSid (str) – The last Sid returned in the previous page, used to avoid listing duplicated resources if new ones are created while paging.
Queue.delete()

Delete this resource.

Queue.get()

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Queue.update(obj)

Update this resource.

Variables:obj (dict) – a Python object representing the updated resource, usually in the same format as returned from get. Refer to the upstream documentation for details.

Queues

Account.queues()

Return a list of queues within this account.

Queues.create(obj)

Create a new resource.

Variables:obj – a Python object representing the resource to be created, usually in the same format as returned from get. Refer to the upstream documentation for details.
Queues.get(Page=None, PageSize=None, AfterSid=None)

Fetch the list of conferences of an account.

Variables:
  • Page (int) – The current page number. Zero-indexed, so the first page is 0.
  • PageSize (int) – How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • AfterSid (str) – The last Sid returned in the previous page, used to avoid listing duplicated resources if new ones are created while paging.

Recording

Account.recording(sid)

Return a Recording resource representation, representing a recording generated during the course of a phone call made to or from this account.

Transcriptions

Recording.transcriptions()

Return a set of Transcription resource representations for this recording.

Transcriptions.get(Page=None, PageSize=None, AfterSid=None)

Fetch the list of transcriptions for an account or call.

Variables:
  • Page (int) – The current page number. Zero-indexed, so the first page is 0.
  • PageSize (int) – How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • AfterSid (str) – The last Sid returned in the previous page, used to avoid listing duplicated resources if new ones are created while paging.
Recording.delete()

Delete this resource.

Recording.get()

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Recordings

Account.recordings()

Return a list of Recording resource representations, each representing a recording generated during the course of a phone call made to or from this account.

Recordings.get(CallSid=None, DateCreated=None, DateCreatedGT=None, DateCreatedLT=None, Page=None, PageSize=None, AfterSid=None)

Fetch the list of transcriptions for an account or call.

Variables:
  • CallSid (str) – Show only recordings made during the call given by this sid.
  • DateCreated (str) – Only show recordings created on this date, given as YYYY-MM-DD.
  • DateCreatedGT (str) – Greater than inequality for DateCreated, use it for recordings created at or after midnight on a date (generates DateCreated>=YYYY-MM-DD).
  • DateCreatedLT – Lower than inequality for DateCreated, use it for recordings created at or before midnight on a date (generates DateCreated<=YYYY-MM-DD).
  • Page (int) – The current page number. Zero-indexed, so the first page is 0.
  • PageSize (int) – How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • AfterSid (str) – The last Sid returned in the previous page, used to avoid listing duplicated resources if new ones are created while paging.

SMS

Account.sms()

Return a SMS resource to query messages and short codes resources.

Message

SMS.message(sid)

Return a SMS message associated with this account.

Message.get()

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Messages

SMS.messages()

Return a list of SMS messages associated with this account.

Messages.create(obj)

Create a new resource.

Variables:obj – a Python object representing the resource to be created, usually in the same format as returned from get. Refer to the upstream documentation for details.
Messages.get(To=None, From=None, DateSent=None, DateSentGT=None, DateSentLT=None, Page=None, PageSize=None, AfterSid=None)

Fetch the list of SMS messages associated with an account.

Variables:
  • To (str) – Only show SMS messages to this phone number.
  • From (str) – Only show SMS messages from this phone number.
  • DateSent (str) – Only show SMS messages on this date, given as YYYY-MM-DD.
  • DateSentGT (str) – Greater than inequality for DateSent, use it for message sent at or after midnight on a date (generates DateSent>=YYYY-MM-DD).
  • DateSentLT – Lower than inequality for DateSent, use it for messages sent at or before midnight on a date (generates DateSent<=YYYY-MM-DD).
  • Page (int) – The current page number. Zero-indexed, so the first page is 0.
  • PageSize (int) – How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • AfterSid (str) – The last Sid returned in the previous page, used to avoid listing duplicated resources if new ones are created while paging.

ShortCode

SMS.short_code(sid)

Return a ShortCode resource representation, representing a short code within this account.

ShortCode.get()

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

ShortCode.update(obj)

Update this resource.

Variables:obj (dict) – a Python object representing the updated resource, usually in the same format as returned from get. Refer to the upstream documentation for details.

ShortCodes

SMS.short_codes()

Return a list of ShortCode resource representations, each representing a short code within this account.

ShortCodes.get(ShortCode=None, FriendlyName=None, Page=None, PageSize=None, AfterSid=None)

Fetch the list of short codes for an account.

Variables:
  • ShortCode (str) – Only show the ShortCode resources that match this pattern. You can specify partial numbers and use * as a wildcard for any digit.
  • FriendlyName (str) – Only show the ShortCode resources with friendly names that exactly match this name.
  • Page (int) – The current page number. Zero-indexed, so the first page is 0.
  • PageSize (int) – How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • AfterSid (str) – The last Sid returned in the previous page, used to avoid listing duplicated resources if new ones are created while paging.

Transcription

Account.transcription(sid)

Return a Transcription resource representation for call made to of from this account.

Transcription.get()

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Transcriptions

Account.transcriptions()

Return a set of Transcription resource representations for this account.

Transcriptions.get(Page=None, PageSize=None, AfterSid=None)

Fetch the list of transcriptions for an account or call.

Variables:
  • Page (int) – The current page number. Zero-indexed, so the first page is 0.
  • PageSize (int) – How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • AfterSid (str) – The last Sid returned in the previous page, used to avoid listing duplicated resources if new ones are created while paging.

Usage

Account.usage()

Return a usage resource to query records and triggers resources.

Records

Usage.records()

Return a list of usage records.

RecordsAllTime

Records.all_time()

Return a single usage record for each usage category, each representing usage over the date-range specified. This is the same as the root .usage().records().

RecordsAllTime.get(Category=None, StartDate=None, EndDate=None, Page=None, PageSize=None, AfterSid=None)

Fetch a list of usage records.

Variables:
  • Category (str) – Only include usage records of this usage category.
  • StartDate (str) – Only include usage that has occurred on or after this date. Format is YYYY-MM-DD. All dates are in GMT. As a convenience, you can also specify offsets to today. For example, StartDate=-30days will make StartDate be 30 days before today.
  • EndDate (str) – Only include usage that has occurred on or before this date. Format is YYYY-MM-DD. All dates are in GMT. As a convenience, you can also specify offsets to today. For example, EndDate=+30days will make EndDate be 30 days from today.
  • Page (int) – The current page number. Zero-indexed, so the first page is 0.
  • PageSize (int) – How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • AfterSid (str) – The last Sid returned in the previous page, used to avoid listing duplicated resources if new ones are created while paging.

RecordsDaily

Records.daily()

Return multiple usage records for each usage category, each representing usage over a daily time-interval.

RecordsDaily.get(Category=None, StartDate=None, EndDate=None, Page=None, PageSize=None, AfterSid=None)

Fetch a list of usage records.

Variables:
  • Category (str) – Only include usage records of this usage category.
  • StartDate (str) – Only include usage that has occurred on or after this date. Format is YYYY-MM-DD. All dates are in GMT. As a convenience, you can also specify offsets to today. For example, StartDate=-30days will make StartDate be 30 days before today.
  • EndDate (str) – Only include usage that has occurred on or before this date. Format is YYYY-MM-DD. All dates are in GMT. As a convenience, you can also specify offsets to today. For example, EndDate=+30days will make EndDate be 30 days from today.
  • Page (int) – The current page number. Zero-indexed, so the first page is 0.
  • PageSize (int) – How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • AfterSid (str) – The last Sid returned in the previous page, used to avoid listing duplicated resources if new ones are created while paging.

RecordsLastMonth

Records.last_month()

Return a single usage record per usage category, for last month’s usage only.

RecordsLastMonth.get(Category=None, StartDate=None, EndDate=None, Page=None, PageSize=None, AfterSid=None)

Fetch a list of usage records.

Variables:
  • Category (str) – Only include usage records of this usage category.
  • StartDate (str) – Only include usage that has occurred on or after this date. Format is YYYY-MM-DD. All dates are in GMT. As a convenience, you can also specify offsets to today. For example, StartDate=-30days will make StartDate be 30 days before today.
  • EndDate (str) – Only include usage that has occurred on or before this date. Format is YYYY-MM-DD. All dates are in GMT. As a convenience, you can also specify offsets to today. For example, EndDate=+30days will make EndDate be 30 days from today.
  • Page (int) – The current page number. Zero-indexed, so the first page is 0.
  • PageSize (int) – How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • AfterSid (str) – The last Sid returned in the previous page, used to avoid listing duplicated resources if new ones are created while paging.

RecordsMonthly

Records.monthly()

Return multiple usage records for each usage category, each representing usage over a monthly time-interval.

RecordsMonthly.get(Category=None, StartDate=None, EndDate=None, Page=None, PageSize=None, AfterSid=None)

Fetch a list of usage records.

Variables:
  • Category (str) – Only include usage records of this usage category.
  • StartDate (str) – Only include usage that has occurred on or after this date. Format is YYYY-MM-DD. All dates are in GMT. As a convenience, you can also specify offsets to today. For example, StartDate=-30days will make StartDate be 30 days before today.
  • EndDate (str) – Only include usage that has occurred on or before this date. Format is YYYY-MM-DD. All dates are in GMT. As a convenience, you can also specify offsets to today. For example, EndDate=+30days will make EndDate be 30 days from today.
  • Page (int) – The current page number. Zero-indexed, so the first page is 0.
  • PageSize (int) – How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • AfterSid (str) – The last Sid returned in the previous page, used to avoid listing duplicated resources if new ones are created while paging.

RecordsThisMonth

Records.this_month()

Return a single usage record per usage category, for this month’s usage only.

RecordsThisMonth.get(Category=None, StartDate=None, EndDate=None, Page=None, PageSize=None, AfterSid=None)

Fetch a list of usage records.

Variables:
  • Category (str) – Only include usage records of this usage category.
  • StartDate (str) – Only include usage that has occurred on or after this date. Format is YYYY-MM-DD. All dates are in GMT. As a convenience, you can also specify offsets to today. For example, StartDate=-30days will make StartDate be 30 days before today.
  • EndDate (str) – Only include usage that has occurred on or before this date. Format is YYYY-MM-DD. All dates are in GMT. As a convenience, you can also specify offsets to today. For example, EndDate=+30days will make EndDate be 30 days from today.
  • Page (int) – The current page number. Zero-indexed, so the first page is 0.
  • PageSize (int) – How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • AfterSid (str) – The last Sid returned in the previous page, used to avoid listing duplicated resources if new ones are created while paging.

RecordsToday

Records.today()

Return a single usage record per usage category, for today’s usage only.

RecordsToday.get(Category=None, StartDate=None, EndDate=None, Page=None, PageSize=None, AfterSid=None)

Fetch a list of usage records.

Variables:
  • Category (str) – Only include usage records of this usage category.
  • StartDate (str) – Only include usage that has occurred on or after this date. Format is YYYY-MM-DD. All dates are in GMT. As a convenience, you can also specify offsets to today. For example, StartDate=-30days will make StartDate be 30 days before today.
  • EndDate (str) – Only include usage that has occurred on or before this date. Format is YYYY-MM-DD. All dates are in GMT. As a convenience, you can also specify offsets to today. For example, EndDate=+30days will make EndDate be 30 days from today.
  • Page (int) – The current page number. Zero-indexed, so the first page is 0.
  • PageSize (int) – How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • AfterSid (str) – The last Sid returned in the previous page, used to avoid listing duplicated resources if new ones are created while paging.

RecordsYearly

Records.yearly()

Return multiple usage records for each usage category, each representing usage over a yearly time-interval.

RecordsYearly.get(Category=None, StartDate=None, EndDate=None, Page=None, PageSize=None, AfterSid=None)

Fetch a list of usage records.

Variables:
  • Category (str) – Only include usage records of this usage category.
  • StartDate (str) – Only include usage that has occurred on or after this date. Format is YYYY-MM-DD. All dates are in GMT. As a convenience, you can also specify offsets to today. For example, StartDate=-30days will make StartDate be 30 days before today.
  • EndDate (str) – Only include usage that has occurred on or before this date. Format is YYYY-MM-DD. All dates are in GMT. As a convenience, you can also specify offsets to today. For example, EndDate=+30days will make EndDate be 30 days from today.
  • Page (int) – The current page number. Zero-indexed, so the first page is 0.
  • PageSize (int) – How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • AfterSid (str) – The last Sid returned in the previous page, used to avoid listing duplicated resources if new ones are created while paging.

RecordsYesterday

Records.yesterday()

Return a single usage record per usage category, for yesterday’s usage only.

RecordsYesterday.get(Category=None, StartDate=None, EndDate=None, Page=None, PageSize=None, AfterSid=None)

Fetch a list of usage records.

Variables:
  • Category (str) – Only include usage records of this usage category.
  • StartDate (str) – Only include usage that has occurred on or after this date. Format is YYYY-MM-DD. All dates are in GMT. As a convenience, you can also specify offsets to today. For example, StartDate=-30days will make StartDate be 30 days before today.
  • EndDate (str) – Only include usage that has occurred on or before this date. Format is YYYY-MM-DD. All dates are in GMT. As a convenience, you can also specify offsets to today. For example, EndDate=+30days will make EndDate be 30 days from today.
  • Page (int) – The current page number. Zero-indexed, so the first page is 0.
  • PageSize (int) – How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • AfterSid (str) – The last Sid returned in the previous page, used to avoid listing duplicated resources if new ones are created while paging.
Records.get(Category=None, StartDate=None, EndDate=None, Page=None, PageSize=None, AfterSid=None)

Fetch a list of usage records.

Variables:
  • Category (str) – Only include usage records of this usage category.
  • StartDate (str) – Only include usage that has occurred on or after this date. Format is YYYY-MM-DD. All dates are in GMT. As a convenience, you can also specify offsets to today. For example, StartDate=-30days will make StartDate be 30 days before today.
  • EndDate (str) – Only include usage that has occurred on or before this date. Format is YYYY-MM-DD. All dates are in GMT. As a convenience, you can also specify offsets to today. For example, EndDate=+30days will make EndDate be 30 days from today.
  • Page (int) – The current page number. Zero-indexed, so the first page is 0.
  • PageSize (int) – How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • AfterSid (str) – The last Sid returned in the previous page, used to avoid listing duplicated resources if new ones are created while paging.

Trigger

Usage.trigger(sid)

Return an usage trigger set on this account.

Trigger.delete()

Delete this resource.

Trigger.get()

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Trigger.update(obj)

Update this resource.

Variables:obj (dict) – a Python object representing the updated resource, usually in the same format as returned from get. Refer to the upstream documentation for details.

Triggers

Usage.triggers()

Return a list of usage triggers set on this account.

Triggers.create(obj)

Create a new resource.

Variables:obj – a Python object representing the resource to be created, usually in the same format as returned from get. Refer to the upstream documentation for details.
Triggers.get(Recurring=None, UsageCategory=None, TriggerBy=None, Page=None, PageSize=None, AfterSid=None)

Fetch a list of usage triggers resource representations.

Variables:
  • Recurring (str) – Only show usage triggers that count over this interval. One of daily, monthly, or yearly. To retrieve non-recurring triggers, leave this empty or use alltime.
  • UsageCategory (str) – Only include usage triggers that watch this usage category.
  • TriggerBy (str) – Only show usage triggers that trigger by this field in the usage record. Must be one of: count, usage, or price.
  • Page (int) – The current page number. Zero-indexed, so the first page is 0.
  • PageSize (int) – How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • AfterSid (str) – The last Sid returned in the previous page, used to avoid listing duplicated resources if new ones are created while paging.
Account.get()

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Account.update(obj)

Update this resource.

Variables:obj (dict) – a Python object representing the updated resource, usually in the same format as returned from get. Refer to the upstream documentation for details.

Accounts

Twilio.accounts()

Return the set of Accounts resources belonging to the Account used to make the API request. This list includes that account, along with any subaccounts belonging to it.

You can use the Accounts list resource to create subaccounts and retrieve the subaccounts that exist under your main account.

Accounts.create(obj)

Create a new resource.

Variables:obj – a Python object representing the resource to be created, usually in the same format as returned from get. Refer to the upstream documentation for details.
Accounts.get(FriendlyName=None, Status=None, Page=None, PageSize=None, AfterSid=None)

Fetch the (sub)accounts belonging to this account.

Variables:
  • FriendlyName (str) – Only return the Account resources with friendly names that exactly match this name.
  • Status (str) – Only return Account resources with the given status. Can be closed, suspended or active.
  • Page (int) – The current page number. Zero-indexed, so the first page is 0.
  • PageSize (int) – How many resources to return in each list page. The default is 50, and the maximum is 1000.
  • AfterSid (str) – The last Sid returned in the previous page, used to avoid listing duplicated resources if new ones are created while paging.