{
  "schemaVersion": 1,
  "snapshotDate": "2026-10-23",
  "slug": "reference-xero-connections-list",
  "title": "Xero List Tenant Connections",
  "section": "Library asset reference",
  "description": "Read connected tenants for the consenting access-token user. No tenant header is required. Uses GET /connections; optional authEventId filters the authorization event. No business write.",
  "kind": "node",
  "url": "/wiki/reference-xero-connections-list/",
  "markdown": "/wiki/reference-xero-connections-list/index.md",
  "json": "/wiki/reference-xero-connections-list/index.json",
  "headings": [
    {
      "id": "audited-socket-contract-21-october-2026",
      "title": "Audited socket contract (21 October 2026)",
      "depth": 2
    },
    {
      "id": "catalog-identity",
      "title": "Catalog identity",
      "depth": 2
    },
    {
      "id": "inputs",
      "title": "Inputs",
      "depth": 2
    },
    {
      "id": "outputs",
      "title": "Outputs",
      "depth": 2
    },
    {
      "id": "configuration-schema",
      "title": "Configuration schema",
      "depth": 2
    },
    {
      "id": "source-and-installed-versions",
      "title": "Source and installed versions",
      "depth": 2
    }
  ],
  "sources": [
    "../OpenNodeFlow-Library/work/catalog-all.mjs",
    "../OpenNodeFlow-Library/work/azure-pack-consolidation-20261022/catalog-policy.mjs",
    "../OpenNodeFlow-Library/work/developer-packs-20261022/catalog.mjs",
    "shared/seed.ts",
    "shared/storage-library.ts",
    "shared/variable-library.ts",
    "shared/control-flow.ts",
    "shared/remote-routes.ts",
    "server/runtime-library.ts",
    "shared/error-library.ts",
    "shared/storage-model.ts",
    "shared/builtin-documentation.ts"
  ],
  "family": "xero",
  "contract": {
    "key": "xero.connections.list",
    "slug": "xero-connections-list",
    "name": "Xero List Tenant Connections",
    "kind": "node",
    "family": "xero",
    "packId": null,
    "category": "Xero",
    "description": "Read connected tenants for the consenting access-token user. No tenant header is required. Uses GET /connections; optional authEventId filters the authorization event. No business write.",
    "inputs": [
      {
        "id": "exec",
        "name": "exec",
        "type": "control",
        "typeName": "Control",
        "required": false
      },
      {
        "id": "authEventId",
        "name": "authEventId",
        "type": "string",
        "typeName": "Text",
        "required": false
      }
    ],
    "outputs": [
      {
        "id": "connections",
        "name": "connections",
        "type": "@xero.connections",
        "typeName": "Xero Tenant Connection List",
        "typeKey": "xero.connections",
        "typeVersion": 1,
        "required": true
      },
      {
        "id": "metadata",
        "name": "metadata",
        "type": "@xero.metadata",
        "typeName": "Xero Response Metadata",
        "typeKey": "xero.metadata",
        "typeVersion": 1,
        "required": true
      },
      {
        "id": "next",
        "name": "next",
        "type": "control",
        "typeName": "Control",
        "required": false
      },
      {
        "id": "error",
        "name": "error",
        "type": "control",
        "typeName": "Control",
        "required": false
      }
    ],
    "configSchema": {
      "type": "object",
      "properties": {
        "authMode": {
          "type": "string",
          "enum": [
            "accessToken",
            "managedRefresh"
          ],
          "default": "accessToken",
          "description": "accessToken reads a current bearer secret; managedRefresh keeps rotating tokens encrypted in workspace storage."
        },
        "accessTokenSecret": {
          "type": "string",
          "default": "XERO_ACCESS_TOKEN"
        },
        "bootstrapTokenSecret": {
          "type": "string",
          "default": "XERO_OAUTH_BOOTSTRAP",
          "description": "JSON secret containing access_token, refresh_token and expires_at (ISO time). Used only when the storage key does not exist."
        },
        "clientIdSecret": {
          "type": "string",
          "default": "XERO_CLIENT_ID"
        },
        "clientSecretSecret": {
          "type": "string",
          "default": "XERO_CLIENT_SECRET"
        },
        "pkce": {
          "type": "boolean",
          "default": false
        },
        "tokenNamespace": {
          "type": "string",
          "default": "integration.xero.oauth",
          "minLength": 1
        },
        "tokenKey": {
          "type": "string",
          "default": "default",
          "minLength": 1
        },
        "mockBaseUrl": {
          "type": "string",
          "default": "",
          "description": "Tests only: HTTP loopback origin. Production endpoints cannot be overridden."
        },
        "requestTimeoutMs": {
          "type": "integer",
          "minimum": 100,
          "maximum": 30000,
          "default": 10000
        },
        "readRetries": {
          "type": "integer",
          "minimum": 0,
          "maximum": 2,
          "default": 1
        },
        "maxRetryDelayMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10000,
          "default": 2000
        }
      },
      "required": [],
      "additionalProperties": false
    },
    "documentation": "Read connected tenants for the consenting access-token user. No tenant header is required. Uses GET /connections; optional authEventId filters the authorization event. No business write.\n\nInputs: authEventId. Outputs: connections, metadata. exec/next/error are control sockets. Throwing selects an explicitly wired error control route through ONF; data outputs are absent on that path.\n\nAuthentication: configure secret **names**, never literal credentials. Access-token mode reads XERO_ACCESS_TOKEN. Managed-refresh mode bootstraps once from XERO_OAUTH_BOOTSTRAP JSON containing access_token, refresh_token, expires_at; XERO_CLIENT_ID / XERO_CLIENT_SECRET hold client values. PKCE omits the secret. Rotated pairs are immediately CAS-persisted in encrypted workspace storage; a 60-second CAS lock serializes refresh. Never use the same refresh grant in different workspaces/namespaces/keys or another app. Do not inspect/export token records into logs. Crash between provider refresh and persistence needs recovery within Xero's documented refresh grace period. No tokens are returned.\n\nRequests use fixed HTTPS Xero hosts, no redirect following, bounded 2 MB response and per-request timeout. Only explicit HTTP loopback mock origins are accepted as overrides. Read HTTP 429/5xx retries are bounded to readRetries (0..2) and Retry-After/maxRetryDelayMs; a longer wait fails with metadata in the safe error message. Network failures and accounting writes are never internally retried. Configure ONF instance retries deliberately; keep write retries disabled. Errors omit raw provider bodies to avoid credential/PII disclosure.\n\nValidation: isolated local mock services only; live tenant consent and account access have not been verified. [Xero accounting requests](https://developer.xero.com/documentation/api/accounting/requests-and-responses/), [OAuth tokens](https://developer.xero.com/documentation/guides/oauth2/token-types/), [tenant connections](https://developer.xero.com/documentation/guides/oauth2/tenants/), [idempotency](https://developer.xero.com/documentation/guides/idempotent-requests/idempotency/), [rate limits](https://developer.xero.com/documentation/best-practices/api-call-efficiencies/rate-limits/).\n\n## Audited socket contract (21 October 2026)\n\nInputs:\n- `authEventId`: `string`; optional (absent stays absent).\n\nOutputs:\n- `connections`: `@xero.connections`; required.\n- `metadata`: `@xero.metadata`; required.\n\nConfiguration:\n- `authMode`: string; default \"accessToken\". accessToken reads a current bearer secret; managedRefresh keeps rotating tokens encrypted in workspace storage.\n- `accessTokenSecret`: string; default \"XERO_ACCESS_TOKEN\"\n- `bootstrapTokenSecret`: string; default \"XERO_OAUTH_BOOTSTRAP\". JSON secret containing access_token, refresh_token and expires_at (ISO time). Used only when the storage key does not exist.\n- `clientIdSecret`: string; default \"XERO_CLIENT_ID\"\n- `clientSecretSecret`: string; default \"XERO_CLIENT_SECRET\"\n- `pkce`: boolean; default false\n- `tokenNamespace`: string; default \"integration.xero.oauth\"\n- `tokenKey`: string; default \"default\"\n- `mockBaseUrl`: string; default \"\". Tests only: HTTP loopback origin. Production endpoints cannot be overridden.\n- `requestTimeoutMs`: integer; default 10000\n- `readRetries`: integer; default 1\n- `maxRetryDelayMs`: integer; default 2000\n\nKnown provider records and list elements have structural schemas. Explicit dynamic payloads, selected query results and provider extensions retain the recursive JSON Value vocabulary; they do not imply a known provider entity. Null is distinct from omission. Runtime validates the exact selected immutable type version; reading newer documentation never repins existing graphs. This audit used synthetic fixtures/local mocks and does not establish live provider authorization or delivery.",
    "runtime": "javascript",
    "tags": [
      "integration",
      "library-expansion",
      "xero"
    ],
    "source": "baseline-catalog"
  }
}
