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

# Resolve Conflict

> Resolve one conflict from the conflict report by index.

## Overview

Applies a resolution action to a single conflict identified by its **index** in the full conflict array for that agent and date (same ordering as the JSON report file). This uses the same resolution logic as the Memanto CLI conflict flow (updates Moorcheh memories and marks the row resolved in the report).

## Authentication

API clients do not send an API key or `Authorization` header.

<ParamField header="X-Session-Token" type="string" required>
  Session token from [Activate Agent](/api-reference/sessions/activate-agent). Must match `agent_id`.
</ParamField>

<ParamField header="Content-Type" type="string" required>
  Must be `application/json`
</ParamField>

## Path Parameters

<ParamField path="agent_id" type="string" required>
  The unique identifier of the agent.
</ParamField>

## Body

<ParamField body="conflict_index" type="integer" required>
  Zero-based index into the **full** conflicts list for that `date` (not only unresolved rows).
</ParamField>

<ParamField body="action" type="string" required>
  One of: `keep_old`, `keep_new`, `keep_both`, `remove_both`, `manual`.
</ParamField>

<ParamField body="date" type="string">
  Report date `YYYY-MM-DD`. Defaults to **today** on the server when omitted.
</ParamField>

<ParamField body="manual_content" type="string">
  Required when `action` is `manual`: replacement memory text (both conflicting memories are removed and this content is stored).
</ParamField>

<ParamField body="manual_type" type="string">
  Optional memory type for the manual replacement (defaults follow implementation when omitted).
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "http://localhost:8000/api/v2/agents/my-agent/conflicts/resolve" \
    -H "X-Session-Token: your_session_token" \
    -H "Content-Type: application/json" \
    -d '{
      "date": "2026-05-08",
      "conflict_index": 0,
      "action": "keep_new"
    }'
  ```

  ```bash cURL (manual resolution) theme={null}
  curl -X POST "http://localhost:8000/api/v2/agents/my-agent/conflicts/resolve" \
    -H "X-Session-Token: your_session_token" \
    -H "Content-Type: application/json" \
    -d '{
      "date": "2026-05-08",
      "conflict_index": 0,
      "action": "manual",
      "manual_content": "We use PostgreSQL for OLTP and MongoDB only for analytics.",
      "manual_type": "fact"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - OK theme={null}
  {
    "agent_id": "my-agent",
    "session_id": "sess_982287b6a5f5",
    "date": "2026-05-08",
    "action": "keep_new",
    "deleted": "abc-123",
    "status": "resolved"
  }
  ```

  ```json 401 - Unauthorized (Missing Token) theme={null}
  {
    "detail": "Missing session token. Use X-Session-Token header."
  }
  ```

  ```json 422 - Validation Error theme={null}
  {
    "detail": [
      {
        "type": "missing",
        "loc": ["body", "conflict_index"],
        "msg": "Field required",
        "input": {}
      }
    ]
  }
  ```

  ```json 500 - Server Error theme={null}
  {
    "detail": {
      "error": "InternalServerError",
      "message": "An unexpected error occurred",
      "details": {
        "original_error": "..."
      }
    }
  }
  ```
</ResponseExample>

Invalid `action`, missing conflict report, out-of-range index, or missing `manual_content` for `manual` typically surface as **500** with details from the underlying resolver.

## Next Steps

* [List Conflicts](/api-reference/data/list-conflicts) to fetch remaining unresolved rows
* [Recall](/api-reference/search/recall) to verify memory state after resolution
