> ## Documentation Index
> Fetch the complete documentation index at: https://docs.magpipe.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Memory

> Update a caller's memory

Update a caller's memory record. Only include fields you want to change.

## Request Body

<ParamField body="memory_id" type="string" required>
  UUID of the memory record to update
</ParamField>

<ParamField body="summary" type="string">
  Updated relationship summary
</ParamField>

<ParamField body="key_topics" type="array">
  Updated list of key topics
</ParamField>

<ParamField body="preferences" type="object">
  Updated caller preferences
</ParamField>

<ParamField body="relationship_notes" type="string">
  Updated relationship notes
</ParamField>

## Response

Returns the updated memory object.

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.magpipe.ai/functions/v1/update-memory" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "memory_id": "789e0123-e89b-12d3-a456-426614174000",
      "summary": "VIP customer, longtime buyer. Had delivery issue that was resolved.",
      "preferences": {
        "contact_method": "email",
        "best_time": "afternoons",
        "vip": true
      },
      "relationship_notes": "Escalate any issues to manager immediately"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "789e0123-e89b-12d3-a456-426614174000",
    "summary": "VIP customer, longtime buyer. Had delivery issue that was resolved.",
    "key_topics": ["orders", "delivery", "refunds"],
    "preferences": {
      "contact_method": "email",
      "best_time": "afternoons",
      "vip": true
    },
    "relationship_notes": "Escalate any issues to manager immediately",
    "last_updated": "2024-01-15T16:00:00Z"
  }
  ```

  ```json 404 theme={null}
  {
    "error": {
      "code": "not_found",
      "message": "Memory not found"
    }
  }
  ```
</ResponseExample>
