---
title: "Open a pull request through one of your git connections"
method: POST
path: "/git-connections/{connection_id}/repositories/{owner}/{repo}/pull-requests"
tags: ["Git Provider Connections"]
---

# Open a pull request through one of your git connections

`POST /git-connections/{connection_id}/repositories/{owner}/{repo}/pull-requests`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/git-connections/{connection_id}/repositories/{owner}/{repo}/pull-requests`
- Auth: HTTP bearer

Uses the token of a connection you own. The head branch must already
exist, for example after committing to it. Another user's connection
answers 404.

## Path parameters

- `connection_id` integer, required
- `owner` string, required
- `repo` string, required

## Request body

- OpenPullRequestRequest: Request body for opening a pull request.
  - `base_branch` string, nullable: Branch to merge into. Defaults to the repository's default branch.
  - `body` string, nullable
  - `head_branch` string, required: Branch holding the changes.
  - `title` string, required

## Response `201`

Pull request opened

- PullRequestResponse
  - `base_branch` string, required
  - `connection_id` integer, required
  - `head_branch` string, required
  - `number` integer, required
  - `repository` string, required
  - `title` string, required
  - `url` string, required

## Other responses

- `400`: Invalid title, branch or body, or the connection is inactive
- `401`: Unauthorized
- `403`: Insufficient permissions
- `404`: Connection not found, or not owned by the caller
- `502`: The git provider rejected or failed the request

## Changes

> 81 revisions in range; 1 not diffed.

- **2026-10-20** `79089e9f49ee`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/git-connections/:connection_id/repositories/:owner/:repo/pull-requests/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) · [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) · [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/ab6d5d19e930?raw)
