Pgyer Docs
API 2.0

App Settings

Read and partially update persistent app settings, including installation options, download availability and automatic same-version cleanup.

These endpoints manage persistent settings for an entire app, sharing data and validation with Dashboard. Continue using App Info for individual build details.

Read App Settings

Returns current settings and available operations. GET is also supported, but POST avoids placing your API Key in the URL.

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

Request Parameters

ParameterTypeRequiredDescription
_api_keyStringYesAccount API Key; see Authentication
appKeyStringYesApp-level key from the app list, not an individual buildKey

Response

data includes current values of the writable settings below, except that plaintext buildPassword and appInstallAnswer are never returned. It also includes:

FieldTypeDescription
appKeyStringApp identifier
buildPasswordSetBooleanWhether an installation password is set
appInstallAnswerSetBooleanWhether an installation answer is set
allowedInstallTypesArraySupported installation modes, using the numbers below
abmEnabledBooleanWhether ABM installation is enabled
appSameVersionCleanupAvailableBooleanWhether this account can manage this app's same-version cleanup
appSameVersionCleanupRevisionInteger / nullCleanup setting revision; pass it back when changing the switch. Null when unavailable or unauthorized

When appSameVersionCleanupAvailable=false, appSameVersionCleanup is also null; this does not mean the setting is disabled.

{
  "code": 0,
  "message": "",
  "data": {
    "appKey": "0123456789abcdef0123456789abcdef",
    "appDownloadStatus": 1,
    "appDownloadNameType": 2,
    "appAutoSync": 2,
    "appDisplayAds": 1,
    "appLang": 3,
    "appFeedbackStatus": 2,
    "appShowPgyerCopyright": 1,
    "appDisplayInstallGuide": 1,
    "appDisplayHistory": 1,
    "buildVersionType": 1,
    "buildInstallType": 2,
    "buildPasswordSet": true,
    "appInstallQuestion": "",
    "appInstallAnswerSet": false,
    "appIsInstallDate": 2,
    "appInstallStartDate": "",
    "appInstallEndDate": "",
    "appSameVersionCleanupAvailable": true,
    "appSameVersionCleanup": 2,
    "appSameVersionCleanupRevision": 0,
    "allowedInstallTypes": [1, 2, 3, 4, 5],
    "abmEnabled": false
  }
}

Update App Settings

Send only fields you want to change. Omitted settings are preserved. All fields are saved together; if any field fails validation, the entire request is rejected without applying any changes.

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

Request Parameters

Send an application/x-www-form-urlencoded form containing _api_key, appKey, and at least one setting. Unknown fields, arrays, null values and invalid enums are rejected. Switches use the existing API convention of 1 / 2, not 0 / 1.

ParameterTypeDescription
buildVersionTypeIntegerBuild numbering: 1 Pgyer sequence; 2 original installer Build
buildInstallTypeInteger1 public; 2 password; 3 team; 4 question and answer; 5 authorization code. Must be in allowedInstallTypes
buildPasswordStringInstallation password, up to 100 characters. Password mode requires a valid password; omit to keep an existing one
appInstallQuestionStringInstallation question, up to 50 characters
appInstallAnswerStringInstallation answer, up to 50 characters. Question-and-answer mode requires valid values for both
appDownloadStatusIntegerDownloads: 1 enabled; 2 disabled. Does not bypass platform moderation restrictions
appDownloadNameTypeIntegerFilename: 1 original; 2 app name_version
appIsInstallDateIntegerDownload validity period: 1 enabled; 2 disabled (also clears both dates)
appInstallStartDateStringStart date: YYYY-MM-DD. Uses the existing download validity rules; time-of-day is not supported
appInstallEndDateStringEnd date, same format, not earlier than start. Supply both dates when first enabling the period
appAutoSyncIntegerSync app store information: 1 enabled; 2 disabled. Unsupported for HarmonyOS
appDisplayAdsInteger1 show ads (do not use an ad-removal pack); 2 enable ad-removal packs. Actual ad removal follows account entitlements
appLangString / Integerauto, zh-CN, en, ru, fr, de, it, ja, pl, es, th, zh-TW; numeric codes below are also accepted
appFeedbackStatusIntegerUser feedback form: 1 enabled; 2 disabled
appShowPgyerCopyrightIntegerPgyer copyright: 1 show; 2 hide. Display remains subject to account entitlements
appDisplayInstallGuideIntegerInstallation guide: 1 show; 2 hide. Android and HarmonyOS only
appDisplayHistoryIntegerInstallation-page version history: 1 show; 2 hide. This does not delete versions
appSameVersionCleanupIntegerAutomatic same-version cleanup: 1 enabled; 2 disabled (default). Only the owning main account can change this
appSameVersionCleanupRevisionIntegerRequired with the cleanup switch; use the latest revision returned by the read endpoint

