> 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/getting-started.md). Agents can also search and read this documentation through its [MCP server](https://docs.patchmypc.com/~gitbook/mcp).

# Getting started

Set up access to the Patch My PC Cloud Customer API and make your first call from REST, C#, or PowerShell.

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

This page takes you from nothing to a first successful call to the Patch My PC Cloud Customer API. The first call reads your account information, which every account can do.

## Before you begin

You need:

* **A Patch My PC cloud account.** The Cloud Customer API acts on the account—also called the company—that your token belongs to. Your account is hosted in one region: US, EU, or UK.
* **Permissions in that account.** The Cloud Customer API never lets you do more than you can do yourself. To read applications you need read access to applications; to create or update them you need write access; to manage deployments you need deployment access.
* **A personal access token (PAT).** Create one in the Patch My PC portal, and give it the `appcatbroker:customer:read` scope for this first call. For the steps, see [Create a personal access token](https://docs.patchmypc.com/patch-my-pc-cloud-api/authentication.md#create-a-personal-access-token).

## Good to know for the private preview

* **Use a personal access token (PAT).** Sign in to the portal to create your PAT. For API calls, use the PAT instead of interactive sign-in. In PowerShell, `Connect-PmpcCloud` may stop at a required prompt. If you send an API request after signing in interactively, it can return `400 Bad Request`. Use `Connect-PmpcCloudWithPat` or follow the PAT steps below.
* **Include supporting files when you create a custom app.** The [custom application upload](https://docs.patchmypc.com/patch-my-pc-cloud-api/guides/create-a-custom-application.md#step-1-prepare-the-application-folder) can include files in subfolders. You can't attach extra files or folders when you [create or edit a deployment](https://docs.patchmypc.com/patch-my-pc-cloud-api/guides/deploy-an-application.md#before-you-begin).
* **Some operations may not be available for your account.** If the API reports `feature_not_enabled`, see [Understand forbidden responses](https://docs.patchmypc.com/patch-my-pc-cloud-api/errors.md#understand-forbidden-responses).

## Choose a surface

| If you…                                                        | Use               |
| -------------------------------------------------------------- | ----------------- |
| Build a .NET application                                       | .NET SDK          |
| Write scripts or work at a PowerShell prompt                   | PowerShell module |
| Work in another language, or want full control of each request | REST API          |

The SDK and the PowerShell module handle the token exchange, regional endpoints, token renewal, file uploads, and retries for you. The REST API gives you the raw operations.

## Make your first call

Read your account information and usage limits.

{% tabs %}
{% tab title="REST" %}
These examples use the US host, `https://us.portal.patchmypc.com`. Use `https://eu.portal.patchmypc.com` for EU accounts or `https://uk.portal.patchmypc.com` for UK accounts.

1. Exchange your PAT for an access token. For details, see [Exchange the PAT for an access token](https://docs.patchmypc.com/patch-my-pc-cloud-api/authentication.md#exchange-the-pat-for-an-access-token).

```http
POST https://us.portal.patchmypc.com/v1/api/auth/token
Authorization: Bearer {personal-access-token}
```

2. Call the customer information operation with the access token from the `gatewayJwt` property of the response. The access token is valid for 60 minutes.

```http
GET https://us.portal.patchmypc.com/v1/api/customer-info
Authorization: Bearer {access-token}
Accept: application/json
```

See [Get customer info](https://docs.patchmypc.com/patch-my-pc-cloud-api/rest-api/applications.md#get-customer-info).
{% endtab %}

{% tab title="C#" %}

1. Add the `PatchMyPC.Cloud` package from nuget.org to your project. The SDK targets .NET 8 and .NET 10.

```bash
dotnet add package PatchMyPC.Cloud
```

2. Set your account's region, `Us`, `Eu`, or `Uk`, in configuration.

{% code title="appsettings.json" %}

```json
{
  "PmpcCloudSdkConfig": {
    "Region": "Us"
  }
}
```

{% endcode %}

3. Register the SDK, authenticate with your PAT, and make the call. This example reads the PAT from the `PMPC_PAT` environment variable, so the token stays out of your source code.

{% code title="Program.cs" %}

```csharp
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using PatchMyPC.Cloud.Extensions;
using PatchMyPC.Cloud.Services;

var configuration = new ConfigurationBuilder()
    .AddJsonFile("appsettings.json")
    .AddEnvironmentVariables()
    .Build();

var services = new ServiceCollection();
services.AddSingleton<IConfiguration>(configuration);
services.AddPmpcCloudSdk();

var client = services.BuildServiceProvider().GetRequiredService<IPmpcCloudClient>();

var pat = Environment.GetEnvironmentVariable("PMPC_PAT")
    ?? throw new InvalidOperationException("Set PMPC_PAT to a personal access token.");

// Exchanges the PAT for an access token for the token's company.
var session = await client.AuthenticateWithPersonalAccessTokenAsync(pat);
if (session.IsFailure)
{
    Console.WriteLine($"{session.Error.Code}: {session.Error.Message}");
    return;
}

var info = await client.GetCustomerInfoAsync();
if (info.IsSuccess)
{
    Console.WriteLine(info.Value.CustomerName);
}
```

{% endcode %}

See [GetCustomerInfoAsync](https://docs.patchmypc.com/patch-my-pc-cloud-api/sdk/customer-and-connections.md#getcustomerinfoasync).
{% endtab %}

{% tab title="PowerShell" %}

1. Install the module from the PowerShell Gallery. It requires PowerShell 7.4 or later on Windows, macOS, or Linux.

```powershell
Install-Module PatchMyPC.Cloud -Scope CurrentUser
```

2. Connect with your PAT and make the call. `Read-Host -AsSecureString` prompts for the token without showing it on screen.

```powershell
$token = Read-Host -AsSecureString -Prompt 'Personal access token'
Connect-PmpcCloudWithPat -Token $token -Region Us
Get-PmpcCustomerInfo
```

Set `-Region` to your account's region: `Us`, `Eu`, or `Uk`.

See [Connect-PmpcCloudWithPat](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/connect-pmpccloudwithpat.md) and [Get-PmpcCustomerInfo](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/get-pmpccustomerinfo.md).
{% endtab %}
{% endtabs %}

Every SDK method returns a result instead of throwing an exception, and every cmdlet writes a PowerShell error record with a stable error code. See [Errors](https://docs.patchmypc.com/patch-my-pc-cloud-api/errors.md).

## Next steps

* [Authentication](https://docs.patchmypc.com/patch-my-pc-cloud-api/authentication.md)
* [Automate with a personal access token](https://docs.patchmypc.com/patch-my-pc-cloud-api/guides/automate-with-a-personal-access-token.md)
* [Search the catalog](https://docs.patchmypc.com/patch-my-pc-cloud-api/guides/search-the-catalog.md)
* [Create a custom application](https://docs.patchmypc.com/patch-my-pc-cloud-api/guides/create-a-custom-application.md)
* [Deploy an application](https://docs.patchmypc.com/patch-my-pc-cloud-api/guides/deploy-an-application.md)
* [Rate limits](https://docs.patchmypc.com/patch-my-pc-cloud-api/rate-limits.md)


---

# 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/getting-started.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.
