Memory API (v1) - Store 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.
Create a Memory Store
List Memory Stores
Retrieve a Memory Store
Update a Memory Store
POST/v1/ControlPlane/Stores
Base url: https://memory.twilio.com (base url)
Create a new Memory Store for the Twilio account. Accounts can have multiple memory stores, up to a maximum limit of 15. Each memory store will automatically provision other dependent resources as needed, including Conversational Intelligence capabilities.
application/jsonProvides a unique and addressable name to be assigned to this Store. This name is assigned by the developer and can be used in addition to the ID. It is intended to be human-readable and unique within the account.
sandboxPattern: ^[a-zA-Z0-9-]+$A human readable description of this resource, up to 128 characters.
A testing ground for development, training, and experimentation without affecting live user dataMin length: 1Max length: 128Store creation accepted for async processing. Inspect the status URL for progress.
1// 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 createStore() {11const store = await client.memory.v1.stores.create({12displayName: "sandbox",13});1415console.log(store.message);16}1718createStore();
Response
1{2"message": "message",3"statusUrl": "statusUrl"4}
GET/v1/ControlPlane/Stores
Base url: https://memory.twilio.com (base url)
Get a list of memory stores for the Twilio account.
The maximum number of items to return per page, maximum of 100.
50Minimum: 1Maximum: 100Either 'ASC' or 'DESC' to sort results ascending or descending respectively.
DESCPossible values: ASCDESCMemory stores retrieved successfully
List of Memory Store IDs associated with the Twilio account.
["mem_store_0123456789abcdefghijklmnop","mem_store_1123456789abcdefghijklmnop","mem_store_2123456789abcdefghijklmnop","mem_store_3123456789abcdefghijklmnop"]Max items: 1001// 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 listStores() {11const stores = await client.memory.v1.stores.list({12orderBy: "DESC",13limit: 20,14});1516stores.forEach((s) => console.log(s));17}1819listStores();
Response
1{2"meta": {3"key": "key",4"pageSize": 50,5"nextToken": "nextToken",6"previousToken": "previousToken"7},8"stores": [9"mem_store_01111111111111111111111111"10]11}
GET/v1/ControlPlane/Stores/{storeId}
Base url: https://memory.twilio.com (base url)
Retrieve the details of a specific Memory Store by its unique ID.
A unique Memory Store ID using Twilio Type ID (TTID) format
mem_store_00000000000000000000000000Pattern: ^mem_(store|service)_[0-7][0-9a-z]{25}$Memory Store details retrieved successfully
Provides a unique and addressable name to be assigned to this Store. This name is assigned by the developer and can be used in addition to the ID. It is intended to be human-readable and unique within the account.
sandboxPattern: ^[a-zA-Z0-9-]+$A human readable description of this resource, up to 128 characters.
A testing ground for development, training, and experimentation without affecting live user dataMin length: 1Max length: 128The unique identifier for the Memory Store
mem_store_00000000000000000000000000Pattern: ^mem_(store|service)_[0-7][0-9a-z]{25}$The current status of the Memory Store. A store begins in the QUEUED state as it is scheduled for processing. It then moves to PROVISIONING at the beginning of processing. It transitions to ACTIVE once all dependent resources are provisioned, including Conversational Intelligence capabilities. If there is an issue provisioning resources, the store will move to the FAILED state.
ACTIVEPossible values: QUEUEDPROVISIONINGACTIVEFAILEDThe ID of the associated intelligence service that was provisioned for memory extraction.
intelligence_service_00000000000000000000000000Max length: 64The current version number of the Memory Store. Incremented on each successful update.
3Minimum: 11// 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 fetchStore() {11const store = await client.memory.v112.stores("mem_store_00000000000000000000000000")13.fetch();1415console.log(store.displayName);16}1718fetchStore();
Response
1{2"description": "description",3"displayName": "sandbox",4"id": "mem_store_00000000000000000000000000",5"intelligenceServiceId": "intelligenceServiceId",6"status": "ACTIVE",7"version": 38}
PATCH/v1/ControlPlane/Stores/{storeId}
Base url: https://memory.twilio.com (base url)
Partially update a Memory Store. Only the fields provided in the request body will be updated.
Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites.
"eyJpZCI6ImFuX2lkIiwidiI6MX0"Max length: 100A unique Memory Store ID using Twilio Type ID (TTID) format
mem_store_00000000000000000000000000Pattern: ^mem_(store|service)_[0-7][0-9a-z]{25}$application/jsonProvides a unique and addressable name to be assigned to this Store. This name is assigned by the developer and can be used in addition to the ID. It is intended to be human-readable and unique within the account.
sandbox-updatedPattern: ^[a-zA-Z0-9-]+$A human readable description of this resource, up to 128 characters.
Updated service for development and testingMin length: 1Max length: 1281// 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 patchStore() {11const store = await client.memory.v112.stores("mem_store_00000000000000000000000000")13.patch({14displayName: "sandbox-updated",15});1617console.log(store.message);18}1920patchStore();
Response
1{2"message": "message",3"statusUrl": "statusUrl"4}