Skip to contentSkip to navigationSkip to topbar

Memory API (v1) - Event endpoints


(information)

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(link takes you to an external page). 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(link takes you to an external page). 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.

Overview

overview page anchor

Tag description

Endpoints


Add events to a specific profile

create-profile-events page anchor

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.

Request

create-profile-events-request page anchor

Path parameters

create-profile-events-path-parameters page anchor
Property nameTypeRequiredPIIDescription
storeIdstring
required
Not PII

The storeId identifier


profileIdstring
required

The profileId identifier

Encoding type:application/json
SchemaExample
Property nameTypeRequiredPIIDescriptionChild properties
typeenum<string>
required

The type of event being sent.

Example: twilio-comms-lifecyclePossible values:
twilio-communication-eventtwilio-comms-lifecycle

events
array(oneOf):
required
Max items: 1000
202400404429500503

Events accepted for processing.

Schema
Property nameTypeRequiredPIIDescriptionChild properties
messagestring

Optional

Example: Events accepted for processing.Max length: 1024
Add events to a specific profileLink to code sample: Add events to a specific profile
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function createProfileEvents() {
11
const event = await client.memory.v1.events("storeId", "profileId").create({
12
type: "twilio-comms-lifecycle",
13
events: [
14
{
15
timestamp: "2009-07-06T20:30:00Z",
16
lifecycle: "lifecycle",
17
conversationId: "conv_conversation_00000000000000000000000000",
18
communicationId: "comms_communication_00000000000000000000000000",
19
communicationType: "communicationType",
20
communicationStatus: "communicationStatus",
21
direction: "OUTBOUND",
22
sender: {
23
address: "address",
24
participantId: "comms_participant_00000000000000000000000000",
25
},
26
recipient: {
27
address: "address",
28
participantId: "comms_participant_00000000000000000000000000",
29
},
30
errorCode: "errorCode",
31
errorMessage: "errorMessage",
32
},
33
],
34
});
35
36
console.log(event.message);
37
}
38
39
createProfileEvents();

Response

Note about this response
1
{
2
"message": "message"
3
}