Create a draft release and get upload targets
curl --request POST \
--url https://patch.gg/api/v1/projects/{owner}/{slug}/releases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"manifest": {},
"files": [
{
"path": "files/plugins.zip",
"sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
"size": 123
}
],
"changelog": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
manifest: {},
files: [
{
path: 'files/plugins.zip',
sha256: '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08',
size: 123
}
],
changelog: '<string>'
})
};
fetch('https://patch.gg/api/v1/projects/{owner}/{slug}/releases', 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}/releases"
payload = {
"manifest": {},
"files": [
{
"path": "files/plugins.zip",
"sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
"size": 123
}
],
"changelog": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"release": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project": "<string>",
"version": "<string>",
"channel": "dev",
"status": "draft",
"kind": "web_game",
"trust_tier": "sandboxed",
"changelog": "<string>",
"manifest": {},
"created_at": "<string>",
"submitted_at": "<string>",
"published_at": "<string>"
},
"uploads": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sha256": "<string>",
"size": 123,
"paths": [
"<string>"
],
"method": "PUT",
"url": "<string>",
"headers": {},
"expires_at": "<string>",
"multipart": {
"part_size": 123,
"parts": [
{
"part_number": 123,
"url": "<string>",
"headers": {}
}
],
"complete_path": "<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>"
}
}Releases
Create a draft release and get upload targets
Send the parsed patch.json and every file’s path, SHA-256 and size. Only files Patch doesn’t already store come back as upload targets. Sending the same version again while it’s a draft replaces it, so a retried publish resumes.
POST
/
projects
/
{owner}
/
{slug}
/
releases
Create a draft release and get upload targets
curl --request POST \
--url https://patch.gg/api/v1/projects/{owner}/{slug}/releases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"manifest": {},
"files": [
{
"path": "files/plugins.zip",
"sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
"size": 123
}
],
"changelog": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
manifest: {},
files: [
{
path: 'files/plugins.zip',
sha256: '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08',
size: 123
}
],
changelog: '<string>'
})
};
fetch('https://patch.gg/api/v1/projects/{owner}/{slug}/releases', 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}/releases"
payload = {
"manifest": {},
"files": [
{
"path": "files/plugins.zip",
"sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
"size": 123
}
],
"changelog": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"release": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project": "<string>",
"version": "<string>",
"channel": "dev",
"status": "draft",
"kind": "web_game",
"trust_tier": "sandboxed",
"changelog": "<string>",
"manifest": {},
"created_at": "<string>",
"submitted_at": "<string>",
"published_at": "<string>"
},
"uploads": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sha256": "<string>",
"size": 123,
"paths": [
"<string>"
],
"method": "PUT",
"url": "<string>",
"headers": {},
"expires_at": "<string>",
"multipart": {
"part_size": 123,
"parts": [
{
"part_number": 123,
"url": "<string>",
"headers": {}
}
],
"complete_path": "<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>"
}
}Authorizations
An API key (pch_...) or the token from pch login.
Body
application/json