Skip to main content
GET
/
user_memory
/
list_user_memories
List User Memories
curl --request GET \
  --url https://api.usecortex.ai/user_memory/list_user_memories \
  --header 'Authorization: Bearer <token>'
{
  "success": true,
  "user_memories": [
    {
      "memory_id": "memory_1234",
      "memory_content": "I prefer detailed technical explanations and works in the Pacific timezone"
    },
    {
      "memory_id": "memory_4567",
      "memory_content": "I prefer dark mode"
    }
  ]
}
Hit the Try it button to try this API now in our playground. It’s the best way to check the full request and response in one place, customize your parameters, and generate ready-to-use code snippets.

Sample Request

curl --request GET \
  --url 'https://api.usecortex.ai/user_memory/list_user_memories?tenant_id=tenant_1234&sub_tenant_id=sub_tenant_4567' \
  --header 'Authorization: Bearer YOUR_API_KEY'

Overview

Retrieve all stored memories for a specific user within a tenant/sub-tenant combination to view and manage the user’s complete memory profile.

Functionality

  • Complete Memory Retrieval: Fetches all user memories
  • Tenant-Based Filtering: Returns memories specific to the provided tenant and sub-tenant combination
  • Simplified Response: Provides essential memory information including unique IDs and content
  • User Context Integration: Automatically filters memories based on the authenticated user
  • Memory Management: Enables you to review and manage stored user memories

Use Cases

  • Memory Audit: Review all stored memories for a user to ensure data quality
  • User Profile Overview: Get a complete picture of what the system knows about a user
  • Memory Management: Identify memories that may need updating or deletion
  • Debugging: Troubleshoot issues with user personalization by examining stored memories
  • Data Export: Retrieve all user memories for data analysis or migration

With Optional Sub-tenant

curl -X GET "https://api.cortex.com/user_memory/list_user_memories?tenant_id=company_123" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"
Sub-tenant Default: If no sub_tenant_id is provided, the system uses DEFAULT sub-tenant which was created while creating the tenant.

Important Notes

Memory Privacy: This API returns all memories for the authenticated user. Ensure proper access controls are in place to prevent unauthorized access to user memory data.
Memory IDs: Each memory has a unique memory_id that can be used with the Delete User Memory endpoint to remove specific memories.
Pro Tip: Use this API in combination with Retrieve User Memory to first search for relevant memories, then list all memories to get the complete context.

Response Fields

FieldTypeDescription
successbooleanIndicates whether the operation was successful
user_memoriesarrayList of user memory objects
user_memories[].source_idstringUnique identifier for the memory
user_memories[].source_contentstringThe actual content of the memory

Error Responses

All endpoints return consistent error responses following the standard format. For detailed error information, see our Error Responses documentation.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

tenant_id
string
required

Unique identifier for the tenant/organization

Example:

"tenant_1234"

sub_tenant_id
string
default:""

Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.

Example:

"sub_tenant_4567"

Response

Successful Response

Response model for listing all user memories.

success
boolean
required

Indicates whether the memory listing operation was successful

Example:

true

user_memories
UserMemory · object[]

Array of all user memories associated with your tenant

Example:
[
{
"memory_id": "memory_1234",
"memory_content": "I prefer detailed technical explanations and works in the Pacific timezone"
},
{
"memory_id": "memory_4567",
"memory_content": "I prefer dark mode"
}
]
I