GetInstalledPatches
Will retrieve the installed patches or packages as reported by the product.
Syntax
Method ID
#define WAAPI_MID_GET_INSTALLED_PATCHES 1023
JSON Input Structure
{
"input": {
"method": 1023,
"signature": number,
"query_history": boolean,
"retry_internet_services": boolean,
"token": string
}
}
Input Properties
| Parameter | Type | Description |
|---|---|---|
query_history | boolean | (optional) If true, will trigger a search in the update history to obtain a broader list of updates. Default is 'false'. |
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. |
JSON Output Structure
{
"result": {
"method": 1023,
"code": number,
"timing": number,
"timestamp": string,
"patches": [
{
"title": string,
"description": string,
"product": string,
"vendor": string,
"severity": string,
"category": string,
"security_update_id": string,
"kb_id": string,
"type": number,
"group": string,
"version": string,
"source": 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 installed patches or packages detected for the product. |
result.patches.title | string | The title of the installed patch or package. |
result.patches.description | string | The description of the installed patch or package. |
result.patches.product | string | The product for the patch or package name. |
result.patches.vendor | string | (optional) The vendor of the product for the patch or package vendor. |
result.patches.severity | string | The severity of the installed 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 MDES SDK 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 | string | The category of the installed patch: 'security_update', 'update_rollup', 'critical_update', 'update', 'driver', 'driver_set', 'service_pack', 'definition_update', 'feature_pack', 'hotfix', 'tool', 'upgrade', 'unknown'. |
result.patches.security_update_id | string | (optional) The security update id for the installed 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 for the installed patch. May duplicate security_update_id on some platforms. |
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.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.version | string | (optional) The version of the installed patch or package. |
result.patches.source | string | (optional) (Linux only) The name of the source package, used to build binary packages, may not be present on all Linux distributions. |
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. |
note
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.
Examples
Examples will be added here demonstrating the usage of this method.
See Also
Last updated: 2026-10-01