curl --request PUT \
--url https://api.outerlayer.ai/v1/work-items/{workItemId}/pull-request \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Outerlayer-App-Id: <api-key>' \
--data '
{
"body": "<string>",
"title": "<string>",
"repository": "<string>"
}
'import requests
url = "https://api.outerlayer.ai/v1/work-items/{workItemId}/pull-request"
payload = {
"body": "<string>",
"title": "<string>",
"repository": "<string>"
}
headers = {
"X-Outerlayer-App-Id": "<api-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-Outerlayer-App-Id': '<api-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({body: JSON.stringify('<string>'), title: '<string>', repository: '<string>'})
};
fetch('https://api.outerlayer.ai/v1/work-items/{workItemId}/pull-request', 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.outerlayer.ai/v1/work-items/{workItemId}/pull-request",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'body' => '<string>',
'title' => '<string>',
'repository' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Outerlayer-App-Id: <api-key>"
],
]);
$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.outerlayer.ai/v1/work-items/{workItemId}/pull-request"
payload := strings.NewReader("{\n \"body\": \"<string>\",\n \"title\": \"<string>\",\n \"repository\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Outerlayer-App-Id", "<api-key>")
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.put("https://api.outerlayer.ai/v1/work-items/{workItemId}/pull-request")
.header("X-Outerlayer-App-Id", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"body\": \"<string>\",\n \"title\": \"<string>\",\n \"repository\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.outerlayer.ai/v1/work-items/{workItemId}/pull-request")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Outerlayer-App-Id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"body\": \"<string>\",\n \"title\": \"<string>\",\n \"repository\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"created": true,
"draft": true,
"number": 123,
"repository": "<string>",
"url": "<string>"
}
}{
"data": {
"created": true,
"draft": true,
"number": 123,
"repository": "<string>",
"url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Open or edit a work item's pull request
Opens the pull request for the work item a build is working on, from the branch its live claim named in one of the claim’s repositories, into that repository’s default branch, as the factory’s GitHub App, or edits the title and body of the open pull request already on that branch, whoever opened it. repository picks the repository and defaults to the claim’s primary; a build that changed several repositories calls the route once for each. The route takes no branch and no pull request number, so it reaches only this item’s own pull requests. A new pull request is opened as a draft, and as one ready for review in a repository that cannot have drafts. An edit does not change whether the pull request is a draft. Only the item key a claim returns may call it; any other credential is refused as if it lacked the permission. The pull request is linked to the item. Answers 201 when it opened one and 200 when it edited one. Refusals: claim_expired (410), claim_has_no_branch (409, a lease recorded before claims named a branch), repository_not_in_claim (403, the repository is not one the claim names), work_item_has_no_repository (422), repository_not_connected (422), repository_not_in_installation (422), repository_permissions_pending (409, the installation has not accepted the App’s pull request write permission), branch_has_no_commits (422, the branch has nothing the default branch lacks), branch_not_pushed (422, the branch is not on the remote; push it first), repository_tokens_unavailable (503, this gateway has no GitHub App) and github_unavailable (503, GitHub was rate limiting or failing; retry).
curl --request PUT \
--url https://api.outerlayer.ai/v1/work-items/{workItemId}/pull-request \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Outerlayer-App-Id: <api-key>' \
--data '
{
"body": "<string>",
"title": "<string>",
"repository": "<string>"
}
'import requests
url = "https://api.outerlayer.ai/v1/work-items/{workItemId}/pull-request"
payload = {
"body": "<string>",
"title": "<string>",
"repository": "<string>"
}
headers = {
"X-Outerlayer-App-Id": "<api-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-Outerlayer-App-Id': '<api-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({body: JSON.stringify('<string>'), title: '<string>', repository: '<string>'})
};
fetch('https://api.outerlayer.ai/v1/work-items/{workItemId}/pull-request', 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.outerlayer.ai/v1/work-items/{workItemId}/pull-request",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'body' => '<string>',
'title' => '<string>',
'repository' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Outerlayer-App-Id: <api-key>"
],
]);
$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.outerlayer.ai/v1/work-items/{workItemId}/pull-request"
payload := strings.NewReader("{\n \"body\": \"<string>\",\n \"title\": \"<string>\",\n \"repository\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Outerlayer-App-Id", "<api-key>")
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.put("https://api.outerlayer.ai/v1/work-items/{workItemId}/pull-request")
.header("X-Outerlayer-App-Id", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"body\": \"<string>\",\n \"title\": \"<string>\",\n \"repository\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.outerlayer.ai/v1/work-items/{workItemId}/pull-request")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Outerlayer-App-Id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"body\": \"<string>\",\n \"title\": \"<string>\",\n \"repository\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"created": true,
"draft": true,
"number": 123,
"repository": "<string>",
"url": "<string>"
}
}{
"data": {
"created": true,
"draft": true,
"number": 123,
"repository": "<string>",
"url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}