---
title: "Create a pull request directly"
method: POST
path: "/api/v2/agent/createPullRequest"
tags: ["Agent"]
---

# Create a pull request directly

`POST /api/v2/agent/createPullRequest`

## Request

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

Create a pull request directly via the VCS provider (GitHub, GitLab, or Bitbucket). Use this for ad-hoc PRs not tied to a specific vulnerability patch. The branch must already exist on the remote.

## Request body

- AgentCreatePullRequestRequest
  - `organizationId` string: Organization ID (injected by MCP server)
  - `repositoryId` string, uuid, required: ID of the repository to create a PR in
  - `branchName` string, required: Source branch name for the pull request
  - `baseBranch` string, required: Target/base branch for the pull request
  - `title` string, required: Pull request title
  - `body` string, required: Pull request body/description

## Response `200`

Pull request created

- AgentCreatePullRequestResponse
  - `prUrl` string, required: Web URL of the created pull request

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