---
title: "Get a lossless compact position replay"
method: GET
path: "/v1/positions/{positionId}/replay/compact"
tags: ["positions"]
---

# Get a lossless compact position replay

`GET /v1/positions/{positionId}/replay/compact`

## Request

- Base URL: `https://app.legend.trade/api/rest`
- URL: `https://app.legend.trade/api/rest/v1/positions/{positionId}/replay/compact`
- Auth: none declared

Complete replay at one capture cutoff, without temporary storage. Decode RFC 4648 base64, decompress gzip with an output limit of byteLength (maximum 128 MiB), verify the exact byte count, then decode UTF-8 and validate PositionReplayCompactPayload. Verify its id matches the requested position; capturedAt is included in the decoded payload. Version 2 uses fixed-column tuple tables documented by its row schemas; all other PositionReplay v1 fields are unchanged. Null optional trade cells mean absent fields. Reconstruct v1 objects without recalculating financial values. The serialized envelope is limited to 4,000,000 UTF-8 bytes; larger payloads return HTTP 412 with data.replayReason=payload_limit and no truncated data.

## Path parameters

- `positionId` string, uuid, required

## Response `200`

Successful response

- PositionReplayCompactEnvelope
  - `version` 2, required
  - `encoding` 'gzip-base64', required
  - `byteLength` integer, required: Exact uncompressed compact JSON UTF-8 byte length. Bound decompression to this length and reject a mismatch.
  - `data` string, required: RFC 4648 base64 of gzip-compressed PositionReplayCompactPayload JSON. Decode base64, decompress with a byte limit, verify byteLength, decode UTF-8, then validate PositionReplayCompactPayload.

## Other responses

- `400`: Invalid input data
- `404`: Not found
- `412`: Replay is unavailable. Use data.replayReason to identify the cause.
- `500`: Internal server error

## Changes

- **2026-10-26** `640a7bdb8015`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/legend/apis/legend-api/changes/v1/positions/:positionId/replay/compact/get.md)

---

[API](https://skmtc.dev/legend/apis/legend-api.md) - [All operations](https://skmtc.dev/legend/apis/legend-api/llms.txt) - [OpenAPI document](https://skmtc.dev/legend/apis/legend-api/revisions/c3e45061cf81?raw)
