openapi: 3.2.0 info: title: Twilio Memory Profile 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: Profile description: Profiles are the canonical customer records in a Memory Store. paths: /v1/Stores/{storeId}/Profiles/{profileId}: servers: - url: https://memory.twilio.com parameters: - $ref: '#/components/parameters/StoreId' - $ref: '#/components/parameters/ProfileId' x-twilio: defaultOutputProperties: - id - createdAt pathType: instance delete: operationId: DeleteProfile summary: Delete Profile description: Asynchronously delete the profile permanently and all associated identifiers and traits. This operation is irreversible. Downstream caches or analytical stores may take time to reflect the deletion. Use cautiously and consider a soft‑delete strategy if regulatory or recovery requirements apply. tags: - Profile responses: '202': description: Profile deletion accepted. content: application/json: schema: type: object required: - message properties: message: type: string maxLength: 512 example: Profile accepted for deletion. examples: Accepted: value: message: Profile accepted for deletion. '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' get: operationId: FetchProfile summary: Get Profile description: Retrieve profile traits by profile ID. Use the `traitGroups` query parameter to restrict results to a comma-separated allow list of trait group names. For large sets of traits, prefer using the dedicated `/Traits` endpoint for pagination. tags: - Profile parameters: - $ref: '#/components/parameters/TraitGroupsQueryParam' responses: '200': description: A profile. content: application/json: schema: $ref: '#/components/schemas/Profile' headers: Canonical-Profile-Id: $ref: '#/components/headers/Canonical-Profile-Id' '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' patch: operationId: PatchProfileTraits summary: Patch Profile description: Update or add specific traits to an existing profile. Only the traits provided are added or updated; unspecified traits remain unchanged. Only pre-defined trait groups and traits configured for the memory store can be patched. To remove a trait entirely, set its value to null. tags: - Profile requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ProfilePatch' example: traits: Activity: lastVisited: '2024-10-07T15:39:25Z' responses: '202': description: Trait patch accepted. content: application/json: schema: type: object required: - message properties: message: type: string example: Trait modifications accepted for processing. maxLength: 255 maxProperties: 1 examples: Accepted: value: message: Trait modifications accepted for processing. '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: servers: - url: https://memory.twilio.com parameters: - $ref: '#/components/parameters/StoreId' x-twilio: defaultOutputProperties: - profiles pathType: list get: operationId: ListProfiles summary: List Profiles description: Return a paginated list of profile IDs ordered by most recently created first. Use the optional paging parameters (`pageSize`, `pageToken`, `orderBy`) to control pagination and sorting. This endpoint is optimized for browsing newly created profiles and lightweight lookups where only the identifiers are needed before requesting full profile details. tags: - Profile parameters: - $ref: '#/components/parameters/PageSize' - $ref: '#/components/parameters/PageToken' - $ref: '#/components/parameters/OrderBy' responses: '200': description: A list of profile IDs up to a maximum of 1000. content: application/json: schema: type: object properties: profiles: type: array maxItems: 1000 items: $ref: '#/components/schemas/IdentityProfileID' example: - mem_profile_00000000000000000000000000 - mem_profile_00000000000000000000000001 - mem_profile_00000000000000000000000002 - mem_profile_00000000000000000000000003 - mem_profile_00000000000000000000000004 - mem_profile_00000000000000000000000005 - mem_profile_00000000000000000000000006 - mem_profile_00000000000000000000000007 - mem_profile_00000000000000000000000008 - mem_profile_00000000000000000000000009 meta: $ref: '#/components/schemas/IdentityProfilesMeta' maxProperties: 2 '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: CreateProfile summary: Create Profile description: Create a new profile and set initial traits. The request synchronously resolves identity and either creates a new profile ID or retrieves the associated canonical profile ID based on any provided identifier traits present in the request. The request must contain at least one trait that is promoted to an identifier in its trait group settings. Any additional traits are queued for asynchronous processing. tags: - Profile requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ProfileData' examples: Add Contact: value: traits: Contact: email: Alyssa.Mock@example.com phone: '+13175551234' lastName: Mock firstName: Alyssa street: 123 Main St city: San Francisco state: CA postalCode: '94107' country: US Unknown Caller (Customer Care): value: traits: Contact: phone: '+13175551234' preferredLanguage: en IVR: datetime: '2023-10-05T15:39:25Z' ivrPath: main_menu>technical_support>password_reset languageSelected: en Support: disposition: resolved Known New Caller (Customer Care): value: traits: Contact: phone: '+13175551234' lastName: Mock firstName: Alyssa preferredLanguage: en Account: accountNumber: '123456' IVR: datetime: '2023-10-05T15:39:25Z' ivrPath: main_menu>technical_support>password_reset>xfer_to_agent languageSelected: en Support: disposition: resolved responses: '202': description: Profile resolved and accepted for processing. content: application/json: schema: type: object required: - message - id properties: id: $ref: '#/components/schemas/ProfileID' example: mem_profile_00000000000000000000000000 message: type: string example: Profile resolved and accepted for processing. maxLength: 255 maxProperties: 2 examples: Accepted: value: message: Profile resolved and accepted for processing. id: mem_profile_00000000000000000000000000 '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/Bulk: servers: - url: https://memory.twilio.com parameters: - $ref: '#/components/parameters/StoreId' x-twilio: pathType: list put: operationId: UpdateProfilesBulk summary: Bulk Upsert Profiles description: Create or update up to 1000 profiles in a single asynchronous batch. Each profile body follows the same structure as single profile creation. If a profile already exists its traits are merged (new keys added, existing keys overwritten). Large batches may take time to process; the 202 response indicates the batch has been accepted. Monitor downstream telemetry or audit logs to confirm completion. tags: - Profile requestBody: required: true content: application/json: schema: type: object properties: profiles: type: array maxItems: 1000 minItems: 1 items: $ref: '#/components/schemas/ProfileData' maxProperties: 1 example: profiles: - traits: Contact: phone: '+13175551234' email: Alyssa.Mock@example.com lastName: Mock firstName: Alyssa - traits: Contact: phone: '+13175556789' email: John.Doe@example.com lastName: Doe firstName: John responses: '202': description: Profiles batch accepted. content: application/json: schema: type: object required: - message properties: message: type: string example: Profile batch accepted for processing. maxLength: 255 maxProperties: 1 examples: Accepted: value: message: Profile batch accepted for processing. '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/Imports: servers: - url: https://memory.twilio.com parameters: - $ref: '#/components/parameters/StoreId' x-twilio: defaultOutputProperties: - imports pathType: list get: operationId: ListProfileImportsV2 summary: Get a list of imports description: Retrieve a paginated list of profile import task IDs submitted for this service, ordered by import recency. Use the returned IDs to query individual import status details, and the paging parameters to iterate through larger sets. `orderBy` defaults to `DESC`; omitting `pageSize`/`pageToken` returns a default first page. tags: - Profile responses: '200': description: A list of import ids. content: application/json: schema: type: object properties: imports: type: array maxItems: 100 items: $ref: '#/components/schemas/ImportID' meta: allOf: - $ref: '#/components/schemas/ProfilesMeta' properties: key: example: imports maxProperties: 2 examples: All Imports: summary: A page of import IDs for a store value: imports: - mem_import_00000000000000000000000000 - mem_import_11234567890123456789012345 meta: key: imports 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' parameters: - $ref: '#/components/parameters/PageSize' - $ref: '#/components/parameters/PageToken' - $ref: '#/components/parameters/OrderBy' post: operationId: CreateProfilesImportV2 summary: Import Profiles description: Initiate a profile import by requesting a pre-signed upload URL and an associated `importId`. Upload your CSV to the returned URL (single PUT). Query the import status endpoint to track processing progress. This endpoint creates the import task and allocates resources for subsequent ingestion. tags: - Profile requestBody: required: true content: application/json: schema: type: object properties: filename: type: string description: The name of the file to generate a presigned URL maxLength: 255 fileSize: type: integer description: The size of the file in bytes (1 byte to 100 MiB) minimum: 1 maximum: 104857600 columnMappings: type: array description: Mappings of CSV header columns to traits' fields maxItems: 100 minItems: 2 items: $ref: '#/components/schemas/ColumnMappingItem' required: - filename - fileSize - columnMappings maxProperties: 3 example: filename: profiles_import.csv fileSize: 204800 columnMappings: - columnName: first_name traitGroup: Contact traitName: firstName - columnName: last_name traitGroup: Contact traitName: lastName - columnName: email_address traitGroup: Contact traitName: email responses: '201': description: Import task created. content: application/json: schema: type: object required: - importId - url properties: importId: type: string description: ID of the import task. example: mem_import_00000000000000000000000000 maxLength: 39 url: type: string description: Pre-signed URL to upload the CSV via a single PUT request. example: https://cell-1.us-east-1.profiles-import.s3.us-east-1.amazonaws.com/AC0001/store_0001/import_0001/profiles.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA...&X-Amz-Date=20260101T000000Z&X-Amz-Expires=1800&X-Amz-SignedHeaders=host&X-Amz-Signature=abcd1234... maxLength: 2048 maxProperties: 2 examples: Created: summary: Example created import value: importId: mem_import_00000000000000000000000000 url: https://cell-1.us-east-1.profiles-import.s3.us-east-1.amazonaws.com/AC0001/store_0001/import_0001/profiles.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA...&X-Amz-Date=20260101T000000Z&X-Amz-Expires=1800&X-Amz-SignedHeaders=host&X-Amz-Signature=abcd1234... '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/Imports/{importId}: servers: - url: https://memory.twilio.com parameters: - $ref: '#/components/parameters/StoreId' - $ref: '#/components/parameters/ImportId' x-twilio: defaultOutputProperties: - status - filename - createdAt pathType: instance get: operationId: FetchProfileImportV2 summary: Get Import Status description: Retrieve the current processing status of a previously submitted bulk import task. Query this endpoint using the `importId` returned from the upload URL request until a terminal state (COMPLETED or FAILED) is reached. tags: - Profile responses: '200': description: Import Status. content: application/json: schema: type: object required: - status - filename - createdAt properties: status: type: string enum: - PENDING - PROCESSING - COMPLETED - FAILED description: Current processing status of the import task filename: type: string description: Original filename of the uploaded CSV maxLength: 255 example: profiles_import.csv createdAt: type: string format: date-time description: Timestamp when the import was created example: '2025-11-14T20:29:21Z' updatedAt: type: string format: date-time description: Timestamp when the import was last updated example: '2025-11-14T20:30:15Z' fileSize: type: integer description: Size of the uploaded file in bytes (1 byte to 100 MiB) minimum: 1 maximum: 104857600 example: 204800 columnMappings: type: array description: Mappings of CSV header columns to traits' fields maxItems: 100 minItems: 2 items: $ref: '#/components/schemas/ColumnMappingItem' summary: type: object description: Summary statistics of the import operation properties: errors: type: integer description: Total count of errors encountered during import example: 10 warnings: type: integer description: Total count of warnings encountered during import example: 5 '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: parameters: TraitGroupsQueryParam: name: traitGroups in: query required: false description: Comma separated list of trait group names to include. schema: type: string minLength: 1 maxLength: 256 example: Contact 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 PageToken: name: pageToken in: query required: false description: The token for the page of results to retrieve. schema: type: string maxLength: 4096 ImportId: name: importId in: path description: The task identifier for the import process. required: true schema: type: string pattern: ^mem_import_[0-7][0-9a-z]{25}$ 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 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 IdentityProfilesMeta: type: object maxProperties: 4 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: profiles pageSize: type: integer default: 50 nextToken: type: string example: eyJlYXN0ZXIiOiJlZ2cifQ maxLength: 4096 previousToken: type: string example: eyJlYXN0ZXIiOiJlZ2cifQ maxLength: 4096 IdentityProfileID: type: string pattern: ^mem_profile_[0-7][0-9a-z]{25}$ example: mem_profile_00000000000000000000000000 description: The canonical profile ID. TraitGroups: type: object description: Multiple trait groups. maxProperties: 50 example: Contact: email: Alyssa.Mock@example.com phone: '+13175551234' lastName: Mock firstName: Alyssa street: 123 Main St city: San Francisco state: CA postalCode: '94107' country: US additionalProperties: x-additionalPropertiesName: TraitGroupPropertyName type: object description: Multiple traits. maxProperties: 99 additionalProperties: description: The value of a trait. Can be a string, integer, boolean, or an array of these types (arrays cannot contain nested arrays). ProfileID: type: string pattern: ^mem_profile_[0-7][0-9a-z]{25}$ example: mem_profile_00000000000000000000000000 description: The canonical profile ID. ColumnMappingItem: type: object additionalProperties: false description: Mapping of a CSV header column to the trait fields required: - columnName - traitGroup - traitName properties: columnName: type: string description: The name of the column in the CSV header example: first_name maxLength: 64 traitGroup: type: string description: The trait group to which this trait belongs example: Contact maxLength: 64 traitName: type: string description: The name of the trait in the trait group example: firstName maxLength: 64 maxProperties: 3 ProfilesMeta: type: object maxProperties: 4 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: profiles pageSize: type: integer default: 50 nextToken: type: string example: eyJlYXN0ZXIiOiJlZ2cifQ maxLength: 4096 previousToken: type: string example: eyJlYXN0ZXIiOiJlZ2cifQ maxLength: 4096 ProfilePatch: type: object additionalProperties: false properties: traits: $ref: '#/components/schemas/TraitGroups' ImportID: type: string pattern: ^mem_import_[0-7][0-9a-z]{25}$ example: mem_import_00000000000000000000000000 description: The import operation ID. Profile: type: object additionalProperties: false properties: id: $ref: '#/components/schemas/ProfileID' createdAt: type: string format: date-time description: The time the profile was created. example: '2025-01-01T12:00:00Z' traits: $ref: '#/components/schemas/TraitGroups' ProfileData: type: object description: Data for creating or updating a profile, including traits. additionalProperties: false properties: traits: $ref: '#/components/schemas/TraitGroups' 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 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. 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