curl --request POST \
--url https://melso.ai/api/pull-requests/{id}/merge \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"merge_method": "squash"
}
'import requests
url = "https://melso.ai/api/pull-requests/{id}/merge"
payload = { "merge_method": "squash" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({merge_method: 'squash'})
};
fetch('https://melso.ai/api/pull-requests/{id}/merge', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://melso.ai/api/pull-requests/{id}/merge",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'merge_method' => 'squash'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://melso.ai/api/pull-requests/{id}/merge"
payload := strings.NewReader("{\n \"merge_method\": \"squash\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://melso.ai/api/pull-requests/{id}/merge")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"merge_method\": \"squash\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://melso.ai/api/pull-requests/{id}/merge")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"merge_method\": \"squash\"\n}"
response = http.request(request)
puts response.read_body{
"merged": true,
"pull_request": {
"id": "<string>",
"provider": "<string>",
"workspace_id": "<string>",
"repo_owner": "<string>",
"repo_name": "<string>",
"number": 123,
"title": "<string>",
"state": "<string>",
"html_url": "<string>",
"branch": "<string>",
"head_sha": "<string>",
"author_login": "<string>",
"author_avatar_url": "<string>",
"merged_at": "<string>",
"closed_at": "<string>",
"pr_created_at": "<string>",
"pr_updated_at": "<string>",
"mergeable_state": "<string>",
"mergeable": "<string>",
"merge_state_status": "<string>",
"checks_rollup": "<string>",
"checks_conclusion": "<string>",
"checks_total": 123,
"checks_passed": 123,
"checks_failed": 123,
"checks_running": 123,
"checks_pending": 123,
"failed_check_names": [
"<string>"
],
"snapshot_stale": true,
"snapshot_fetched_at": "<string>",
"snapshot_head_sha": "<string>",
"additions": 123,
"deletions": 123,
"changed_files": 123,
"snapshot_available": true
},
"sha": "<unknown>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Merge pull request
Workspace owner/admin (a person), or a workspace API key with admin scope. Run and MCP credentials are rejected, and tasks API keys get 403 workspace_key_scope; can_merge on the PR detail reports whether the caller may merge.
Request: merge_method?:"merge"|"squash"|"rebase", commit_title?:string, commit_message?:string.
Response: {merged:boolean,sha:string,pull_request:GitHubPullRequestResponse}.
Status: 200; 400 invalid method; 403 denied; 409 merge/check conflict; 502 GitHub failure. Authentication and resource-access errors follow Overview.
curl --request POST \
--url https://melso.ai/api/pull-requests/{id}/merge \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"merge_method": "squash"
}
'import requests
url = "https://melso.ai/api/pull-requests/{id}/merge"
payload = { "merge_method": "squash" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({merge_method: 'squash'})
};
fetch('https://melso.ai/api/pull-requests/{id}/merge', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://melso.ai/api/pull-requests/{id}/merge",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'merge_method' => 'squash'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://melso.ai/api/pull-requests/{id}/merge"
payload := strings.NewReader("{\n \"merge_method\": \"squash\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://melso.ai/api/pull-requests/{id}/merge")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"merge_method\": \"squash\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://melso.ai/api/pull-requests/{id}/merge")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"merge_method\": \"squash\"\n}"
response = http.request(request)
puts response.read_body{
"merged": true,
"pull_request": {
"id": "<string>",
"provider": "<string>",
"workspace_id": "<string>",
"repo_owner": "<string>",
"repo_name": "<string>",
"number": 123,
"title": "<string>",
"state": "<string>",
"html_url": "<string>",
"branch": "<string>",
"head_sha": "<string>",
"author_login": "<string>",
"author_avatar_url": "<string>",
"merged_at": "<string>",
"closed_at": "<string>",
"pr_created_at": "<string>",
"pr_updated_at": "<string>",
"mergeable_state": "<string>",
"mergeable": "<string>",
"merge_state_status": "<string>",
"checks_rollup": "<string>",
"checks_conclusion": "<string>",
"checks_total": 123,
"checks_passed": 123,
"checks_failed": 123,
"checks_running": 123,
"checks_pending": 123,
"failed_check_names": [
"<string>"
],
"snapshot_stale": true,
"snapshot_fetched_at": "<string>",
"snapshot_head_sha": "<string>",
"additions": 123,
"deletions": 123,
"changed_files": 123,
"snapshot_available": true
},
"sha": "<unknown>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Authorizations
Company API key (mwk_) or personal access token (mel_). A PAT requires X-Workspace-ID on company-scoped routes. An API key implies its own company.
Headers
Company UUID for a personal token on company-scoped operations. A company API key already binds its company.
Path Parameters
id from the corresponding authorized response.