Talk this topic through with an AI

You get an answer from the documentation and the page it comes from.

Console & fleet

The management API

Everything you can do per app in the console also works as a REST call, so a fleet can be provisioned from CI/CD, configuration management or an MDM. This page is the endpoint reference: What each call does, how you authenticate, and why the API never sees protected content.

~7 min read · Console & fleet

What it is

  • A small REST surface for the app lifecycle: Create, enroll, list, deactivate and delete protected apps.
  • Built for automation: Bake an un-enrolled daemon into a golden image and mint enrollment codes in advance; each machine enrolls itself on first start.
  • Machine-readable: An OpenAPI 3 specification is published alongside this page.
It is the programmatic counterpart to the console: The same lifecycle, driven from CI/CD, Ansible, an SSH loop, or an MDM such as SCCM or Intune.

Management plane versus data plane

The decisive property is what this API does not see. The system has two distinct planes:

PlaneTrafficSees content?
Management planeThis API: App lifecycle and metadata only (identifier, name, status, platform, agent version, timestamps, enrollment codes).No: No memory content, no diff, no evaluation payload ever crosses it.
Data planeThe daemon's own traffic: Check-ins and, in the cloud-assisted flow, evaluation of redacted diffs.Content stays on the device; only a redacted projection is evaluated.
Audit reporting and decision feedback are daemon data-plane traffic, not management-plane calls. Provisioning a thousand machines through the API exposes no protected content to it.

Authentication

Callers authenticate with a bearer key created in the console under Settings, API keys. The key (pz_live_ followed by forty characters) is shown once; at rest only its SHA-256 hash is stored, so a database disclosure yields no usable credential.

bashTerminal
curl -H "Authorization: Bearer pz_live_..." \
  https://poisonzero.com/api/v1/apps
  • Owner-scoped: Every request is bound to the key's owner.
  • No enumeration: A foreign or unknown app answers an identical 404, so identifiers outside your fleet cannot be probed.
  • Ten active keys per account; any key can be revoked independently.

Endpoints

The endpoints mirror the console and are reached over HTTPS at poisonzero.com/api/v1/. Every call takes the bearer key:

EndpointPurposeReturns
POST /v1/appsCreate an app and a first enrollment code in one call (optional body {"name":"..."}).201 with appId, enrollCode, enrollCodeExpiresAt.
GET /v1/appsList your fleet.One entry per app (see the app object below).
GET /v1/apps/{appId}Fetch one app.404 for unknown or foreign IDs.
POST /v1/apps/{appId}/enroll-codeMint a fresh enrollment code, for example to re-provision a machine.201; codes are single-use and valid for 30 days.
POST /v1/apps/{appId}/revokeDeactivate an app; status becomes revoked and the daemon's credentials stop working immediately.appId and status.
DELETE /v1/apps/{appId}Delete an app permanently (app, configuration, daemon identity, open codes, review-queue entries; audit logs are retained).204.
POST /v1/install-codesCreate a fleet install code that enrolls many devices.201 with id, code, expiresAt and maxRedemptions. The code appears only in this response.
GET /v1/install-codesList your install codes.Each entry holds metadata only, never the code.
POST /v1/install-codes//docs/id/revokeRevoke an install code so no further device can enroll with it.id and status.
GET / PUT / DELETE /v1/otel-configManage the OpenTelemetry export configuration for the fleet (Enterprise).See the observability export page.
POST /v1/intune/windows-packageDownload the Windows Intune package (.intunewin) of your tenant with a new install code inside.The file as the response body, details in X-PZ-* headers.
POST /v1/intune/macos-scriptDownload the ready Intune shell script for macOS with a new install code inside.The script as the response body, details in X-PZ-* headers.
POST /v1/intune/linux-scriptDownload the ready Intune shell script for Linux with a new install code inside.The script as the response body, details in X-PZ-* headers.
POST /v1/intune/macos-profileDownload the macOS configuration profile (.mobileconfig) with a new install code inside.The profile as the response body, details in X-PZ-* headers.
GET and PUT on /v1/otel-config require an Enterprise owner (otherwise 403); DELETE is always allowed so a downgraded owner can still purge a stored collector secret. The export itself: OpenTelemetry export.

Fleet install codes

One install code enrolls many devices, so an Intune or ConfigMgr package needs one code, not one per machine. The API follows the console rules: A code is valid for 30 days, and its device cap follows your plan. The create call takes three optional fields:

FieldMeaning
deviceModecloud (default) or private sets the mode of every device enrolled with the code.
profileIdThe enrolled devices get this policy profile.
maxRedemptionsThe device cap of the code. On Free and Pro the default is your free device slots, and the plan's device limit is the ceiling. On Enterprise the default is unlimited.

Pipe the code straight into the next step, here a CI secret, so it never shows up in a log:

bashTerminal
curl -fsS -X POST https://poisonzero.com/api/v1/install-codes \
  -H "Authorization: Bearer $PZ_API_KEY" -H "Content-Type: application/json" \
  -d '{"maxRedemptions": 500}' \
  | jq -r .code | gh secret set PZ_ENROLL_CODE
