Merge pull
Merge an open pull request into the target ref.
Endpoints
POST /api/v1/teams/{team_slug}/repos/{repo_slug}/pulls/{number}/merge
POST /api/v1/users/{username}/repos/{repo_slug}/pulls/{number}/merge
Authenticated
Request
JSON body (optional optimistic concurrency checks):
message(optional, used when the merge produces a merge commit)expected_target_oid(optional)expected_source_oid(optional)
Usage
curl --request POST \
--header "Authorization: Bearer $PEARING_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{"message": "Merge feature into main", "expected_target_oid": "abc123"}' \
"$PEARING_API_URL/v1/teams/platform/repos/website/pulls/42/merge"
Success
200 OK with merge metadata and updated pull, including creator, merger, and closer actor fields where applicable.
{
"pull": {
"uuid": "...",
"number": 42,
"status": "merged",
"merge_commit_oid": "def456"
},
"merge_mode": "merge_commit"
}
Errors
400 Bad Requestwhen pull is not open or refs are invalid.403 Forbiddenwhen caller lacks maintainer access to target repo.404 Not Foundwhen repo or pull number is not found.409 Conflictwitherror=repo_pull_already_mergedwhen the pull is already merged.409 Conflictwitherror=repo_pull_merge_fast_forward_requiredwhen a fast-forward-only branch protection applies and the branches have diverged.409 Conflictwitherror=repo_pull_merge_content_conflictwhen a merge commit would have unresolved file conflicts. These responses includeconflict_paths.409 Conflictwitherror=repo_pull_merge_stalefor stale optimistic concurrency checks.500 Internal Server Errorfor merge execution failures.
{
"error": "repo_pull_merge_content_conflict",
"detail": "Merge has unresolved file conflicts.",
"conflict_paths": ["README.md"]
}
Common auth errors are documented on the API overview page.