GetMissingPatches
Will retrieve the missing patches or available packages as reported by the product.
Syntax
Method ID
#define WAAPI_MID_GET_MISSING_PATCHES 1013
JSON Input Structure
{
"input": {
"method": 1013,
"signature": number,
"username": string,
"password": string,
"timeout": number,
"retry_internet_services": boolean,
"token": string,
"mode": number,
"fetch_update_repository": boolean
}
}
Input Properties
| Parameter | Type | Description |
|---|---|---|
username | string | (optional) The name required by the product to retrieve the necessary data. |
password | string | (optional) The password required by the product to retrieve the necessary data. |
timeout | number | (optional) A timeout value in seconds that can be set to this method call. Default value is 0 (infinite). |
retry_internet_services | boolean | (optional) (Windows Update Agent only) If true, will retry with the internet services when failed with managed servers (if they are configured, such as WSUS, Configuration Server). Default value is true. |
token | string | (optional) The API token required by the product to retrieve the necessary data. |
mode | number | (optional) Windows Update Agent only 0: Detect as many available patches on the current device as possible. 1: Detects patches like Windows Update UI. Default value is 0.Dandified Yum only 0: Base settings for Dandified Yum on all supported Linux distro. 1: Advanced settings for Dandified Yum on Amazon Linux 2023. Default value is 0.Other products 0: Will try to get as much data of the patches as possible with internet services. 1: Will retrieve missing patches from local data sources. Default value is 0.More info about the input.mode can be found at documentation. |
fetch_update_repository | boolean | (optional) Instructs the SDK to update the repository before retrieving missing packages. Default value is false. |
JSON Output Structure
{
"result": {
"method": 1013,
"code": number,
"timing": number,
"timestamp": string,
"patches": [
{
"id": string,
"title": string,
"description": string,
"revision": number,
"product": string,
"vendor": string,
"severity": string,
"category_id": string,
"category": string,
"category_description": string,
"category_parent": string,
"security_update_id": string,
"kb_id": string,
"date": string,
"size": number,
"reboot_required": boolean,
"optional": boolean,
"deployment_action": number,
"version": string,
"installed_version": string,
"type": number,
"source": string,
"phased": number,
"dependencies": [
{
"name": string,
"version": string
},
...
],
"preview_patch": boolean,
"group": string
},
...
],
"patches_source": string
}
}
Output Properties
| Property | Type | Description |
|---|---|---|
result.method | number | The method ID that generated this result. |
result.code | number | The result code. See Result Codes. |
result.timing | number | The measured time for the method call in milliseconds. |
result.timestamp | string | The timestamp in seconds of when the call was made. |
result.patches | array<object> | An array of missing patches or available updates detected for the product. |
result.patches.id | string | (optional) The id of a missing patch. |
result.patches.title | string | The title of the missing patch or the name of the available package. |
result.patches.description | string | The description of a missing patch or package. |
result.patches.revision | number | (optional) The current revision of a missing patch. |
result.patches.product | string | The product missing this patch or package name. |
result.patches.vendor | string | (optional) The vendor of the product missing this patch or package vendor. |
result.patches.severity | string | The severity of a missing patch or package update. Possible values are: low, moderate, important, critical, unknown. More info about the severity of Windows Update Agent can be found at How does OESIS Framework determine the Severity of GetMissingPatches for Windows Update Agent?.Note: In addition to the values listed above, the deprecated not_available value is exclusive to SCCM when severity data cannot be retrieved. |
result.patches.category_id | string | (optional) The id of the category this update belongs to. |
result.patches.category | string | The category of a missing patch: 'critical_update', 'definition_update', 'feature_pack', 'security_update', 'service_pack', 'tool', 'update_rollup', 'update', 'upgrade', 'driver', 'driver_set', 'hotfix', 'unknown'. |
result.patches.category_description | string | (optional) The description of the current category. |
result.patches.category_parent | string | (optional) The name of parent category. |
result.patches.security_update_id | string | (optional) The security update id of a missing patch. This is equivalent to Security Bulletin ids for Windows, Security Update ids for Apple, and various Security Alert ids for Linux. |
result.patches.kb_id | string | (optional) The knowledge base article id of a missing patch. May duplicate security_update_id on some platforms. |
result.patches.date | string | (optional) The release date of the patch or package update, as a timestamp. |
result.patches.size | number | (optional) The size of the patch, in bytes. For Windows Update Agent, this is the maximum download size of the patch. (The MaxDownloadSize property is not always downloaded. The MaxDownloadSize property is downloaded based on the configuration of the computer that receives the update). |
result.patches.reboot_required | boolean | (optional) Indicates if the patch requires a system reboot or not. For Windows Update Agent, if the value is false, the update will not restart. Otherwise, it may require a restart. |
result.patches.optional | boolean | (optional) (Windows Update Agent only) Indicates whether the patch is an optional update as defined by Microsoft in the DeploymentAction field. The True value corresponds to the "daOptionalInstallation=4" value from Microsoft. |
result.patches.deployment_action | number | (optional) (Windows Update Agent only) Defines the action for which an update is explicitly deployed. 0: No explicit deployment action is specified on the update, the update inherits the value from its bundled updates. 1: The update should be installed on the computer and/or for the specified user. 2: The update should be uninstalled from the computer and/or for the specified user. 3: The update is deployed only to determine the applicability of the update, the update will not be installed. 4: The update may be installed on the computer and/or for the specified user. |
result.patches.version | string | (optional) The version of the missing patch or package that needs to be upgraded. |
result.patches.installed_version | string | (optional) (Linux only) The version of the installed patch or package needs to be upgraded. |
result.patches.type | number | (optional) Identify whether the patch is operating system or application. 0 : patch is operating system. 1 : patch is application. |
result.patches.source | string | (optional) Retrieve the patch source that can be used to download and install updates. |
result.patches.phased | number | (optional) (Linux only) Indicates the phased update percentage of a missing patch. If no phased update information is available, this field will be omitted. |
result.patches.dependencies | array<object> | (optional) (Linux only) Retrieve the required dependencies to download and install this package. |
result.patches.dependencies.name | string | (optional) The dependency name. |
result.patches.dependencies.version | string | (optional) The dependency version. |
result.patches.preview_patch | boolean | (optional) (Windows Update Agent only) indicates whether a patch is classified as a preview patch, returning "true" if it is a preview and "false" if it is not. Disclaimer: This feature is currently in beta. Expect potential changes or improvements in future versions. |
result.patches.group | string | (optional) (Linux only) Package grouping varies by distribution type: • Debian-based systems: Use Debian sections for classification. While official sections are documented, additional unofficial sections can be found via: dpkg-query -W -f='$\{Section\}\n' | sort | uniq• RPM-based systems: Use RPM groups for classification. |
result.patches_source | string | (optional) (Windows Update Agent only) The source supplying patches: 'Windows Update', 'Microsoft Update', 'WSUS or Configuration Manager', 'Unknown', or the file path to the wsusscn2.cab in case WUA works in offline mode |
Result Codes
| Code | Name | Description |
|---|---|---|
| 0 | WAAPI_OK | The operation completed successfully. |
| -1 | WAAPI_ERROR_GENERAL | General error that is not yet defined. |
| -17 | WAAPI_ERROR_NO_CONNECTION | No connection to online source. On Linux, this is related to the input.fetch_update_repository flag. On Windows, this is caused by lost internet connectivity or lost connection to wa_3rd_party_process. |
| -20 | WAAPI_ERROR_INVALID_INPUT_ARGS | The input parameters are incorrect or do not match the method's documented requirements. |
| -22 | WAAPI_ERROR_ACCESS_DENIED | (Linux only) Administrator permission (sudo) is required when input.fetch_update_repository is enabled and fetching the online patches source requires elevated permissions. |
| -24 | WAAPI_ERROR_NOT_RUNNING | The package manager service is not running, causing the query for missing patches to fail. |
| -49 | WAAPI_ERROR_THREAD_TIMEOUT | Timeout reached when querying for missing patches data. |
| -60 | WAAPI_ERROR_3RD_PARTY_HOST_CONNECTION_NOT_ESTABLISHED | (Windows Update Agent only) Unable to start the wa_3rd_party_host process to query missing patches. |
| -70 | WAAPI_ERROR_RESOURCE_BUSY | (Linux only) The system is busy (e.g., another process is using the package manager). See troubleshooting guide. |
| -73 | WAAPI_ERROR_MISSING_PACKAGE_SOURCES | (Linux only) The package source is missing. See troubleshooting guide. |
| -74 | WAAPI_ERROR_MISSING_PACKAGE_INFORMATION | (Linux only) The package information is missing or corrupted. See troubleshooting guide. |
| -77 | WAAPI_ERROR_PACKAGE_SOURCES_OUT_OF_DATE | (Linux only) The package sources are out of date. See troubleshooting guide. |
| -85 | WAAPI_ERROR_INVALID_PACKAGE_SOURCES | (Linux only) The list of sources could not be read. |
Other codes may be returned. See the full Result Codes reference for the complete list.
Remarks
Error Handling
The results of this function are determined by the error code returned by the call. If successful, WAAPI_OK or a special success code will be returned. Always check both the function return value and the result.code field in the output JSON.
Linux Package Sources
(Linux only) If the package source is missing or corrupted, the following error codes may be returned:
- WAAPI_ERROR_MISSING_PACKAGE_SOURCES
- WAAPI_ERROR_MISSING_PACKAGE_INFORMATION
- WAAPI_ERROR_PACKAGE_SOURCES_OUT_OF_DATE
For troubleshooting steps, refer to the documentation on resolving missing package sources.
Windows Update Agent
To understand how Windows Update Agent interacts with the SDK, see the documentation on interpreting SDK error codes related to WUA.
Knowledge Base
(Linux only) If the package source is missing or corrupted, WAAPI_ERROR_MISSING_PACKAGE_SOURCES, WAAPI_ERROR_MISSING_PACKAGE_INFORMATION, or WAAPI_ERROR_PACKAGE_SOURCES_OUT_OF_DATE will be returned.
To understand how Windows Update Agent interacts with the SDK, see the documentation.
Examples
Examples will be added here demonstrating the usage of this method.
See Also
Last updated: 2026-10-01