Pgyer Docs
API 2.0

Upload & Release

Endpoints for uploading apps to Pgyer via API, including the three-step fast upload flow, HarmonyOS cert and Hsp uploads, and the legacy upload endpoint.

Every API endpoint for uploading apps to Pgyer. Prefer the fast upload flow — it's faster and more reliable.

Fast Upload (New)

Reference implementation: https://github.com/PGYER/upload-app-api-example

Get a pre-upload URL: call getCOSToken to get the upload URL and signing params.

Upload the app file: POST the app as multipart/form-data to the URL returned in the previous step.

Poll for release status: call buildInfo until it returns success or failure.

Get an Upload Token

Returns the pre-upload URL and the signing params.

POSThttps://www.pgyer.com/apiv2/app/getCOSToken

Request Parameters

ParameterTypeRequiredDescription
_api_keyStringYesAPI Key — see auth
buildTypeStringYesApp type: ios or ipa for iOS, android or apk for Android, harmonyos or hap for HarmonyOS
overseaIntegerNoUse overseas upload acceleration: 1 overseas, 2 mainland China; leave blank for auto-detect by IP
buildInstallTypeIntegerNoInstall method, default 1. 1: public; 2: password; 3: invite
buildPasswordStringNoInstall password — empty means public install
buildDescriptionStringNoApp description; pass empty or omit if none
buildUpdateDescriptionStringNoRelease notes; pass empty or omit if none
buildInstallDateIntegerNoWhether to set a validity window: 1 with window, 2 forever; omit to leave the previous setting
buildInstallStartDateStringNoInstall window start, e.g. 2018-01-01
buildInstallEndDateStringNoInstall window end, e.g. 2018-12-31
buildChannelShortcutStringNoChannel short URL to update. Channel must already exist; one at a time, e.g. abcd

Response

FieldTypeDescription
keyStringUnique storage key for the uploaded file
endpointStringURL to upload the file to
paramsObjectParams required by the upload: signature, x-cos-security-token, key
{
  "code": 0,
  "message": "",
  "data": {
    "endpoint": "https://upload-v7.upload.cos.ap-shanghai.myqcloud.com",
    "key": "apps/xxx/yyyy/zzzz.apk",
    "params": {
      "signature": "q-sign-algorithm=sha1&q-ak=...&q-signature=...",
      "x-cos-security-token": "...",
      "key": "apps/xxx/yyyy/zzzz.apk"
    }
  }
}

Upload the File to the Returned URL

Upload the app file to the endpoint returned by getCOSToken.

A successful upload triggers Pgyer's backend release queue — this step returning success doesn't mean the release is done. Publishing typically completes within a minute; poll buildInfo in the next step to check status.

POST<endpoint from the previous response>

Set Content-Type: multipart/form-data.

Request Parameters

ParameterTypeRequiredDescription
keyStringYesFrom the previous response
signatureStringYesFrom the previous response
x-cos-security-tokenStringYesFrom the previous response
x-cos-meta-file-nameStringNoOriginal filename, e.g. app-release.apk
fileFileYesLocal path to the app file

Response

  • Success: HTTP 204 No Content.
  • Failure: the corresponding error message.

Check Release Status

Check whether the app has finished publishing and fetch the release info.

GEThttps://www.pgyer.com/apiv2/app/buildInfo

Request Parameters

ParameterTypeRequiredDescription
_api_keyStringYesAPI Key — see auth
buildKeyStringYesThe key returned in step one

Response

Three possible outcomes:

