Create pull

Create a pull request into a target repository.

Endpoints

POST /api/v1/teams/{team_slug}/repos/{repo_slug}/pulls
POST /api/v1/users/{username}/repos/{repo_slug}/pulls
Authenticated

Request

JSON body:

  • source_repo (required): teams/{team_slug}/{repo_slug} or {username}/{repo_slug}
  • source_ref (required)
  • target_ref (required)
  • title (required)
  • body (optional)
  • status (optional): open or draft

Usage

curl --request POST \
  --header "Authorization: Bearer $PEARING_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{"source_repo": "alice/website-fork", "source_ref": "feature-x", "target_ref": "main", "title": "Feature x", "body": "Please review.", "status": "open"}' \
  "$PEARING_API_URL/v1/teams/platform/repos/website/pulls"

Success

201 Created with the created pull request, including created_by_uuid/created_by_username and nullable merge/close actor fields.

{
  "uuid": "...",
  "number": 42,
  "target_ref": "main",
  "source_repo": "alice/website-fork",
  "source_ref": "feature-x",
  "title": "Feature x",
  "body": "Please review.",
  "status": "open",
  "created_at": "2026-03-09T12:00:00Z",
  "updated_at": "2026-03-09T12:00:00Z"
}

Errors

  • 400 Bad Request for invalid source_repo or invalid create status.
  • 403 Forbidden when the caller cannot access source/target repo or the target repo's public_repo_pull_policy does not allow pull creation for that caller.
  • 404 Not Found when source or target repo is missing.
  • 409 Conflict for duplicate open refs or invalid same-repo refs.

Common auth errors are documented on the API overview page.