---
title: "Retry failed trades from an async batch review job"
method: POST
path: "/api/agents/review-batch/{jobId}/retry"
tags: ["Agent API"]
---

# Retry failed trades from an async batch review job

`POST /api/agents/review-batch/{jobId}/retry`

## Request

- Base URL: `https://klinepic.com`
- URL: `https://klinepic.com/api/agents/review-batch/{jobId}/retry`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-KLine-Agent-Key`

## Path parameters

- `jobId` string, required

## Headers

- `X-Agent-Request-Id` string

## Request body

- AgentReviewBatchRetryRequest
  - `requestId` string
  - `callbackUrl` string, uri: Optional public HTTPS callback URL for the retry job.
  - `batch` AgentBatchPayload
    - `templateId` 'clean-review' | 'content-card' | 'risk-first' | 'minimal' | 'team-branded': Built-in chart style. It fills common defaults for window size, indicators, sub-panels, imageTheme, and layout. Caller fields still override the template.
    - `tradesText` string, required: Trade events as CSV or JSON. CSV columns: trade_id,symbol,event_type,position_side,time,price,quantity. Optional columns include name,fee,note.
    - `tradesFormat` 'csv' | 'json', required
    - `preBars` integer: Number of bars to show before the first trade event. Defaults from templateId or 120.
    - `postBars` integer: Number of bars to show after the last trade event. Defaults from templateId or 40.
    - `minDisplayBars` integer
    - `indicatorConfig` AgentIndicatorConfig
      - `ma` object[], required
        - `period` integer, required
        - `visible` boolean, required
      - `ema` object[], required
        - `period` integer, required
        - `visible` boolean, required
      - `volumeMa` object[], required
        - `period` integer, required
        - `visible` boolean, required
      - `macd` object, required
        - `fast` integer, required
        - `slow` integer, required
        - `signal` integer, required
        - `visible` boolean, required
      - `kdj` object, required
        - `n` integer, required
        - `m1` integer, required
        - `m2` integer, required
        - `visible` boolean, required
      - `rsi` object, required
        - `period` integer, required
        - `visible` boolean, required
      - `boll` object, required
        - `period` integer, required
        - `stdMult` number, required
        - `visible` boolean, required
      - `atr` object, required
        - `period` integer, required
        - `visible` boolean, required
      - `vwap` object, required
        - `anchor` 'daily' | 'holding' | 'custom', required
        - `customStart` string, date-time
        - `visible` boolean, required
    - `indicatorProfile` 'standard' | 'trend' | 'momentum' | 'risk' | 'minimal' | 'vegas': Reusable named indicator combination. It fills indicatorConfig and default sub-panels unless the caller supplies raw indicatorConfig or showSubPanels.
    - `showSubPanels` string[]
    - `imageTheme` 'darkUs' | 'darkCn' | 'lightUs' | 'lightCn': Output image style. This controls the generated chart only, not the website light/dark mode.
    - `theme` 'darkUs' | 'darkCn' | 'lightUs' | 'lightCn': Deprecated alias for imageTheme. It is still accepted for old callers.
    - `layoutPreset` 'standard' | 'compact' | 'wide' | 'square' | 'portrait' | 'mobile': Convenience layout applied before explicit width, height, or scale. You can also put this field under output.
    - `output` AgentChartOutput
      - `layoutPreset` 'standard' | 'compact' | 'wide' | 'square' | 'portrait' | 'mobile': standard=1280x800@2x, compact=960x600@1x, wide=1280x720@2x, square=1200x1200@1x, portrait=1200x1600@1x, mobile=1080x1920@1x. Explicit width, height, or scale wins over the preset.
      - `width` integer
      - `height` integer
      - `scale` number: PNG pixel ratio. 1280x800 with scale=2 returns a 2560x1600 PNG.
      - `locale` 'zh-CN' | 'zh-TW' | 'en-US' | 'ja-JP' | 'ko-KR': Language used for rendered chart labels and built-in watermark text.
      - `timezone` string: Optional IANA timezone used for displayed timestamps. It does not change trade math or data matching.
      - `showInfoPanel` boolean: Set false to remove the right-side summary panel and give the K-line more horizontal room.
      - `infoPanelFields` string[]: Optional allow-list for right-side summary panel metrics. Omit it to render the full panel.
      - `infoPanelMode` 'reserved' | 'overlay': reserved keeps chart space clear for the summary panel. overlay places the panel over the chart and is mainly useful for compact previews.
      - `annotationDensity` 'smart' | 'full' | 'balanced' | 'minimal' | 'none': Controls chart annotation detail. smart clusters crowded buy/sell markers, full keeps all labels, balanced keeps trade labels with less range detail, minimal keeps only markers/range, none hides SVG annotations.
      - `markerLabelTemplate` string: Optional template for buy/sell marker labels. Supported tokens: {label}, {action}, {side}, {price}, {quantity}, {tradeId}, {symbol}, {name}, {fee}, {note}. Omit it to keep the built-in localized labels.
      - `themeOverrides` AgentThemeOverrides: Hex-only color overrides. Use #RRGGBB values; arbitrary CSS strings are not accepted.
        - `background` string
        - `grid` string
        - `axis` string
        - `candleUp` string
        - `candleDown` string
        - `candleLimitUp` string
        - `candleLimitDown` string
        - `ma` string[]
        - `ema` string[]
        - `boll` object
          - `middle` string
          - `upper` string
          - `lower` string
        - `vwap` string
        - `macd` object
          - `dif` string
          - `dea` string
          - `histogramUp` string
          - `histogramDown` string
        - `kdj` object
          - `k` string
          - `d` string
          - `j` string
        - `rsi` string
        - `atr` string
        - `volume` object
          - `up` string
          - `down` string
          - `ma` string[]
        - `annotations` object
          - `buyMarker` string
          - `sellMarker` string
          - `buyPriceLine` string
          - `sellPriceLine` string
          - `holdingBg` string
          - `maxProfit` string
          - `drawdown` string
          - `dividend` string
        - `infoPanel` object
          - `bg` string
          - `border` string
          - `text` string
          - `label` string
          - `valuePositive` string
          - `valueNegative` string
          - `accentCyan` string
          - `accentRed` string
          - `accentPurple` string
        - `watermark` string
      - `styleOverrides` AgentStyleOverrides: Safe numeric size controls for SVG decorations. Omit to keep the template default sizes.
        - `annotation` object: Controls trade labels, marker triangles/circles, and annotation line widths.
          - `textScale` number: Scales annotation label text.
          - `markerScale` number: Scales trade marker triangles and point circles.
          - `lineWidthScale` number: Scales SVG annotation strokes such as price lines and connectors.
        - `watermark` object
          - `textScale` number: Scales the built-in rendered watermark text.
      - `showWatermark` boolean
      - `watermark` union: Custom watermark text, or false to hide the default watermark.
        - string
        - boolean
      - `title` string
      - `subtitle` string
      - `footer` string
      - `logoText` string: Short text logo badge, for example a strategy or team name.
    - `period` '1m' | '5m' | '15m' | '30m' | '60m' | '1h' | '4h' | '1d'
    - `market` 'cn-a' | 'us-stock' | 'crypto' | 'futures' | 'forex'
    - `source` 'tushare' | 'akshare' | 'binance' | 'csv', required: Use csv for the most stable paid API integration. Other values are available only when enabled on the server.
    - `klineCsv` string: Required when source=csv. CSV columns: symbol,time,open,high,low,close,volume. Optional columns include amount,adjust.
    - `tushareToken` string: Required when source=tushare. Do not send this unless the caller intentionally uses Tushare.

## Response `202`

Retry batch job accepted

- AgentReviewBatchCreateResponse
  - `ok` true, required
  - `requestId` string, required
  - `job` AgentBatchJob, required
    - `id` string
    - `status` 'queued' | 'running' | 'completed' | 'failed' | 'cancelled'
    - `total` integer
    - `completed` integer
    - `success` integer
    - `failed` integer
    - `retryRequestAvailable` boolean: True when the underlying batch job retained a safe retry payload. Public Agent retry requests still send a full batch payload; the server uses the source job to rerun failed trades only.
    - `callback` object
      - `configured` true
      - `attempts` integer
      - `maxAttempts` integer
      - `lastAttemptAt` string, date-time
      - `nextAttemptAt` string, date-time
      - `deliveredAt` string, date-time
      - `error` string
    - `results` object[]
      - `tradeId` string
      - `status` string
      - `fileName` string
      - `imageUrl` string, uri: Absolute URL for downloading this PNG.
      - `signedImageUrl` string, uri: Temporary signed URL for downloading this PNG without sending an API key.
  - `links` AgentBatchLinks, required
    - `status` string, uri, required
    - `wait` string, uri, required
    - `events` string, uri, required
    - `manifest` string, uri, required
    - `archive` string, uri, required
  - `signedLinks` AgentSignedBatchLinks
    - `manifest` string, uri, required: Temporary signed manifest URL that can be fetched without an API key.
    - `archive` string, uri, required: Temporary signed ZIP archive URL that can be fetched without an API key.
    - `expiresAt` string, date-time, required
    - `expiresAtUnix` integer, required
  - `account` object, required
  - `apiKey` object
  - `commercialState` object

## Other responses

- `400`: Structured error
- `401`: Authentication or policy failure
- `402`: Authentication or policy failure
- `403`: Authentication or policy failure
- `404`: Structured error
- `409`: Structured error
- `429`: Structured error

---

[API](https://skmtc.dev/klinepic/apis/klinepic-agent-api.md) · [All operations](https://skmtc.dev/klinepic/apis/klinepic-agent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/klinepic/apis/klinepic-agent-api/revisions/1c0680282e2c?raw)
