Docs › API quickstart

API quickstart

Drive PatchPilot from your scripts, RMM, or in-house tooling.

1. Generate an API key

From the admin console, open Settings > API Keys and click Create key. Give it a clear name (e.g. ci-deploy-bot) and an expiry (we recommend ≤ 12 months). The key is shown once; copy it somewhere safe.

API keys are prefixed ppk_ and are stored hashed (SHA-256) on the server — we cannot retrieve a lost key, only revoke and reissue.

Treat ppk_ keys like passwords. They grant the same scope as the user that created them. Rotate on staff offboarding.

2. Make your first call

List the devices in your organisation:

curl -fsSL https://patchpilot.co.uk/api/devices \
  -H "Authorization: Bearer ppk_your_key_here" \
  -H "Accept: application/json"

Response (truncated):

{
  "devices": [
    {
      "device_id": "dev_01HXYZ...",
      "hostname": "FINANCE-LAPTOP-04",
      "os_family": "windows",
      "os_name": "Windows 11 Pro",
      "status": "online",
      "last_seen": "2026-04-26T09:14:22Z",
      "updates_available": 7,
      "critical_count": 1
    }
  ],
  "total": 84
}

3. Common endpoints

MethodPathPurpose
GET/api/devicesList devices in your org
GET/api/devices/:idFetch a single device's full state
GET/api/vulnerabilitiesList CVEs detected across the fleet
GET/api/compliance/snapshotExport the latest compliance snapshot
GET/api/reboot-managementDevices pending a reboot
POST/api/reboot-management/:id/scheduleSchedule a reboot
GET/api/patch-exclusionsList KB / package blocklist entries
POST/api/patch-exclusionsAdd a blocklist entry

4. Auth scheme

5. Rate limits

The API is rate-limited per key:

If you exceed a limit you'll get HTTP 429 with a Retry-After header. Back off and retry.

6. Webhooks

For event-driven integrations, configure a webhook in Integrations > Webhooks. PatchPilot will POST a JSON payload to your endpoint for events like device.online, patch.failed, compliance.drift_detected. Each delivery is signed with HMAC-SHA256 using your webhook secret — verify the X-Patchpilot-Signature header before trusting the body.

Previous← Getting started NextWindows agent →

Last updated: 2026-04-26 · Back to Docs