---
title: "Create a vulnerability patch record"
method: POST
path: "/api/v2/agent/createPatch"
tags: ["Agent"]
---

# Create a vulnerability patch record

`POST /api/v2/agent/createPatch`

## Request

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

Create a CodeScanVulnerabilityPatch record for a vulnerability. This records a proposed fix and can later be submitted for PR creation via agent.triggerPrFromPatch.

## Request body

- AgentCreatePatchRequest
  - `organizationId` string: Organization ID (injected by MCP server)
  - `vulnerabilityId` string, uuid, required: ID of the vulnerability to create a patch for
  - `prTitle` string, required: Title for the pull request
  - `prDescription` string: Description for the pull request
  - `gitDiff` string: Git diff content for the patch
  - `localBranch` string: Local branch name where the patch was created

## Response `200`

Patch record created

- AgentCreatePatchResponse
  - `patch` object, required
    - `id` string, uuid, required

## Other responses

- `400`: Error Response
- `401`: Error Response
- `404`: Error Response

---

[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)
