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 $GHIT_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"}' \
  "$GHIT_API_URL/v1/teams/platform/repos/website/pulls"

Success

201 Created with the created pull request.

{
  "uuid": "...",
  "number": 42,
  "target_ref": "main",
  "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.
  • 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.