Language codes: 1 Simplified Chinese, 2 English, 3 auto, 4 Russian, 5 French, 6 German, 7 Italian, 8 Japanese, 9 Polish, 10 Spanish, 11 Thai, 12 Traditional Chinese. Responses always return a numeric appLang.

Changing installation mode clears credentials that no longer apply. Unrelated fields remain unchanged. If ABM installation is enabled, disable it in Dashboard before changing installation mode. Use the existing management interface for TestFlight apps or apps without a published build.

Automatic Same-Version Cleanup

When enabled, subsequent new uploads trigger cleanup after successful publication and approval. Historical versions of this app with the same version number are eligible; Build numbers may differ. The most recently published build for that version number and protected builds are retained. Saving the setting does not itself run cleanup.

This setting is independent of account storage quota policies: it does not require exceeding quota and does not wait for the quota enforcement date. Web and API uploads both follow it without an additional upload parameter. The default is disabled, and it applies only to new uploads after enabling it.

Read the latest revision before changing the switch. This prevents overwriting a more recent change from Dashboard or another API client. After error 1402, read again and confirm the intended value rather than blindly retrying the old revision.

Permissions

Reading and updating ordinary settings follow Dashboard app-management permissions. Only the owning main account can manage same-version cleanup; other authorized members can still manage ordinary settings. An account API Key cannot manage an unauthorized app. Existing restrictions on subaccount API Keys remain unchanged.

Response

On success, code=0 and data contains the saved settings in the same format as the read endpoint. Example error:

{"code": 1402, "message": "清理设置已变化,请重新查询后再提交"}
codeDescription
1001 / 1002 / 1003Missing or invalid API Key, or unsupported account type
1009App missing, deleted or without a manageable published build
1033No management permission, or a non-owner tried to change cleanup
1400Invalid setting, value or combination; see message
1401Settings temporarily unavailable; retry later
1402Stale cleanup revision; read current settings again
1403Unsupported HTTP method; updates require POST

Examples

Read settings:

curl -X POST 'https://www.pgyer.com/apiv2/app/settings' \
  --data-urlencode "_api_key=$PGYER_API_KEY" \
  --data-urlencode 'appKey=0123456789abcdef0123456789abcdef'

Change only version-history visibility and language:

curl -X POST 'https://www.pgyer.com/apiv2/app/updateSettings' \
  --data-urlencode "_api_key=$PGYER_API_KEY" \
  --data-urlencode 'appKey=0123456789abcdef0123456789abcdef' \
  --data-urlencode 'appDisplayHistory=1' \
  --data-urlencode 'appLang=en'

Enable same-version cleanup. Replace the example revision of 0 with the actual revision from your read response:

curl -X POST 'https://www.pgyer.com/apiv2/app/updateSettings' \
  --data-urlencode "_api_key=$PGYER_API_KEY" \
  --data-urlencode 'appKey=0123456789abcdef0123456789abcdef' \
  --data-urlencode 'appSameVersionCleanup=1' \
  --data-urlencode 'appSameVersionCleanupRevision=0'

On this page