curl --request POST \
--url https://patch.gg/api/v1/projects/{owner}/{slug}/change-requests/{number}/decline \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://patch.gg/api/v1/projects/{owner}/{slug}/change-requests/{number}/decline', 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}/change-requests/{number}/decline"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text){
"number": 12,
"title": "Port to 26.5",
"description": "<string>",
"state": "open",
"from": "kai/sky-mod",
"branch": "port-26.5",
"into": "26.5",
"head_commit": "<string>",
"problems": [
"<string>"
],
"author": "kai",
"talk_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"closed_at": "2023-11-07T05:31:56Z",
"closed_by": "<string>",
"merge_commit": "<string>"
}{
"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>"
}
}Decline a change request
The repo’s org, but for a request from one of the repo’s own branches, whoever opened it withdraws it instead. Needs the publish scope. Its hidden branch goes, so outside the org its commits are out of reach by id, and what it changed stays on its page. It’s the way to take commits out of reach that a rewrite of the repo left there.
curl --request POST \
--url https://patch.gg/api/v1/projects/{owner}/{slug}/change-requests/{number}/decline \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://patch.gg/api/v1/projects/{owner}/{slug}/change-requests/{number}/decline', 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}/change-requests/{number}/decline"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text){
"number": 12,
"title": "Port to 26.5",
"description": "<string>",
"state": "open",
"from": "kai/sky-mod",
"branch": "port-26.5",
"into": "26.5",
"head_commit": "<string>",
"problems": [
"<string>"
],
"author": "kai",
"talk_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"closed_at": "2023-11-07T05:31:56Z",
"closed_by": "<string>",
"merge_commit": "<string>"
}{
"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.
Path Parameters
"patch"
"demo-mod"
x >= 112
Response
Declined
12
"Port to 26.5"
open: waiting on the repo's owner. merged: its commits are in the branch it was for. declined: the owner turned it down. withdrawn: its author took it back.
open, merged, declined, withdrawn The repo its branch is in, as owner/slug: the fork it comes from, or this repo itself for one of its own branches. Null if you can't reach the fork.
"kai/sky-mod"
The branch it offers, in from
"port-26.5"
The branch it would change in this repo
"26.5"
Its latest commit, as copied into this repo, where a clone doesn't see it: git fetch <clone_url> <head_commit> gets its commits while it's open.
What stopped the latest push to its branch being copied, which stays out of the request until it's fixed: a refusal, a fork that isn't open, which copies when it opens, or a copy that failed, which a new push tries again. Empty says nothing has stopped one, and a copy may still be on its way.
Who opened it: their username
"kai"
Posts in its talk
Who merged, declined or withdrew it: their username
The commit its branch was at after the merge.