Interactions are read-only communications logs of a given Session. Each Interaction represents a single communication.
Interactions are composed of an inbound (to Twilio) and an outbound (from Twilio) leg. Interactions can have both inbound and outbound legs or be "one-sided" (like when creating a Message Interaction resource).
If a user sends an SMS to a proxy number, and Twilio Proxy handles the proxying to the other Participant, you'll have an Interaction with both an inbound SMS and an outbound SMS.
data
type: stringA JSON string that includes the message body of message interactions (e.g. {"body": "hello"}
) or the call duration (when available) of a call (e.g. {"duration": "5"}
).
type
type: enum<string>The Type of the Interaction. Can be: message
, voice
or unknown
.
message
voice
unknown
inbound_resource_status
type: enum<string>The inbound resource status of the Interaction. Will always be delivered
for messages and in-progress
for calls.
outbound_resource_status
type: enum<string>The outbound resource status of the Interaction. Can be: accepted
, canceled
, deleted
, delivered
, delivery-unknown
, failed
, partially-delivered
, queued
, read
, received
, receiving
, scheduled
, sending
, sent
, undelivered
, or unknown
for messages. Can be initiated
or completed
or unknown
for calls.
date_created
type: string<date-time>The ISO 8601 date and time in GMT when the Interaction was created.
date_updated
type: string<date-time>The ISO 8601 date and time in GMT when the resource was last updated.
You cannot POST
to the Interactions resource. Instead, you can generate Interactions via the appropriate Participant's MessageInteraction resource. For details, see Sending Messages. Otherwise, Interactions are created automatically when Participants text or call each other.
GET https://proxy.twilio.com/v1/Services/{ServiceSid}/Sessions/{SessionSid}/Interactions/{Sid}
Sid
type: SID<KI>The Twilio-provided string that uniquely identifies the Interaction resource to fetch.
GET https://proxy.twilio.com/v1/Services/{ServiceSid}/Sessions/{SessionSid}/Interactions
Retrieve a list of Interactions for a given Session.
ServiceSid
type: SID<KS>The SID of the parent Service to read the resources from.
SessionSid
type: SID<KC>The SID of the parent Session to read the resources from.
PageSize
type: integerHow many resources to return in each list page. The default is 50, and the maximum is 1000.
DELETE https://proxy.twilio.com/v1/Services/{ServiceSid}/Sessions/{SessionSid}/Interactions/{Sid}
Deleting an Interaction removes it permanently.
Any Message or Call records created during this interaction will NOT be deleted automatically. If you want to delete all related Message/Call resources, you must issue direct DELETE
requests for the inbound and outbound resources directly. Once you have deleted an interaction, those resource SIDs will not be discoverable via Proxy.
ServiceSid
type: SID<KS>The SID of the parent Service of the resource to delete.
SessionSid
type: SID<KC>The SID of the parent Session of the resource to delete.
Sid
type: SID<KI>The Twilio-provided string that uniquely identifies the Interaction resource to delete.