App Version API Documentation
Overview
The App Version API provides endpoints for managing app version configurations for Android and iOS platforms. This includes minimum required versions, latest versions, update types (soft/force), and store URLs.
Public Endpoints
Get Latest App Version
Retrieves the most recent app version configuration. No authentication required.
Endpoint: GET /api/v1/app-version
Response:
{
"android": {
"latestVersion": "1.5.0",
"minRequiredVersion": "1.3.0",
"updateType": "soft",
"storeUrl": "https://play.google.com/store/apps/details?id=com.zishes.app"
},
"ios": {
"latestVersion": "1.5.0",
"minRequiredVersion": "1.3.0",
"updateType": "force",
"storeUrl": "https://apps.apple.com/app/zishes/id123456789"
},
"updatedAt": "2025-10-03T10:30:00.000Z"
}
Status Codes:
200- Success404- No version configuration found
Update Types:
soft- User can skip the updateforce- User must update to continue using the app
Admin Endpoints
All admin endpoints require admin authentication.
Get All App Versions
Retrieves all app version configurations, sorted by most recent first.
Endpoint: GET /api/admin/app-version
Response:
{
"data": [
{
"_id": "65f9a8b7c4d3e2f1a8b9c0d1",
"androidLatestVersion": "1.5.0",
"androidMinRequiredVersion": "1.3.0",
"androidUpdateType": "soft",
"androidStoreUrl": "https://play.google.com/store/apps/details?id=com.zishes.app",
"iosLatestVersion": "1.5.0",
"iosMinRequiredVersion": "1.3.0",
"iosUpdateType": "force",
"iosStoreUrl": "https://apps.apple.com/app/zishes/id123456789",
"createdAt": "2025-10-03T10:00:00.000Z",
"updatedAt": "2025-10-03T10:30:00.000Z"
}
]
}
Get App Version by ID
Retrieves a specific app version configuration.
Endpoint: GET /api/admin/app-version/:id
Response:
{
"data": {
"_id": "65f9a8b7c4d3e2f1a8b9c0d1",
"androidLatestVersion": "1.5.0",
"androidMinRequiredVersion": "1.3.0",
"androidUpdateType": "soft",
"androidStoreUrl": "https://play.google.com/store/apps/details?id=com.zishes.app",
"iosLatestVersion": "1.5.0",
"iosMinRequiredVersion": "1.3.0",
"iosUpdateType": "force",
"iosStoreUrl": "https://apps.apple.com/app/zishes/id123456789",
"createdAt": "2025-10-03T10:00:00.000Z",
"updatedAt": "2025-10-03T10:30:00.000Z"
}
}
Status Codes:
200- Success404- App version not found
Create App Version
Creates a new app version configuration.
Endpoint: POST /api/admin/app-version
Request Body:
{
"androidLatestVersion": "1.5.0",
"androidMinRequiredVersion": "1.3.0",
"androidUpdateType": "soft",
"androidStoreUrl": "https://play.google.com/store/apps/details?id=com.zishes.app",
"iosLatestVersion": "1.5.0",
"iosMinRequiredVersion": "1.3.0",
"iosUpdateType": "force",
"iosStoreUrl": "https://apps.apple.com/app/zishes/id123456789"
}
Response:
{
"data": {
"_id": "65f9a8b7c4d3e2f1a8b9c0d1",
"androidLatestVersion": "1.5.0",
"androidMinRequiredVersion": "1.3.0",
"androidUpdateType": "soft",
"androidStoreUrl": "https://play.google.com/store/apps/details?id=com.zishes.app",
"iosLatestVersion": "1.5.0",
"iosMinRequiredVersion": "1.3.0",
"iosUpdateType": "force",
"iosStoreUrl": "https://apps.apple.com/app/zishes/id123456789",
"createdAt": "2025-10-03T10:00:00.000Z",
"updatedAt": "2025-10-03T10:00:00.000Z"
},
"message": "App version created successfully"
}
Status Codes:
201- Created successfully400- Invalid update type (must be "soft" or "force")
Update App Version
Updates an existing app version configuration. All fields are optional.
Endpoint: PUT /api/admin/app-version/:id
Request Body:
{
"androidLatestVersion": "1.6.0",
"androidUpdateType": "force",
"iosLatestVersion": "1.6.0"
}
Response:
{
"data": {
"_id": "65f9a8b7c4d3e2f1a8b9c0d1",
"androidLatestVersion": "1.6.0",
"androidMinRequiredVersion": "1.3.0",
"androidUpdateType": "force",
"androidStoreUrl": "https://play.google.com/store/apps/details?id=com.zishes.app",
"iosLatestVersion": "1.6.0",
"iosMinRequiredVersion": "1.3.0",
"iosUpdateType": "force",
"iosStoreUrl": "https://apps.apple.com/app/zishes/id123456789",
"createdAt": "2025-10-03T10:00:00.000Z",
"updatedAt": "2025-10-03T11:00:00.000Z"
},
"message": "App version updated successfully"
}
Status Codes:
200- Updated successfully400- Invalid update type404- App version not found
Delete App Version
Deletes an app version configuration.
Endpoint: DELETE /api/admin/app-version/:id
Response:
{
"message": "App version deleted successfully",
"data": {
"_id": "65f9a8b7c4d3e2f1a8b9c0d1",
"androidLatestVersion": "1.5.0",
// ... other fields
}
}
Status Codes:
200- Deleted successfully404- App version not found
Field Descriptions
| Field | Type | Description |
|---|---|---|
androidLatestVersion | String | Latest available Android version |
androidMinRequiredVersion | String | Minimum Android version required to use the app |
androidUpdateType | String | Update enforcement type: "soft" or "force" |
androidStoreUrl | String | Google Play Store URL |
iosLatestVersion | String | Latest available iOS version |
iosMinRequiredVersion | String | Minimum iOS version required to use the app |
iosUpdateType | String | Update enforcement type: "soft" or "force" |
iosStoreUrl | String | Apple App Store URL |
Usage Examples
Mobile App Integration
// Check if app needs update
const response = await fetch('https://api.zishes.com/api/v1/app-version');
const versionData = await response.json();
const currentVersion = "1.4.0";
const platform = Platform.OS; // "ios" or "android"
const minRequired = platform === "ios"
? versionData.ios.minRequiredVersion
: versionData.android.minRequiredVersion;
const updateType = platform === "ios"
? versionData.ios.updateType
: versionData.android.updateType;
const storeUrl = platform === "ios"
? versionData.ios.storeUrl
: versionData.android.storeUrl;
// Compare versions
if (isVersionLessThan(currentVersion, minRequired)) {
if (updateType === "force") {
// Show mandatory update dialog
showForceUpdateDialog(storeUrl);
} else {
// Show optional update dialog
showSoftUpdateDialog(storeUrl);
}
}
Admin Panel - Creating Version
const createVersion = async () => {
const response = await fetch('https://api.zishes.com/api/admin/app-version', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer <admin-token>'
},
body: JSON.stringify({
androidLatestVersion: "1.5.0",
androidMinRequiredVersion: "1.3.0",
androidUpdateType: "soft",
androidStoreUrl: "https://play.google.com/...",
iosLatestVersion: "1.5.0",
iosMinRequiredVersion: "1.3.0",
iosUpdateType: "force",
iosStoreUrl: "https://apps.apple.com/..."
})
});
const result = await response.json();
console.log(result.message); // "App version created successfully"
};
Best Practices
-
Version Updates:
- Always create a new version document rather than updating existing ones
- Keep historical versions for audit purposes
-
Update Types:
- Use
forcefor critical security updates or breaking changes - Use
softfor feature updates that maintain backward compatibility
- Use
-
Version Strings:
- Follow semantic versioning (e.g., "1.5.0")
- Ensure minRequiredVersion ≤ latestVersion
-
Testing:
- Test version checks on staging before production release
- Verify store URLs are correct and accessible
-
Rollout Strategy:
- Start with
softupdates to monitor adoption - Switch to
forceonly if necessary - Give users reasonable time to update before enforcing
- Start with