---
title: "Regenerate Patch"
method: POST
path: "/api/v2/issues/regeneratePatch"
tags: ["Issues"]
---

# Regenerate Patch

`POST /api/v2/issues/regeneratePatch`

## Request

- Base URL: `https://zeropath.com`
- URL: `https://zeropath.com/api/v2/issues/regeneratePatch`
- Auth: API key in header `X-ZeroPath-API-Token-Id` and API key in header `X-ZeroPath-API-Token-Secret`

Regenerate the patch for a single issue. Deletes any existing patch (and any leftover patch candidates) and enqueues a fresh patch generation request. If `force` is true and the issue was previously marked unpatchable, the unpatchable flag (and any recorded reason/remediation instructions) is cleared and a new patch generation request is enqueued anyway — the agent may still refuse on retry. With `variantCount` > 1 the worker stores alternative patch candidates on the issue instead of a patch; fetch them from the issue detail (`patchCandidates`) and promote one with `issues.selectPatchCandidate`. Returns the new patch generation request id.

## Request body

- object
  - `organizationId` string
  - `issueId` string, required
  - `force` boolean: Override the unpatchable flag and force generation. Defaults to false.
  - `feedback` string: Free-form feedback describing what should change about the previous patch. Forwarded verbatim to the patch-generation agent.
  - `variantCount` integer: How many alternative patches to generate (default 1). With more than 1, the worker stores patch candidates for selection instead of applying a patch directly.

## Response `200`

Patch regeneration request created

- object
  - `ok` boolean, required
  - `requestId` string, required

---

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