A Session is a single instance of two individuals communicating. It belongs to a Service and maps two Participants for a Proxy application. Sessions allow you to:
date_last_interaction
type: string<date-time>The ISO 8601 date when the Session last had an interaction.
date_expiry
type: string<date-time>The ISO 8601 date when the Session should expire. If this is value is present, it overrides the ttl
value.
unique_name
type: stringAn application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. Supports UTF-8 characters. This value should not have PII.
status
type: enum<string>The status of the Session. Can be: open
, in-progress
, closed
, failed
, or unknown
.
open
in-progress
closed
failed
unknown
ttl
type: integerThe time, in seconds, when the session will expire. The time is measured from the last Session create or the Session's last Interaction.
mode
type: enum<string>The Mode of the Session. Can be: message-only
, voice-only
, or voice-and-message
.
message-only
voice-only
voice-and-message
date_updated
type: string<date-time>The ISO 8601 date and time in GMT when the resource was last updated.
POST https://proxy.twilio.com/v1/Services/{ServiceSid}/Sessions
Create a new Session.
UniqueName
type: stringAn application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. This value should not have PII.
DateExpiry
type: string<date-time>The ISO 8601 date when the Session should expire. If this is value is present, it overrides the ttl
value.
Ttl
type: integerThe time, in seconds, when the session will expire. The time is measured from the last Session create or the Session's last Interaction.
Mode
type: enum<string>The Mode of the Session. Can be: message-only
, voice-only
, or voice-and-message
and the default value is voice-and-message
.
message-only
voice-only
voice-and-message
Status
type: enum<string>The initial status of the Session. Can be: open
, in-progress
, closed
, failed
, or unknown
. The default is open
on create.
open
in-progress
closed
failed
unknown
GET https://proxy.twilio.com/v1/Services/{ServiceSid}/Sessions/{Sid}
Retrieve a single Session.
Sid
type: stringThe Twilio-provided string that uniquely identifies the Session resource to fetch.
GET https://proxy.twilio.com/v1/Services/{ServiceSid}/Sessions
Retrieve a list of all Sessions for a given Service.
PageSize
type: integerHow many resources to return in each list page. The default is 50, and the maximum is 1000.
POST https://proxy.twilio.com/v1/Services/{ServiceSid}/Sessions/{Sid}
Post updates to a given Session.
ServiceSid
type: SID<KS>The SID of the parent Service of the resource to update.
Sid
type: SID<KC>The Twilio-provided string that uniquely identifies the Session resource to update.
DateExpiry
type: string<date-time>The ISO 8601 date when the Session should expire. If this is value is present, it overrides the ttl
value.
Ttl
type: integerThe time, in seconds, when the session will expire. The time is measured from the last Session create or the Session's last Interaction.
Status
type: enum<string>The new status of the resource. Can be: in-progress
to re-open a session or closed
to close a session.
open
in-progress
closed
failed
unknown
DELETE https://proxy.twilio.com/v1/Services/{ServiceSid}/Sessions/{Sid}
Deleting a Session removes it permanently. Related Participants and Interactions will also be deleted.
Any Message or Call logs created during interactions for this Session will be deleted automatically after 90 days of the Session being closed, as per our Session retention policy. If you want to delete these resources before then, you must issue DELETE
requests for the inbound and outbound resources of all child Interactions directly. Once you have deleted a Session, those resource SIDs will not be discoverable via Proxy.
ServiceSid
type: SID<KS>The SID of the parent Service of the resource to delete.
Sid
type: SID<KC>The Twilio-provided string that uniquely identifies the Session resource to delete.