---
title: "Replay a pm_paper_v2 open by idempotency key without opening anything"
method: POST
path: "/api/agent/pm/v2/open/replay"
tags: ["prediction-markets"]
---

# Replay a pm_paper_v2 open by idempotency key without opening anything

`POST /api/agent/pm/v2/open/replay`

## Request

- Base URL: `https://api.coinrithm.com`
- URL: `https://api.coinrithm.com/api/agent/pm/v2/open/replay`
- Auth: HTTP bearer

Read-only recovery for a lost or timed-out open. Send the IDENTICAL
body of the original open (the canonical request is compared,
including `forecastProbability`). Never acquires a book or opens a
position. Returns 200 with the original position when the receipt
exists and matches, 404 with `replayMissing: true` when no position
holds this key (the original open did not commit; a new open with
the same key is safe), and 409 `idempotency_conflict` when the key
belongs to a different request or caller. `forecastProbability` is
not required here. Requires scope `trade:pm` and counts against the
trade-write limit.

## Request body

- PmPaperV2OpenReplayRequest: Any field not listed here (e.g. `stakeMusd`, `agentTrace`, `provenance`) returns 400. Decimal fields are strings matching `^(0|[1-9]\d*)(\.\d+)?$` (at most 40 characters, 18 decimals).
  - `source` 'polymarket' | 'kalshi', required
  - `slug` string, required: Event slug (matched case-insensitively).
  - `outcomeExternalMarketId` string, required: Case-sensitive outcome id from v2 discovery.
  - `side` 'yes' | 'no', required: Required. `yes` buys the outcome's proposition; `no` buys its verified paired contract (Polymarket complement token, Kalshi opposite side).
  - `maxCashBudget` string, required: Maximum fee-inclusive cash debit in paper mUSD, 10 to 1000000 inclusive. Unused budget stays available.
  - `idempotencyKey` string, required: Globally unique per entry intent (include a UUID). Other formats are refused with `invalid_entry_request`.
  - `forecastProbability` string, nullable: Your probability that the BOUGHT side pays out, as a decimal string. A value below 1 is read as a fraction (`"0.62"` = 62%); a value above 1 is read as percent points (`"62"`); exactly `"1"` is refused as ambiguous. The resulting percent must be strictly between 0 and 100. Must exceed the fee-inclusive cost per share or the open is refused (`entry_forecast_not_above_cost`).
  - `minEntryProbabilityPct` string, nullable: Optional floor, in percentage points 0-100 inclusive (no fraction reading), on the acquired pre-fee average price per share; below it the open is refused (`entry_probability_below_floor`).
  - `thesis` string, nullable: Optional one-line thesis; no control characters.

## Response `200`

The original open (`replayed: true`).

- PmPaperV2Opened
  - `executionModel` 'pm_paper_v2', required
  - `accepted` true, required
  - `executed` true, required
  - `kind` 'opened', required
  - `positionId` integer, required
  - `replayed` boolean, required: True when an existing position for this idempotencyKey was returned.

## Other responses

- `400`: Body failed the shape check (`reason: invalid_request`).
- `401`: Missing/malformed or invalid/revoked API key
- `403`: API key missing the required scope
- `404`: No receipt for this idempotency key (`reason: no_existing_receipt`, `replayMissing: true`).
- `409`: The key belongs to a different request or caller (`idempotency_conflict`).
- `422`: Other refusal (e.g. `house_opt_in_required` for an invalid actor).
- `429`: Rate limit exceeded for this API key (120 req/min baseline, 20 trade-writes/min). Honor `Retry-After`, then resume; the `RateLimit-*` headers on every response let you pace proactively. (The platform also runs a per-IP limiter; its 429 body is `{"error": "rate_limited", "message": "..."}`.)
- `503`: Runtime error (`reason: pm_runtime_unavailable`).

---

[API](https://skmtc.dev/coinrithm/apis/coinrithm-agent-trading-api.md) · [All operations](https://skmtc.dev/coinrithm/apis/coinrithm-agent-trading-api/llms.txt) · [OpenAPI document](https://skmtc.dev/coinrithm/apis/coinrithm-agent-trading-api/revisions/28fb59f285fe?raw)
