---
title: "Get session memory changes"
method: GET
path: "/v1/projects/{projectSlug}/sessions/{sessionId}/memory/changes"
tags: ["Sessions"]
---

# Get session memory changes

`GET /v1/projects/{projectSlug}/sessions/{sessionId}/memory/changes`

Returns the memory writes the session made as per-record before/after diffs. Pass `traceId` to restrict to a single trace of the session.

## Path parameters

- `projectSlug` string, required — Project slug (human-readable identifier)
- `sessionId` string, required — Session identifier lifted from instrumentation. Up to 128 characters.

## Query parameters

- `traceId` string — Restrict the memory changes to this trace of the session. Omit for the whole session.

## Response `200`

Session memory changes

- SessionMemoryChanges
  - `records` SessionMemoryChange[], required — Per-record before/after diffs for what the session changed.
    - `storeId` string, required — Store the changed record belongs to.
    - `recordId` string, required — Record that changed.
    - `kind` 'added' | 'updated' | 'removed', required — How the session changed the record.
    - `beforeBody` string, nullable, required — The record's body before the session's writes. `null` when added or when the prior body was not captured.
    - `afterBody` string, nullable, required — The record's body after the session's writes. `null` when removed or when the body was not captured.
    - `tokensAdded` integer, required — Tokens added by the session's writes.
    - `tokensRemoved` integer, required — Tokens removed by the session's writes.
    - `degraded` boolean, required — `true` when a side's body was unavailable, so the diff is incomplete.
    - `lastChangeSpanId` string, nullable, required — Span of the session's last write to this record. `null` when unknown.

## Other responses

- `400` — Validation error
- `401` — Unauthorized
- `404` — Not found

## Changes

- **2026-07-22** `7fedfdd5ae66` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/latitude-dev/apis/latitude/changes/v1/projects/:projectSlug/sessions/:sessionId/memory/changes/get.md)

---

[API](https://skmtc.dev/latitude-dev/apis/latitude.md) · [All operations](https://skmtc.dev/latitude-dev/apis/latitude/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/latitude-dev/latitude/revisions/a0bf72a85607/schema)
