curl --request POST \
--url https://patch.gg/api/v1/projects/{owner}/{slug}/github/pulls \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"head": "sky-boost",
"title": "Add the sky boost",
"base": "main",
"body": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
head: 'sky-boost',
title: 'Add the sky boost',
base: 'main',
body: JSON.stringify('<string>')
})
};
fetch('https://patch.gg/api/v1/projects/{owner}/{slug}/github/pulls', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://patch.gg/api/v1/projects/{owner}/{slug}/github/pulls"
payload = {
"head": "sky-boost",
"title": "Add the sky boost",
"base": "main",
"body": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"number": 12,
"url": "<string>",
"title": "<string>",
"head": "sky-boost",
"base": "main",
"state": "open",
"merged_at": "<string>",
"mergeable": true,
"opened": false
}{
"number": 12,
"url": "<string>",
"title": "<string>",
"head": "sky-boost",
"base": "main",
"state": "open",
"merged_at": "<string>",
"mergeable": true,
"opened": true
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}Open a pull request on a connected repo
From a branch on GitHub into another, the repo’s default branch unless base says. Asked again for a branch with one open, it’s that one (200, opened false). 404 no_such_branch for a branch GitHub doesn’t have, 422 nothing_to_merge for one with no commits of its own, and 422 github_refused for anything else GitHub won’t take, in its words. Without the app’s permission, details.compare_url is GitHub’s page for opening it by hand. For a member of the project’s org who can push to its GitHub repo, as they are on GitHub. 403 github_not_linked without a connected GitHub account, github_no_push without push on the repo, and github_no_access when Patch’s GitHub App can’t reach it, or hasn’t got what this needs, with where to accept that in details.settings_url; 404 gone_from_github.
curl --request POST \
--url https://patch.gg/api/v1/projects/{owner}/{slug}/github/pulls \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"head": "sky-boost",
"title": "Add the sky boost",
"base": "main",
"body": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
head: 'sky-boost',
title: 'Add the sky boost',
base: 'main',
body: JSON.stringify('<string>')
})
};
fetch('https://patch.gg/api/v1/projects/{owner}/{slug}/github/pulls', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://patch.gg/api/v1/projects/{owner}/{slug}/github/pulls"
payload = {
"head": "sky-boost",
"title": "Add the sky boost",
"base": "main",
"body": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"number": 12,
"url": "<string>",
"title": "<string>",
"head": "sky-boost",
"base": "main",
"state": "open",
"merged_at": "<string>",
"mergeable": true,
"opened": false
}{
"number": 12,
"url": "<string>",
"title": "<string>",
"head": "sky-boost",
"base": "main",
"state": "open",
"merged_at": "<string>",
"mergeable": true,
"opened": true
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}Authorizations
An API key (pch_...) or the token from pch login.
Body
The branch to merge, on the same repo
^(?![-/])(?!.*\.\.)[\w.\-/]{1,200}$"sky-boost"
1 - 256"Add the sky boost"
The branch it goes into: the repo's default branch, left out
^(?![-/])(?!.*\.\.)[\w.\-/]{1,200}$"main"
What it does, in GitHub's Markdown
60000Response
It was open already
12
Its page on GitHub
The branch it's from
"sky-boost"
The branch it goes into
"main"
open, closed, merged When it merged, or null
Whether it can merge as it stands, or null while GitHub works that out
false