API 2.0
Version Management
List an app's versions, mark or clear 'latest', check for app updates, and delete a version.
Endpoints for managing app versions.
List All Versions of an App
Paginated history of every version of an app.
POST
https://www.pgyer.com/apiv2/app/buildsRequest Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| _api_key | String | Yes | API Key — see auth |
| appKey | String | Yes | See appKey |
| buildKey | String | No | See buildKey |
| page | Integer | No | Page number for history |
Response
| Field | Type | Description |
|---|---|---|
| buildKey | String | Build Key, unique index ID for the app |
| buildType | Integer | App type (1: iOS; 2: Android) |
| buildFileSize | Integer | Installer size |
| buildName | String | App name |
| buildVersion | String | Version number, default 1.0 |
| buildVersionNo | String | Build version in the uploaded installer, default 1 |
| buildBuildVersion | Integer | Pgyer-generated build number |
| buildIdentifier | String | App package identifier — BundleId on iOS, package name on Android |
| buildIcon | String | App icon key. Access URL is https://cdn-app-icon2.pgyer.com/<buildIconPath>/<buildIcon>?x-oss-process=image/resize,m_lfit,h_120,w_120/format,jpg; buildIconPath is the first 5 chars of buildIcon joined by / |
| buildCreated | String | Upload time |
| pageCount | Integer | Total pages |
| currentPage | Integer | Current page |
{
"code": 0,
"message": "",
"data": {
"pageCount": 3,
"currentPage": 1,
"list": [
{
"buildKey": "a1b2c3d4e5f6",
"buildType": 2,
"buildFileSize": 12345678,
"buildName": "Sample App",
"buildVersion": "1.1",
"buildVersionNo": "28",
"buildBuildVersion": 5,
"buildIdentifier": "com.example.app",
"buildIcon": "123abcdefaaa",
"buildCreated": "2025-01-01 10:00:00"
}
]
}
}Set Latest Version
Mark the version identified by buildKey as the latest.
POST
https://www.pgyer.com/apiv2/app/setNewestVersionRequest Parameters
Response
| Field | Type | Description |
|---|---|---|
| code | Integer | 0 on success; anything greater — see error codes |
| message | String | Result message |
{
"code": 0,
"message": "Set successfully"
}Clear Latest Version
Remove the "latest version" mark from the version identified by buildKey.
POST
https://www.pgyer.com/apiv2/app/cancelNewestVersionRequest Parameters
Response
| Field | Type | Description |
|---|---|---|
| code | Integer | 0 on success; anything greater — see error codes |
| message | String | Result message |
{
"code": 0,
"message": "Cleared successfully"
}Check for App Updates
Check from the client whether a newer version exists and fetch the update info.
POST
https://www.pgyer.com/apiv2/app/checkRequest Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| _api_key | String | Yes | API Key — see auth |
| appKey | String | Yes | See appKey |
| buildVersion | String | No | The app's own build version — versionname on Android, version on iOS |
| buildBuildVersion | Integer | No | Pgyer's auto-incrementing build number |
| channelKey | String | No | Channel key |
Response
| Field | Type | Description |
|---|---|---|
| buildBuildVersion | Integer | Pgyer-generated build number |
| forceUpdateVersion | String | Force-update version (empty if not forced) |
| forceUpdateVersionNo | String | Force-update build version |
| needForceUpdate | Boolean | Whether the update is forced |
| downloadURL | String | App install URL |
| appURl | String | App install single-page URL |
| buildHaveNewVersion | Boolean | Whether a new version exists |
| buildVersionNo | String | Build version, default 1 |
| buildVersion | String | Version number, default 1.0 |
| buildDescription | String | App description |
| buildUpdateDescription | String | Release notes |
| appKey | String | Unique app identifier |
| buildKey | String | Unique app-version identifier |
| buildName | String | App name |
| buildIcon | String | App icon |
| buildFileKey | String | File storage key |
| buildFileSize | String | File size |
{
"code": 0,
"message": "",
"data": {
"buildBuildVersion": 5,
"forceUpdateVersion": "",
"forceUpdateVersionNo": "",
"needForceUpdate": false,
"downloadURL": "https://www.pgyer.com/apiv2/app/install?_api_key=xxx&buildKey=a1b2c3d4e5f6",
"appURl": "https://www.pgyer.com/abcd",
"buildHaveNewVersion": true,
"buildVersionNo": "28",
"buildVersion": "1.1",
"buildDescription": "Sample description",
"buildUpdateDescription": "Various bug fixes",
"appKey": "x1y2z3",
"buildKey": "a1b2c3d4e5f6",
"buildName": "Sample App",
"buildIcon": "123abcdefaaa",
"buildFileKey": "apps/xxx/yyyy/zzzz.apk",
"buildFileSize": "12345678"
}
}Delete a Version
Delete a specific version of an app. To delete the entire app, use Delete App instead.
Deletion cannot be undone. Double-check the buildKey before calling.
POST
https://www.pgyer.com/apiv2/app/buildDeleteRequest Parameters
Response
| Field | Type | Description |
|---|---|---|
| code | Integer | 0 on success; anything greater — see error codes |
{
"code": 0,
"message": ""
}