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.
sid
type: SID<KI>The unique string that we created to identify the Interaction resource.
^KI[0-9a-fA-F]{32}$
34
34
session_sid
type: SID<KC>service_sid
type: SID<KS>account_sid
type: SID<AC>The SID of the Account that created the Interaction resource.
^AC[0-9a-fA-F]{32}$
34
34
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_participant_sid
type: SID<KP>The SID of the inbound Participant resource.
^KP[0-9a-fA-F]{32}$
34
34
inbound_resource_sid
type: SIDThe SID of the inbound resource; either the Call or Message.
^[a-zA-Z]{2}[0-9a-fA-F]{32}$
34
34
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_participant_sid
type: SID<KP>outbound_resource_sid
type: SIDThe SID of the outbound resource; either the Call or Message.
^[a-zA-Z]{2}[0-9a-fA-F]{32}$
34
34
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}
ServiceSid
type: SID<KS>The SID of the parent Service of the resource to fetch.
^KS[0-9a-fA-F]{32}$
34
34
SessionSid
type: SID<KC>The SID of the parent Session of the resource to fetch.
^KC[0-9a-fA-F]{32}$
34
34
Sid
type: SID<KI>The Twilio-provided string that uniquely identifies the Interaction resource to fetch.
^KI[0-9a-fA-F]{32}$
34
34
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.
^KS[0-9a-fA-F]{32}$
34
34
SessionSid
type: SID<KC>The SID of the parent Session to read the resources from.
^KC[0-9a-fA-F]{32}$
34
34
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
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.
^KS[0-9a-fA-F]{32}$
34
34
SessionSid
type: SID<KC>The SID of the parent Session of the resource to delete.
^KC[0-9a-fA-F]{32}$
34
34
Sid
type: SID<KI>The Twilio-provided string that uniquely identifies the Interaction resource to delete.
^KI[0-9a-fA-F]{32}$
34
34