---
title: "Create Run Pull Request"
method: POST
path: "/api/v1/runs/{id}/pull_request"
tags: ["Runs"]
---

# Create Run Pull Request

`POST /api/v1/runs/{id}/pull_request`

Durably requests creation of a pull request for a completed run. The
server generates the pull request content and creates the GitHub pull
request after this request returns. Poll the URL in the Location
response header until the creation succeeds or fails.

If a creation is already pending for the run, the response returns
that creation unchanged; any different `model` or `force` values in
the new request are ignored.

## Path parameters

- `id` string, required

## Request body

- CreateRunPullRequestRequest — Request body for creating a run pull request.
  - `force` boolean, required — Create the pull request even if the run did not finish with succeeded or partially_succeeded.
  - `model` string, nullable — Optional model override for generating the pull request description.

## Response `202`

Pull request creation was durably accepted

- PullRequestCreation — Durable status for the latest explicit pull request creation requested for a run.
  - `id` string, required — Stable identifier for one explicit pull request creation request.
  - `status` 'pending' | 'succeeded' | 'failed', required — Durable state of a pull request creation request.
  - `model` string, required — Resolved model identifier used to generate the pull request content.
  - `force` boolean, required — Whether creation was allowed for a run without a successful conclusion.
  - `requested_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `pull_request` PullRequestLink — Minimal GitHub pull request link associated with a run.
    - `owner` string, required
    - `repo` string, required
    - `number` integer, required
    - `html_url` string, uri, required — Computed GitHub web URL for the pull request.
  - `error` string, nullable

## Other responses

- `400` — Pull request creation does not apply to this run
- `404` — Run not found
- `409` — Pull request already exists for this run. Clients can GET /runs/{id}/pull_request to retrieve the stored record.
- `503` — GitHub integration is unavailable on the server

---

[API](https://skmtc.net/fabro-sh/apis/fabro-run-api.md) · [All operations](https://skmtc.net/fabro-sh/apis/fabro-run-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/fabro-sh/fabro-run-api/versions/bee030053823/schema)
