Memory API (v1) - Event endpoints
Legal information
Conversation Memory, including the APIs, may use artificial intelligence or machine learning technologies and is subject to the terms of the Predictive and Generative AI/ML Features Addendum. For more details on AI usage and data, see the AI Nutrition Facts.
Conversation Memory is not a HIPAA Eligible Service or PCI compliant and should not be enabled in workflows that are subject to HIPAA or PCI.
Conversation Memory is not intended for use with sensitive information about individuals. Twilio does not control what information comes from conversation channels and relies on you to ensure the data in customer profiles aligns with our acceptable use policy. Twilio does have limited guardrails in the form of a prompt exclusion that is designed to provide a minimal screening against inclusion of GDPR special category data. As a reminder our profile technology uses generative artificial intelligence. Because generative artificial intelligence can make mistakes, review all outputs to ensure that the profile is correct.
Conversations products are only available in the new Twilio Console. If your account hasn't been migrated, you'll be redirected to the legacy Console where these products won't appear.
Add events to a specific profile
POST/v1/Stores/{storeId}/Profiles/{profileId}/Events
Base url: https://memory.twilio.com (base url)
Multiple events can be added to a profile in a single request. The maximum number of events per request is 1000 and they will be processed asynchronously.
Any traits that are configured for identifier promotion will be set as an identifier value on the profile.
Types of events:
twilio-communication-event- Twilio communication event, used for tracking multi-channel communications.
The profileId identifier
application/jsonEvents accepted for processing.
Events accepted for processing.Max length: 10241// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createProfileEvents() {11const event = await client.memory.v1.events("storeId", "profileId").create({12type: "twilio-comms-lifecycle",13events: [14{15timestamp: "2009-07-06T20:30:00Z",16lifecycle: "lifecycle",17conversationId: "conv_conversation_00000000000000000000000000",18communicationId: "comms_communication_00000000000000000000000000",19communicationType: "communicationType",20communicationStatus: "communicationStatus",21direction: "OUTBOUND",22sender: {23address: "address",24participantId: "comms_participant_00000000000000000000000000",25},26recipient: {27address: "address",28participantId: "comms_participant_00000000000000000000000000",29},30errorCode: "errorCode",31errorMessage: "errorMessage",32},33],34});3536console.log(event.message);37}3839createProfileEvents();
Response
1{2"message": "message"3}