{
  "name": "LedgerHQ Agent API",
  "description": "Scoped access layer for accounting agents working across connected LedgerHQ client files.",
  "baseUrl": "https://ledgerhq.app/api/agent/v1",
  "auth": {
    "type": "bearer",
    "header": "Authorization",
    "format": "Bearer lhq_live_..."
  },
  "docs": {
    "quickstart": "https://ledgerhq.app/docs/agent-quickstart.md",
    "playbook": "https://ledgerhq.app/docs/agent-qbo-playbook.md",
    "recipes": "https://ledgerhq.app/docs/agent-recipes.json",
    "openapi": "https://ledgerhq.app/docs/openapi.json",
    "rest": "https://ledgerhq.app/docs/api.md",
    "mcp": "https://ledgerhq.app/docs/mcp.md",
    "security": "https://ledgerhq.app/docs/security.md"
  },
  "skills": {
    "list": "https://ledgerhq.app/api/agent/v1/skills",
    "recipes": "https://ledgerhq.app/api/agent/v1/recipes"
  },
  "recommendedEnvironment": {
    "LEDGERHQ_API_BASE": "https://ledgerhq.app/api/agent/v1",
    "LEDGERHQ_API_KEY": "lhq_live_..."
  },
  "smokeTest": {
    "method": "GET",
    "path": "/status"
  },
  "firstCall": {
    "method": "GET",
    "path": "/qbo/clients"
  },
  "learningPath": [
    "Read /docs/agent-qbo-playbook.md for task guidance.",
    "Read /docs/agent-recipes.json for machine-readable workflows.",
    "Use /api/agent/v1/qbo/clients to pick a client.",
    "Use /api/agent/v1/qbo/clients/{clientId}/query to find QBO IDs.",
    "Use /api/agent/v1/qbo/clients/{clientId}/request to call QBO paths."
  ],
  "permissionPresets": [
    {
      "id": "readonly",
      "name": "Read-only",
      "description": "Inspect connected clients and QBO data without changing source data."
    },
    {
      "id": "readwrite",
      "name": "Full read/write",
      "description": "Query, create, edit, and delete QBO data through LedgerHQ."
    }
  ],
  "writeScopes": [
    "qbo:query",
    "qbo:request",
    "qbo:entities:read",
    "qbo:entities:create",
    "qbo:entities:update",
    "qbo:entities:delete",
    "qbo:transactions:create",
    "qbo:transactions:update",
    "qbo:transactions:delete",
    "qbo:attachments:write",
    "qbo:rules:write",
    "qbo:browser:write"
  ],
  "safeStorageRules": [
    "Store keys in an agent host secrets manager or environment variables.",
    "Do not paste keys into prompts, docs, GitHub, browser localStorage, or shared notes.",
    "Use one key per agent, vendor, or workflow.",
    "Prefer selected-client access unless the agent truly needs every client."
  ]
}
