Xero Proxy

Developer documentation

Authentication and keys

Key format, the Xero-Tenant-Id rule, rotation with a grace window, and instant revocation.

View as markdown

Key format

xpk_live_<keyid>_<secret>
  • <keyid> is public and is what we look up on. <secret> is 256 bits of machine entropy, stored only as a hash.
  • The full credential is shown exactly once, when the key is created or rotated. It cannot be retrieved afterwards.
  • xpk_test_ keys are a separate environment: a test prefix never resolves a live key, even if the rest matches.

The Xero-Tenant-Id rule

  1. 1.Key scoped to one organisation, header absent: we fill it in for you.
  2. 2.Key scoped to several organisations, header absent: 400 tenant_required, listing the tenant IDs you may use.
  3. 3.Header present but not in the key's set: 403 tenant_not_allowed, whether that organisation belongs to another account, was guessed, or does not exist.

Rotation and revocation

  • Rotation mints a replacement carrying the same organisations, scopes and allowlist, and gives the old credential a grace window (24 hours by default) during which both work.
  • Revocation is immediate: keys are read from the database on every request, so there is no cache window to wait out.
  • An expiry date on a key is enforced on the request path, not by a sweep, so a key stops working the moment it passes.

Management-plane scopes

A key can additionally carry management scopes, which grant access to this platform's own control plane through the management MCP server. They are held separately from Xero scopes and have no effect on proxied traffic.

ScopeWhat it grants
management.connections.readRead Xero connection health and the organisations behind it
management.keys.readList API keys and their scoping (never their secrets)
management.keys.writeCreate, rotate and revoke API keys
management.usage.readRead request volume, error rates and the recent request log
management.diagnostics.readInspect one request by its id, including any bodies captured during a debug window
management.diagnostics.writeStart and stop time-boxed body capture on a key
management.alerts.readRead open and acknowledged alerts
management.alerts.writeAcknowledge and resolve alerts
management.cache.readRead the caching settings and what caching is saving
management.cache.writePurge cached responses
management.limits.readRead the quota policy, per-key limits and the organisation's remaining Xero budget
management.limits.writeChange per-key rate limits, daily quotas and priority
management.idempotency.readRead the write-safety settings and which writes are currently protected against replay
management.idempotency.writeForget stored write responses, so the next retry of each reaches Xero
management.deferred.readRead the deferred-execution settings and the queue of work accepted for later
management.webhooks.readRead event subscriptions and their delivery history
management.webhooks.writePause, resume and re-queue event deliveries
management.callbacks.readRead completion-callback endpoints and whether they are being delivered to
management.callbacks.writeRe-queue a completion callback that exhausted its retries