> For the complete documentation index, see [llms.txt](https://docs.patchmypc.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.patchmypc.com/patch-my-pc-cloud-api/sdk/applications.md). Agents can also search and read this documentation through its [MCP server](https://docs.patchmypc.com/~gitbook/mcp).

# Applications

SDK methods for searching applications, reading their details and files, and creating, updating, and editing applications.

[Back to the Cloud Customer API overview](https://docs.patchmypc.com/patch-my-pc-cloud-api)

These methods search for applications, read their details, and create new applications or new versions. Applications come from two catalogs:

* **Your custom applications**—applications you package and upload yourself.
* **The Patch My PC public catalog**—applications Patch My PC packages and maintains.

The methods on this page that don't name a catalog work against your custom applications and keep the behavior the Patch My PC Cloud Customer API has always had. For methods that target your custom applications explicitly, see [Custom applications](https://docs.patchmypc.com/patch-my-pc-cloud-api/sdk/custom-applications.md).

All of these methods need an authenticated session. For details, see [SDK authentication methods](https://docs.patchmypc.com/patch-my-pc-cloud-api/sdk/authentication.md). Search and read methods need the `appcatbroker:apps:read` scope, and create, update, and edit methods need `appcatbroker:apps:write`.

## Models

The application types live in two namespaces: request models such as `ApplicationMetadata` are in `PatchMyPC.Cloud.Models`, and response types such as `ProductDto` and the `OSType` enumeration are in `PatchMyPC.Cloud.Client`. The `RequirementArchitecture` and `InstallationBehavior` enumerations are available from the SDK's client types as well.

### Search filter

`ProductFilterRequest` describes a search. Every property is optional.

| Property                                   | Type                         | Default         | Description                                                                                                                                          |
| ------------------------------------------ | ---------------------------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `DisplayNameSearchString`                  | `string?`                    | `null`          | Text to match against the application display name.                                                                                                  |
| `VendorIds`                                | `Guid[]?`                    | `null`          | Only return applications from these vendors.                                                                                                         |
| `Languages`                                | `string[]?`                  | `null`          | Only return applications in these languages, for example `en-US`.                                                                                    |
| `Architectures`                            | `RequirementArchitecture[]?` | `null`          | Only return applications for these architectures.                                                                                                    |
| `OsType`                                   | `OSType?`                    | `null`          | The operating system to search. `null` searches Windows applications. macOS applications require the macOS applications entitlement on your account. |
| `FeedTypes`                                | array                        | `null`          | The catalogs to search. The catalog-specific search methods set this for you.                                                                        |
| `ConnectionId`                             | `Guid?`                      | `null`          | The connection to scope a public catalog search to.                                                                                                  |
| `LastModifiedFromUtc`, `LastModifiedToUtc` | `DateTime?`                  | `null`          | Only return applications modified in this range.                                                                                                     |
| `LastUpdatedFromUtc`, `LastUpdatedToUtc`   | `DateTime?`                  | `null`          | Only return applications whose latest version was published in this range.                                                                           |
| `Skip`                                     | `int`                        | `0`             | The number of results to skip, for paging.                                                                                                           |
| `Limit`                                    | `int`                        | `50`            | The maximum number of results to return.                                                                                                             |
| `SortField`                                | `string`                     | `"DisplayName"` | The property to sort by.                                                                                                                             |
| `Ascending`                                | `bool`                       | `true`          | Sort in ascending order.                                                                                                                             |
| `IncludeIconData`                          | `bool`                       | `false`         | Include base64 icon data in each result. This makes responses considerably larger, so leave it off unless you need the icons.                        |

### Search results

`ProductFilterResponse` contains one page of results.

| Property              | Type                              | Description                                                                                       |
| --------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------- |
| `TotalAmount`         | `long`                            | The total number of matching applications across all pages.                                       |
| `TotalVariantsAmount` | `long`                            | The total number of matching application variants, for example language or architecture variants. |
| `Products`            | collection of `ProductSummaryDto` | The applications on this page.                                                                    |

Each `ProductSummaryDto` has these key properties. Its `Id` and `ProductId` properties contain the same application ID; prefer `ProductId`. The type-specific `Custom`, `Pmpc`, or `Winget` block is present only for that application type.

| Property                                   | Type                   | Description                                                                                                                                                            |
| ------------------------------------------ | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ProductId`                                | `Guid`                 | The application ID. `Id` carries the same value; prefer `ProductId`.                                                                                                   |
| `UpdateId`                                 | `Guid?`                | Deprecated for custom applications; use `Custom.UpdateId`. It is omitted from public and Winget search JSON, so the nullable SDK property is `null` for those results. |
| `Type`                                     | `string`               | The application type: `pmpc` (Patch My PC catalog), `custom` (your custom applications), or `winget` (Winget).                                                         |
| `DisplayName`                              | `string`               | The display name.                                                                                                                                                      |
| `Description`, `VendorName`, `Language`    | `string?`              | Descriptive details.                                                                                                                                                   |
| `Version`                                  | `string?`              | The latest version.                                                                                                                                                    |
| `State`                                    | enum                   | The state of the latest version, for example `SuccessfullyCompleted`.                                                                                                  |
| `LastUpdated`                              | `DateTimeOffset`       | When the application was last updated.                                                                                                                                 |
| `IconURL`, `IconBase64`, `IconContentType` | `string?`              | The icon. `IconBase64` is only set when you request icon data.                                                                                                         |
| `Actions`                                  | collection of `string` | The operations currently available on the application: `deploy`, `update`, `edit`, `delete`, and `download-files`.                                                     |

For custom search results, `Custom.UpdateId` is the canonical version ID. The deprecated top-level `UpdateId` remains for compatibility on custom rows. Public and Winget search JSON omits top-level `updateId` rather than returning `null`; the nullable SDK property reads as `null`.

### Application details

`ProductDto` describes one of your applications in detail.

| Property                                               | Type                      | Description                                                                                |
| ------------------------------------------------------ | ------------------------- | ------------------------------------------------------------------------------------------ |
| `ProductId`                                            | `Guid`                    | The application ID.                                                                        |
| `Type`                                                 | `string`                  | The application type.                                                                      |
| `DisplayName`, `Description`, `VendorName`, `Language` | `string?`                 | Descriptive details.                                                                       |
| `UpdateVersion`                                        | `string?`                 | The current version.                                                                       |
| `MainFile`                                             | `string?`                 | The primary installer file.                                                                |
| `Architecture`                                         | `RequirementArchitecture` | The architecture the application targets.                                                  |
| `InstallerType`                                        | enum                      | The installer type, for example MSI or EXE.                                                |
| `InstallContext`                                       | `InstallationBehavior?`   | Whether the application installs for the system or the user.                               |
| `SilentInstallArguments`, `SilentUninstallArguments`   | `string?`                 | The silent install and uninstall arguments.                                                |
| `ConflictingProcessList`                               | collection of `string`    | Processes that block installation while running.                                           |
| `DetectionRules`                                       | object                    | How Intune detects that the application is installed.                                      |
| `CustomRequirements`                                   | object                    | The installation requirements.                                                             |
| `ArpDisplayNameMatch`                                  | `string?`                 | The Add or Remove Programs display name to match. Required when you create an application. |
| `MsiProductCode`                                       | `Guid?`                   | The MSI product code, for MSI installers.                                                  |
| `Notes`, `IntuneNotes`, `Owner`, `Developer`           | `string?`                 | Additional information shown in Intune.                                                    |
| `PrivacyUrl`, `InformationUrl`                         | `string?`                 | Links shown in Intune.                                                                     |
| `IconURL`, `IconBase64`, `IconContentType`             | `string?`                 | The icon.                                                                                  |
| `Actions`                                              | collection of `string`    | The operations currently available on the application.                                     |

`PublicApplicationDto` describes a public catalog application. It has the descriptive properties of `ProductDto`—`ProductId`, `Type`, `DisplayName`, `Description`, `Language`, `VendorName`, `UpdateVersion`, the icon properties, `PrivacyUrl`, `InformationUrl`, `Developer`, `IntuneNotes`, `InstallerType`, `Architecture`, `InstallContext`, and `Actions`—but not the packaging details, which Patch My PC maintains for you. Its `Variants` collection contains the exact selectable options for the requested operating system. Each variant has its owning `ProductId` and a `CatalogEntryId`; use that entry ID when creating a deployment.

### Catalog identities

Search results use the same value for `Id` and `ProductId`; use `ProductId` in new code. A custom search result's `Custom.UpdateId` is the canonical version ID, and custom details may also include `Custom.ProductId` and `Custom.CatalogEntryId`. Those detail-only IDs may be absent from search results. Public details expose `Variants`; each variant carries `ProductId` and `CatalogEntryId`. `CatalogEntryId`, not `ProductId` or `UpdateId`, identifies the exact entry to deploy.

### Application metadata

`ApplicationMetadata` describes a new application.

| Property                                             | Type                      | Default   | Description                                                                                                                                                                                                                       |
| ---------------------------------------------------- | ------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `FolderPath`                                         | `string`                  | none      | Required. The folder that contains the application's files. Every file in the folder is uploaded.                                                                                                                                 |
| `PrimaryInstallerFile`                               | `string`                  | none      | Required. The main installer file, relative to `FolderPath` or as an absolute path.                                                                                                                                               |
| `DisplayName`                                        | `string`                  | none      | Required. The display name.                                                                                                                                                                                                       |
| `Description`                                        | `string`                  | none      | Required. The description.                                                                                                                                                                                                        |
| `Publisher`                                          | `string`                  | none      | Required. The publisher or vendor name.                                                                                                                                                                                           |
| `Architecture`                                       | `RequirementArchitecture` | `X64`     | The architecture the application targets.                                                                                                                                                                                         |
| `Language`                                           | `string`                  | `"en-US"` | The language code.                                                                                                                                                                                                                |
| `InstallContext`                                     | `InstallationBehavior`    | `System`  | Whether the application installs for the system or the user.                                                                                                                                                                      |
| `CmdArguments`                                       | `string?`                 | `null`    | The silent install arguments.                                                                                                                                                                                                     |
| `SilentUninstallArg`                                 | `string?`                 | `null`    | The silent uninstall arguments.                                                                                                                                                                                                   |
| `MsiProductCode`                                     | `Guid?`                   | `null`    | The MSI product code, for MSI installers.                                                                                                                                                                                         |
| `ArpDisplayNameMatch`, `ArpVersionMatch`             | `string?`                 | `null`    | The Add or Remove Programs display name and version to match for detection. Both are required when you create an application. The version is numeric, with two to four parts separated by dots, for example `24.08` or `1.2.3.4`. |
| `DetectionRules`                                     | object                    | `null`    | Custom detection rules. When omitted, detection uses `MsiProductCode` or the Add or Remove Programs matches.                                                                                                                      |
| `CustomRequirements`                                 | object                    | `null`    | Custom installation requirements. When omitted, the requirement is derived from `Architecture`.                                                                                                                                   |
| `ConflictingProcesses`                               | `List<string>`            | empty     | Processes that block installation while running.                                                                                                                                                                                  |
| `IconPath`                                           | `string?`                 | `null`    | The path to an icon file. The SDK uploads it for you.                                                                                                                                                                             |
| `DocumentationUrl`, `PrivacyUrl`, `InformationalUrl` | `string?`                 | `null`    | Links shown in Intune.                                                                                                                                                                                                            |
| `Notes`, `IntuneNotes`, `Owner`, `Developer`         | `string?`                 | `null`    | Additional information shown in Intune.                                                                                                                                                                                           |

`ApplicationUpdateMetadata` describes a new version of an existing custom application. It has `ProductId` and `UpdateId`—the application and the version the new one follows—plus the packaging properties from the table above: `FolderPath`, `PrimaryInstallerFile`, `CmdArguments`, `SilentUninstallArg`, `MsiProductCode`, `ArpDisplayNameMatch`, `ArpVersionMatch`, `DetectionRules`, `CustomRequirements`, and `ConflictingProcesses`. Get `ProductId` and the canonical `Custom.UpdateId` from a custom search result. `ArpVersionMatch` is required, because each version has its own version number.

### Edit metadata

`ApplicationEditMetadata` describes changes to an application's current version. Apart from `ProductId`, every property is optional, and `null` keeps the current value.

| Property                                                                       | Type            | Description                                                                                                                                  |
| ------------------------------------------------------------------------------ | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `ProductId`                                                                    | `Guid`          | Required. The application to edit.                                                                                                           |
| `UpdateId`                                                                     | `Guid?`         | The version to edit. When omitted, the SDK finds the current version for you.                                                                |
| `DisplayName`, `Description`, `Publisher`, `Owner`, `Developer`, `IntuneNotes` | `string?`       | New descriptive details.                                                                                                                     |
| `PrivacyUrl`, `InformationalUrl`                                               | `string?`       | New links.                                                                                                                                   |
| `IconPath`                                                                     | `string?`       | The path to a replacement icon.                                                                                                              |
| `CmdArguments`, `SilentUninstallArg`                                           | `string?`       | New silent install and uninstall arguments.                                                                                                  |
| `ArpDisplayNameMatch`                                                          | `string?`       | A new Add or Remove Programs display name match.                                                                                             |
| `MsiProductCode`                                                               | `Guid?`         | A new MSI product code. You can't use this to clear the product code, because the installer type can't change during an edit.                |
| `ConflictingProcesses`                                                         | `List<string>?` | A replacement list. An empty list clears it.                                                                                                 |
| `DetectionRules`, `CustomRequirements`                                         | object          | Replacement detection rules or requirements.                                                                                                 |
| `FolderPath`                                                                   | `string?`       | A folder whose contents replace the application's files. The SDK uploads only files that are new or changed. `null` keeps the current files. |
| `PrimaryInstallerFile`                                                         | `string?`       | A new primary installer file, relative to `FolderPath`.                                                                                      |

### Upload result and progress

Create, update, and edit methods return `ApplicationData`.

| Property             | Type       | Description                                       |
| -------------------- | ---------- | ------------------------------------------------- |
| `ProductId`          | `Guid`     | The application ID.                               |
| `UpdateId`           | `Guid`     | The ID of the version that was created or edited. |
| `FilesUploaded`      | `int`      | The number of files uploaded.                     |
| `TotalBytesUploaded` | `long`     | The number of bytes uploaded.                     |
| `Duration`           | `TimeSpan` | How long the operation took.                      |

If you pass an `IProgress<UploadProgress>`, the SDK reports progress as it works.

| Property                                    | Type      | Description                                                                      |
| ------------------------------------------- | --------- | -------------------------------------------------------------------------------- |
| `Stage`                                     | enum      | The current stage: `ComputingHashes`, `Uploading`, `Finalizing`, or `Completed`. |
| `FileName`                                  | `string`  | The file being uploaded.                                                         |
| `BytesUploaded`, `TotalBytes`               | `long`    | Progress for the current file.                                                   |
| `BytesUploadedOverall`, `TotalBytesOverall` | `long`    | Progress across all files.                                                       |
| `FilesProcessed`, `TotalFiles`              | `int`     | Files completed and the total number of files.                                   |
| `ChunksUploaded`, `TotalChunks`             | `int`     | Chunks completed and the total number of chunks.                                 |
| `Message`                                   | `string?` | A status message, if any.                                                        |

To tune the upload, pass `ChunkUploadOptions`. For details, see [Install and configure the SDK](https://docs.patchmypc.com/patch-my-pc-cloud-api/sdk/install-and-configure.md).

## Methods

### SearchApplicationsAsync

Searches your custom applications. This legacy method and `/apps/search` return custom applications only. Use [`SearchPublicApplicationsAsync`](#searchpublicapplicationsasync) for the public catalog.

{% code collapsedlinecount="10" %}

```csharp
Task<Result<ProductFilterResponse>> SearchApplicationsAsync(
    ProductFilterRequest filterRequest,
    CancellationToken cancellationToken = default);
```

{% endcode %}

| Parameter           | Type                                     | Description                    |
| ------------------- | ---------------------------------------- | ------------------------------ |
| `filterRequest`     | [`ProductFilterRequest`](#search-filter) | Required. The search criteria. |
| `cancellationToken` | `CancellationToken`                      | Optional. Cancels the call.    |

**Returns:** a [`ProductFilterResponse`](#search-results) with one page of results.

{% code collapsedlinecount="10" %}

```csharp
var search = await client.SearchApplicationsAsync(new ProductFilterRequest
{
    DisplayNameSearchString = "{search-text}",
    Limit = 25
});

if (search.IsFailure)
{
    Console.WriteLine($"Search failed: {search.Error.Code} {search.Error.Message}");
    return;
}

Console.WriteLine($"{search.Value.TotalAmount} matching applications");
foreach (var product in search.Value.Products)
{
    Console.WriteLine($"{product.DisplayName} {product.Version} ({product.ProductId})");
    Console.WriteLine($"Current custom version: {product.Custom?.UpdateId}");
}
```

{% endcode %}

**See also:** [Find-PmpcCustomApplication](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/find-pmpccustomapplication.md) and [Search applications](https://docs.patchmypc.com/patch-my-pc-cloud-api/rest-api/applications.md#search-applications).

### Read all search pages

Application searches use offset-based pagination. `Skip` defaults to `0`, `Limit` defaults to `50`, and each response's `TotalAmount` is the total number of matches before paging. To collect every match, request pages until the offset reaches `TotalAmount`; advance `Skip` by the number of products actually returned. Stop if a page is empty.

{% code collapsedlinecount="10" %}

```csharp
using PatchMyPC.Cloud.Client;

const int pageSize = 50;
var skip = 0;
long totalAmount;

do
{
    var pageResult = await client.SearchApplicationsAsync(new ProductFilterRequest
    {
        DisplayNameSearchString = "{search-text}",
        Skip = skip,
        Limit = pageSize
    });

    if (pageResult.IsFailure)
    {
        Console.WriteLine($"Search failed: {pageResult.Error.Code} {pageResult.Error.Message}");
        return;
    }

    var page = pageResult.Value;
    totalAmount = page.TotalAmount;
    foreach (var product in page.Products)
    {
        Console.WriteLine($"{product.DisplayName} ({product.ProductId})");
    }

    if (page.Products.Count == 0)
    {
        break;
    }

    skip += page.Products.Count;
}
while (skip < totalAmount);
```

{% endcode %}

Use the same `Skip` and `Limit` pattern with [`SearchCustomApplicationsAsync`](https://docs.patchmypc.com/patch-my-pc-cloud-api/sdk/custom-applications.md#searchcustomapplicationsasync) or [`SearchPublicApplicationsAsync`](#searchpublicapplicationsasync). A public-catalog search also requires a selected connection.

### GetApplicationDetailsAsync

Gets the details of one of your custom applications.

{% code collapsedlinecount="10" %}

```csharp
Task<Result<ProductDto>> GetApplicationDetailsAsync(
    Guid productId,
    CancellationToken cancellationToken = default);
```

{% endcode %}

| Parameter           | Type                | Description                   |
| ------------------- | ------------------- | ----------------------------- |
| `productId`         | `Guid`              | Required. The application ID. |
| `cancellationToken` | `CancellationToken` | Optional. Cancels the call.   |

**Returns:** a [`ProductDto`](#application-details). If the application doesn't exist, the error code is `NOT_FOUND`. The details don't include the file list; use [`GetApplicationFilesAsync`](#getapplicationfilesasync) for that.

{% code collapsedlinecount="10" %}

```csharp
var details = await client.GetApplicationDetailsAsync(productId);
if (details.IsFailure)
{
    Console.WriteLine($"Couldn't read the application: {details.Error.Message}");
    return;
}

Console.WriteLine($"{details.Value.DisplayName} {details.Value.UpdateVersion}");
Console.WriteLine($"Installer: {details.Value.MainFile} {details.Value.SilentInstallArguments}");
```

{% endcode %}

**See also:** [Get-PmpcCustomApplication](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/get-pmpccustomapplication.md) and [Get application details](https://docs.patchmypc.com/patch-my-pc-cloud-api/rest-api/applications.md#get-application-details).

### CreateApplicationAsync

Creates a custom application and uploads its files in one call.

{% code collapsedlinecount="10" %}

```csharp
Task<Result<ApplicationData>> CreateApplicationAsync(
    ApplicationMetadata metadata,
    ChunkUploadOptions? uploadOptions = null,
    IProgress<UploadProgress>? progress = null,
    CancellationToken cancellationToken = default);
```

{% endcode %}

| Parameter           | Type                                           | Description                                                        |
| ------------------- | ---------------------------------------------- | ------------------------------------------------------------------ |
| `metadata`          | [`ApplicationMetadata`](#application-metadata) | Required. The application details and the folder to upload.        |
| `uploadOptions`     | `ChunkUploadOptions?`                          | Optional. Upload tuning. `null` uses the defaults.                 |
| `progress`          | `IProgress<UploadProgress>?`                   | Optional. Receives [upload progress](#upload-result-and-progress). |
| `cancellationToken` | `CancellationToken`                            | Optional. Cancels the upload.                                      |

**Returns:** an [`ApplicationData`](#upload-result-and-progress) with the new application's `ProductId` and `UpdateId`.

The SDK creates a draft, uploads the files in chunks, and completes the application. Each new application counts against your custom application limit; check `GetCustomerInfoAsync` to see your usage. If you've reached the limit, the method fails with `VALIDATION_ERROR` and a message that says you have reached the maximum number of custom applications.

{% code collapsedlinecount="10" %}

```csharp
using PatchMyPC.Cloud.Models;
using PatchMyPC.Cloud.Client;

var metadata = new ApplicationMetadata
{
    FolderPath = @"{path-to-folder}",
    PrimaryInstallerFile = "{installer-file-name}.msi",
    DisplayName = "{display-name}",
    Description = "{description}",
    Publisher = "{publisher}",
    Architecture = RequirementArchitecture.X64,
    InstallContext = InstallationBehavior.System,
    CmdArguments = "/qn",
    ArpDisplayNameMatch = "{display-name}",
    ArpVersionMatch = "{version}",
    MsiProductCode = Guid.Parse("{msi-product-code}")
};

var progress = new Progress<UploadProgress>(p =>
    Console.WriteLine($"{p.Stage}: {p.BytesUploadedOverall}/{p.TotalBytesOverall} bytes"));

var created = await client.CreateApplicationAsync(metadata, progress: progress);
if (created.IsFailure)
{
    Console.WriteLine($"Create failed: {created.Error.Code} {created.Error.Message}");
    return;
}

Console.WriteLine($"Created {created.Value.ProductId} in {created.Value.Duration}");
```

{% endcode %}

**See also:** [New-PmpcCustomApplication](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/new-pmpccustomapplication.md), [Create application draft](https://docs.patchmypc.com/patch-my-pc-cloud-api/rest-api/applications.md#create-application-draft), and [Complete application creation](https://docs.patchmypc.com/patch-my-pc-cloud-api/rest-api/applications.md#complete-application-creation).

### UpdateApplicationAsync

Publishes a new version of one of your custom applications and uploads its files.

{% code collapsedlinecount="10" %}

```csharp
Task<Result<ApplicationData>> UpdateApplicationAsync(
    ApplicationUpdateMetadata updateMetadata,
    ChunkUploadOptions? uploadOptions = null,
    IProgress<UploadProgress>? progress = null,
    CancellationToken cancellationToken = default);
```

{% endcode %}

| Parameter           | Type                                                 | Description                                                                           |
| ------------------- | ---------------------------------------------------- | ------------------------------------------------------------------------------------- |
| `updateMetadata`    | [`ApplicationUpdateMetadata`](#application-metadata) | Required. The application, the version the new one follows, and the folder to upload. |
| `uploadOptions`     | `ChunkUploadOptions?`                                | Optional. Upload tuning. `null` uses the defaults.                                    |
| `progress`          | `IProgress<UploadProgress>?`                         | Optional. Receives [upload progress](#upload-result-and-progress).                    |
| `cancellationToken` | `CancellationToken`                                  | Optional. Cancels the upload.                                                         |

**Returns:** an [`ApplicationData`](#upload-result-and-progress) with the new version's `UpdateId`.

For an MSI application, set `MsiProductCode` to the new installer's product code. An update can't change the installer type, and an MSI update without a product code is rejected.

To correct the current version without publishing a new one, use [`EditApplicationAsync`](#editapplicationasync) instead.

{% code collapsedlinecount="10" %}

```csharp
if (product.Custom?.UpdateId is not Guid currentUpdateId)
{
    Console.WriteLine("The custom application has no current version ID.");
    return;
}

var update = await client.UpdateApplicationAsync(new ApplicationUpdateMetadata
{
    ProductId = product.ProductId,
    UpdateId = currentUpdateId,
    FolderPath = @"{path-to-new-version}",
    PrimaryInstallerFile = "{installer-file-name}.msi",
    MsiProductCode = Guid.Parse("{msi-product-code}"),
    CmdArguments = "/qn",
    ArpVersionMatch = "{version}"
});

if (update.IsFailure)
{
    Console.WriteLine($"Update failed: {update.Error.Code} {update.Error.Message}");
    return;
}

Console.WriteLine($"Published version {update.Value.UpdateId}");
```

{% endcode %}

**See also:** [Update-PmpcCustomApplication](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/update-pmpccustomapplication.md), [Create update draft](https://docs.patchmypc.com/patch-my-pc-cloud-api/rest-api/applications.md#create-update-draft), and [Complete application update](https://docs.patchmypc.com/patch-my-pc-cloud-api/rest-api/applications.md#complete-application-update).

### EditApplicationAsync

Corrects an application's current version in place, without publishing a new version.

{% code collapsedlinecount="10" %}

```csharp
Task<Result<ApplicationData>> EditApplicationAsync(
    ApplicationEditMetadata editMetadata,
    ChunkUploadOptions? uploadOptions = null,
    IProgress<UploadProgress>? progress = null,
    CancellationToken cancellationToken = default);
```

{% endcode %}

| Parameter           | Type                                        | Description                                                                |
| ------------------- | ------------------------------------------- | -------------------------------------------------------------------------- |
| `editMetadata`      | [`ApplicationEditMetadata`](#edit-metadata) | Required. The changes to make. `null` properties keep their current value. |
| `uploadOptions`     | `ChunkUploadOptions?`                       | Optional. Upload tuning. Ignored when no files change.                     |
| `progress`          | `IProgress<UploadProgress>?`                | Optional. Receives [upload progress](#upload-result-and-progress).         |
| `cancellationToken` | `CancellationToken`                         | Optional. Cancels the call.                                                |

**Returns:** an [`ApplicationData`](#upload-result-and-progress) for the edited version.

Use this method to fix a display name, change an owner, replace an icon, or amend detection rules. The SDK reads the application's current details and files, applies your changes, uploads only files that are new or changed, and submits the result, so you only set the properties you want to change.

{% code collapsedlinecount="10" %}

```csharp
var edit = await client.EditApplicationAsync(new ApplicationEditMetadata
{
    ProductId = productId,
    DisplayName = "{new-display-name}",
    Owner = "{new-owner}"
});

if (edit.IsFailure)
{
    Console.WriteLine($"Edit failed: {edit.Error.Code} {edit.Error.Message}");
    return;
}

Console.WriteLine($"Edited version {edit.Value.UpdateId}");
```

{% endcode %}

**See also:** [Set-PmpcCustomApplication](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/set-pmpccustomapplication.md), [Create edit draft](https://docs.patchmypc.com/patch-my-pc-cloud-api/rest-api/applications.md#create-edit-draft), and [Complete application edit](https://docs.patchmypc.com/patch-my-pc-cloud-api/rest-api/applications.md#complete-application-edit).

### GetApplicationFilesAsync

Lists the files in an application's current version.

{% code collapsedlinecount="10" %}

```csharp
Task<Result<IReadOnlyList<ApplicationFileDto>>> GetApplicationFilesAsync(
    Guid productId,
    CancellationToken cancellationToken = default);
```

{% endcode %}

| Parameter           | Type                | Description                   |
| ------------------- | ------------------- | ----------------------------- |
| `productId`         | `Guid`              | Required. The application ID. |
| `cancellationToken` | `CancellationToken` | Optional. Cancels the call.   |

**Returns:** a list of `ApplicationFileDto` objects.

| Property                 | Type     | Description                                             |
| ------------------------ | -------- | ------------------------------------------------------- |
| `ProductId`              | `Guid`   | The application ID.                                     |
| `FileName`               | `string` | The file name.                                          |
| `FileSize`               | `long`   | The file size in bytes.                                 |
| `FileType`               | enum     | The file's role, for example `Installation` or `Extra`. |
| `Sha1Hash`, `Sha256Hash` | `string` | The file hashes. `Sha256Hash` can be `null`.            |

`EditApplicationAsync` reads the file list for you, so you don't need this method to edit an application.

{% code collapsedlinecount="10" %}

```csharp
var files = await client.GetApplicationFilesAsync(productId);
if (files.IsFailure)
{
    Console.WriteLine($"Couldn't list files: {files.Error.Code} {files.Error.Message}");
    return;
}

foreach (var file in files.Value)
{
    Console.WriteLine($"{file.FileName} ({file.FileSize:N0} bytes, {file.FileType})");
}
```

{% endcode %}

**See also:** [Get-PmpcApplicationFile](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/get-pmpcapplicationfile.md) and [Get application files](https://docs.patchmypc.com/patch-my-pc-cloud-api/rest-api/applications.md#get-application-files).

### SearchPublicApplicationsAsync

Searches the Patch My PC public catalog.

{% code collapsedlinecount="10" %}

```csharp
Task<Result<ProductFilterResponse>> SearchPublicApplicationsAsync(
    ProductFilterRequest filterRequest,
    CancellationToken cancellationToken = default);
```

{% endcode %}

| Parameter           | Type                                     | Description                                                                                                          |
| ------------------- | ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `filterRequest`     | [`ProductFilterRequest`](#search-filter) | Required. The search criteria. `FeedTypes` is ignored. If `ConnectionId` isn't set, the selected connection is used. |
| `cancellationToken` | `CancellationToken`                      | Optional. Cancels the call.                                                                                          |

**Returns:** a [`ProductFilterResponse`](#search-results) with one page of public catalog results.

A public catalog search needs an Intune connection. Set `ConnectionId` or select a connection first; otherwise the method fails with the message "Either supply a connectionId or call SetSelectedConnectionAsync first." For details, see [Customer information and connections](https://docs.patchmypc.com/patch-my-pc-cloud-api/sdk/customer-and-connections.md).

{% code collapsedlinecount="10" %}

```csharp
var search = await client.SearchPublicApplicationsAsync(new ProductFilterRequest
{
    DisplayNameSearchString = "{search-text}",
    OsType = OSType.Windows
});

if (search.IsFailure)
{
    Console.WriteLine($"Search failed: {search.Error.Code} {search.Error.Message}");
    return;
}

foreach (var product in search.Value.Products)
{
    Console.WriteLine($"{product.DisplayName} {product.Version} ({product.ProductId})");
    Console.WriteLine(product.UpdateId is null ? "No updateId is returned for public results." : $"Legacy updateId: {product.UpdateId}");
}
```

{% endcode %}

The public search response omits `updateId` from JSON; the SDK's nullable `UpdateId` property reads as `null`. Public applications are selected for deployment from their detail variants, not by an update ID.

**See also:** [Find-PmpcApplication](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/find-pmpcapplication.md) and [Search public applications](https://docs.patchmypc.com/patch-my-pc-cloud-api/rest-api/applications.md#search-public-applications).

### GetPublicApplicationDetailsAsync

Gets the details of one public catalog application.

{% code collapsedlinecount="10" %}

```csharp
Task<Result<PublicApplicationDto>> GetPublicApplicationDetailsAsync(
    Guid productId,
    Guid? connectionId = null,
    CancellationToken cancellationToken = default);

Task<Result<PublicApplicationDto>> GetPublicApplicationDetailsAsync(
    Guid productId,
    Guid? connectionId,
    OSType? osType,
    CancellationToken cancellationToken = default);
```

{% endcode %}

| Parameter           | Type                | Description                                                                            |
| ------------------- | ------------------- | -------------------------------------------------------------------------------------- |
| `productId`         | `Guid`              | Required. The application ID.                                                          |
| `connectionId`      | `Guid?`             | Optional. The connection to scope the lookup to. `null` uses the selected connection.  |
| `osType`            | `OSType?`           | Optional, second overload only. The operating system to look up. `null` means Windows. |
| `cancellationToken` | `CancellationToken` | Optional. Cancels the call.                                                            |

**Returns:** a [`PublicApplicationDto`](#application-details). If you look up a macOS application and your account isn't entitled to macOS applications, the error code is `NOT_FOUND`.

{% code collapsedlinecount="10" %}

```csharp
var details = await client.GetPublicApplicationDetailsAsync(productId, connectionId: null, osType: OSType.Windows);
if (details.IsFailure)
{
    Console.WriteLine($"Couldn't read the application: {details.Error.Code} {details.Error.Message}");
    return;
}

Console.WriteLine($"{details.Value.DisplayName} {details.Value.UpdateVersion} by {details.Value.VendorName}");
```

{% endcode %}

**See also:** [Get-PmpcApplication](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/get-pmpcapplication.md) and [Get public application details](https://docs.patchmypc.com/patch-my-pc-cloud-api/rest-api/applications.md#get-public-application-details).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.patchmypc.com/patch-my-pc-cloud-api/sdk/applications.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
