Add a game to your library, or note that you played it
curl --request POST \
--url https://patch.gg/api/v1/me/library \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"project": "mira/lantern-run",
"played": true
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({project: 'mira/lantern-run', played: true})
};
fetch('https://patch.gg/api/v1/me/library', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://patch.gg/api/v1/me/library"
payload = {
"project": "mira/lantern-run",
"played": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"project": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner": "<string>",
"slug": "<string>",
"handle": "patch/demo-mod",
"name": "<string>",
"summary": "<string>",
"description": "<string>",
"kind": "web_game",
"status": "active",
"cover_url": "<string>",
"min_players": 123,
"max_players": 123,
"source_visibility": "open_source",
"code_license": "MIT",
"art_license": "MIT",
"links": {
"discord": "https://discord.gg/patch",
"x": "https://x.com/patchgg",
"telegram": "https://t.me/patchgg",
"youtube": "https://youtube.com/@patchgg",
"twitch": "https://twitch.tv/patchgg",
"github": "https://github.com/patchgg/demo-mod"
},
"host_games": [
{
"slug": "<string>",
"name": "<string>",
"role": "host"
}
],
"latest_release": {
"version": "<string>",
"channel": "<string>",
"published_at": "<string>",
"trust_tier": "sandboxed"
},
"created_at": "<string>",
"updated_at": "<string>"
},
"added_at": "<string>",
"last_played_at": "<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>"
}
}Library
Add a game to your library, or note that you played it
Adding a game that’s already there keeps it; with played, it also moves to the top.
POST
/
me
/
library
Add a game to your library, or note that you played it
curl --request POST \
--url https://patch.gg/api/v1/me/library \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"project": "mira/lantern-run",
"played": true
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({project: 'mira/lantern-run', played: true})
};
fetch('https://patch.gg/api/v1/me/library', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://patch.gg/api/v1/me/library"
payload = {
"project": "mira/lantern-run",
"played": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"project": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner": "<string>",
"slug": "<string>",
"handle": "patch/demo-mod",
"name": "<string>",
"summary": "<string>",
"description": "<string>",
"kind": "web_game",
"status": "active",
"cover_url": "<string>",
"min_players": 123,
"max_players": 123,
"source_visibility": "open_source",
"code_license": "MIT",
"art_license": "MIT",
"links": {
"discord": "https://discord.gg/patch",
"x": "https://x.com/patchgg",
"telegram": "https://t.me/patchgg",
"youtube": "https://youtube.com/@patchgg",
"twitch": "https://twitch.tv/patchgg",
"github": "https://github.com/patchgg/demo-mod"
},
"host_games": [
{
"slug": "<string>",
"name": "<string>",
"role": "host"
}
],
"latest_release": {
"version": "<string>",
"channel": "<string>",
"published_at": "<string>",
"trust_tier": "sandboxed"
},
"created_at": "<string>",
"updated_at": "<string>"
},
"added_at": "<string>",
"last_played_at": "<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.