The create call returns the code once. List and revoke use id, which cannot enroll a device. Revoking stops new enrollments; devices already enrolled keep working. How the device uses the code: Enroll a device on your account.

The app object

List and fetch return the lifecycle metadata of each app, never content:

FieldMeaning
appIdStable app identifier.
nameDisplay name.
statuspending, active or revoked.
platformReported operating system.
agentVersionReported daemon version.
lastSeenAt, createdAtTimestamps.

Transport

  • HTTPS at poisonzero.com/api/v1/; a reverse proxy forwards only the method, path, authorization header, content type and a size-capped body.
  • The path is decoded to a fixed point and any dot-segment or backslash is rejected, closing path-traversal attempts.
  • Fleet management is not gated on an active subscription, so you can provision and revoke while a plan is being arranged.

Errors

All errors share one shape, {"error":{"code":"...","message":"..."}}, with a stable machine-readable code:

StatusMeaning
400Validation, for example invalid_name, limit_reached or invalid_argument.
401Missing, invalid or revoked key, or a disabled account.
404Unknown endpoint, or an unknown or foreign app ID or install code ID.
413Request body over 64 KiB (payload_too_large).
429Too many requests; slow down and retry (up to 600 per minute per account).
Policy profiles, watched paths and thresholds are configured in the console, not through this API; the REST surface covers the app lifecycle, fleet install codes and the OpenTelemetry export configuration. The machine-readable OpenAPI 3 specification is published at /docs/api/openapi.json.

The Enterprise export configured through /v1/otel-config: OpenTelemetry export. Where enrollment codes are used at rollout: Installing the poison0 agent.

Intune files for your tenant

You get through the API the same ready files as the console button Download Intune package: The Windows package, the macOS profile and the scripts for macOS and Linux. Each call makes a new install code, valid for one year, and puts it inside the file. A pipeline can fetch a fresh file and hand it to Intune. GET answers like POST; POST is the call, because it makes a key.

Field or headerMeaning
deviceNameFromHostnameOptional, true or false (default false). With true, every device enrolled with the file reports its computer name as its device name. POST takes it in the JSON body, GET as a query parameter. Anything else is 400 invalid_argument.
Content-DispositionThe file name, for example pcg-poisonzero.intunewin or pcg-poisonzero-macos.sh, named after your tenant.
X-PZ-Install-Code-IdThe id of the new code, as GET /v1/install-codes lists it. POST /v1/install-codes//docs/id/revoke revokes it.
X-PZ-Install-Code-Last4The last four characters of the code, as the console lists them.
X-PZ-Expires-AtWhen the code expires (ISO 8601), one year after the call.
X-PZ-Max-RedemptionsThe device cap of the code: A number, or unlimited on Enterprise.
X-PZ-Sha256The SHA-256 digest of the response body.
X-PZ-VersionWindows package only: The agent release the package installs.
bashTerminal
curl -fsS -X POST https://poisonzero.com/api/v1/intune/windows-package \
  -H "Authorization: Bearer $PZ_API_KEY" -H "Content-Type: application/json" \
  -d '{"deviceNameFromHostname": true}' \
  -o pcg-poisonzero.intunewin

curl -fsS -X POST https://poisonzero.com/api/v1/intune/macos-script \
  -H "Authorization: Bearer $PZ_API_KEY" -o pcg-poisonzero-macos.sh
StatusMeaning
429rate_limited: More than 10 calls per hour for this API key or 30 per day for the account.
429intune_code_limit: Too many active Intune install codes; revoke old ones.
500package_failed: The file could not be created; its new install code is revoked again.
503rate_limit_unavailable or release_unavailable: Retry later.
The code is only inside the file, never in a header, a log or an audit entry. Everyone who can read the file in Intune sees the code, so revoke it after the rollout. Each API key may make 10 calls per hour and your account 30 per day, shared with the console. Without a published release (503 release_unavailable), no code is made.

macOS profile

POST /v1/intune/macos-profile returns the profile for the package and profile rollout on macOS (Intune, Jamf or any other MDM). The response is the .mobileconfig file (Content-Type: application/x-apple-aspen-config), named <tenant>-poisonzero-macos.mobileconfig, with a new install code inside (label Intune macOS profile with the date, valid for one year). Options, headers (without X-PZ-Version), limits and errors are the same as above. deviceNameFromHostname sets the key DeviceNameFromHostname in the profile. The package poisonzero-<version>.pkg is the same for every customer and is not part of the API. The steps are in Install the poison0 agent on macOS.

bashTerminal
curl -fsS -X POST https://poisonzero.com/api/v1/intune/macos-profile \
  -H "Authorization: Bearer $PZ_API_KEY" -H "Content-Type: application/json" \
  -d '{"deviceNameFromHostname": true}' \
  -o pcg-poisonzero-macos.mobileconfig