---
title: "Submit RatingEvents to update memory usefulness posteriors"
method: POST
path: "/api/memory/rate"
tags: ["Memory"]
---

# Submit RatingEvents to update memory usefulness posteriors

`POST /api/memory/rate`

## Request body

- object
  - `events` object[], required
    - `memoryId` string, required
    - `signal` number, required
    - `weight` number, required
    - `source` 'llm' | 'explicit-self', required
    - `reasoning` string
    - `taskId` string, uuid
    - `referencesSource` string — Optional external source ID this memory references. Free-form string, convention "<source>:<identifier>" (e.g. "github:owner/repo#N", "linear:KEY-N", "customer:<slug>", "slack:<channel>:<ts>", "agentmail:<thread-id>"). Pick any prefix that fits — no closed enum. When present, an edge from this memory to the external source is created/updated.

## Response `200`

Ratings applied; per-event rejections returned in body

- object
  - `applied` number, required
  - `rejected` object[], required
    - `memoryId` string, required
    - `reason` string, required

## Other responses

- `400` — Validation error or explicit-self R6 spam-guard rejection
- `409` — Duplicate explicit-self rating for (taskId, memoryId)

---

[API](https://skmtc.net/desplega-ai/apis/agent-swarm-api.md) · [All operations](https://skmtc.net/desplega-ai/apis/agent-swarm-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/desplega-ai/agent-swarm-api/versions/0375890be8c4/schema)
