Every API response automatically includes update and latest_version fields.
The mobile app should send its current version in the app_version request header on every call.
The server compares the app version against the currently deployed API version and returns an update status with no additional configuration required.
Rules are derived entirely from package.json: no environment variables or server configuration needed. Deploying a new major version automatically triggers hard update enforcement.
| Header | Example | Required | Description |
|---|---|---|---|
app_version |
23.0.0 |
Recommended | The current version of the mobile app. If omitted, update defaults to none. |
platform |
android |
Informational | Client platform identifier. Accepted but not currently used in gate logic. |
Version strings with fewer than three parts are supported: missing segments default to 0. 23 is treated as 23.0.0.
| Condition | update value |
Meaning |
|---|---|---|
app_major < api_major |
hard |
App must update before continuing. Closeloop ships a new major release alongside every API major bump. |
app_major == api_major and app_minor < api_minor |
soft |
Update recommended but not required. App can continue. |
| Same major.minor (any patch difference) | none |
App is up to date. No action needed. |
app_version header missing |
none |
Old clients pass through safely. |
These fields are injected into every API response that returns a standard JSON envelope.
{
"update": "none",
"latest_version": {
"string": "23.0.0",
"major": 23,
"minor": 0,
"patch": 0
}
}
{
"update": "hard",
"update_title": "Update Required",
"update_message": "Please update the app to continue using services.",
"store_url": null,
"latest_version": {
"string": "23.0.0",
"major": 23,
"minor": 0,
"patch": 0
}
}
store_url will be populated once Play Store distribution is configured.
Send a test request with a custom app_version header to see the gate response.
Result:
…