---
title: "Set up an Agent for a managed account"
description: "Create a one-time setup link and connect CloudPrint Agent to the correct customer account without a portal login."
---
<nav class="docs-breadcrumb" aria-label="Breadcrumb"><a href="/docs/">CloudPrint Documentation</a><span aria-hidden="true">/</span><span>Developer Platform</span></nav>

# Set up an Agent for a managed account

<p class="docs-lead">Agent Enrollment connects one or more local CloudPrint Agents to the intended managed customer account without requiring the customer to register or sign in to CloudPrint.</p>

## Create every Enrollment idempotently

Initial provisioning returns the canonical `agent_onboarding_url`. Add another computer before or after onboarding with `POST /partner-api/v1/accounts/{relationshipId}/agent-enrollments` and a mandatory `Idempotency-Key`. An exact replay returns the original Enrollment ID, expiry and URL. Persist the pending key, `state`, name, callback and optional `replaces_enrollment_id` before the first request; only the application assertion changes on retry. Use `replaces_enrollment_id` when replacing a known unused Enrollment.

## Track the exact Enrollment

Persist the returned `agent_enrollment_id` and poll `GET /partner-api/v1/accounts/{relationshipId}/agent-enrollments/{enrollmentId}`. Continue while the status is `pending`; when it becomes `claimed`, store the returned `agent_id`. Stop on `expired` or `revoked`. GET and list responses do not repeat the secret-bearing onboarding URL, so keep the create response secure until onboarding finishes. Tracking the exact Enrollment also avoids mistaking an Agent that was already connected for the computer using the new link.

## List and revoke Enrollment records

Use `GET /partner-api/v1/accounts/{relationshipId}/agent-enrollments` to inspect pending, claimed, expired and revoked records; listing never exposes secret codes. Revoke one unused code with `DELETE /partner-api/v1/accounts/{relationshipId}/agent-enrollments/{enrollmentId}`. Repeating a revoke is safe.

## List and revoke connected Agents

Use `GET /partner-api/v1/accounts/{relationshipId}/agents` to show every connected computer and its state. Replace a lost, broken or retired computer by revoking it through `DELETE /partner-api/v1/accounts/{relationshipId}/agents/{agentId}` and creating a new Enrollment. Revocation takes that Agent's printers offline.

## Recover a lost Enrollment response

Retry the exact Enrollment request with a fresh single-use assertion and the same Enrollment `Idempotency-Key`. CloudPrint returns the original onboarding URL while the idempotency record is retained. A different body or route with the same key returns `409 partner.idempotency.conflict`; do not invent a new key after an uncertain response.

## Open the onboarding link

Open the complete `agent_onboarding_url` unchanged, including its `#token` fragment. Do not parse, rebuild, proxy or log the URL. Public installers are discovered through `GET /agent-download-api/v1/releases` and downloaded by the returned filename through `GET /agent-download-api/v1/installers/{filename}`. After the callback, verify `state`. `result=ready` confirms the first authenticated Agent heartbeat, not printer availability. Refresh the managed Account, Agents and printer list; enable printing only when `status=active`, `online_agent_count > 0` and `online_printer_count > 0`.

## Give support actionable context

Store the customer ID, `relationship_id`, `installation_id`, Enrollment ID, Agent ID, Agent version, last-seen state and relevant `X-Request-Id` values. Support should distinguish account status, Enrollment, Agent connectivity, printer discovery and Print API failures without requesting credentials.

## Next steps

<div class="docs-card-grid"><a class="docs-card" href="/docs/developer-platform/managed-accounts/"><strong>Managed accounts in CloudPrint Developer Platform</strong><span>Create and manage isolated CloudPrint accounts for customers from your own product.</span></a>
<a class="docs-card" href="/docs/developer-platform/managed-accounts/account-lifecycle/"><strong>Create and manage customer accounts</strong><span>Authenticate Partner API requests, create managed customer accounts, and suspend, resume or close them when needed.</span></a>
<a class="docs-card" href="/docs/api/agents-and-printers/"><strong>Connect an agent and select a printer</strong><span>Install the CloudPrint agent, discover local printer queues and choose a stable printer ID based on its advertised capabilities.</span></a></div>

<nav class="docs-resource-links" aria-label="Next steps"><a href="https://cloudprint.me/status/">Service status</a><a href="/docs/api/v1/explorer/">OpenAPI</a><a href="https://developer.cloudprint.me">Developer Portal</a><a href="https://my.cloudprint.me">Open account</a><a href="/docs/legal/privacy/">Privacy Policy</a><a href="/docs/legal/terms/">Terms</a><a href="/docs/legal/data-processing/">DPA</a><a href="/docs/legal/service-level-agreement/">Service Level Agreement</a></nav>