# Replace an item with a corrected one

`POST /memory/items/{id}/supersede` · Rivier · memory

Replace an item with a corrected one.

- Scope: memory:write
- Graphql: Mutation.memoryItemSupersede
- Sdk: memory.item.supersede
- Cli: memory item supersede

## Parameters

- `id` (path, required), string

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "scope": {
      "type": "object",
      "properties": {
        "level": {
          "type": "string",
          "enum": [
            "account",
            "organization",
            "project",
            "product",
            "agent"
          ]
        },
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
        }
      },
      "required": [
        "level",
        "id"
      ],
      "additionalProperties": false
    },
    "kind": {
      "type": "string",
      "enum": [
        "business_fact",
        "brand_voice",
        "guideline",
        "product",
        "policy",
        "faq",
        "decision",
        "preference",
        "conversation_summary",
        "correction",
        "note",
        "research_note",
        "reflection",
        "opinion",
        "life_event",
        "relationship"
      ]
    },
    "text": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4000
    },
    "language": {
      "type": "string",
      "maxLength": 20
    },
    "source": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "upload",
            "conversation",
            "web",
            "connector",
            "human",
            "reflection",
            "lw",
            "call"
          ]
        },
        "ref": {
          "type": "string",
          "maxLength": 300
        },
        "label": {
          "type": "string",
          "maxLength": 120
        },
        "url": {
          "type": "string",
          "maxLength": 500
        },
        "retrievedAt": {
          "type": "string",
          "maxLength": 40
        }
      },
      "required": [
        "type"
      ],
      "additionalProperties": false
    },
    "origin": {
      "type": "string",
      "enum": [
        "human",
        "learned",
        "research",
        "reflection",
        "persona_life",
        "conversation"
      ]
    },
    "state": {
      "type": "string",
      "enum": [
        "proposed",
        "active"
      ]
    },
    "confidence": {
      "type": "number",
      "minimum": 0,
      "maximum": 1
    },
    "importance": {
      "type": "number",
      "minimum": 0,
      "maximum": 1
    },
    "sensitive": {
      "type": "boolean"
    },
    "pinned": {
      "type": "boolean"
    },
    "visibility": {
      "type": "string",
      "enum": [
        "all_agents",
        "named_agents",
        "humans_only"
      ]
    },
    "visibleTo": {
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 100
      },
      "maxItems": 50
    },
    "validFrom": {
      "type": "string",
      "maxLength": 40
    },
    "validTo": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 40
        },
        {
          "type": "null"
        }
      ]
    },
    "entityIds": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      },
      "maxItems": 50
    }
  },
  "required": [
    "scope",
    "kind",
    "text",
    "source",
    "origin"
  ],
  "additionalProperties": false
}
```

## Responses

- `201`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X POST 'https://api.rivier.ai/memory/items/{id}/supersede' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "scope": {
    "level": "account",
    "id": "string"
  },
  "kind": "business_fact",
  "text": "string",
  "source": {
    "type": "upload"
  },
  "origin": "human"
}'
```