FieldTypeDescription
buildKeyStringBuild Key, unique index ID for the app
buildTypeIntegerApp type (1: iOS; 2: Android)
buildIsFirstIntegerIs this the first build (1: yes; 2: no)
buildIsLastestIntegerIs this the latest version (1: yes; 2: no)
buildFileSizeIntegerInstaller size
buildNameStringApp name
buildVersionStringVersion number, default 1.0 (the version shown to users, e.g. 1.1, 8.2.1)
buildVersionNoStringBuild version in the uploaded installer, default 1 (Android's Version Code; iOS is string, Android is integer, e.g. 1001, 28)
buildBuildVersionIntegerPgyer-generated build number used to distinguish historical versions
buildIdentifierStringApp package identifier — BundleId on iOS, package name on Android
buildIconStringApp 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 /. For buildIcon = 123abcdefaaa, buildIconPath = 1/2/3/a/b
buildDescriptionStringApp description
buildUpdateDescriptionStringRelease notes
buildScreenShotsStringScreenshot key; access URL is https://www.pgyer.com/image/view/app_screenshots/<screenshot_key>
buildShortcutUrlStringApp short URL
buildQRCodeURLStringApp QR code URL
buildCreatedStringUpload time
buildUpdatedStringUpdate time
{
  "code": 0,
  "message": "",
  "data": {
    "buildKey": "a1b2c3d4e5f6",
    "buildType": 2,
    "buildIsFirst": 2,
    "buildIsLastest": 1,
    "buildFileSize": 12345678,
    "buildName": "Sample App",
    "buildVersion": "1.1",
    "buildVersionNo": "28",
    "buildBuildVersion": 5,
    "buildIdentifier": "com.example.app",
    "buildIcon": "123abcdefaaa",
    "buildDescription": "Sample description",
    "buildUpdateDescription": "Various bug fixes",
    "buildScreenShots": "",
    "buildShortcutUrl": "abcd",
    "buildQRCodeURL": "https://www.pgyer.com/app/qrcode/abcd",
    "buildCreated": "2025-01-01 10:00:00",
    "buildUpdated": "2025-01-01 10:05:00"
  }
}
FieldTypeDescription
codeIntegerError code, 1247 — app is still publishing
messageStringHuman-readable message
{
  "code": 1247,
  "message": "App is publishing"
}
FieldTypeDescription
codeIntegerError code, 1216 — publishing failed
messageStringHuman-readable message
{
  "code": 1216,
  "message": "App publish failed"
}

When you get code = 1247 (still publishing), retry every 3–5 seconds until you see success or failure.

Upload HarmonyOS App p12 Certificate

When releasing a HarmonyOS .hap, upload the p12 signing certificate.

POSThttps://www.pgyer.com/apiv2/app/uploadHarmonyCert

Set Content-Type: multipart/form-data.

Request Parameters

ParameterTypeRequiredDescription
_api_keyStringYesAPI Key — see auth
fileFileYesThe .p12 file to upload
passwordStringYesPassword for the p12
buildKeyStringYesSee buildKey

Response

FieldTypeDescription
codeInteger0 on success; anything greater — see error codes

Upload HarmonyOS Hsp File

When a HarmonyOS .hap has .hsp dependencies, upload each .hsp.

POSThttps://www.pgyer.com/apiv2/app/uploadHarmonyHsp

Set Content-Type: multipart/form-data.

Request Parameters

ParameterTypeRequiredDescription
_api_keyStringYesAPI Key — see auth
fileFileYesThe Hsp file to upload
buildKeyStringYesSee buildKey

Response

FieldTypeDescription
codeInteger0 on success; anything greater — see error codes

Upload App (Legacy)

This endpoint is slow — use Fast Upload instead.

POSThttps://www.pgyer.com/apiv2/app/upload

Request Parameters

ParameterTypeRequiredDescription
_api_keyStringYesAPI Key — see auth
fileFileYesThe ipa or apk to upload
buildInstallTypeIntegerNoInstall method, default 1. 1: public; 2: password; 3: invite
buildPasswordStringNoInstall password — empty means public install
buildUpdateDescriptionStringNoRelease notes; pass empty or omit if none
buildInstallDateIntegerNoWhether to set a validity window: 1 with window, 2 forever; omit to leave the previous setting
buildInstallStartDateStringNoInstall window start, e.g. 2018-01-01
buildInstallEndDateStringNoInstall window end, e.g. 2018-12-31
buildChannelShortcutStringNoChannel short URL to update; one at a time, e.g. abcd

Response

FieldTypeDescription
buildKeyStringBuild Key, unique index ID for the app
buildTypeIntegerApp type (1: iOS; 2: Android)
buildIsFirstIntegerIs this the first build (1: yes; 2: no)
buildIsLastestIntegerIs this the latest version (1: yes; 2: no)
buildFileSizeIntegerInstaller size
buildNameStringApp name
buildVersionStringVersion number, default 1.0
buildVersionNoStringBuild version in the uploaded installer, default 1
buildBuildVersionIntegerPgyer-generated build number used to distinguish historical versions
buildIdentifierStringApp package identifier — BundleId on iOS, package name on Android
buildIconStringApp 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 /
buildDescriptionStringApp description
buildUpdateDescriptionStringRelease notes
buildScreenShotsStringScreenshot key; access URL is https://www.pgyer.com/image/view/app_screenshots/<screenshot_key>
buildShortcutUrlStringApp short URL
buildQRCodeURLStringApp QR code URL
buildCreatedStringUpload time
buildUpdatedStringUpdate time

On this page