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

# Update Fact

> Update the text or metadata of an existing fact

```
PATCH /openapi/memorylake/api/v3/workspaces/{workspaceId}/projects/{projectId}/memories/facts/{factId}
```

Updates the text or metadata of an existing fact in a project. You can modify the fact content, its metadata, or both.

<Note>
  **Permission required:** `project:mem_modify`
</Note>

### Path Parameters

<ParamField path="workspaceId" type="string" required>
  Workspace ID
</ParamField>

<ParamField path="projectId" type="string" required>
  Project ID
</ParamField>

<ParamField path="factId" type="string" required>
  Fact ID
</ParamField>

### Request Body

<ParamField body="fact" type="string">
  Updated fact text
</ParamField>

<ParamField body="metadata" type="object">
  Updated key-value metadata to attach to the fact
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH 'https://app.memorylake.ai/openapi/memorylake/api/v3/workspaces/ws_abc123def456/projects/proj_a1b2c3d4e5f6/memories/facts/fact_8f3a1b2c4d5e' \
    -H 'Authorization: Bearer sk_xxxxxx' \
    -H 'Content-Type: application/json' \
    -d '{
      "fact": "User prefers dark mode in all applications and IDEs",
      "metadata": {
        "category": "preferences",
        "confidence": "high",
        "verified": true
      }
    }'
  ```
</RequestExample>

### Response

<ResponseField name="data" type="object">
  <Expandable title="Fact object">
    <ResponseField name="id" type="string">Unique fact identifier</ResponseField>
    <ResponseField name="fact" type="string">The fact text</ResponseField>
    <ResponseField name="metadata" type="object">Arbitrary key-value metadata attached to the fact</ResponseField>
    <ResponseField name="expired" type="boolean">Whether the fact has been forgotten</ResponseField>
    <ResponseField name="score" type="number">Relevance score</ResponseField>
    <ResponseField name="expiration_date" type="string|null">Scheduled expiration date, or `null` if the fact does not expire</ResponseField>
    <ResponseField name="created_at" type="string">Creation timestamp</ResponseField>
    <ResponseField name="updated_at" type="string">Last update timestamp</ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json Success (200) theme={null}
  {
    "success": true,
    "data": {
      "id": "fact_8f3a1b2c4d5e",
      "fact": "User prefers dark mode in all applications and IDEs",
      "metadata": {
        "category": "preferences",
        "confidence": "high",
        "verified": true
      },
      "expired": false,
      "score": 0.95,
      "expiration_date": null,
      "created_at": "2025-06-10T14:30:00Z",
      "updated_at": "2025-06-20T11:45:00Z"
    }
  }
  ```
</ResponseExample>
