---
title: "Link a pull request to an issue"
method: POST
path: "/issues/{issueId}/pull-requests"
tags: ["Issues"]
---

# Link a pull request to an issue

`POST /issues/{issueId}/pull-requests`

## Request

- Base URL: `https://api.sazabi.com/v1`
- URL: `https://api.sazabi.com/v1/issues/{issueId}/pull-requests`
- Auth: none declared

Link a GitHub or Bitbucket pull request to an issue as a fix or suspected cause. Linking is idempotent and never bills.

## Path parameters

- `issueId` string, uuid, required: Issue to link the pull request to.

## Request body

- object
  - `url` string, uri, required: Pull request URL: `https://github.com/{owner}/{repo}/pull/{number}`, `https://bitbucket.org/{workspace}/{repo}/pull-requests/{number}`, or `https://git.cafe/{owner}/{repo}/pull/{number}`.
  - `relation` 'fixes' | 'caused_by': Whether the pull request fixes or is suspected of causing the issue.

## Response `200`

OK

- object
  - `pullRequest` object, required
    - `id` string, uuid, required
    - `number` integer, required
    - `repositoryFullName` string, required
    - `title` string, nullable, required
    - `url` string, uri, nullable, required
    - `status` 'open' | 'merged' | 'closed', nullable, required
    - `reviewState` 'review_required' | 'approved' | 'changes_requested', nullable, required
    - `checksState` 'passing' | 'failing' | 'pending', nullable, required
    - `relation` 'fixes' | 'caused_by', required: How the pull request relates to the issue: it fixes the issue or is its suspected cause.
    - `source` 'sazabi' | 'linked', required: `sazabi` for a pull request Sazabi opened; `linked` for one opened elsewhere (for example by your own coding agent) and linked to the issue. Status, review, and checks of a linked pull request stay null when its repository is not connected.
  - `created` boolean, required: False when the exact relationship already existed.

## Changes

- **2026-10-05** `f8153a7e1664`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/sazabi/apis/sazabi-public-api/changes/issues/:issueId/pull-requests/post.md)

---

[API](https://skmtc.dev/sazabi/apis/sazabi-public-api.md) - [All operations](https://skmtc.dev/sazabi/apis/sazabi-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/sazabi/apis/sazabi-public-api/revisions/965b6230cf45?raw)
