openapi: 3.2.0 info: title: Twilio Memory Observations API description: APIs for managing memory stores, profiles, and conversational intelligence capabilities. version: '1.0' termsOfService: https://www.twilio.com/legal/tos contact: name: Twilio Support url: https://support.twilio.com email: support@twilio.com license: name: Apache 2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html x-twilio: apiStandards: v1.0 servers: - url: https://memory.twilio.com security: - accountSid_authToken: [] tags: - name: Observations description: Observations are small contextual text snippets automatically extracted from conversations that run through Conversation Orchestrator. paths: /v1/Stores/{storeId}/Profiles/{profileId}/Observations: servers: - url: https://memory.twilio.com parameters: - $ref: '#/components/parameters/StoreId' - $ref: '#/components/parameters/ProfileId' x-twilio: defaultOutputProperties: - observations pathType: list get: operationId: ListProfileObservations summary: List Observations description: Retrieve a paginated list of transient observations for a specific profile. Observations are sorted by creation time in descending order by default. Results can be filtered by source parameter. Supports response compression for large datasets. tags: - Observations parameters: - $ref: '#/components/parameters/PageSize' - $ref: '#/components/parameters/PageToken' - $ref: '#/components/parameters/OrderBy' - $ref: '#/components/parameters/SourceParam' - $ref: '#/components/parameters/CreatedAfter' - $ref: '#/components/parameters/CreatedBefore' - $ref: '#/components/parameters/ConversationId' - $ref: '#/components/parameters/AcceptEncoding' responses: '200': description: A list of observations for the profile. headers: Content-Encoding: $ref: '#/components/headers/ContentEncoding' Canonical-Profile-Id: $ref: '#/components/headers/Canonical-Profile-Id' content: application/json: schema: type: object properties: observations: type: array maxItems: 50 items: $ref: '#/components/schemas/ObservationInfo' meta: $ref: '#/components/schemas/ObservationsMeta' example: observations: - id: mem_observation_00000000000000000000000001 content: Customer expressed frustration with billing process during call on 2025-01-15. Mentioned difficulty understanding charges. source: customer_service occurredAt: '2025-01-15T14:30:00Z' createdAt: '2025-01-15T10:30:45Z' updatedAt: '2025-01-15T10:30:45Z' - id: mem_observation_00000000000000000000000002 conversationIds: - conv_conversation_00000000000000000000000000 content: 'Customer: ''I love the new feature you added.'' Agent: ''Thank you for the feedback, we''re glad you''re enjoying it.''' source: chat_transcript occurredAt: '2025-01-15T14:30:00Z' createdAt: '2025-01-15T11:15:30Z' updatedAt: '2025-01-15T11:15:30Z' meta: pageSize: 2 nextToken: eyJlYXN0ZXIiOiJlZ2cifQ '301': $ref: '#/components/responses/MovedPermanently' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' '500': $ref: '#/components/responses/InternalServerError' '503': $ref: '#/components/responses/ServiceUnavailable' post: operationId: CreateProfileObservation summary: Create Observations description: Create one or more transient observations associated with the specified profile. Supports both single observation creation and batch creation of up to 10 observations. Supports request compression for large batch operations and response compression for the response. All observations will be automatically indexed for semantic search capabilities. The content can be up to 4KB in length and should contain relevant information about the profile. The createdAt and updatedAt timestamps will be automatically set to the current time. Each observation will be created with a unique ID in Twilio Type ID (TTID) format. tags: - Observations parameters: - $ref: '#/components/parameters/AcceptEncoding' - $ref: '#/components/parameters/ContentEncoding' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateObservationsRequest' examples: Single Observation: value: observations: - content: Customer expressed frustration with billing process during call on 2025-01-15. Mentioned difficulty understanding charges. source: customer_service occurredAt: '2025-01-15T14:30:00Z' Batch Observations: value: observations: - content: Customer expressed frustration with billing process during call on 2025-01-15. Mentioned difficulty understanding charges. source: customer_service occurredAt: '2025-01-15T14:30:00Z' - content: 'Customer: ''I love the new feature you added.'' Agent: ''Thank you for the feedback, we''re glad you''re enjoying it.''' source: chat_transcript occurredAt: '2025-01-15T15:30:00Z' conversationIds: - conv_conversation_00000000000000000000000000 responses: '202': description: Observation creation accepted and is being processed. headers: Content-Encoding: $ref: '#/components/headers/ContentEncoding' content: application/json: schema: $ref: '#/components/schemas/ObservationCreatedResponse' '308': $ref: '#/components/responses/PermanentRedirect' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' '500': $ref: '#/components/responses/InternalServerError' '503': $ref: '#/components/responses/ServiceUnavailable' /v1/Stores/{storeId}/Profiles/{profileId}/Observations/{observationId}: servers: - url: https://memory.twilio.com parameters: - $ref: '#/components/parameters/StoreId' - $ref: '#/components/parameters/ProfileId' - $ref: '#/components/parameters/ObservationId' x-twilio: pathType: instance get: operationId: FetchProfileObservation summary: Retrieve Observation description: Retrieve a specific transient observation by its ID for the given profile. tags: - Observations responses: '200': description: Observation retrieved successfully. headers: Canonical-Profile-Id: $ref: '#/components/headers/Canonical-Profile-Id' content: application/json: schema: $ref: '#/components/schemas/ObservationInfo' examples: Conversation Observation: value: id: mem_observation_00000000000000000000000001 content: Customer expressed frustration with billing process during call on 2025-01-15. Mentioned difficulty understanding charges. source: customer_service occurredAt: '2025-01-15T14:30:00Z' conversationIds: - conv_conversation_00000000000000000000000000 createdAt: '2025-01-15T10:30:45Z' updatedAt: '2025-01-15T10:30:45Z' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' '500': $ref: '#/components/responses/InternalServerError' '503': $ref: '#/components/responses/ServiceUnavailable' patch: operationId: PatchProfileObservation summary: Update Observation description: Update a specific transient observation by its ID. Only provided fields will be updated. The updated timestamp will be automatically set. This allows for selective updates without needing to provide all fields. tags: - Observations requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ObservationBase' examples: Update Content Only: value: content: 'Updated: Customer expressed satisfaction with recent product update during support call. Follow-up scheduled.' source: customer_service occurredAt: '2025-01-15T16:00:00Z' Update Source: value: content: Customer preferences noted during interaction. source: customer_service_followup occurredAt: '2025-01-15T16:30:00Z' Update Intelligent Operator Fields: value: content: Analysis updated with improved confidence assessment. source: ai_analysis occurredAt: '2025-01-15T17:00:00Z' responses: '202': description: Observation update accepted and is being processed. content: application/json: schema: type: object properties: message: type: string maxLength: 512 example: Observation update accepted required: - message '308': $ref: '#/components/responses/PermanentRedirect' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' '500': $ref: '#/components/responses/InternalServerError' '503': $ref: '#/components/responses/ServiceUnavailable' delete: operationId: DeleteProfileObservation summary: Delete Observation description: Delete a specific transient observation by its ID. This action is irreversible. tags: - Observations responses: '202': description: Observation deletion accepted and is being processed. content: application/json: schema: type: object properties: message: type: string maxLength: 255 example: Observation deletion accepted required: - message '308': $ref: '#/components/responses/PermanentRedirect' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' '500': $ref: '#/components/responses/InternalServerError' '503': $ref: '#/components/responses/ServiceUnavailable' /v1/Stores/{storeId}/Profiles/{profileId}/Observations/{observationId}/Revisions: servers: - url: https://memory.twilio.com parameters: - $ref: '#/components/parameters/StoreId' - $ref: '#/components/parameters/ProfileId' - $ref: '#/components/parameters/ObservationId' x-twilio: defaultOutputProperties: - revisions pathType: list get: operationId: ListObservationRevisions summary: List Observation Revisions description: Retrieve a chronologically ordered list of all past revisions of a specific observation by its ID. Revisions represent the complete history of updates and modifications made to an observation, with each revision capturing the full state at the time of change. Revisions are sorted by update time in descending order (newest first), allowing you to track how an observation has evolved through updates over time. tags: - Observations parameters: - $ref: '#/components/parameters/PageSize' - $ref: '#/components/parameters/PageToken' - $ref: '#/components/parameters/AcceptEncoding' responses: '200': description: A chronologically ordered list of observation revisions. headers: Content-Encoding: $ref: '#/components/headers/ContentEncoding' Canonical-Profile-Id: $ref: '#/components/headers/Canonical-Profile-Id' content: application/json: schema: type: object properties: revisions: type: array maxItems: 50 items: $ref: '#/components/schemas/ObservationInfo' description: Array of observation revisions ordered chronologically descending by update time (newest first). meta: $ref: '#/components/schemas/ObservationsMeta' examples: Observation Revisions: value: revisions: - id: mem_observation_00000000000000000000000001 content: 'Updated: Customer expressed satisfaction with recent product update during support call. Follow-up scheduled.' source: customer_service occurredAt: '2025-01-15T14:30:00Z' createdAt: '2025-01-15T10:30:45Z' updatedAt: '2025-01-15T14:20:15Z' - id: mem_observation_00000000000000000000000001 content: Customer expressed frustration with billing process during call on 2025-01-15. Mentioned difficulty understanding charges. source: customer_service occurredAt: '2025-01-15T14:30:00Z' createdAt: '2025-01-15T10:30:45Z' updatedAt: '2025-01-15T10:30:45Z' meta: pageSize: 2 nextToken: eyJlYXN0ZXIiOiJlZ2cifQ '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' '500': $ref: '#/components/responses/InternalServerError' '503': $ref: '#/components/responses/ServiceUnavailable' components: schemas: TwilioError: type: object additionalProperties: false maxProperties: 10 description: A generic error object communicating client and server side API errors. properties: code: type: integer minimum: 100 maximum: 999999 description: The Twilio error code. format: int32 message: type: string maxLength: 1024 description: A human readable message describing the error. more_info: type: string description: A URL to a [Twilio error directory](https://www.twilio.com/docs/api/errors) page with more information about the error code. status: type: integer minimum: 100 maximum: 599 description: The HTTP status code for the error. format: int32 example: code: 21614 message: The address specified in the request is not a valid phone number. more_info: https://www.twilio.com/docs/api/errors/21614 status: 400 ObservationBase: type: object description: Core mutable properties for creating observation objects. properties: content: type: string description: The main content of the observation. minLength: 1 maxLength: 4096 example: Customer expressed satisfaction with recent product update during support call. occurredAt: type: string format: date-time description: The timestamp when the observation originally occurred. example: '2025-01-15T10:15:30Z' source: type: string description: The source system that generated this observation. Allows letters, numbers, spaces, periods, underscores, hyphens, and forward slashes. minLength: 1 maxLength: 100 pattern: ^[a-zA-Z0-9 _./-]+$ example: conversational-intelligence conversationIds: type: array description: Array of conversation IDs associated with this observation. maxItems: 10 items: $ref: '#/components/schemas/ConversationID' ConversationID: type: string description: A unique identifier for the conversation using Twilio Type ID (TTID) format. pattern: ^conv_conversation_[0-7][0-9a-z]{25}$ example: conv_conversation_00000000000000000000000000 ObservationCreateRequest: type: object properties: content: type: string description: The main content of the observation. minLength: 1 maxLength: 4096 example: Customer expressed satisfaction with recent product update during support call. occurredAt: type: string format: date-time description: The timestamp when the observation originally occurred. example: '2025-01-15T10:15:30Z' source: type: string description: The source system that generated this observation. Allows letters, numbers, spaces, periods, underscores, hyphens, and forward slashes. minLength: 1 maxLength: 100 pattern: ^[a-zA-Z0-9 _./-]+$ example: conversational-intelligence conversationIds: type: array description: Array of conversation IDs associated with this observation. maxItems: 10 items: $ref: '#/components/schemas/ConversationID' required: - source - occurredAt - content ObservationCreatedResponse: type: object description: Response for batch observation creation. properties: message: type: string description: Confirmation message for the operation. minLength: 1 maxLength: 255 example: Observations creation accepted required: - message CreateObservationsRequest: type: object description: Request payload for creating one or more observations. Supports creation of up to 10 observations. properties: observations: type: array description: Array of observations to create in a single batch operation. minItems: 1 maxItems: 10 items: $ref: '#/components/schemas/ObservationCreateRequest' required: - observations additionalProperties: false ObservationID: type: string description: A unique identifier for the observation using Twilio Type ID (TTID) format. pattern: ^mem_observation_[0-7][0-9a-z]{25}$ example: mem_observation_00000000000000000000000000 ObservationsMeta: type: object properties: key: type: string maxLength: 64 description: 'The key of the list property contains the actual data items. This enables programmatic iteration over paginated results. ' example: observations pageSize: type: integer minimum: 1 maximum: 50 default: 50 nextToken: type: string minLength: 1 maxLength: 4096 example: eyJlYXN0ZXIiOiJlZ2cifQ previousToken: type: string minLength: 1 maxLength: 4096 example: eyJlYXN0ZXIiOiJlZ2cifQ ObservationInfo: type: object description: A transient and mutable observation memory associated with a profile. properties: content: type: string description: The main content of the observation. minLength: 1 maxLength: 4096 example: Customer expressed satisfaction with recent product update during support call. occurredAt: type: string format: date-time description: The timestamp when the observation originally occurred. example: '2025-01-15T10:15:30Z' source: type: string description: The source system that generated this observation. Allows letters, numbers, spaces, periods, underscores, hyphens, and forward slashes. minLength: 1 maxLength: 100 pattern: ^[a-zA-Z0-9 _./-]+$ example: conversational-intelligence conversationIds: type: array description: Array of conversation IDs associated with this observation. maxItems: 10 items: $ref: '#/components/schemas/ConversationID' id: $ref: '#/components/schemas/ObservationID' createdAt: type: string format: date-time description: The timestamp when the observation was created. example: '2025-01-15T10:30:45Z' updatedAt: type: string format: date-time description: The timestamp when the observation was last updated. example: '2025-01-15T10:30:45Z' required: - id - createdAt - updatedAt responses: InternalServerError: description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/TwilioError' example: code: 20500 message: Internal Server Error more_info: https://www.twilio.com/docs/api/errors/20500 status: 500 Forbidden: description: Forbidden content: application/json: schema: $ref: '#/components/schemas/TwilioError' example: code: 403 message: Permission to access resource denied more_info: https://www.twilio.com/docs/api/errors/403 status: 403 PermanentRedirect: description: This resource has moved. content: application/json: schema: type: object required: - message - uri properties: message: type: string default: This resource has moved. example: This resource has moved. maxLength: 255 uri: type: string example: https://memory.twilio.com/v1/Stores/mem_store_00000000000000000000000000/Profiles/mem_profile_00000000000000000000000000 maxLength: 2048 maxProperties: 2 headers: Canonical-Profile-Id: $ref: '#/components/headers/Canonical-Profile-Id' Location: $ref: '#/components/headers/Location' NotFound: description: Not Found content: application/json: schema: $ref: '#/components/schemas/TwilioError' example: code: 20404 message: Not Found more_info: https://www.twilio.com/docs/api/errors/20404 status: 404 Unauthorized: description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/TwilioError' example: code: 20003 message: Failed to complete request due to lack of authentication credentials more_info: https://www.twilio.com/docs/api/errors/20003 status: 401 ServiceUnavailable: description: Service Unavailable content: application/json: schema: $ref: '#/components/schemas/TwilioError' example: code: 20503 message: Service Unavailable more_info: https://www.twilio.com/docs/api/errors/20503 status: 503 TooManyRequests: description: This error indicates that you have sent too many requests to the API. You should retry according to the `Retry-After` response header. content: application/json: schema: $ref: '#/components/schemas/TwilioError' example: code: 20429 message: Too many requests. Please retry according to the Retry-After response header. more_info: https://www.twilio.com/docs/api/errors/20429 status: 429 headers: Retry-After: description: The amount of time in seconds that the customer should wait before issuing a new request towards the API. schema: type: string pattern: ^[0-9]+$ MovedPermanently: description: This resource has moved. content: application/json: schema: type: object required: - message - uri properties: message: type: string default: This resource has moved. example: This resource has moved. maxLength: 255 uri: type: string example: https://memory.twilio.com/v1/Stores/mem_store_00000000000000000000000000/Profiles/mem_profile_00000000000000000000000000 maxLength: 2048 maxProperties: 2 headers: Canonical-Profile-Id: $ref: '#/components/headers/Canonical-Profile-Id' Location: $ref: '#/components/headers/Location' BadRequest: description: Bad Request content: application/json: schema: $ref: '#/components/schemas/TwilioError' example: code: 400 message: Failed to complete request due to a bad request more_info: https://www.twilio.com/docs/api/errors/400 status: 400 parameters: ConversationId: name: conversationId in: query required: false description: Filter by conversation ID. Returns only items associated with the specified conversation. schema: $ref: '#/components/schemas/ConversationID' StoreId: name: storeId in: path required: true description: A unique Memory Store ID using Twilio Type ID (TTID) format schema: type: string pattern: ^mem_(store|service)_[0-7][0-9a-z]{25}$ example: mem_store_00000000000000000000000000 ProfileId: name: profileId in: path required: true description: The unique identifier for the profile using Twilio Type ID (TTID) format. schema: type: string pattern: ^mem_profile_[0-7][0-9a-z]{25}$ example: mem_profile_00000000000000000000000000 ContentEncoding: name: Content-Encoding in: header required: false description: Compression algorithm used for the request body (e.g., gzip, deflate, br) schema: type: string enum: - gzip - deflate - br - compress example: gzip CreatedBefore: name: createdBefore in: query description: Filter observations created before this timestamp (exclusive). required: false schema: type: string format: date-time example: '2025-01-31T23:59:59Z' CreatedAfter: name: createdAfter in: query description: Filter observations created after this timestamp (inclusive). required: false schema: type: string format: date-time example: '2025-01-01T00:00:00Z' PageToken: name: pageToken in: query required: false description: The token for the page of results to retrieve. schema: type: string maxLength: 4096 ObservationId: name: observationId in: path description: The observation ID. required: true schema: $ref: '#/components/schemas/ObservationID' OrderBy: name: orderBy in: query required: false description: Either 'ASC' or 'DESC' to sort results ascending or descending respectively. schema: type: string enum: - ASC - DESC default: DESC PageSize: name: pageSize in: query required: false description: The maximum number of items to return per page, maximum of 1000. schema: type: integer default: 50 minimum: 1 maximum: 1000 SourceParam: name: source in: query required: false description: Filter by source. Allows letters, numbers, spaces, periods, underscores, hyphens, and forward slashes. schema: type: string minLength: 1 maxLength: 100 pattern: ^[a-zA-Z0-9 _./-]+$ example: customer service platform AcceptEncoding: name: Accept-Encoding in: header required: false description: Compression algorithms supported by the client (e.g., gzip, deflate, br) schema: type: string maxLength: 200 pattern: ^[a-zA-Z0-9, .-]*$ example: gzip, deflate, br headers: Location: description: The URL of the new location for the resource. schema: type: string format: uri example: https:///memory.twilio.com/v1/Stores/mem_store_00000000000000000000000000/Profiles/mem_profile_00000000000000000000000000 description: The URL of the new location for the resource. Canonical-Profile-Id: description: The canonical profile ID associated with the requested resource. If provided, this header indicates that the requested profile is merged to the canonical profile ID. schema: type: string pattern: ^mem_profile_[0-7][0-9a-z]{25}$ example: mem_profile_00000000000000000000000000 description: The canonical profile ID. ContentEncoding: description: The compression algorithm used for the response body schema: type: string enum: - gzip - deflate - br - compress example: gzip securitySchemes: basic_apikey_or_accountsid: scheme: basic type: http description: This API uses [basic authentication](https://www.twilio.com/docs/glossary/what-is-basic-authentication). Use an [API key](https://www.twilio.com/docs/iam/api-keys) as the username and the API key secret as the password. You can also use your account SID and auth token, but limit their use to local testing. accountSid_authToken: scheme: basic type: http