Skip to main content
POST /api/agent/deploy can provision wallets and spend gas. End-to-end mainnet agent deployment remains unverified. Mainnet x402 and unconfigured ERC-8183 jobs remain unavailable even after an identity exists. See availability.

Authentication and input

Use the active verified merchant’s own API key or supported merchant_token session. An internal service key or consumer session is not the merchant identity required here. Keep keys server-side. The authenticated merchant and Circle responses determine the wallet/record binding. Registry address and Circle blockchain come from central network configuration; the old IDENTITY_REGISTRY_ADDRESS override is not honored.

Execution and response

The route applies a merchant deployment throttle, provisions a wallet set with owner/validator SCAs, writes a deployment intent, submits registration, polls Circle, indexes a token ID, then persists an active AgentRegistry row. Success returns success, agent, txHash, explorerUrl and wallets.owner/wallets.validator. Keep the identifiers separate:
  • agent.id: Registry ID, a database integer for canonical owner-only wallet/policy/pay/treasury routes.
  • agent.tokenId: ERC-8004 token ID, a string used by reputation/validation.
  • agent.scaAddress: SCA wallet address.
  • agent.circleWalletId: Circle wallet UUID, not an agent or job ID.
This is not atomic across Circle, chain and database. Same-key replay returns 409, not a fresh deployment. Existing intents prevent many repeated submissions, but intent creation occurs after wallet provisioning; not every concurrent/crash window is eliminated. Creation without a replay key is not idempotent. 502 PENDING_IDENTITY_CONFIRMATION includes inspection fields and a hash when registration may have succeeded but identity indexing failed. 408 polling timeout is also an uncertain outcome, not proof no transaction exists. Do not redeploy to recover or bypass a saved key; inspect the original Circle transaction and receipt first.

POST /api/agent/deploy/recover

Under the same owning merchant authentication, send only txHash, a 0x-prefixed 64-hex transaction hash. The endpoint reads the configured registry receipt and the merchant’s server-stored deployment intents. A new recovery must bind a real mint holder to that intent and prove membership in its Circle wallet set before creating the missing agent row. Client-supplied token ID, owner, wallet set or merchant fields are not recovery authority. Recovery does not provision wallets or submit another registration. Existing identities can return replayed: true; intent bookkeeping is best-effort. Recovery does not recreate every original descriptive/pricing field. Malformed hash returns 400; missing receipt 404; absent/unmatched merchant intent or unproven wallet membership 403; invalid mint 422; conflicting claimed identity 409; unavailable Circle credentials for new recovery 503. These responses are not permission to create a second registration.