The Memory API provides endpoints for managing encrypted user memories. All memory content is automatically encrypted at rest and queued for vector embedding to enable semantic search.
Create Memory
curl -X POST https://api.azen.sh/api/v1/memory \
-H "azen-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "I love hiking in the mountains"
}'
Creates a new memory with the provided text content. The content is automatically encrypted and queued for embedding.
Request Body
The text content to store as a memory. Must be at least 1 character long. Example: "I love hiking in the mountains"
Response
Response status indicator Value: "success"
UUID of the newly created memory Example: "550e8400-e29b-41d4-a716-446655440000"
ISO 8601 timestamp of memory creation Example: "2024-01-15T10:30:00.000Z"
Embedding status (always ‘processing’ for new memories) Value: "processing"
201 Success
400 Invalid Request
401 Unauthorized
403 Forbidden
429 Rate Limited
500 Server Error
{
"status" : "success" ,
"memoryId" : "550e8400-e29b-41d4-a716-446655440000" ,
"createdAt" : "2024-01-15T10:30:00.000Z" ,
"embedding" : "processing"
}
List Memories
curl -X GET "https://api.azen.sh/api/v1/memory?page=1&per=20" \
-H "azen-api-key: YOUR_API_KEY"
Retrieves a paginated list of all memories for the authenticated user, ordered by creation date (newest first).
Query Parameters
Page number for pagination (starts at 1) Minimum: 1
Number of memories per page Minimum: 1Maximum: 100
Response
Response status indicator Value: "success"
Array of memory objects for the current page Unique identifier for the memory (UUID format)
The decrypted text content of the memory
Optional metadata associated with the memory
ISO 8601 timestamp when the memory was created
Indicates whether the memory has been successfully embedded for vector search
Number of memories per page
Total number of pages available
Total count of memory objects
200 Success
401 Unauthorized
403 Forbidden
429 Rate Limited
500 Server Error
{
"status" : "success" ,
"memories" : [
{
"id" : "550e8400-e29b-41d4-a716-446655440000" ,
"content" : "I love hiking in the mountains" ,
"metadata" : null ,
"createdAt" : "2024-01-15T10:30:00.000Z" ,
"embedded" : true
},
{
"id" : "550e8400-e29b-41d4-a716-446655440001" ,
"content" : "I enjoy reading sci-fi novels" ,
"metadata" : null ,
"createdAt" : "2024-01-14T15:20:00.000Z" ,
"embedded" : true
}
],
"page" : 1 ,
"per" : 20 ,
"total_pages" : 5 ,
"total_count" : 100
}
Get Memory
curl -X GET https://api.azen.sh/api/v1/memory/550e8400-e29b-41d4-a716-446655440000 \
-H "azen-api-key: YOUR_API_KEY"
Retrieves a specific memory using its unique UUID. Returns 404 if the memory doesn’t exist or doesn’t belong to the authenticated user.
Path Parameters
UUID of the memory to retrieve Example: "550e8400-e29b-41d4-a716-446655440000"
Response
Response status indicator Value: "success"
The memory object Unique identifier for the memory (UUID format)
The decrypted text content of the memory
Optional metadata associated with the memory
ISO 8601 timestamp when the memory was created
Indicates whether the memory has been successfully embedded for vector search
200 Success
400 Invalid ID
401 Unauthorized
403 Forbidden
404 Not Found
429 Rate Limited
500 Server Error
{
"status" : "success" ,
"memory" : {
"id" : "550e8400-e29b-41d4-a716-446655440000" ,
"content" : "I love hiking in the mountains" ,
"metadata" : null ,
"createdAt" : "2024-01-15T10:30:00.000Z" ,
"embedded" : true
}
}
Delete Memory
DELETE /api/v1/memory/{id}
curl -X DELETE https://api.azen.sh/api/v1/memory/550e8400-e29b-41d4-a716-446655440000 \
-H "azen-api-key: YOUR_API_KEY"
Permanently deletes a memory and its associated vector embeddings. Returns 404 if the memory doesn’t exist.
Path Parameters
UUID of the memory to delete Example: "550e8400-e29b-41d4-a716-446655440000"
Response
Response status indicator Value: "success"
Indicates successful deletion Value: true
UUID of the deleted memory
Confirmation message Value: "Memory deleted successfully"
200 Success
400 Invalid ID
401 Unauthorized
403 Forbidden
404 Not Found
429 Rate Limited
500 Delete Vectors Failed
500 Delete Record Failed
{
"status" : "success" ,
"deleted" : true ,
"memoryId" : "550e8400-e29b-41d4-a716-446655440000" ,
"message" : "Memory deleted successfully"
}