Create Pull Request
curl --request POST \
--url https://api.yertle.com/orgs/{org_id}/nodes/{node_id}/pull-requests \
--header 'Content-Type: application/json' \
--data '
{
"source_branch": "<string>",
"title": "<string>",
"target_branch": "main",
"description": "<string>",
"is_draft": false
}
'import requests
url = "https://api.yertle.com/orgs/{org_id}/nodes/{node_id}/pull-requests"
payload = {
"source_branch": "<string>",
"title": "<string>",
"target_branch": "main",
"description": "<string>",
"is_draft": False
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
source_branch: '<string>',
title: '<string>',
target_branch: 'main',
description: '<string>',
is_draft: false
})
};
fetch('https://api.yertle.com/orgs/{org_id}/nodes/{node_id}/pull-requests', 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://api.yertle.com/orgs/{org_id}/nodes/{node_id}/pull-requests",
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([
'source_branch' => '<string>',
'title' => '<string>',
'target_branch' => 'main',
'description' => '<string>',
'is_draft' => false
]),
CURLOPT_HTTPHEADER => [
"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://api.yertle.com/orgs/{org_id}/nodes/{node_id}/pull-requests"
payload := strings.NewReader("{\n \"source_branch\": \"<string>\",\n \"title\": \"<string>\",\n \"target_branch\": \"main\",\n \"description\": \"<string>\",\n \"is_draft\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.yertle.com/orgs/{org_id}/nodes/{node_id}/pull-requests")
.header("Content-Type", "application/json")
.body("{\n \"source_branch\": \"<string>\",\n \"title\": \"<string>\",\n \"target_branch\": \"main\",\n \"description\": \"<string>\",\n \"is_draft\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.yertle.com/orgs/{org_id}/nodes/{node_id}/pull-requests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"source_branch\": \"<string>\",\n \"title\": \"<string>\",\n \"target_branch\": \"main\",\n \"description\": \"<string>\",\n \"is_draft\": false\n}"
response = http.request(request)
puts response.read_body{
"pr": {
"id": "<string>",
"node_id": "<string>",
"number": 123,
"title": "<string>",
"source_branch": "<string>",
"target_branch": "<string>",
"source_commit": "<string>",
"target_commit": "<string>",
"status": "<string>",
"is_draft": true,
"author": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"author_email": "<string>",
"merged_by": "<string>",
"merged_by_email": "<string>",
"closed_by": "<string>",
"closed_by_email": "<string>",
"merged_at": "2023-11-07T05:31:56Z",
"closed_at": "2023-11-07T05:31:56Z",
"can_merge": true,
"merge_reason": "<string>",
"commits_ahead": 123
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Pull Requests
Create Pull Request
Create a new pull request from one branch into another.
Yertle’s merge model is fast-forward only — the source branch must be a strict descendant of the target for the PR to be mergeable. You can still open a PR that can’t currently fast-forward; the UI will surface the conflict and the author can rebase before merging.
Set is_draft=true for a work-in-progress PR that cannot be merged
until promoted to ready. The PR number is auto-assigned per node and
returned in the response.
POST
/
orgs
/
{org_id}
/
nodes
/
{node_id}
/
pull-requests
Create Pull Request
curl --request POST \
--url https://api.yertle.com/orgs/{org_id}/nodes/{node_id}/pull-requests \
--header 'Content-Type: application/json' \
--data '
{
"source_branch": "<string>",
"title": "<string>",
"target_branch": "main",
"description": "<string>",
"is_draft": false
}
'import requests
url = "https://api.yertle.com/orgs/{org_id}/nodes/{node_id}/pull-requests"
payload = {
"source_branch": "<string>",
"title": "<string>",
"target_branch": "main",
"description": "<string>",
"is_draft": False
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
source_branch: '<string>',
title: '<string>',
target_branch: 'main',
description: '<string>',
is_draft: false
})
};
fetch('https://api.yertle.com/orgs/{org_id}/nodes/{node_id}/pull-requests', 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://api.yertle.com/orgs/{org_id}/nodes/{node_id}/pull-requests",
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([
'source_branch' => '<string>',
'title' => '<string>',
'target_branch' => 'main',
'description' => '<string>',
'is_draft' => false
]),
CURLOPT_HTTPHEADER => [
"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://api.yertle.com/orgs/{org_id}/nodes/{node_id}/pull-requests"
payload := strings.NewReader("{\n \"source_branch\": \"<string>\",\n \"title\": \"<string>\",\n \"target_branch\": \"main\",\n \"description\": \"<string>\",\n \"is_draft\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.yertle.com/orgs/{org_id}/nodes/{node_id}/pull-requests")
.header("Content-Type", "application/json")
.body("{\n \"source_branch\": \"<string>\",\n \"title\": \"<string>\",\n \"target_branch\": \"main\",\n \"description\": \"<string>\",\n \"is_draft\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.yertle.com/orgs/{org_id}/nodes/{node_id}/pull-requests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"source_branch\": \"<string>\",\n \"title\": \"<string>\",\n \"target_branch\": \"main\",\n \"description\": \"<string>\",\n \"is_draft\": false\n}"
response = http.request(request)
puts response.read_body{
"pr": {
"id": "<string>",
"node_id": "<string>",
"number": 123,
"title": "<string>",
"source_branch": "<string>",
"target_branch": "<string>",
"source_commit": "<string>",
"target_commit": "<string>",
"status": "<string>",
"is_draft": true,
"author": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"author_email": "<string>",
"merged_by": "<string>",
"merged_by_email": "<string>",
"closed_by": "<string>",
"closed_by_email": "<string>",
"merged_at": "2023-11-07T05:31:56Z",
"closed_at": "2023-11-07T05:31:56Z",
"can_merge": true,
"merge_reason": "<string>",
"commits_ahead": 123
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Headers
Body
application/json
Response
Successful Response
Response for creating a pull request.
Created pull request
Show child attributes
Show child attributes
⌘I